Category: How to ? (page 2 of 3)

screencast with byzance on linux

byzanz-record -c –duration=60 –x=80 –y=310 –width=800 –height=600 out.gif

Not permitted to mount disk ? [EN]

A few days ago, I started to have a very disturbing “Not permitted” message when trying to mount a usb disk from Thunar. The only way I found was to pmount the disk : not as intuitive as just clicking the disk on Thunar.

But after some googling, I found where was the real problem : udisk, who is responsible of mounting disks, uses polkit to know if I have the right to mount, or not, external disk. So, if you have the same problem, follow this steps :

sudo nano /usr/share/polkit-1/actions/org.freedesktop.udisks2.policy

(use your favorite text editor in place of nano)

Then, look for the section with “udisks2.filesystem-mount”, inside you’ll have a “defaults” section with interesting stuff :


Now, replace all “auth_admin*” by “yes” to give access for every user, like this :


Save your modifications. Forget this annoying message !

How To Forward Outlook Emails With VB Script [EN]

  1. In Windows, create a certificate via Start > All Programs > Microsoft Office > Microsoft Office Tools > Digital Certificate for VBA Projects
  2. In Microsoft Outlook, open the VB editor and copy/paste the code below
  3. Replace and save
  4. Click on Tools > Digital Signature
  5. Click on [Choose] and select your certificate
  6. Click OK, then save and close the VB editor
  7. Create the Outlook rule with [run a script] as action and select your macro
  8. That’s all folks !
Private Const TO_EMAIL As String = ""
Sub ForwardAllEmail(theMail As MailItem)
	On Error GoTo EndSub
	Dim mailObj As Outlook.MailItem
	Dim item As Outlook.MailItem
	Set mailObj = Application.Session.GetItemFromID(theMail.EntryID)
	Set item = mailObj.Forward
	item.Recipients.Add (TO_EMAIL)
	Set item = Nothing      ' Set variables to null to prevent memory leaks
	Set mailObj = Nothing
	Exit Sub
  MsgBox "Error: " & Err.Description
End Sub

Tmux for the impatient

New session : tmux

Attach to a session : tmux a

Detach : Ctrl+b d

Scroll : Ctrl+b PgUp/PgDown (quit with q) also can use mouse after first page up or down

Copy mode : Ctrl+b [ (quit with q)

Split horizontally : Ctrl+b “

Split vertically : Ctrl+b %

Switch pane : Ctrl+b arrow key

Resize pane : Hold Ctrl+b + arrow keys


install xclip so buffer copied insied tmux are also available to X : sudo apt-get install xclip

Wireless auto configuration with guessnet on Linux

The wireless tour eiffel
Assume we have access to the wifi at work and at home. How can I configure my laptop to automatically connect to the right network without using a graphical network manager ? Welcome guessnet !
Read more →

If ssh client disconnect and freeze

Add in your ~/.ssh/config :

Host *
 ServerAliveInterval 240

src =

Git delete remote branch

As of Git v1.7.0, you can delete a remote branch using

git push origin --delete <branchName>

src =

Horizontal rule in zsh prompt


Put in your ~/.zshrc :

PS1=$'%U${(r:$COLUMNS:: :)}%u'$PS1

src =

Increase wordpress max file upload size

On Ubuntu/Debian distro, edit the /etc/wordpress/htaccess and add this lines :

php_value upload_max_filesize 50M
php_value post_max_size 50M
php_value memory_limit 50M

Substitute a text only in files where it appears

For example, to substitute foo with bar

for f in `grep -lR foo`; do
	echo -n ">> $f";
	sed 's/foo/bar/g' $f > $f.tmp ;
	mv $f.tmp $f ;
	echo " done.";
  • 1) for loops on all files containing the text “foo”, grep -l only show the file name with corresponding text inside.
  • 3) sed replace foo with bar in all file
  • 4) mv save the modification (delete if you don’t want to overwrite the original files, the modified files is named with .tmp at the end)
  • 2) & 5) echo: which file is treated