Le mouvement Sciences en marche est parti !
Voici la carte finale pour le trajet en vélo Grenoble-Lyon samedi 4 octobre :
Le mouvement Sciences en marche est parti !
Voici la carte finale pour le trajet en vélo Grenoble-Lyon samedi 4 octobre :
After an unexpected power cut during the weekend, both Drobo FS at work restarted (21 hours later when the power was restored) but the samba/windows shares could not be accessed.
When I tried my droboStatus script, everything was displayed normally, except for one line:
Overall status of the device | 98304 = 11000000000000000b -> UNKNOWN STATUS – please see http://code.google.com/p/drobowebdashboard/wiki/ESATMUpdate#ESATMUpdate/mStatus |
As the linked page does not give an answer, it seems that it means that everything is ok after a file system check (fsck) but the shares do not work.
A simple reboot with the button at the back of the Drobos was enough to get everything on line again.
When trying to construct a head model for MRI studies, I did some experiments with coconuts.
Here are some images using BrainVisa/Anatomist for display of the acquisitions from a coconut still half full of juice.
WordPress is used for a small website in my workplace. The server must use a proxy to connect to the web, and this is necessary for many plugins and for updates.
As explained in the documentation, the proxy is declared in wp-config.php
define('WP_PROXY_HOST', 'myCache.fr'); define('WP_PROXY_PORT', '3128');
Since 3.8.1, the Dashboard does not show any update available (even if now 3.9.1 is out). No error message is displayed either.
I had to run wireshark to see what was happening :
It seems that the proxy does not support HTTPS POST requests. So I had to find where the https URL was defined in WordPress. It turns out it is in wp-includes/update.php. But the URLs are defined as http, and the following code is used (in three different places) to convert it to https if ssl is available :
if ( $ssl = wp_http_supports( array( 'ssl' ) ) ) $url = set_url_scheme( $url, 'https' );
I thus commented those :
/**if ( $ssl = wp_http_supports( array( 'ssl' ) ) ) $url = set_url_scheme( $url, 'https' );*/
And I could update the server. Of course, I will have to do that again after each update…
Five years ago I made backups of my data to three hard drives. When my desktop died, I used a small laptop where I could not copy the 1+Tb of data stored on the backups.
Last week, I tried to copy back all the data from my laptop and the old data from my Backups onto a new computer.
Of the three backup disks, one was completely dead (it did not even power up), the second one worked but contained only a partial backup (it was a smaller disk), and the last one was apparently unreadable.
When this disk was plugged in, ‘dmesg’ was printing ‘Read errors’ all over the place, and Linux did not detect any partition on the disk. I thought I had lost 1Tb of data…
Then I found this, this and this.
And here is how I got almost everything back :
[200135.764454] Buffer I/O error on device sdi, logical block 9464 [200160.490454] sd 9:0:0:0: [sdi] Unhandled sense code [200160.490457] sd 9:0:0:0: [sdi] [200160.490458] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE [200160.490460] sd 9:0:0:0: [sdi] [200160.490461] Sense Key : Medium Error [current] [200160.490463] sd 9:0:0:0: [sdi] [200160.490465] Add. Sense: Data phase error [200160.490466] sd 9:0:0:0: [sdi] CDB: [200160.490467] Read(10): 28 00 00 01 27 c0 00 00 08 00 [200160.490472] end_request: I/O error, dev sdi, sector 75712
sudo dd if=/dev/sdi of=/home/myself/backupdisk.bin conv=noerror,sync
testdisk /home/myself/backupdisk.bin
sudo fdisk -lu /home/myself/backupdisk.bin Disk /home/myself/backupdisk.bin: 1000.2 GB, 1000204886016 bytes 255 têtes, 63 secteurs/piste, 121601 cylindres, total 1953525168 secteurs Unités = secteurs de 1 * 512 = 512 octets Taille de secteur (logique / physique) : 512 octets / 512 octets taille d'E/S (minimale / optimale) : 512 octets / 512 octets Identifiant de disque : 0x00000000 Périphérique Amorçage Début Fin Blocs Id. Système /home/myself/backupdisk.bin1 * 63 1953520064 976760001 83 Linux
sudo losetup -o 32256 /dev/loop0 /home/myself/backupdisk.bin
sudo fsck -y /dev/loop0 # This ends with : /dev/loop0: ***** FILE SYSTEM WAS MODIFIED ***** /dev/loop0 : 968660/122109952 files (3.9% non contiguous), 234454083/244190000 blocks
sudo mkdir /mnt/backupdisk sudo mount /dev/loop0 /mnt/backupdisk
sudo umount /mnt/backupdisk
sudo losetup -d /dev/loop0
Around 2010, while developping MRI sequences for brain imaging, we used an pineapple to test the effect of some parameters on the images.
Here are some images rendered with Anatomist (from a Philips 3 Tesla scanner). Most are T1-weighted 3D sequences, the most beautiful ones are T2 2D multi-slices sequences
[To be translated…]
Before each election in France, the largest political parties call for “tactical voting” (‘vote utile’, litterally ‘useful vote’) in the first round of our two-round elections to avoid a risk, e.g. the left being removed for the second round (like in Presidential elections of 2002 which saw a right/far-right second round) or the election of the left with a right majority as the vote is split between multiple right-wind candidates. The good citizen should thus vote for the main party of its side of the political spectrum.
Lastly in the 2014 local elections, the same idea took the form of “republican withdrawal” mostly defended by the parti socialiste : if the far right might win in the second round against a right-wing and a left-wing candidate (with just 34% of votes), the least successful in the first round should withdraw and ask voters to vote for the other. This idea was not really successful as it was not accepted by UMP (main right-wing party), so PS withdrew in favor of UMP when they had the lowest score, not the other way around.
Thus, largest political parties are blackmailing citizens : if you don’t vote for us, you may get the worst (far-right). How strange for the very idea of democracy ! Voters wouldn’t be free to vote for the party they like the most, but should feel responsible enough to support the major parties as a lesser evil. So “voting against” instead of “voting for”. Where is this coming from ?
In the current voting system (in France) if there are two left-wing candidates L1 and L2, a right-wing one R and a far-right one FR in the second round, if the results are 25.9%(L1), 26.1%(L2), 21%(R), 27%(FR), far-right will govern, despite the fact that 52% of voters wanted a left-wing candidate !
The solution is simple : changing the voting system !
There are numerous voting systems which don’t have this problem. I’ll present only one here : Instant run-off voting.
So, allowing voters to rank candidates allows a free expression of voters’opinion, without the fear of having cast a “wasted vote”, a vote without any influence on the choice of the winner because their preferred option lost the election.
It is of course possible to add a blank vote in the list, to express disatisfaction with all candidates, but to follow it by you ranking of the candidates, thus giving your voice for the “least bad”.
If there are solutions, why are they not implemented ? In fact they have been in many countries (Australia, New Zealand, Ireland, India…).
The main beneficiaries of the current system are the largest parties (PS and UMP in France), so it would be suprising that their members risk changing what works for them : they want to keep their seats in the Parliament (where they are dominant thanks to the voting system)
And that’s how you convert the diversity of opinions in a two-party system !
As a conclusion, here is a relevant excerpt of The Hitchiker’s Guide to the Galaxy by Douglas Adams :
On its world, the people are people. The leaders are lizards. The people hate the lizards and the lizards rule the people.”
“Odd,” said Arthur, “I thought you said it was a democracy.”
“I did,” said Ford. “It is.”
“So,” said Arthur,[…] “why don’t people get rid of the lizards?”
“It honestly doesn’t occur to them,” said Ford. “They’ve all got the vote, so they all pretty much assume that the government they’ve voted in more or less approximates to the government they want.”
“You mean they actually vote for the lizards?”
“Oh yes,” said Ford with a shrug, “of course.”
“But,” said Arthur,[…] “why?”
“Because if they didn’t vote for a lizard,” said Ford, “the wrong lizard might get in.
At last, I put online a web version of PyVotons!.
It is alpha software, not easy to run, lacking a lot of features.
You should read the Documentation page before trying to install it.
You need Python and python-openssl, on a system running on GNU/Linux.
Here it is :
Relatively easy thing to do, but I will keep this here if I need to do it again someday… Here is the code of a small bash script used to do that (not optimal, I know). But first, to get things started :
# Create a backup user to get read access to the database
mysql -u root -p
mysql> GRANT SELECT,RELOAD,LOCK TABLES ON *.* TO ‘backup_user’@’localhost’;
# Add the root user to the mysql group (as cron jobs run as root)
sudo usermod -a -G mysql root
# Allows read access to users of the mysql group for the directories of mysql data files
sudo find /var/lib/mysql -maxdepth 1 -type d -exec chmod g+r \{\} \;
# List all databases
mysql -u backup_user -B -e ‘show databases;’
# Backup one database
mysqlhotcopy -u backup_user databaseName /TheBackupDir/
# Backup all databases -> this does not work as some databases listed do not really exist !
for i in `mysql -u backup_user -B -e ‘show databases;’`; do echo $i; mysqlhotcopy -u backup_user “$i” /TheBackupDir/ ; done
On the samba share, create a directory WebServerBackup and in this directory, an empty file autoBackup to allow the script to confirm that the right directory is mounted before backing the database to it.
The samba share used here does not need a username or password, but adding user=”myuser”,password=”mypassword” to the list of options when mounting the share should work nicely in other cases.
The /var/www dir will be saved as is (no old versions) in the same directory and kept syncrhonized by rsync. A log will be written in /var/log/backup.log
Here is the script itself :
#!/bin/bash echo >> /var/log/backup.log echo >> /var/log/backup.log day=$(date +%d-%m-%Y_%Hh%M) # List of databases to backup. Unfortunately, # mysql -u backup_user -B -e 'show databases;' # lists system databases that cannot be saved. Using manual list instead in the for loop echo "-------------------------------------------------" >> /var/log/backup.log echo "Beginning WebServer Backup -> Launching backupWebsite.sh" >> /var/log/backup.log date -R >> /var/log/backup.log mount -t cifs -o iocharset=utf8,file_mode=0777,dir_mode=0777 //MySambaServer/MySambaShare /backupDisk if [ -f "/backupDisk/WebServerBackup/autoBackup" ] then rsync -rltp --del --stats /var/www /backupDisk/WebServerBackup/www >> /var/log/backup.log # --del mkdir "/backupDisk/WebServerBackup/mysql_$day" # Backup all databases for i in 'mybase' 'wordpress' 'mysql'; do echo $i; mysqlhotcopy -u backup_user "$i" "/backupDisk/WebServerBackup/mysql_$day" >> /var/log/backup.log ; done # Remove the old database backups (more than 30 days) find /backupDisk/WebServerBackup -maxdepth 1 -type d -name "mysql_*" -mtime +30 -exec rm -rf \{\} \; else echo "Echec du montage ! ***Pas de sauvegarde du serveur web !***" >> /var/log/backup.log fi umount /backupDisk echo "WebServer BACKUP FINISHED (in //MySambaServer/MySambaShare/WebServerBackup )" >> /var/log/backup.log date -R >> /var/log/backup.log echo "**************************************************" >> /var/log/backup.log
Finally, the script (executable, thanks to a sudo chmod a+x /usr/bin/backupWebsite.sh) is linked to from the directory /etc/cron.daily/ so it will launch automatically once a day. The .sh is removed in the link name as some versions of cron don’t execute .sh files.
sudo ln -s /usr/bin/backupWebsite.sh /etc/cron.daily/backupWebsite
After a few month of slumber, project PyVotons has awaken. It is now moving fast towards an alpha release on this website in the next few weeks.
This version should include account creation, poll creation, voter’s listings, voting page and finally poll’s result display.
Technical details : PyVotons contains a UI that runs in the client web browser (python compiled to javascript by Pyjamas) and a standalone HTTPS serveur (also using python) connected to a MySQL database to store user and poll data.
It should be the first usable web version of PyVotons but there will still be a lot on the TODO list :