The trick to get your wordpress behind a reverse proxy

I have been meaning to get this blog SSL protected for a while and since solution like letsencrypt makes it easy I have generated some SSL keys for my domain and configured it in apache. So far so good, but the thing is my VM at my hosting provider is pretty small and I have been using varnish for quite some time or I would get out of memory quickly some the kernel OOM killer kicking1 it....

September 22, 2016

Upload to Rackspace Cloud Files in a shell script

I don’t really use much the GUI and always the command line so I don’t really use the Cloud File plugin I created for nautilus. So here is a shell script to upload to Rackspace Cloud Files and give you back a shortened URL of the public URL file. Great for quick sharing… You have to install the zenity binary first.. [Update: this is now available here https://github.com/chmouel/upcs]

June 9, 2010

Unit conversion from zsh

Quick conversion from shell :

June 6, 2010

rsync like backup to Rackspace Cloud File with duplicity

It seems that there is no much documentation about how to do rsync like backup with duplicty so here it is : Install python-cloudfiles from here http://github.com/rackspace/python-cloudfiles #!/bin/bash UPLOAD_TO_CONTAINER="backup" #adjust it as you like export CLOUDFILES_USERNAME=Your Username export CLOUDFILES_APIKEY=API_KEY_YOU_GOT export PASSPHRASE=The Passphrase for your encrypted backup duplicity /full/path cf+http://${UPLOAD_TO_CONTAINER} This should take care to upload the backup files to the backup container. It does that incrementally and detect the changes to your file system to upload....

September 2, 2009

Upload to Rackspace Cloud files from GNOME nautilus

After seeing this script http://overhrd.com/?p=106 which allow to upload files with the file manager (finder) of MacosX to Rackspace Cloud Files, I have made a nautilus script that doe the same for us Gnome/Unix users. Available here : http://github.com/chmouel/nautilus-rackspace-cloud-file/tree/master

September 2, 2009

Using ProxyCommand with OpenSSH and a Bastion server.

So at work we have to use a bastion host for all our connections to servers to be able to get called PCI compliant. This kind of stuff could be a pain to use when you have to use another host to do RSYNC/SCP or other stuff that need direct transfer to workstation. Thankfully OpenSSH is very flexible and have multiple options to easy the pain. If you add this to your ~/....

February 8, 2009

Generating md5 encrypted password for chpasswd

If you want to generate properly encrypted password to feed to chpasswd, the most easier and proper way is to do that from command line : [code lang=“bash”] echo “encryptedpassword”|openssl passwd -1 -stdin [/code] If you want to generate in pure python you can do it like that : [code lang=“python”] def md5crypt(password, salt, magic=’$1$’): import md5 m = md5.new() m.update(password + magic + salt) # /* Then just as many characters of the MD5(pw,salt,pw) */...

August 17, 2007

Automatic best resolution with xrandr

If you like me you have a big screen with your laptop and wants to automate when your X session start to get the best resolution, you can use that script : [code lang=“bash”] #!/bin/bash function get_resolutions() { xrandr|while read -a line;do RES="${line[1]}x${line[3]} " [[ ${RES} != [0-9]* ]] && continue echo ${RES} done } _BEST_RES=0 BEST_RES= for res in $(get_resolutions);do _res=${res/x/} [[ $_res -ge ${_BEST_RES} ]] && { BEST_RES=${res}...

July 31, 2007

Automate SSH known_hosts cleanup

If you like me, you have to do a lot of installs1 of the same test machine with the same IP and have to ssh it you will notice this annoying message : IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY! Someone could be eavesdropping on you right now (man-in-the-middle attack)! It is also possible that the RSA host key has just been changed. The fingerprint for the RSA key sent by the remote host is 54:9d:c0:37:3a:80:48:6c:82:ec:d1:84:93:61:24....

May 30, 2007

SVN Diff against changes in the remote repository.

A useful svn wrapper scripts. Get a diff of your local repostitory against the upstream repository changes. I wonder why it is not builtins though like a svn status -u but for dif. #!/bin/bash IFS=" " for line in `svn status -u`;do [[ $line != " "* ]] && continue rev=`echo $line|awk '{print $2}'` ff=`echo $line|awk '{print $3}'` svn diff -r${rev}:HEAD $ff done

February 7, 2007