sudo hdparm -I /dev/sdc sudo hdparm user-master u security-set-pass Einstein /dev/sdc sudo time hdparm user-master u security-erase Einstein /dev/sdc Result /dev/sdc: Issuing SECURITY_ERASE command, password="Einstein", user=user 0.00user 0.00system 2:38:09elapsed 0%CPU (0avgtext+0avgdata […]
Ubuntu
Force resolution in Linux using xrandr
Easy peasy! xrandr --newmode $(gtf 1280 1024 60 | sed -ne 's/"//g;s/ Modeline //p') xrandr --addmode VGA1 1280x1024_60.00 source
LVM Cheat Sheet
Expand a logical volume Source Make sure the host partition is big enough (using parted or gparted) (must be done offline if partition is mounted) The following commands can be done online (even if the logical volume is in use) Check disk usage (Allocated / Free) sudo lvm vgdisplay Check allocation […]
Installing services under Linux
I had to setup thoses as part of my work. Here is a copy here as the method can apply to many services. Original article I wrote: Install elasticsearch on CentOS Install from repository We use an Automated install. We could have used […]
Removed Kernel by mistake
I got problems with a linux machine with a very small /boot partition. It wouldn't install any updates anymore and would complain about boot partition being full. I found out that many kernel versions were stored in this partition, and I did a bit of cleanup -- which turned out quite bad because I […]
Convert MTS or M2TS to something else
I've got a JVC HD camcorder which uses a proprietary MTS container. It is however quite simple to re-mux those videos into MKV (without re-encoding, which is also possible but of course much slower): ffmpeg -i input.mt2s -scodec copy -acodec copy -vcodec copy -f matroska input.mkv An a bash script […]
Converting flac to mp3
Note that you will need flac and lame for this to work. Run the following line in the directory where the flac files are: for file in *.flac; do flac -cd “$file” | lame -h – “${file%.flac}.mp3″; done You can also make lame create the mp3 files somewhere else. Take the following line: for file in […]
Setup OpenVPN in Ubuntu
I recently installed a PC running Ubuntu in an encrypted drive. The next step was to use a VPN provider to anonymize it a bit. I first used the Network Manager to configure and run the VPN, but I was a bit confused by the GUI, and wanted to customize the VPN a bit more. Moreover Network Manager […]
Enable correct resolution on VGA output
I recently reinstalled Ubuntu 12.10 from scratch on a PC with a nvidia GeForce 9300 embedded. The only particular thing is that it was connected to the monitor through VGA. Unfortunately, the display was stuck at 1366x768 instead of the native resolution 1680x1050 no matter if I used the nouveau or […]
Fix Nero Linux 4 for Ubuntu 11.10+ 64 bits
Tried to use Nero to convert and burn an audio CD. It would always giving me a "incorrect parameter" error and refuse to do anything. It turned out I upgraded to Ubuntu 12.04 recently and didn't use Nero ever since... Fortunately I could a find an answer to this problem: sudo mkdir […]
Ubuntu 12.04 Replacing the Unity interface
Bookmarked :) http://complete-concrete-concise.com/ubuntu-2/ubuntu-12-04/ubuntu-12-04-replacing-the-unity-interface
Enable Wake On Lan for Ubuntu (useful for XBMC too)
I want to be able to start XBMC Live remotely. XBMC being based on Ubuntu, it was not so hard to achieve, once I understood I should follow the Ubuntu tutorial rather than the XBMC one. You may need to install the ethtool package sudo apt-get install ethtool You can then try to enable WOL manually […]
Convert WMA files to MP3
I dislike MP3 but less than I dislike WMA :-) Anyway, my car CD player wouldn't want to play WMA. So: 1. Install Medibuntu repository in 1 line sudo wget http://www.medibuntu.org/sources.list.d/$(lsb_release -cs).list output-document=/etc/apt/sources.list.d/medibuntu.list && sudo apt-get -q […]
Extract audio from a DVD
Extract audio tracks out of a video DVD appeared to be a one liner in Ubuntu. Command line power! for i in {01..11}; do mplayer -vc null -vo null -ao pcm:fast -ao pcm:file=output$i.wav -chapter $i-$i DVD://01; done The previous example extracts audio from chapters 1 to 11 and store them is wav files […]
Clean up Linux history
Login history: sudo -i echo > / var / log / wtmp echo > / var / log / btmp Terminal command history: history -c or echo > ~ /. bash_history source
Install Firefox 4 in Ubuntu 10.10
Quite easy in fact: sudo add-apt-repository ppa:mozillateam/firefox-stable Then update! Too bad that my favorite theme, Whitehart, won't be supported in FF4... Source
Chromium in Ubuntu colors
Although I still use Firefox a lot, I find the interface and performances a bit outdated. I sure hope version 4.0 will change this. Meanwhile I learned to appreciate Chromium, although it doesn't integrate too well in the Ubuntu desktop. The following themes are here to fix that: […]
Bug: Ubuntu 10.10 does not apply themes properly
After the upgrade from 10.04 to 10.10 I noticed the Ubuntu theme was sometimes reverted to the default Gnome one, meaning fonts, icons, toolbars are all reset. I tried a clean reinstall but the same bug raised up again. It seems to be a race condition appearing on higher hardware (combination of SSD […]
Enabling NumLock in the Gnome login screen
Install numlockx using apt-get, aptitude or Synaptic Edit /etc/gdm/Init/Default Find the line exit 0 Add the following code above that line if [ -x /usr/bin/numlockx ]; then /usr/bin/numlockx on fi source 1 […]
How to secure delete files in Linux
Shred shred OPTIONS filename Common options: -n N Overwrite a file N times. -u Remove the file after you’ve shredded it. -z After shredding a file with random bits (ones and zeros), overwrite the file with only zeros. So, for example, to shred a file “topsecret.txt” with 26 iterations, and delete it […]