tag:blogger.com,1999:blog-63377419574375607352024-02-17T10:48:58.632+02:00Plug-and-Praysoftware engineering | computer science | GNU/Linux | otherAlexandrahttp://www.blogger.com/profile/07936817579635597668noreply@blogger.comBlogger45125tag:blogger.com,1999:blog-6337741957437560735.post-55428499235648809132014-05-22T16:52:00.000+03:002014-05-22T16:53:57.516+03:00Problems with my Intel Wifi 5100 on Linux<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: verdana;">
I've really had it with <a href="http://plug-and-pray.blogspot.fr/2009/05/asus-pro57vr-notebook-m51vr-and-linux.html">this</a> laptop of mine. It was OK at its time, but now it's long time due. I'm getting a new system in a couple of months from now. I've really missed having a desktop computer these last few years.<br />
<br />
But anyway... my Kubuntu 13.10 x86_64, or my wifi controller, or both, suddenly decided to make wifi networking impossible, all of a sudden. The wifi controller in question is an Intel 5100. The funny thing is that it appears that I <i>do</i> have the right firmware for it.<br /></span>
<br />
<code>alex@asus:~$ lspci | grep Net<br />
06:00.0 Network controller: Intel Corporation WiFi Link 5100<br />
alex@asus:~$ modinfo iwlwifi | grep ^firmware<br />
firmware: iwlwifi-100-5.ucode<br />
firmware: iwlwifi-1000-5.ucode<br />
firmware: iwlwifi-135-6.ucode<br />
firmware: iwlwifi-105-6.ucode<br />
firmware: iwlwifi-2030-6.ucode<br />
firmware: iwlwifi-2000-6.ucode<br />
firmware: iwlwifi-5150-2.ucode<br />
firmware: iwlwifi-5000-5.ucode<br />
firmware: iwlwifi-6000g2b-6.ucode<br />
firmware: iwlwifi-6000g2a-5.ucode<br />
firmware: iwlwifi-6050-5.ucode<br />
firmware: iwlwifi-6000-4.ucode<br />
firmware: iwlwifi-3160-7.ucode<br />
firmware: iwlwifi-7260-7.ucode<br />
</code>
<br />
<span style="font-family: verdana;">
After some very frustrating research, I found a fix:<p>
</span>
<code>alex@asus:~$ sudo echo "options iwlwifi 11n_disable=1" >> /etc/modprobe.d/iwlwifi.conf<p></code>
<span style="font-family: verdana;">and a reboot did the trick for me.</span>
</div>Alexandrahttp://www.blogger.com/profile/07936817579635597668noreply@blogger.com1tag:blogger.com,1999:blog-6337741957437560735.post-77587955170535795932013-04-27T17:07:00.001+03:002017-12-19T01:17:18.240+02:00Google Chrome theme fix on Linux<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Verdana, sans-serif;">(Off-topic: this is my first post in more than two years on this blog! In the meantime, I learned to speak English better and I forgot most of my Linux know-how...)</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">Right, so Google inadvertently fscked things up with Chrome (which, with all its downsides, is still the best browser in my opinion) – with the Chrome themes, to be more precise. Since you normally get them <i>via</i> the Google Store, the ones that you've already tried out are displayed as being already installed. However, if you want to use an old (installed!) theme again... you might not be able to. It's shown as installed, but there's no means to choose it. You can't uninstall it either, since it's not an app, but a – erm – theme.</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<a name='more'></a><span style="font-family: Verdana, sans-serif;">Too confusing? Okay, suppose you want to switch from <b>theme 1</b> that you've been using to <b>theme 2</b>. After a while, it becomes boring and you want to switch to <b>theme 1</b> again. The workaround that I found is that you have to delete <b>theme 1</b>, in order to be able to install it and use it... again. Nope, it's not very intelligent, but that's the way Chrome coders code their stuff. And since it's free, you don't have the right to complain.</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">So fire up a terminal and search for your installed themes:</span><br />
<blockquote class="tr_bq">
<span style="font-family: "courier new" , "courier" , monospace;">find ~/.config/google-chrome/Default/Extensions/ -type f -iname *pak</span></blockquote>
<span style="font-family: Verdana, sans-serif;">You'll get results that might look something like this:</span><br />
<blockquote>
<span style="font-family: "courier new" , "courier" , monospace;">/home/user/.config/google-chrome/Default/Extensions/bfjgbcjfpbbfepcccpaffkjofcmglifg/1.0_0/Cached Theme.pak</span></blockquote>
<span style="font-family: Verdana, sans-serif;">Now you'd just need to delete that directory:</span><br />
<blockquote>
<span style="font-family: "courier new" , "courier" , monospace;">rm -fr /home/user/.config/google-chrome/Default/Extensions/bfjgbcjfpbbfepcccpaffkjofcmglifg</span></blockquote>
<span style="font-family: Verdana, sans-serif;">After you restart your browser, you'll be able to pick and install the theme you want from the Google Store.</span></div>
Alexandrahttp://www.blogger.com/profile/07936817579635597668noreply@blogger.com0tag:blogger.com,1999:blog-6337741957437560735.post-3110225810947990392010-02-14T09:47:00.012+02:002010-02-14T17:47:12.565+02:00RapidShare Premium, wget and your download queue<span style="font-family: verdana"><p>So you just bought a RapidShare Premium account and would like to automatize fetching your link list? Here is a very raw solution with cookie-based authentication handled by <span style="font-family: courier new">wget</span> and a download queue in the form of a plain text file.</p></span><a name='more'></a><span style="font-family: verdana"><h3>An overview</h3><p>The idea for getting your download queue with <span style="font-family: courier new">wget</span>, using your RapidShare Premium account, is very simple. Here are the main steps:</p><ul style="text-align: justify"><li>Enable direct downloads from your RapidShare profile;</li><li>Make <span style="font-family: courier new">wget</span> save your RapidShare cookie;</li><li>Make <span style="font-family: courier new">wget</span> use the cookie to fetch a link;</li><li>Paste all your links in a plain text file;</li><li>Write a basic bash script that reads the said plain text file – your "download queue".</li></ul><h3>The step-by-step guide</h3><p><b>1.</b> Log into your RapidShare Premium account and go to "Settings". Under the "Configuration" paragraph, you need to tick the "<i>Direct downloads</i>" check box and then click the "Save" button. The direct downloads option means that you will not be shown the free-vs-premium download page each time you open a RapidShare link. You will get the "save as" dialog instead.</p><p><b>2.</b> You need to make <span style="font-family: courier new">wget</span> to store your RapidShare cookie.<blockquote><pre span style="font-family: courier new">wget <br /> --save-cookies ~/.rs \ <br /> --post-data "login=<i>YOUR_RS_USERNAME</i>&password=<i>YOUR_RS_PASSWORD</i>" \ <br /> -O - \ <br /> https://ssl.rapidshare.com/cgi-bin/premiumzone.cgi</pre></blockquote></p><p>You obviously need to replace <span style="font-family: courier new"><i>YOUR_RS_USERNAME</i></span> with your RapidShare user name and <span style="font-family: courier new"><i>YOUR_RS_PASSWORD</i></span> with the password associated to your Premium account. The cookie will be saved in a new file called <span style="font-family: courier new">.rs</span>, in your home directory. It is now time to adjust the permissions on that file:</p><span style="font-family: courier new"><blockquote>chmod 400 ~/.rs</blockquote></span><p>There is one final thing to do here: suppose somebody browses through your command history. You would not want that. So take a look with</p><span style="font-family: courier new"><blockquote>history | tail</blockquote></span><p>You will probably see an output such as:</p><span style="font-family: courier new"><blockquote>503 ls<br />504 wget --save-cookies ~/.rs --post-data "login=YOUR_RS_USERNAME&password=YOUR_RS_PASSWORD" -O - https://ssl.rapidshare.com/cgi-bin/premiumzone.cgi<br />505 chmod 400 ~/.rs<br />506 history | tail</blockquote></span><p>Notice the "offset" (the number associated to the <span style="font-family: courier new">wget</span> command) – in our example, it is 504. You will just have to delete the command at this offset from your bash history:</p><span style="font-family: courier new"><blockquote>history -d 504</blockquote></span><p><b>3.</b> Now that your RapidShare cookie is saved, you can instruct <span style="font-family: courier new">wget</span> to use it. Here is how you can download a single file using your RapidShare Premium account and <span style="font-family: courier new">wget</span>:</p><span style="font-family: courier new"><blockquote>wget --load-cookies ~/.rs <i>URL</i></blockquote></span><p>(You need to replace <span style="font-family: courier new"><i>URL</i></span> above with an actual valid RapidShare link.)</p><p><b>4.</b> It is time to build your "download queue". Just paste the RapidShare links you want to download in a plain text file, one URL per line. Your file might be called <span style="font-family: courier new">rs_download_queue.txt</span> and it might look a bit like this:</p><span style="font-family: courier new"><blockquote>http://rapidshare.com/files/123456781/archive.part1.rar<br />http://rapidshare.com/files/123456782/archive.part2.rar<br />http://rapidshare.com/files/123456783/archive.part3.rar</blockquote></span><p><b>5.</b> The final step is to wrap up the whole thing and start downloading without further interaction. A very raw solution would be to write a script like this one:</p><pre span style="font-family: courier new">#!/bin/bash<br /><br />dq="/path/to/rs_download_queue.txt" # your "download queue"<br />ck="/home/yourusername/.rs" # your RS cookie from step 2<br /><br />for line in `seq "$( wc -l "$dq" | awk '{ print $1 }' )"`<br />do<br /> URL="$( sed -n ''$line'p' "$dq" )"<br /> URL="$( echo "$URL" | sed -e 's/^[ \t]*//;s/[ \t]*$//' )"<br /> if [ "x${URL}" != "x" ]<br /> then<br /> wget --load-cookies "$ck" "$URL"<br /> fi<br />done<br /></pre><p>Save this script as <span style="font-family: courier new">rsdq.sh</span>. Do not forget to make it executable:</p><span style="font-family: courier new"><blockquote>chmod 755 rsdq.sh</blockquote></span><p>So each time you need to download something, you just have to edit the <span style="font-family: courier new">rs_download_queue.txt</span> file accordingly and then launch the script <span style="font-family: courier new">rsdq.sh</span> that you just wrote.</p><h3>Caveats</h3><p>As stated at the beginning of this post, this is a very unsophisticated solution. Since for me it works wonders, I will not bother to improve it, but it is only fair to let you know that:</p><ul style="text-align: justify"><li>The script does not check for dead links.</li><li>The script provides no way to resume an interrupted download.</li><li>The script does not check for the space you have left on the device.</li><li>The script does not check whether you still have RapidShare traffic left for the current day.</li><li>The script does not parse the "download queue" file in any way other than skip empty lines.</li></ul><p>As I said, it works fine for me – as long as I can use it during the RapidShare Happy Hours (when your traffic gets counted only as 10% of the real one), it's enough.</p></span>Alexandrahttp://www.blogger.com/profile/07936817579635597668noreply@blogger.com5tag:blogger.com,1999:blog-6337741957437560735.post-79995694931925115202010-02-07T19:58:00.009+02:002010-02-09T18:15:00.042+02:00Mass-(re)naming files from .flac tags<span style="font-family: verdana"><p>The story is usually the other way around: you have a bunch of correctly named audio files and you want to automatically mass-tag them. Most players and tag editors already allow you to do that.</p><p>My problem was the exact reverse of this situation: I had neatly tagged <span style="font-family: courier new">.flac</span>-s and I wanted to rename the files, which were bleakly called <span style="font-family: courier new">split-track01.flac</span>, <span style="font-family: courier new">split-track02.flac</span> etc.</p></span><a name='more'></a><span style="font-family: verdana"><p>I came up with a handy script that allows me to do just that. In order for it to work, you will of course need the FLAC tools:</p><span style="font-family: courier new"><blockquote>sudo aptitude install flac</blockquote></span><p>Note that this script works <i>only</i> for <span style="font-family: courier new">.flac</span> files at the moment (I have not yet taken the time to dig into the differences between ID3v1 and ID3v2 tags for <span style="font-family: courier new">.mp3</span>-s, nor did I figure out how is it that I should decide on which tag version to take into account – in case both are present).</p><p>Before proceeding with the actual script, let me explain a bit what it does and how it should be used. Suppose you have a directory with these files (all with their tags in place):</p><span style="font-family: courier new"><b>alex@enterprise$</b> ls -1<br /><i>cd7split-track05.flac<br />cd8split-track01.flac<br />cd8split-track02.flac</i></span><p>You know these files are part of the same album and you want to rename them, according to their tags. Here's what the script does if it is invoked with the <span style="font-family: courier new">--display</span> argument:</p><span style="font-family: courier new"><b>alex@enterprise$</b> track_number=1 ; for track in cd7split-track05.flac cd8split-track01.flac cd8split-track02.flac ; do ./flacrename.sh $track $track_number --display ; track_number=$(($track_number+1)) ; done<br /><i>cd7split-track05.flac: 01_Anton_Bruckner_-_Symphony_No._9_in_D_minor_-_I._Feierlich._Misterioso.flac<br />cd8split-track01.flac: 02_Anton_Bruckner_-_Symphony_No._9_in_D_minor_-_II._Scherzo._Bewegt_lebhaft_-_Trio._Schnell.flac<br />cd8split-track02.flac: 03_Anton_Bruckner_-_Symphony_No._9_in_D_minor_-_III._Adagio._Langsam_feierlich.flac</i></span><p>As you can see, the second argument (the one between the file name and the optional <span style="font-family: courier new">--display</span>) represents the track number that is to be inserted at the beginning of the file name. The above output is just that, an output. No changes have been made upon the files themselves. So now that you've checked and made sure there is no error in the file naming scheme, you can run it without the <span style="font-family: courier new">--display</span> parameter. The files will be renamed:</p><span style="font-family: courier new"><b>alex@enterprise$</b> track_number=1 ; for track in cd7split-track05.flac cd8split-track01.flac cd8split-track02.flac ; do ./flacrename.sh $track $track_number ; track_number=$(($track_number+1)) ; done<br /><b>alex@enterprise$</b> ls -1<br /><i>01_Anton_Bruckner_-_Symphony_No._9_in_D_minor_-_I._Feierlich._Misterioso.flac<br />02_Anton_Bruckner_-_Symphony_No._9_in_D_minor_-_II._Scherzo._Bewegt_lebhaft_-_Trio._Schnell.flac<br />03_Anton_Bruckner_-_Symphony_No._9_in_D_minor_-_III._Adagio._Langsam_feierlich.flac</i></span><p>That was the usage part. Here is a short description of what the script actually does:</p><ul style="text-align: justify"><li>If the script is called with anything but two or three arguments: a usage reminder is displayed;</li><li>If it is called with three arguments but the third one is different from <span style="font-family: courier new">--display</span>: a usage reminder is displayed;</li><li>If the second argument (the track number) is not a number <i>or</i> if it is a number less than 1 (i.e. zero or negative): an error message and a usage reminder are displayed;</li><li>If the file specified by the first argument does not exist: an error message is displayed;</li><li>If the file specified by the first argument is not a valid <span style="font-family: courier new">.flac</span>: an error message is displayed;</li><li>The values of the artist, album and track title tags are stored in local variables. The values stored in these variables have two characteristics: all spaces are turned into underscores ('_') and other special characters (that should not appear in a file name) are suppressed;</li><li>The new file name is finally constructed from the said variables. If the <span style="font-family: courier new">--display</span> argument is called, the script will only show what the file name(s) would look like, without doing the actual renaming. If the <span style="font-family: courier new;">--display</span> argument is <i>not</i> invoked, the renaming will proceed normally.</li></ul><p>These being said, here's the script:</p><pre style="font-family: courier new">#!/bin/bash <br /># Return codes<br /># 0 - success <br /># 1 - incorrect usage<br /># 2 - incorrect <track_number> argument<br /># 3 - file <file_name.flac> not found <br /># 4 - file <file_name.flac> not .flac <br /><br />function usage() {<br /> echo "Usage: $0 <file_name.flac> <track_number> [--display]"<br /> echo "" <br /> echo " e.g. The command " <br /> echo " $0 split-track01.flac 3 " <br /> echo " will read the tags in 'split-track01.flac' and will rename "<br /> echo " the file accordingly, preceding it by the specified track " <br /> echo " number – '03' in this case." <br /> echo "" <br /> echo "--display Use this if you only wish to check the resulting "<br /> echo " file name, without actually renaming the file."<br /> echo " e.g. $0 split-track01.flac 3 --display" <br />}<br /> <br />function display() {<br /> echo "$1: $2" <br /> exit 0 <br />} <br /><br />if [ $# -ne 2 ] <br />then <br /> if [ $# -ne 3 ]<br /> then <br /> usage <br /> exit 1 <br /> else <br /> if [ "$3" != "--display" ]<br /> then <br /> usage <br /> exit 1 <br /> fi <br /> fi <br />fi <br /><br />if [ "$( expr $2 - $2 2>/dev/null )" != "0" -o $2 -lt 1 ]<br />then <br /> echo "The <track_number> must be a numeric, greater than zero value!"<br /> echo <br /> usage <br /> exit 2 <br />fi <br /><br />if [ ! -e "$1" ]<br />then<br /> echo "The file you specified does not exist."<br /> exit 3<br />fi<br /><br />if [ "$( file "$1" | grep -c "FLAC audio bitstream data" )" -eq 0 ]<br />then<br /> echo "The file you specified is not a valid FLAC."<br /> exit 4<br />fi<br /><br />flac_artist="$( metaflac --show-tag=artist "$1" | awk -F= '{ print $2 }' )"<br />flac_artist="$( echo "$flac_artist" | sed -e 's/\ /_/g' | sed -e "s/'//g" )"<br />flac_artist="$( echo "$flac_artist" | sed -e 's/[|\/\\",;:?!%&]//g' )"<br /><br />flac_album="$( metaflac --show-tag=album "$1" | awk -F= '{ print $2 }' )"<br />flac_album="$( echo "$flac_album" | sed -e 's/\ /_/g' | sed -e "s/'//g" )"<br />flac_album="$( echo "$flac_album" | sed -e 's/[|\/\\",;:?!%&]//g' )"<br /><br />flac_title="$( metaflac --show-tag=title "$1" | awk -F= '{ print $2 }' )"<br />flac_title="$( echo "$flac_title" | sed -e 's/\ /_/g' | sed -e "s/'//g" )"<br />flac_title="$( echo "$flac_title" | sed -e 's/[|\/\\",;:?!%&]//g' )"<br /><br />if [ $2 -ge 10 ]<br />then<br /> flac_track="$2"<br />else<br /> flac_track="0$2"<br />fi<br /><br />flac_name="${flac_track}_${flac_artist}_-_${flac_album}_-_${flac_title}.flac"<br /><br />if [ "$3" == "--display" ]<br />then<br /> display "$1" "$flac_name"<br />fi<br /><br /># if the execution has reached this line, it means the '--display' argument <br /># was not used; proceed with renaming the file<br /><br />mv "$1" "$flac_name"<br /><br />exit 0<br /></pre><br /></span>Alexandrahttp://www.blogger.com/profile/07936817579635597668noreply@blogger.com0tag:blogger.com,1999:blog-6337741957437560735.post-29506848284897575912010-02-06T20:07:00.012+02:002013-11-04T12:29:08.411+02:00Splitting and converting large .ape files<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: verdana;"></span><br />
<span style="font-family: verdana;">In a <a href="http://plug-and-pray.blogspot.com/2010/02/splitting-large-flac-files.html" target="_blank">previous post</a> I talked about how a large <span style="font-family: courier new;">.flac</span> file can be split into the original CD tracks (provided you have a correct <span style="font-family: courier new;">.cue</span> file).</span><br />
<span style="font-family: verdana;">Here is how to do the same for a large <span style="font-family: courier new;">.ape</span> file.</span><br />
<span style="font-family: verdana;"> </span><br />
<a name='more'></a><br />
<h3 style="text-align: left;">
<span style="font-family: Verdana, sans-serif;">Installing the </span><span style="font-family: courier new; font-size: large;">mac</span> <span style="font-family: Verdana, sans-serif;">utility</span></h3>
<span style="font-family: verdana;"></span><br />
<span style="font-family: verdana;"><span style="font-family: courier new;">APE</span> is <a href="http://www.monkeysaudio.com/" target="_blank">Monkey's Audio</a> file format for lossless audio compression. You can find it at <a href="https://tari.in/www/eng/software/mac/">tari.in</a>.</span><br />
<span style="font-family: verdana;"><br /></span>
<span style="font-family: verdana;">For Debian/Ubuntu, install it as follows:</span><br />
<blockquote>
<span style="font-family: Courier New, Courier, monospace;">
sudo add-apt-repository ppa:robert-tari/main<br />
sudo apt-get update<br />
sudo apt-get install mac<br />
</span></blockquote>
<br />
<h3>
<span style="font-family: verdana;">Splitting the </span><span style="font-family: courier new;">.ape</span><span style="font-family: verdana;"> file</span></h3>
<span style="font-family: verdana;">
You can decompress the file(s) directly:
</span><br />
<blockquote>
<span style="font-family: verdana;"><span style="font-family: courier new;">mac CDImage.ape CDImage.wav -d</span></span></blockquote>
<span style="font-family: verdana;">
Now you can split the <span style="font-family: courier new;">.wav</span> file the normal way, converting the parts into <span style="font-family: courier new;">.flac</span> files at the same time:<br />
</span>
<blockquote>
<span style="font-family: verdana;"><span style="font-family: courier new;">cuebreakpoints CDImage.cue | shnsplit -o flac CDImage.wav</span></span></blockquote>
<span style="font-family: verdana;">
...and add the tags from the <span style="font-family: courier new;">.cue</span> sheet:<br />
<blockquote>
<span style="font-family: courier new;">cuetag CDImage.cue split-track*.flac</span></blockquote>
(If you need to actually convert <span style="font-family: courier new;">.flac</span> files to <span style="font-family: courier new;">.mp3</span>-s, check out <a href="http://plug-and-pray.blogspot.com/2008/04/convert-flac-files-into-mp3.html" target="_blank">this</a> post.)</span></div>
Alexandrahttp://www.blogger.com/profile/07936817579635597668noreply@blogger.com2tag:blogger.com,1999:blog-6337741957437560735.post-61691340875357813342010-02-03T06:40:00.006+02:002010-02-07T19:44:44.938+02:00Splitting large .flac files<span style="font-family: verdana;">Suppose you have a large <span style="font-family:courier new">.flac</span> file and a <span style="font-family:courier new">.cue</span> one (which provides the correct <i>and</i> complete ripping information). The large <span style="font-family:courier new">.flac</span> stands for the whole CD. How to split it into the tracks that should make it up?</span><br /><a name='more'></a><br /><span style="font-family: verdana;"><b>0.</b> First off: if there is no <span style="font-family:courier new">.cue</span> file, no splitting is possible!<br /><br />This being said, we can move on:<br /><br /><b>1.</b> Install these tools:<br /><blockquote><span style="font-family:courier new">sudo aptitude install cuetools shntool</span></blockquote><b>2.</b> Split the file:<br /><blockquote><span style="font-family:courier new">cuebreakpoints large_file.cue | shnsplit -o flac large_file.flac</span></blockquote><b>3.</b> Tag the tracks (according to the ripping information present in the <span style="font-family:courier new">.cue</span> file):<br /><blockquote><span style="font-family:courier new">cuetag large_file.cue split-track*.flac</span></blockquote>This should be it.<br /></span>Alexandrahttp://www.blogger.com/profile/07936817579635597668noreply@blogger.com0tag:blogger.com,1999:blog-6337741957437560735.post-74702835409630633352010-02-02T11:49:00.006+02:002017-12-19T00:56:23.568+02:00How to gobble (GNU scrobble) to Libre.FM using Amarok2<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: "verdana";">There is an open alternative to last.fm for the ones who like to keep track of their listening habits – it is called <a href="http://www.libre.fm/">Libre.FM</a> and it keeps growing. <br /><br />One does not <i>scrobble</i> on Libre.FM, but <i>gobbles</i> instead.<br /><br />It would have all been nice if there wouldn't have been so many issues with clients with poor or no support at all. I discontinued using my Libre.FM account when I switched to Amarok2, which offered no support for Libre.FM. Not any more! It is now possible to submit the metadata in your tracks to your Libre.FM account, even from Amarok2.</span><br />
<a name='more'></a><br />
<span style="font-family: "verdana";">Here's a step-by-step guide.<br /><br /><b>1.</b> Go to <a href="http://www.libre.fm/">Libre.FM</a> and create an account.<br /><br /><b>2.</b> Configure Amarok: Go to <i>Settings</i> -> <i>Configure Amarok...</i> -> <i>Internet Services</i> -> tick the "Last.fm" check box and click the settings icon next to it. Enter here your <b>Libre.FM</b> username and your <b>Libre.FM</b> password and untick the "Submit tracks" and "Retrieve similar artists" check boxes, then click "OK".<br /><br /><b>3.</b> Install </span><span style="font-family: "courier new";">lastfmsubmitd</span><span style="font-family: "verdana";">. If you are using (K)Ubuntu, use this command in a terminal:</span><br />
<blockquote>
<span style="font-family: "courier new";">sudo aptitude install lastfmsubmitd</span></blockquote>
When asked, enter <span style="font-family: "courier new";">audio</span> as the group.<br />
<br />
<b>4.</b> Edit <span style="font-family: "courier new";">/etc/lastfmsubmitd.conf</span><span style="font-family: "verdana";"> and add the following:</span><br />
<blockquote>
<span style="font-family: "courier new";">[server]<br />url=http://turtle.libre.fm/</span></blockquote>
<span style="font-family: "verdana";"><b>5.</b> Make these directories accessible:</span><br />
<blockquote>
<span style="font-family: "verdana";"><span style="font-family: "courier new";">sudo chmod -R 777 /var/spool/lastfm<br />sudo chmod -R 777 /var/log/lastfm</span></span></blockquote>
<span style="font-family: "verdana";"><b>6.</b> Download the <a href="http://kde-apps.org/content/show.php/Amarok2LibreFM?content=107339">Amarok2LibreFM</a> script for Amarok2 (no need to unpack it, just leave it as it is).<br /><br /><b>7.</b> Configure Amarok to use this script: <i>Tools</i> -> <i>Script Manager</i> -> <i>Install Script</i>, then choose the <span style="font-family: "courier new";">Amarok2LibreFM.amarokscript.tar.gz</span> that you just downloaded.<br /><br /><b>8.</b> Restart Amarok and you should be able to scrobble/gobble the tracks that you listen to.<br /><br />Don't know about you, but I'm very glad that Libre.FM is "usable" again.</span></div>
Alexandrahttp://www.blogger.com/profile/07936817579635597668noreply@blogger.com4tag:blogger.com,1999:blog-6337741957437560735.post-68202893174440674042009-11-25T15:24:00.005+02:002009-11-29T05:21:15.928+02:00How to split large files in Linux and *BSD<span style="font-family:verdana;">Suppose you have a large file that you need to "break down" to smaller pieces and then reconstruct. It's fairly simple, using the </span><span style="font-family:'courier new';">split</span><span style="font-family:verdana;"> command.</span><br /><div><span class="Apple-style-span" style="font-family:verdana;"><br /></span></div><div><span style="font-family:verdana;">I will only give a brief usage example. For more information, check out </span><span style="font-family:'courier new';">man split</span><span style="font-family:verdana;"> (and </span><span style="font-family:'courier new';">info coreutils 'split invocation'</span><span style="font-family:verdana;"> on Linux).</span></div><a name='more'></a><div><br /></div><div><span style="font-family:verdana;"><b>1. Splitting </b></span></div><div><br /></div><div><span style="font-family:verdana;">You split a larger file into smaller ones issuing a command such as:</span><br /><blockquote><span style="font-family:'Courier New', Courier, monospace;">split -b 100M your.file</span><br /></blockquote><span style="font-family:verdana;"><span style="font-family:'courier new';"><span style="font-family:'DejaVu Sans';"><span style="font-family:verdana;">The command above will split </span><span style="font-family:'courier new';">your.file</span><span style="font-family:verdana;"> in 100 megabytes volumes, called by default "xaa", "xab", "xac" and so on.</span></span></span></span><br /></div><div><span class="Apple-style-span" style="font-family:verdana;"><br /></span></div><div><span style="font-family:verdana;">If you feel you need another "pattern" or prefix, add that string to the end of the command:</span></div><blockquote><div><span style="font-family:'courier new';">split -b 100M your.file file.part.</span><br /></div><div></div></blockquote><div><span style="font-family:verdana;">The above command will split </span><span style="font-family:'courier new';">your.file</span><span style="font-family:verdana;"> in volumes called "file.part.aa", "file.part.ab" etc. (instead of the default "xaa", "xab" etc.).</span><br /></div><div><span class="Apple-style-span" style="font-family:verdana;"><br /></span></div><div><span style="font-family:verdana;">If you prefer the suffix (the "increment") to be <i>digits</i> rather than letters, use the </span><span style="font-family:'courier new';">-d</span><span style="font-family:verdana;"> flag.</span><br /></div><blockquote><div><span style="font-family:'courier new';">split -db 1G your.file file.part.</span><br /></div><div></div></blockquote><div><span style="font-family:verdana;">would produce volumes of your file of exactly 1 gigabyte, called "file.part.00", "file.part.01" etc.</span><br /></div><div><span style="font-family:verdana;"><br /><b>2. Joining</b></span></div><div><span style="font-family:verdana;"><br />To join the volumes, it is this simple:</span></div><blockquote><div><span style="font-family:'courier new';">cat `echo file.part.* | sort` > your.file.reloaded</span><br /></div><div></div></blockquote><div><span style="font-family:verdana;">Both </span><span style="font-family:'courier new';">your.file</span><span style="font-family:verdana;"> and </span><span style="font-family:'courier new';">your.file.reloaded</span><span style="font-family:verdana;"> have the same MD5 sum – they are identical.</span><br /></div>Alexandrahttp://www.blogger.com/profile/07936817579635597668noreply@blogger.com0tag:blogger.com,1999:blog-6337741957437560735.post-25876123081541344512009-11-19T17:47:00.004+02:002009-11-29T05:22:04.049+02:00IPFW: rule-based forwarding disabled<span style="font-family:verdana;">If you want to enable IPFW (or load the module) and you get "rule-based forwarding disabled" in dmesg... and you </span><i><span style="font-family:verdana;">need </span></i><span style="font-family:verdana;">forwarding, well, that is just too bad. You will need to enable IPFW forwarding support in the kernel.</span><a name='more'></a><br /><div><span class="Apple-style-span" style="font-family:verdana;"><br /></span></div><div><span style="font-family:verdana;">Yes, you will have to compile a custom FreeBSD kernel.</span><br /></div><div><span class="Apple-style-span" style="font-family:verdana;"><br /></span></div><div><span style="font-family:verdana;">It's not that awful, actually.</span><br /></div><div><span class="Apple-style-span" style="font-family:verdana;"><br /></span></div><div><span style="font-family:verdana;">First off, make sure you have the kernel sources (i.e. in </span><span style="font-family:'courier new';">/usr/src/sys</span><span style="font-family:verdana;">). </span><br /></div><div><span class="Apple-style-span" style="font-family:verdana;"><br /></span></div><div><span style="font-family:verdana;">You will be better off if you will run </span><span style="font-family:'courier new';">sysinstall</span><span style="font-family:verdana;"> beforehand: select "Configure" -> "Distributions" -> "Src" -> select "base" and "sys" and install them.</span><br /></div><div><span class="Apple-style-span" style="font-family:verdana;"><br /></span></div><div><span style="font-family:verdana;">Right, now you're ready to configure your kernel to support IPFW and forwarding.</span><br /></div><div><blockquote><div><span style="font-family:'courier new';">cd /usr/src/sys/i386/conf</span><br /></div><div><span style="font-family:'courier new';">cp GENERIC NEWKERNEL</span><br /></div><div><span style="font-family:'courier new';">vim NEWKERNEL</span></div></blockquote><div><span style="font-family:verdana;">Here, add the following:</span><br /></div><div><blockquote><div><span style="font-family:'courier new';">options IPFIREWALL</span><br /></div><div><span style="font-family:'courier new';">options IPFIREWALL_VERBOSE</span><br /></div><div><span style="font-family:'courier new';">options IPFIREWALL_FORWARD</span><br /></div><div><span style="font-family:'courier new';">options IPFIREWALL_VERBOSE_LIMIT=5</span><br /></div><div><span style="font-family:'courier new';">options IPFIREWALL_DEFAULT_TO_ACCEPT</span><br /></div><div><span style="font-family:'courier new';">options IPDIVERT</span></div></blockquote><div><span style="font-family:verdana;">Now you should be ready to compile the new kernel:</span><br /></div></div><blockquote><div><span style="font-family:'courier new';">cd /usr/src</span><br /></div><div><span style="font-family:'courier new';">make buildkernel KERNCONF=NEWKERNEL</span><br /></div><div><span style="font-family:'courier new';">make installkernel KERNCONF=NEWKERNEL</span><br /></div><div><span style="font-family:'courier new';">reboot</span></div></blockquote><div><span style="font-family:verdana;">Basically, you will now need to explicitly enable IPFW and to point to the location of the file containing its rules. So you can add to your</span><span style="font-family:'courier new';"> /etc/rc.conf</span><span style="font-family:verdana;"> the following:</span><br /></div><blockquote><div><span style="font-family:'courier new';">firewall_enable="YES"</span><br /></div><div><span style="font-family:'courier new';">firewall_script="/etc/ipfw.rules"</span></div></blockquote><div><span style="font-family:verdana;">The command</span><br /></div><blockquote><div><span style="font-family:'courier new';"># ipfw list</span><br /></div><div></div></blockquote><div><span style="font-family:verdana;">will show you which rules are in effect at the moment.</span><br /></div><div><span class="Apple-style-span" style="font-family:verdana;"><br /></span></div><div><span style="font-family:verdana;">Further reading: </span><br /></div><div><ul><li><a href="http://www.freebsd.org/doc/en/books/handbook/firewalls-ipfw.html"><span style="font-family:verdana;">IPFW</span></a></li><li><span style="font-family:verdana;">FreeBSD handbook on </span><a href="http://www.freebsd.org/doc/en/books/handbook/kernelconfig-building.html"><span style="font-family:verdana;">building and installing custom kernels</span></a></li><li><span style="font-family:verdana;">FreeBSD handbook: </span><a href="http://www.freebsd.org/doc/en/books/handbook/kernelconfig-trouble.html"><span style="font-family:verdana;">if something goes wrong</span></a><span style="font-family:verdana;"><span style="font-family:Georgia, serif;"><span style="font-family:verdana;"><br /></span></span></span></li></ul></div></div>Alexandrahttp://www.blogger.com/profile/07936817579635597668noreply@blogger.com2tag:blogger.com,1999:blog-6337741957437560735.post-27494537338516039612009-11-19T15:07:00.006+02:002017-12-19T01:38:11.957+02:00Shockwave content on Linux<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: "verdana";">Suppose you have the misfortune of </span><i><span style="font-family: "verdana";">having </span></i><span style="font-family: "verdana";">to access a page which only provides its interactive content in Shockwave, not Flash or Java. A stupid, ugly and slow leftover of old Macromedia (just before they released Shockwave Flash) that should not be supported anymore, anywhere, in my opinion.</span><br />
<a name='more'></a><br />
<div>
<span class="Apple-style-span" style="font-family: "verdana";"><br /></span></div>
<div>
<span style="font-family: "verdana";">If you will try to get the </span><a href="http://get.adobe.com/shockwave"><span style="font-family: "verdana";">Shockwave Player from Adobe</span></a><span style="font-family: "verdana";">, you will have a lame surprise. They don't offer it for Linux. There are only the Windows and Mac OS versions there.</span></div>
<div>
<span class="Apple-style-span" style="font-family: "verdana";"><br /></span></div>
<div>
<span style="font-family: "verdana";">However, do not despair. There is a way to overcome this. It will only work on Firefox, but it's better than nothing. Here are the steps (the following takes place on my Ubuntu machines):</span></div>
<div>
<br /></div>
<div>
<span style="font-family: "verdana";"><b>0.</b> If you haven't already, install Firefox.</span></div>
<div>
<span style="font-family: "verdana";"><b>1.</b> Install </span><span style="font-family: "courier new";">wine</span><span style="font-family: "verdana";">:</span></div>
<div style="font-family: courier new;">
<blockquote>
<span style="font-family: "courier new";">sudo aptitude install wine</span></blockquote>
</div>
<div>
<span style="font-family: "verdana";"><b>2.</b> Now download and install the <b>Windows</b> version of Firefox (from <a href="http://www.mozilla.com/en-US/firefox/all.html">here</a>); I am not kidding; you will be using </span><span style="font-family: "courier new";">wine</span><span style="font-family: "verdana";"> for this purpose.</span></div>
<div>
<span style="font-family: "verdana";"><b>3.</b> Install </span><span style="font-family: "courier new";">mozplugger</span><span style="font-family: "verdana";"> (a useful tool that allows you to "embed" other applications in your browser):</span></div>
<blockquote>
<div>
<span style="font-family: "courier new";">sudo aptitude install mozplugger</span></div>
<div>
</div>
</blockquote>
<div>
<span style="font-family: "verdana";"><b>4.</b> Launch the Windows version of Firefox (using </span><span style="font-family: "courier new";">wine</span><span style="font-family: "verdana";">) and access Adobe's Shockwave and Flash <a href="http://www.adobe.com/shockwave/welcome">test page</a>. Install the missing Adobe Shockwave plug-in. When done, close the browser.</span></div>
<div>
<span style="font-family: "verdana";"><b><span class="Apple-style-span" style="font-size: small;">5.</span></b><span class="Apple-style-span" style="font-size: small;"> Edit the file </span><span style="font-family: "courier new" , monospace; white-space: pre-wrap;"><span class="Apple-style-span" style="font-size: small;">/etc/mozpluggerrc</span></span><span style="white-space: pre-wrap;"><span class="Apple-style-span" style="font-size: small;"> </span></span><span style="white-space: pre-wrap;"><span class="Apple-style-span" style="font-size: small;">– add these lines at the end:</span></span></span></div>
<div>
<span style="font-family: "verdana";"><span style="white-space: pre-wrap;"></span></span><br />
<div>
</div>
<blockquote>
<div>
<span style="font-family: "verdana";"><span style="white-space: pre-wrap;"><span style="font-family: "courier new";"><span class="Apple-style-span" style="font-size: small;">application/x-director: dir,dcr,dxr,cst,cct,cxt,w3d,fgd,swa: Macromedia Director file</span></span><span class="Apple-style-span" style="font-size: small;"><br /></span></span></span></div>
<div>
<span style="font-family: "verdana";"><span style="white-space: pre-wrap;"><span style="font-family: "courier new";"><span class="Apple-style-span" style="font-size: small;"> swallow(firefox.exe) fill stream: wine "C:\\Program Files\\Mozilla Firefox\\firefox.exe" -chrome "$file"</span></span><span class="Apple-style-span" style="font-size: small;"><br /></span></span></span></div>
</blockquote>
<div>
</div>
<div>
<span style="font-family: "verdana";"><span style="white-space: pre-wrap;"><span class="Apple-style-span" style="font-size: small;">If you have a recent Ubuntu (from 9.04 onwards) and a decent Firefox version (at least 3.0.14), you should be able to skip the following step; otherwise, do this:</span><span class="Apple-style-span" style="font-size: small;"><br /></span></span></span></div>
<div>
<span style="font-family: "verdana";"><span style="white-space: pre-wrap;"><span class="Apple-style-span" style="font-size: small;"><br /></span></span></span></div>
<div>
<span style="font-family: "verdana";"><span style="white-space: pre-wrap;"><b><span class="Apple-style-span" style="font-size: small;">6.</span></b><span class="Apple-style-span" style="font-size: small;"> Remove or rename the </span><span style="font-family: "courier new";"><span class="Apple-style-span" style="font-size: small;">pluginreg.dat</span></span><span class="Apple-style-span" style="font-size: small;"> file in Firefox's profile directory:</span><span class="Apple-style-span" style="font-size: small;"><br /></span></span></span></div>
<div>
<blockquote>
<span style="font-family: "verdana";"><span style="white-space: pre-wrap;"><span style="font-family: "courier new";"><span class="Apple-style-span" style="font-size: small;">rm ~/.mozilla/firefox/</span></span><i><span style="font-family: "courier new";"><span class="Apple-style-span" style="font-size: small;">string</span></span></i><span style="font-family: "courier new";"><span class="Apple-style-span" style="font-size: small;">.default/pluginreg.dat</span></span></span></span></blockquote>
</div>
<div>
<span style="font-family: "verdana";"><span style="white-space: pre-wrap;"><span class="Apple-style-span" style="font-size: small;">or </span></span></span></div>
<div>
<blockquote>
<span style="font-family: "verdana";"><span style="white-space: pre-wrap;"><span style="font-family: "courier new";"><span class="Apple-style-span" style="font-size: small;">mv ~/.mozilla/firefox/</span></span><i><span style="font-family: "courier new";"><span class="Apple-style-span" style="font-size: small;">string</span></span></i><span style="font-family: "courier new";"><span class="Apple-style-span" style="font-size: small;">.default/pluginreg.dat ~/.mozilla/firefox/</span></span><i><span style="font-family: "courier new";"><span class="Apple-style-span" style="font-size: small;">string</span></span></i><span style="font-family: "courier new";"><span class="Apple-style-span" style="font-size: small;">.default/pluginreg.dat.bck</span></span></span></span></blockquote>
</div>
<div>
<span style="font-family: "verdana";"><span style="white-space: pre-wrap;"><span class="Apple-style-span" style="font-size: small;">There you go. Now stupid Shockwave content should at least load for you. If it doesn't, have fun at using your colorful vocabulary when referring to the stupid web developers that made use of Shockwave contents.</span></span></span></div>
</div>
</div>
Alexandrahttp://www.blogger.com/profile/07936817579635597668noreply@blogger.com7tag:blogger.com,1999:blog-6337741957437560735.post-36006593875397421712009-11-02T14:05:00.003+02:002009-11-29T05:23:10.263+02:00Keypad/Numpad gone mad in KDE4<span style="font-family:verdana;">I upgraded to KDE4 – Kubuntu Karmic Koala (9.10).</span><br /><div><span class="Apple-style-span" style="font-family:verdana;"><br /></span></div><div><span style="font-family:verdana;">All was fine, excepting for the numerical keypad. My notebook's design includes this keypad which allows me to use the digits (when NumLock is on) and the other keys, respectively (Del, Home, End, Page Up, Page Down, Ins) – when the NumLock LED is off.</span></div><a name='more'></a><div><br /></div><div><span style="font-family:verdana;">I found it impossible to get this basic behavior out-of-the-box: I tried for several hours messing up with System Settings > Regional and Language > Keyboard Layout > Advanced > all kinds of XkbOptions.</span><br /></div><div><span class="Apple-style-span" style="font-family:verdana;"><br /></span></div><div><span style="font-family:verdana;">Nothing seemed to work.</span><br /></div><div><span class="Apple-style-span" style="font-family:verdana;"><br /></span></div><div><span style="font-family:verdana;">So I finally decided to "remap" these keys as if they were the independent ones (Delete, Home, End, Page Up, Page Down, Insert) from a default keyboard.</span><br /></div><div><span class="Apple-style-span" style="font-family:verdana;"><br /></span></div><div><span style="font-family:'courier new';">"xev" <span style="font-family:verdana;">is a useful tool. For instance, pressing the "Home" key on the numpad when NumLock is off will make xev return the following information:</span></span></div><div><span style="font-family:verdana;"><div></div><blockquote><div><span style="font-family:'courier new';">KeyPress event, serial 34, synthetic NO, window 0x5200001,</span><br /></div><div><span style="font-family:'courier new';"> root 0x116, subw 0x0, time 49770457, (162,-8), root:(166,17),</span><br /></div><div><span style="font-family:'courier new';"> state 0x0, keycode 79 (keysym 0xff95, KP_Home), same_screen YES,</span><br /></div><div><div><span style="font-family:'courier new';"> XLookupString gives 0 bytes:</span><br /></div></div><div><span style="font-family:'courier new';"> XmbLookupString gives 0 bytes:</span><br /></div><div><span style="font-family:'courier new';"> XFilterEvent returns: False</span><br /></div><div></div></blockquote><div>Notice that all the keys that were troublesome (that wouldn't "do" anything) were the KP_something ones in this particular case.<br /></div><div><br /></div><div>My solution was to edit a <span style="font-family:'courier new';">.Xmodmap</span> file where I re-mapped the keys I was interested in. I then included this file in Xsession's routines:<br /></div><blockquote><div><span style="font-family:'courier new';">$ vim ~/.Xmodmap</span><br /></div><div><br /></div><div><div><span style="font-family:'courier new';">keycode 79 = Home KP_7 Home KP_7 Home KP_7</span><br /></div><div><span style="font-family:'courier new';">keycode 87 = End KP_1 End KP_1 End KP_1</span><br /></div><div><span style="font-family:'courier new';">keycode 81 = Prior KP_9 Prior KP_9 Prior KP_9</span><br /></div><div><span style="font-family:'courier new';">keycode 89 = Next KP_3 Next KP_3 Next KP_3</span><br /></div><div><span style="font-family:'courier new';">keycode 91 = Delete KP_Decimal Delete KP_Decimal</span><br /></div><div><span style="font-family:'courier new';">keycode 90 = Insert KP_0 Insert KP_0 Insert KP_0</span><br /></div></div></blockquote><div><div></div><div>To quickly check if you achieved the results you were aiming for, run:<br /></div><div><blockquote><span style="font-family:'courier new';">xmodmap ~/.Xmodmap</span><br /></blockquote></div><div>To make the changes permanent (i.e. have them loaded at each login), edit /etc/kde4/kdm/Xsession:</div><blockquote><div><span style="font-family:'courier new';">case $SHELL in</span><br /></div><div><span style="font-family:'courier new';">[... leave this unchanged ... ]</span><br /></div><div><span style="font-family:'courier new';">esac</span><br /></div><div><div><b><span style="font-family:'courier new';">if [ -f $HOME/.Xmodmap ] ; then</span></b><br /></div><div><b><span style="font-family:'courier new';"> /usr/bin/xmodmap $HOME/.Xmodmap</span></b><br /></div><div><b><span style="font-family:'courier new';">fi</span></b><br /></div><div><div><span style="font-family:'courier new';"># invoke global X session script</span><br /></div><div><span style="font-family:'courier new';">. /etc/X11/Xsession</span><br /></div></div></div></blockquote><div><div><div>Just add the above text (the one in bold) in your <span style="font-family:'courier new';">/etc/kde4/kdm/Xsession</span> file.<br /></div><div><br /></div><div>Logout and login again.</div></div></div></div></span></div>Alexandrahttp://www.blogger.com/profile/07936817579635597668noreply@blogger.com0tag:blogger.com,1999:blog-6337741957437560735.post-23907315104168698872009-09-06T13:54:00.003+03:002010-06-11T23:11:48.587+03:00Editing Midnight Commander's color scheme<span style="font-family: verdana;">In a </span><a href="http://plug-and-pray.blogspot.com/2008/11/midnight-commander-transparent-color.html" style="font-family: verdana;">previous post</a><span style="font-family: verdana;"> I was sort of laying out a "formula" on how to transform your Midnight Commander default color scheme into a trasnparent skin, without talking too much about how you can change the other colors.</span><br />
<br />
<span style="font-family: verdana;">To my great shame, I didn't pay too much attention to this blog or to the comments asking for further advice. I found Mateus' comment rather late (just now!) and decided to dig further, in order to find out how exactly to deal with more refined color changes, while still keeping the transparent background (in both in Midnight Commander and its editor).</span><br />
<a name='more'></a><br />
<br />
<span style="font-family: verdana;">So the first thing to know is which are the colors that Midnight Commander supports; the available colors are:</span><br />
<br />
<span style="font-family: 'courier new';">black</span><br />
<span style="font-family: 'courier new';">gray</span><br />
<span style="font-family: 'courier new';">lightgray</span><br />
<span style="font-family: 'courier new';">white</span><br />
<span style="font-family: 'courier new';">red</span><br />
<span style="font-family: 'courier new';">brightred</span><br />
<span style="font-family: 'courier new';">green</span><br />
<span style="font-family: 'courier new';">brightgreen</span><br />
<span style="font-family: 'courier new';">blue</span><br />
<span style="font-family: 'courier new';">brightblue</span><br />
<span style="font-family: 'courier new';">magenta</span><br />
<span style="font-family: 'courier new';">brightmagenta</span><br />
<span style="font-family: 'courier new';">cyan</span><br />
<span style="font-family: 'courier new';">brightcyan</span><br />
<span style="font-family: 'courier new';">brown</span><br />
<span style="font-family: 'courier new';">yellow</span><br />
<span style="font-family: 'courier new';">default</span><br />
<br />
<span style="font-family: verdana;">The "<span style="font-family: 'courier new';">default</span>" color is the one giving out the nice transparency.</span><br />
<br />
<span style="font-family: verdana;">Now, there are certain "components" in Midnight Commander's display that can have their colors altered. Here they are:</span><br />
<br />
<span style="font-family: 'courier new';">base_color, normal, selected, marked, markselect, errors, menu, reverse, dnormal, dfocus, dhotnormal, dhotfocus, viewunderline, menuhot, menusel, menuhotsel, helpnormal, helpitalic, helpbold, helplink, helpslink, gauge, input, directory, executable, link, stalelink, device, core, special, editnormal, editbold, editmarked, errdhotnormal, errdhotfocus</span><br />
<br />
<span style="font-family: verdana;">Each and every one of these "components" can have its own colors set accordingly to the user's wish. Each component is assigned a color pair and must be followed by a colon (':') in order to separate it from the color pair of the next component. Here's how this basic syntax must look like:</span><br />
<br />
<span style="font-family: 'courier new';">component=foreground_color,background_color:</span><br />
<br />
<span style="font-family: verdana;">When you start modifying the color scheme in your Midnight Commander configuration file (located at <span style="font-family: 'courier new';">~/.mc/ini</span>), you just have to add a section called "<span style="font-family: 'courier new';">[Colors]</span>" and proceed with enumerating the color pairs. So you'd have something like this:</span><br />
<br />
<span style="font-family: 'courier new';"># the rest of your ~/.mc/ini file</span><br />
<br />
<span style="font-family: 'courier new';">[Colors]</span><br />
<span style="font-family: 'courier new';">component1=foreground_color1,background_color1:...:componentN= foreground_colorN,background_colorN</span><br />
<br />
<span style="font-family: verdana;">For increased readability, I will "truncate" that long line, adding a backslash ('\') to indicate that in fact what follows on the next line should be adjacent to the text on the previous line. This being said, the <span style="font-family: 'courier new';">[Colors]</span> section could look like this:</span><br />
<br />
<span style="font-family: 'courier new';"># the rest of your ~/.mc/ini file</span><br />
<br />
<span style="font-family: 'courier new';">[Colors]</span><br />
<span style="font-family: 'courier new';">component1=foreground_color1,background_color1:\</span><br />
<span style="font-family: 'courier new';">component2=foreground_color2,background_color2:\</span><br />
<span style="font-family: 'courier new';">...</span><br />
<span style="font-family: 'courier new';">componentN=foreground_colorN,background_colorN</span><br />
<br />
<span style="font-family: verdana;">Now that you've gotten the hang of this, let's see how the <span style="font-family: 'courier new';">[Colors]</span> section looks like in the default Midnight Commander color scheme (you know, the "ugly" one, with blue and dull cyan):</span><br />
<br />
<span style="font-family: verdana; font-weight: bold;"><span class="Apple-style-span" style="color: #38761d;">IMPORTANT NOTE:</span></span><span class="Apple-style-span" style="color: #38761d;"><span style="font-family: verdana;"></span></span><span style="font-family: verdana; font-style: italic;"><span class="Apple-style-span" style="color: #38761d;"> For visual impact's sake and due to Blogspot breaking long lines, I wrote each color pair on a single row, followed by a backslash ('\'). Please note that this does </span></span><span style="font-family: verdana;"><span style="font-weight: bold;"><span class="Apple-style-span" style="color: #38761d;">NOT</span></span><span class="Apple-style-span" style="color: #38761d;"> work in the </span><span style="font-family: 'courier new';"><span class="Apple-style-span" style="color: #38761d;">~/.mc/ini</span></span><span style="font-style: italic;"><span class="Apple-style-span" style="color: #38761d;"> file, so the final </span></span><span style="font-family: 'courier new';"><span class="Apple-style-span" style="color: #38761d;">[Colors]</span></span><span style="font-style: italic;"><span class="Apple-style-span" style="color: #38761d;"> section in your Midnight Commander configuration file </span></span><span style="font-weight: bold;"><span class="Apple-style-span" style="color: #38761d;">MUST</span></span><span style="font-style: italic;"><span class="Apple-style-span" style="color: #38761d;"> be a </span></span><span style="font-weight: bold;"><span class="Apple-style-span" style="color: #38761d;">SINGLE</span></span><span style="font-style: italic;"><span class="Apple-style-span" style="color: #38761d;"> line with no spaces and with each color pair separated from the next one by a colon (':').</span></span></span><br />
<br />
<span style="font-family: 'courier new';"># the rest of your ~/.mc/ini file</span><br />
<br />
<span style="font-family: 'courier new';">[Colors]</span><br />
<span style="font-family: 'courier new';">base_color=lightgray,blue:\</span><br />
<span style="font-family: 'courier new';">normal=lightgray,blue:\</span><br />
<span style="font-family: 'courier new';">selected=black,cyan:\</span><br />
<span style="font-family: 'courier new';">marked=yellow,blue:\</span><br />
<span style="font-family: 'courier new';">markselect=yellow,cyan:\</span><br />
<span style="font-family: 'courier new';">errors=white,red:\</span><br />
<span style="font-family: 'courier new';">menu=white,cyan:\</span><br />
<span style="font-family: 'courier new';">reverse=black,lightgray:\</span><br />
<span style="font-family: 'courier new';">dnormal=black,lightgray:\</span><br />
<span style="font-family: 'courier new';">dfocus=black,cyan:\</span><br />
<span style="font-family: 'courier new';">dhotnormal=blue,lightgray:\</span><br />
<span style="font-family: 'courier new';">dhotfocus=blue,cyan:\</span><br />
<span style="font-family: 'courier new';">viewunderline=brightred,blue:\</span><br />
<span style="font-family: 'courier new';">menuhot=yellow,cyan:\</span><br />
<span style="font-family: 'courier new';">menusel=white,black:\</span><br />
<span style="font-family: 'courier new';">menuhotsel=yellow,black:\</span><br />
<span style="font-family: 'courier new';">helpnormal=black,lightgray:\</span><br />
<span style="font-family: 'courier new';">helpitalic=red,lightgray:\</span><br />
<span style="font-family: 'courier new';">helpbold=blue,lightgray:\</span><br />
<span style="font-family: 'courier new';">helplink=black,cyan:\</span><br />
<span style="font-family: 'courier new';">helpslink=yellow,blue:\</span><br />
<span style="font-family: 'courier new';">gauge=white,black:\</span><br />
<span style="font-family: 'courier new';">input=black,cyan:\</span><br />
<span style="font-family: 'courier new';">directory=white,blue:\</span><br />
<span style="font-family: 'courier new';">executable=brightgreen,blue:\</span><br />
<span style="font-family: 'courier new';">link=lightgray,blue:\</span><br />
<span style="font-family: 'courier new';">stalelink=brightred,blue:\</span><br />
<span style="font-family: 'courier new';">device=brightmagenta,blue:\</span><br />
<span style="font-family: 'courier new';">core=red,blue:\</span><br />
<span style="font-family: 'courier new';">special=black,blue:\</span><br />
<span style="font-family: 'courier new';">editnormal=lightgray,blue:\</span><br />
<span style="font-family: 'courier new';">editbold=yellow,blue:\</span><br />
<span style="font-family: 'courier new';">editmarked=black,cyan:\</span><br />
<span style="font-family: 'courier new';">errdhotnormal=yellow,red:\</span><br />
<span style="font-family: 'courier new';">errdhotfocus=yellow,lightgray</span><br />
<br />
<span style="font-family: verdana;">Now let's see. What you want to change first of all is most of the background of these "components", such that the display will be one with a neat looking transparent background. So first of all you might want to make a few changes to these color pairs by replacing the background color "blue" with "default". After doing these changes, your <span style="font-family: 'courier new';">[Colors]</span> section will look a bit like this:</span><br />
<br />
<span style="font-family: 'courier new';"># the rest of your ~/.mc/ini file</span><br />
<br />
<span style="font-family: 'courier new';">[Colors]</span><br />
<span style="font-family: 'courier new';">base_color=lightgray,default:\</span><br />
<span style="font-family: 'courier new';">normal=lightgray,default:\</span><br />
<span style="font-family: 'courier new';">selected=black,cyan:\</span><br />
<span style="font-family: 'courier new';">marked=yellow,default:\</span><br />
<span style="font-family: 'courier new';">markselect=yellow,cyan:\</span><br />
<span style="font-family: 'courier new';">errors=white,red:\</span><br />
<span style="font-family: 'courier new';">menu=white,cyan:\</span><br />
<span style="font-family: 'courier new';">reverse=black,lightgray:\</span><br />
<span style="font-family: 'courier new';">dnormal=black,lightgray:\</span><br />
<span style="font-family: 'courier new';">dfocus=black,cyan:\</span><br />
<span style="font-family: 'courier new';">dhotnormal=blue,lightgray:\</span><br />
<span style="font-family: 'courier new';">dhotfocus=blue,cyan:\</span><br />
<span style="font-family: 'courier new';">viewunderline=brightred,default:\</span><br />
<span style="font-family: 'courier new';">menuhot=yellow,cyan:\</span><br />
<span style="font-family: 'courier new';">menusel=white,black:\</span><br />
<span style="font-family: 'courier new';">menuhotsel=yellow,black:\</span><br />
<span style="font-family: 'courier new';">helpnormal=black,lightgray:\</span><br />
<span style="font-family: 'courier new';">helpitalic=red,lightgray:\</span><br />
<span style="font-family: 'courier new';">helpbold=blue,lightgray:\</span><br />
<span style="font-family: 'courier new';">helplink=black,cyan:\</span><br />
<span style="font-family: 'courier new';">helpslink=yellow,default:\</span><br />
<span style="font-family: 'courier new';">gauge=white,black:\</span><br />
<span style="font-family: 'courier new';">input=black,cyan:\</span><br />
<span style="font-family: 'courier new';">directory=white,default:\</span><br />
<span style="font-family: 'courier new';">executable=brightgreen,default:\</span><br />
<span style="font-family: 'courier new';">link=lightgray,default:\</span><br />
<span style="font-family: 'courier new';">stalelink=brightred,default:\</span><br />
<span style="font-family: 'courier new';">device=brightmagenta,default:\</span><br />
<span style="font-family: 'courier new';">core=red,default:\</span><br />
<span style="font-family: 'courier new';">special=black,default:\</span><br />
<span style="font-family: 'courier new';">editnormal=lightgray,default:\</span><br />
<span style="font-family: 'courier new';">editbold=yellow,default:\</span><br />
<span style="font-family: 'courier new';">editmarked=black,cyan:\</span><br />
<span style="font-family: 'courier new';">errdhotnormal=yellow,red:\</span><br />
<span style="font-family: 'courier new';">errdhotfocus=yellow,lightgray</span><br />
<br />
<span style="font-family: verdana;">Now you've got the basic "Midnight Commander transparent scheme" that was the result of </span><a href="http://plug-and-pray.blogspot.com/2008/11/midnight-commander-transparent-color.html" style="font-family: verdana;">this post</a><span style="font-family: verdana;">.</span><br />
<br />
<span style="font-family: verdana;">Proceeding to Mateus' question, regarding how to change the rest of the colors now, it's about the same as before. What he didn't like there (and as a matter of fact I don't quite like it, either) is the dull cyan that's still seen in the following places:</span><br />
<ol style="font-family: verdana;"><li>the bottom line (the one displaying the F1...F10 function keys);</li>
<li>the line that signifies the current selection, the "prompt" which shows you on which file/directory you're "on" at a given moment;</li>
<li>the uppermost line (the "menu" line);</li>
<li>the menus themselves, once you open them.</li>
</ol><span style="font-family: verdana;">To "fix" issues 1, 2, and 3 it is sufficient to alter the value of the "<span style="font-family: 'courier new';">selected</span>" parameter. Notice how it is initially</span><br />
<br />
<span style="font-family: 'courier new';">selected=black,cyan:\</span><br />
<br />
<span style="font-family: verdana;">My personal choice is to replace the background cyan, which I don't really like, with green. To do this, I'll change this color pair to</span><br />
<br />
<span style="font-family: 'courier new';">selected=black,green:\</span><br />
<br />
<span style="font-family: verdana;">You can, of course, change the foreground color as well. For me, it's alright to keep the foreground (the text) "black". You can change it to whatever suits your taste.</span><br />
<br />
<span style="font-family: verdana;">To "fix" issue number 4 in the list above, you need to change the "<span style="font-family: 'courier new';">menu</span>" parameter. To get it transparent, just change the "cyan" background to "default". Make other adjustments as you see fit. In other words, change<br />
<br />
</span><span style="font-family: 'courier new';">menu=white,cyan:\</span><br />
<br />
<span style="font-family: verdana;">into, for instance,</span><br />
<br />
<span style="font-family: 'courier new';">menu=ligthgray,default:\</span><br />
<br />
<span style="font-family: verdana;">However, there are a few "leftovers" from the default color scheme.</span><br />
<br />
<span style="font-family: verdana;">One of them is the parameter regarding the hotkeys in the menus (the "underlined" character on most of the menu options, showing you what key you can press in order to access that option faster than by moving to it with the arrow keys). This color pair is called "<span style="font-family: 'courier new';">menuhot</span>". I changed it from</span><br />
<br />
<span style="font-family: 'courier new';">menuhot=yellow,cyan:\</span><br />
<br />
<span style="font-family: verdana;">into</span><br />
<br />
<span style="font-family: 'courier new';">menuhot=yellow,default:\</span><br />
<br />
<span style="font-family: verdana;">Another thing which might bother you is the color of the line in the panel you're in when you've "selected all" files (when you've pressed the "*" key). This parameter is called "<span style="font-family: 'courier new';">markselect</span>". I changed it from</span><br />
<br />
<span style="font-family: 'courier new';">markselect=yellow,cyan:\</span><br />
<br />
<span style="font-family: verdana;">into</span><br />
<br />
<span style="font-family: 'courier new';">markselect=white,green:\</span><br />
<br />
<span style="font-family: verdana;">The color pair of the selected buttons in dialogs is called "<span style="font-family: 'courier new';">dfocus</span>". I changed mine from</span><br />
<br />
<span style="font-family: 'courier new';">dfocus=black,cyan:\</span><br />
<br />
<span style="font-family: verdana;">into</span><br />
<br />
<span style="font-family: 'courier new';">dfocus=black,green:\</span><br />
<br />
<span style="font-family: verdana;">In the "focused" buttons or options, the underlined character is called "<span style="font-family: 'courier new';">dhotfocus</span>". I changed mine from</span><br />
<br />
<span style="font-family: 'courier new';">dhotfocus=blue,cyan:\</span><br />
<br />
<span style="font-family: verdana;">into</span><br />
<br />
<span style="font-family: 'courier new';">dhotfocus=brightgreen,green:\</span><br />
<br />
<span style="font-family: verdana;">since the background color was already green, after I modified the "<span style="font-family: 'courier new';">dfocus</span>" color pair.</span><br />
<br />
<span style="font-family: verdana;">The other buttons or options in the dialogs which have hotkeys assigned to them, but which are not "focused" (the buttons/options that you're not located on at a given moment) are still displayed in blue on a light gray background. This color pair is referred to as "<span style="font-family: 'courier new';">dhotnormal</span>". Since the blue looks a bit odd there, I changed<br />
<br />
</span><span style="font-family: 'courier new';">dhotnormal=blue,lightgray:\</span><br />
<br />
<span style="font-family: verdana;">into</span><br />
<br />
<span style="font-family: 'courier new';">dhotnormal=brightgreen,default:\</span><br />
<br />
<span style="font-family: verdana;">Well, this is nice, in window titles and on normal (unfocused) hotkeys I get the transparent background. The problem now is that the rest of the dialog window is still light gray. To change this (to make the window transparent as well), you only need to alter the "<span style="font-family: 'courier new';">dnormal</span>" color pair, such as changing it from</span><br />
<br />
<span style="font-family: 'courier new';">dnormal=black,lightgray:\</span><br />
<br />
<span style="font-family: verdana;">into</span><br />
<br />
<span style="font-family: 'courier new';">dnormal=white,default:\</span><br />
<br />
<span style="font-family: verdana;">You may notice that the input fields stay cyan, as well; you find these fields in quite a lot of dialog boxes. To alter this, I changed</span><br />
<br />
<span style="font-family: 'courier new';">input=black,cyan:\</span><br />
<br />
<span style="font-family: verdana;">into</span><br />
<br />
<span style="font-family: 'courier new';">input=black,green:\</span><br />
<br />
<span style="font-family: verdana;">One thing which I consider useful is to have symbolic links displayed in bright cyan (as in the colored listings in the terminal). So I just changed</span><br />
<br />
<span style="font-family: 'courier new';">link=lightgray,default:\</span><br />
<br />
<span style="font-family: verdana;">into</span><br />
<br />
<span style="font-family: 'courier new';">link=brightcyan,default:\</span><br />
<br />
<span style="font-family: verdana;">Now, regarding the rest of the color pairs, I don't really know what they do. However, if at some point after using Midnight Commander more with this new, neat, transparent/green color scheme you'll notice unwanted leftovers, you can try out other changes in the color pairs values, one at a time, until you determine the troublesome one.</span><br />
<br />
<span style="font-family: verdana;">After operating the changes above, my <span style="font-family: 'courier new';">[Colors]</span> section in <span style="font-family: 'courier new';">~/.mc/ini</span> now looks like this:</span><br />
<br />
<span style="font-family: 'courier new';">[Colors]</span><br />
<span style="font-family: 'courier new';">base_color=lightgray,default:\</span><br />
<span style="font-family: 'courier new';">normal=lightgray,default:\</span><br />
<span style="font-family: 'courier new';">selected=black,green:\</span><br />
<span style="font-family: 'courier new';">marked=yellow,default:\</span><br />
<span style="font-family: 'courier new';">markselect=white,green:\</span><br />
<span style="font-family: 'courier new';">errors=white,red:\</span><br />
<span style="font-family: 'courier new';">menu=lightgray,default:\</span><br />
<span style="font-family: 'courier new';">reverse=black,lightgray:\</span><br />
<span style="font-family: 'courier new';">dnormal=white,default:\</span><br />
<span style="font-family: 'courier new';">dfocus=black,green:\</span><br />
<span style="font-family: 'courier new';">dhotnormal=brightgreen,default:\</span><br />
<span style="font-family: 'courier new';">dhotfocus=brightgreen,green:\</span><br />
<span style="font-family: 'courier new';">viewunderline=brightred,default:\</span><br />
<span style="font-family: 'courier new';">menuhot=yellow,default:\</span><br />
<span style="font-family: 'courier new';">menusel=white,black:\</span><br />
<span style="font-family: 'courier new';">menuhotsel=yellow,black:\</span><br />
<span style="font-family: 'courier new';">helpnormal=black,lightgray:\</span><br />
<span style="font-family: 'courier new';">helpitalic=red,lightgray:\</span><br />
<span style="font-family: 'courier new';">helpbold=blue,lightgray:\</span><br />
<span style="font-family: 'courier new';">helplink=black,cyan:\</span><br />
<span style="font-family: 'courier new';">helpslink=yellow,default:\</span><br />
<span style="font-family: 'courier new';">gauge=white,black:\</span><br />
<span style="font-family: 'courier new';">input=black,green:\</span><br />
<span style="font-family: 'courier new';">directory=white,default:\</span><br />
<span style="font-family: 'courier new';">executable=brightgreen,default:\</span><br />
<span style="font-family: 'courier new';">link=brightcyan,default:\</span><br />
<span style="font-family: 'courier new';">stalelink=brightred,default:\</span><br />
<span style="font-family: 'courier new';">device=brightmagenta,default:\</span><br />
<span style="font-family: 'courier new';">core=red,default:\</span><br />
<span style="font-family: 'courier new';">special=black,default:\</span><br />
<span style="font-family: 'courier new';">editnormal=lightgray,default:\</span><br />
<span style="font-family: 'courier new';">editbold=yellow,default:\</span><br />
<span style="font-family: 'courier new';">editmarked=black,cyan:\</span><br />
<span style="font-family: 'courier new';">errdhotnormal=yellow,red:\</span><br />
<span style="font-family: 'courier new';">errdhotfocus=yellow,lightgray</span><br />
<br />
<span style="font-family: verdana;">I need to direct you to the "<span style="font-weight: bold;">IMPORTANT NOTE</span>" above. The final <span style="font-family: 'courier new';">[Colors]</span> section above is written like this - one pair on each row, followed by a backslash - for clarity's sake. The </span><span style="font-family: verdana; font-style: italic;">actual</span><span style="font-family: verdana;"> final <span style="font-family: 'courier new';">[Colors]</span> section in your <span style="font-family: 'courier new';">~/.mc/ini</span> file will <span style="font-style: italic;">have</span> to be a one-liner, with no blanks and no backslashes. So it will probably look similar to this:</span><br />
<br />
<span style="font-family: 'courier new';">base_color=lightgray,default:normal=lightgray,default:selected=black,green:marked=yellow,default:markselect=white,green:errors=white,red:menu=lightgray,default:reverse=black,lightgray:dnormal=white,default:dfocus=black,green:dhotnormal=brightgreen,default:dhotfocus=brightgreen,green:viewunderline=brightred,default:menuhot=yellow,default:menusel=white,black:menuhotsel=yellow,black:helpnormal=black,lightgray:helpitalic=red,lightgray:helpbold=blue,lightgray:helplink=black,cyan:helpslink=yellow,default:gauge=white,black:input=black,green:directory=white,default:executable=brightgreen,default:link=brightcyan,default:stalelink=brightred,default:device=brightmagenta,default:core=red,default:special=black,default:editnormal=lightgray,default:editbold=yellow,default:editmarked=black,cyan:errdhotnormal=yellow,red:errdhotfocus=yellow,lightgray</span><br />
<br />
<span style="font-family: verdana;">Now, the next time you start <span style="font-family: 'courier new';">mc</span>, the new color scheme will take effect.</span><br />
<br />
<span style="font-family: verdana;">As a bonus, here's a picture of how my Midnight Commander looks like, with this new "skin" on:</span><br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjlCrnnGCRUI1jBMapsnWn-bRcmj-gWji2FixZbTkjYHLw2ogSge-EpJiBnIXfJMnhdPuTUoPAKrfkZWNCQEnr1cfsJGC0qjEzbnUx_8Hs7UsSKOC1ay9Zwmr9K8MONK6p7gC55fiNjdBQ/s1600-h/mc_transparent_green_color_scheme.png" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" style="font-family: verdana;"><img alt="" border="0" id="BLOGGER_PHOTO_ID_5378368724725687122" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjlCrnnGCRUI1jBMapsnWn-bRcmj-gWji2FixZbTkjYHLw2ogSge-EpJiBnIXfJMnhdPuTUoPAKrfkZWNCQEnr1cfsJGC0qjEzbnUx_8Hs7UsSKOC1ay9Zwmr9K8MONK6p7gC55fiNjdBQ/s320/mc_transparent_green_color_scheme.png" style="cursor: pointer; display: block; height: 200px; margin: 0px auto 10px; text-align: center; width: 320px;" /></a>Unknownnoreply@blogger.com25tag:blogger.com,1999:blog-6337741957437560735.post-65563654553880929392009-09-04T15:04:00.002+03:002009-11-29T05:25:47.375+02:00Core dumps<span style="font-family:verdana;">Since I'm interested in examining core dumps (in order to submit them to the ones developing the application that crashed) I prefer to keep core dumping enabled at all times on my systems.</span><br /><br /><span style="font-family:verdana;">Here is a brief hands-on to core dumps management.</span><a name='more'></a><br /><br /><span style="font-family:verdana;">To check whether core dump is enabled, do this:</span><br /><br /><span style="font-family:courier new;">ulimit -c</span><br /><br /><span style="font-family:verdana;">If the result is '0', the system isn't configured to dump cores. Other values specify how large the core file can get. If you need untruncated dumps, as I do, the best thing to do would be to run:</span><br /><br /><span style="font-family:courier new;">ulimit -c unlimited</span><br /><br /><span style="font-family:verdana;">However, this doesn't permanently solve the problem. It will only work under the current user and in the current terminal.</span><br /><br /><span style="font-family:verdana;">To have core dumping enabled at all times, for all users and on all ttys, you have to set this option in your <span style="font-family:courier new;">/etc/security/limits.conf</span> file. Add to the end of this file the following lines:<br /><br /><span style="font-family:courier new;">* - core unlimited</span><br /><span style="font-family:courier new;">root - core unlimited</span><br /></span><br /><span style="font-family:verdana;">Now, the next thing to do is to establish a naming scheme for the cores and a location where you want to have them dumped. Suppose you want to have core dumps in <span style="font-family:courier new;">/core</span>; if so, create the directory and then change ownership accordingly (to give your normal, non-root user write permission in that directory):<br /><br /><span style="font-family:courier new;"># mkdir /core</span><br /><span style="font-family:courier new;"># chown joe:joe /core</span><br /><br />The only thing left to do now is to instruct your system to dump cores there and to name them according to your preferences. In order to do this, edit your <span style="font-family:courier new;">/etc/sysctl.conf</span> file and insert somewhere a line describing the "core pattern" that you want to use. The available format specifiers for core naming patterns are the following:</span><br /><br /><span style="font-family:courier new;"> %% A single % character</span><br /><span style="font-family:courier new;"> %p PID of dumped process</span><br /><span style="font-family:courier new;"> %u real UID of dumped process</span><br /><span style="font-family:courier new;"> %g real GID of dumped process</span><br /><span style="font-family:courier new;"> %s number of signal causing dump</span><br /><span style="font-family:courier new;"> %t time of dump (seconds since 0:00h, 1 Jan 1970)</span><br /><span style="font-family:courier new;"> %h hostname (same as ’nodename’ returned by uname(2))</span><br /><span style="font-family:courier new;"> %e executable filename</span><br /><br /><span style="font-family:verdana;">Since I'm interested in my cores to contain information on the name and PID of the process which created them and on the specific signal which led to the core dump, the line that I'd insert in my <span style="font-family:courier new;">/etc/sysctl.conf</span> file would be:</span><br /><br /><span style="font-family:courier new;">kernel.core_pattern = /core/core.%e.%s.%p<br /><br /><span style="font-family:verdana;">To have these changes take effect, you'd have to log out and login again. This is because the file <span style="font-family:courier new;">/etc/security/limits.conf</span> has also been altered. If this wouldn't have been the case, in order to reload the new <span style="font-family:courier new;">/etc/sysctl.conf</span> file, you'd have only need to run:<br /><br /><span style="font-family:courier new;">sysctl -p</span><br /><br />which assumes the new settings are to be reloaded from the default <span style="font-family:courier new;">/etc/sysctl.conf</span>. Otherwise,<br /><br /><span style="font-family:courier new;">sysctl -p /path/to/sysctl.conf</span><br /><br />would have been needed.<br /><br />But since you <span style="font-style: italic;">did</span> change both <span style="font-family:courier new;">/etc/sysctl.conf</span> <span style="font-style: italic;">and</span> <span style="font-family:courier new;">/etc/security/limits.conf</span>, you'll need to log out and login again in order for all changes to take effect.<br /></span></span>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6337741957437560735.post-61153418145026598692009-07-02T08:40:00.002+03:002009-11-29T05:27:28.553+02:00SSH, backspace and UTF-8<span class="Apple-style-span" style="font-family:verdana;">Just great. If you use UTF-8 characters encoded on more than 1 byte (such as Latin diacritics, Armenian, Japanese etc. characters) and you attempt to hit [backspace] through SSH to delete them, you might be surprised to find out that backspace in SSH only deletes the last byte.</span><div><span class="Apple-style-span" style="font-family:verdana;"><br /></span></div><div><span class="Apple-style-span" style="font-family:verdana;">This can lead to a lot of unexpected results in your documents and it can generate a lot of confusion for any app you might be running via SSH.</span></div><div><span class="Apple-style-span" style="font-family:verdana;"></span></div><a name='more'></a><div><span class="Apple-style-span" style="font-family:verdana;">Case study: the letter "ș" is encoded as "c8 99". On the host machine, backspace deletes both bytes. Via SSH, only the second one ("99") will get deleted.</span></div><div><span class="Apple-style-span" style="font-family:verdana;"><br /></span></div><div><span class="Apple-style-span" style="font-family:verdana;">Let's see what happens if you write "testș[backspace]test". </span></div><div><span class="Apple-style-span" style="font-family:verdana;"><br /></span></div><div><b><span class="Apple-style-span" style="font-family:verdana;">Note:</span></b><span class="Apple-style-span" style="font-family:verdana;"> endline (Ctrl+D) is encoded as "0a".</span></div><div><br /></div><div><span class="Apple-style-span" style=" ;font-family:monospace;font-size:13px;">user@host:~$ cat > test.txt<br />testș[backspace<wbr>]test<br />^d<br />user@host:~$ hexdump -C test.txt<br />00000000 74 65 73 74 74 65 73 74 0a |testtest.|<br />00000009</span></div><div><span class="Apple-style-span" style="font-family:monospace, serif;font-size:100%;"><span class="Apple-style-span" style="font-size:13px;"><br /></span></span></div><div><span class="Apple-style-span" style="font-family:monospace, serif;font-size:100%;"><span class="Apple-style-span" style="font-size:13px;"><span class="Apple-style-span" style="font-family:verdana;">Great. Now try it via SSH. Just SSH as the same user on the same machine</span> (ssh user@localhost)<span class="Apple-style-span" style="font-family:verdana;">:</span></span></span></div><div><span class="Apple-style-span" style="font-family:monospace, serif;font-size:100%;"><span class="Apple-style-span" style="font-size:13px;"><br /></span></span></div><div><span class="Apple-style-span" style="font-family:monospace, serif;font-size:100%;"><span class="Apple-style-span" style="font-size:13px;"><span class="Apple-style-span" style=" ;font-family:monospace;">user@host:~$ ssh user@localhost<br />user@localhost's password:<br />user@host:~$ cat > test.txt<br />testș[backspace<wbr>]test<br />^d<br />user@host:~$ hexdump -C test.txt<br />00000000 74 65 73 74 c8 74 65 73 74 0a |test.test.|<br />0000000a</span></span></span></div><div><span class="Apple-style-span" style="font-family:monospace, serif;font-size:100%;"><span class="Apple-style-span" style="font-size:13px;"><br /></span></span></div><div><span class="Apple-style-span" style="font-size:100%;"><span class="Apple-style-span" style="font-size:13px;"><span class="Apple-style-span" style="font-family:verdana;">Notice how</span></span></span></div><div><span class="Apple-style-span" style="font-family:monospace, serif;font-size:100%;"><span class="Apple-style-span" style="font-size:13px;"><br /></span></span></div><div><span class="Apple-style-span" style="font-family:monospace, serif;font-size:100%;"><span class="Apple-style-span" style="font-size:13px;">74 65 73 74 74 65 73 74 0a</span></span></div><div><span class="Apple-style-span" style="font-family:monospace, serif;font-size:100%;"><span class="Apple-style-span" style="font-size:13px;"><br /></span></span></div><div><span class="Apple-style-span" style="font-size:100%;"><span class="Apple-style-span" style="font-size:13px;"><span class="Apple-style-span" style="font-family:verdana;">turned into</span></span></span></div><div><span class="Apple-style-span" style="font-family:monospace, serif;font-size:100%;"><span class="Apple-style-span" style="font-size:13px;"><br /></span></span></div><div><span class="Apple-style-span" style="font-family:monospace, serif;font-size:100%;"><span class="Apple-style-span" style="font-size:13px;">74 65 73 74 c8 74 65 73 74 0a</span></span></div><div><span class="Apple-style-span" style="font-family:monospace, serif;font-size:100%;"><span class="Apple-style-span" style="font-size:13px;"><br /></span></span></div><div><span class="Apple-style-span" style="font-size:100%;"><span class="Apple-style-span" style="font-size:13px;"><span class="Apple-style-span" style="font-family:verdana;">I filed in a </span><a href="https://bugs.launchpad.net/ubuntu/+source/openssh/+bug/394570"><span class="Apple-style-span" style="font-family:verdana;">bug report</span></a><span class="Apple-style-span" style="font-family:verdana;"> on launchpad. I am not yet sure whether I should take it to OpenSSH's bug list directly.</span></span></span></div>Unknownnoreply@blogger.com2tag:blogger.com,1999:blog-6337741957437560735.post-76815946843991824742009-06-07T01:49:00.002+03:002009-11-29T05:28:04.829+02:00mt-daapd / Firefly media server -- follow-up<span class="Apple-style-span" style="font-family:verdana;">A little while back I was talking very </span><a href="http://plug-and-pray.blogspot.com/2009/05/mt-daapd-is-not-answer.html"><span class="Apple-style-span" style="font-family:verdana;">angrily</span></a><span class="Apple-style-span" style="font-family:verdana;"> about </span><a href="http://fireflymediaserver.org/"><span class="Apple-style-span" style="font-family:verdana;">mt-daapd / Firefly media server</span></a><span class="Apple-style-span" style="font-family:verdana;">.</span><div><span class="Apple-style-span" style="font-family:verdana;"><br /></span></div><div><span class="Apple-style-span" style="font-family:verdana;">It just so happened that it was 1) crashing and 2) apparently scanning outside of the directories I told it to scan in.</span></div><a name='more'></a><div><span class="Apple-style-span" style="font-family:verdana;"><br /></span></div><div><span class="Apple-style-span" style="font-family:verdana;">I started a </span><a href="http://forums.fireflymediaserver.org/viewtopic.php?f=2&t=10247"><span class="Apple-style-span" style="font-family:verdana;">thread</span></a><span class="Apple-style-span" style="font-family:verdana;"> on the Firefly forums.</span></div><div><span class="Apple-style-span" style="font-family:verdana;"><br /></span></div><div><span class="Apple-style-span" style="font-family:verdana;">Taking down every issue one step at a time, it proved that I was in err and that mt-daapd was actually working OK.</span></div><div><span class="Apple-style-span" style="font-family:verdana;"><br /></span></div><div><span class="Apple-style-span" style="font-family:verdana;">What happened was that in one of the directories it was scanning into I had an old backup of root's home directory that I've forgotten about. And there, in '/foo/backup/root/.wine', there was a naughty symbolic link pointing to '/'.</span></div><div><span class="Apple-style-span" style="font-family:verdana;"><br /></span></div><div><span class="Apple-style-span" style="font-family:'courier new';">lrwxrwxrwx 1 root root 1 2007-11-11 11:45 /media/sda9/backup/b4gg/root/.wine/dosdevices/z: -> /</span></div><div><span class="Apple-style-span" style="font-family:verdana;"><br /></span></div><div><span class="Apple-style-span" style="font-family:verdana;">So, kids, my advice is that the next time you feel like starting swearing a software for "not doing what it's supposed to do", you double- and triple-check <i>your</i> setup first; there's a big chance that <i>you</i> were the one doing something stupid in the first place. :P</span></div><div><span class="Apple-style-span" style="font-family:verdana, fantasy;"><br /></span></div><div><span class="Apple-style-span" style="font-family:verdana, -webkit-fantasy;">So far, after discovering this... user fault, mt-daapd seems to be working nicely for me. I use the svn-1696 release.</span></div>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6337741957437560735.post-75445552440269758022009-05-29T01:36:00.001+03:002009-11-29T05:28:52.641+02:00mt-daapd is not the answer<span style="font-family:verdana;">Depending on how lucky you are, <a href="http://fireflymediaserver.org/">mt-daapd / Firefly Media Server</a> might or might not work for you.</span><br /><br /><span style="font-family:verdana;">The problem at hand is how to elegantly share media files in your LAN without resorting to NFS exports or Samba shares.</span><a name='more'></a><br /><br /><span style="font-family:verdana;">Simple! DAAP! "The best open-source media server, Firefly"! a.k.a. <span style="font-style: italic;">mt-daapd</span>.</span><br /><br /><span style="font-family:verdana;">Installing and configuring it is really simple:</span><br /><br /><span style="font-family:courier new;">sudo aptitude install mt-daapd</span><br /><br /><span style="font-family:verdana;">It should be started already, once the install finishes. If it isn't, however, you can start it with</span><br /><br /><span style="font-family:courier new;">sudo /etc/init.d/mt-daapd start</span><br /><br /><span style="font-family:verdana;">Then, the configuration is straight-forward. You can even avoid manually editing <span style="font-family:courier new;">.conf</span> files. </span><br /><br /><span style="font-family:verdana;">For that, you'd just go to <span style="font-style: italic;">http://hostname:3689</span>, which is the default port it runs on.<br /><br />"<span style="font-style: italic;">hostname</span>" is, of course, the host name of the machine in your LAN that hosts this DAAP server. In other words, the host name of the machine you installed it on. Or its IP, whatever suits you better.</span><br /><br /><span style="font-family:verdana;">The default login name is "<span style="font-weight: bold;">admin</span>" with the password "<span style="font-weight: bold;">mt-daapd</span>".</span><br /><br /><span style="font-family:verdana;">From the web-based administration console of the Firefly server (mt-daapd) you'd just need to go to the "Configuration" tab and specify there a few things, the most important being the directories where you'd want Firefly to search for your music files, the extensions etc.</span><br /><br /><span style="font-family:verdana;">Then you'd be able to access the DAAP server using a client on the other machines in your LAN.</span><br /><br /><span style="font-family:verdana;">One such client is Rhythmbox, the default music player in Gnome. In the left pane it would display a "Shares" drop-down (below "Library", "Stores" etc.) and you'd be able to browse the collection on the remote server and copy parts of it into your collection.</span><br /><br /><span style="font-family:verdana;">Simple, huh?</span><br /><br /><span style="font-family:verdana;">...If only it mt-daapd <a href="http://forums.fireflymediaserver.org/viewtopic.php?f=8&t=10246">wouldn't crash</a> every time it finds a few thousand tracks in its scans!!!</span><br /><br /><span style="font-family:verdana;">...If only it <a href="http://forums.fireflymediaserver.org/viewtopic.php?f=2&t=10247">wouldn't scan </a></span><a href="http://forums.fireflymediaserver.org/viewtopic.php?f=2&t=10247"><span style="font-family:verdana;">outside</span></a><span style="font-family:verdana;"><a href="http://forums.fireflymediaserver.org/viewtopic.php?f=2&t=10247"> of the directories</a> I told it to scan!!!</span><br /><br /><span style="font-family:verdana;">...If only the "most detailed log level" would show me something more useful than:</span><br /><span style="font-family:verdana;"></span><blockquote style="font-family: courier new;">2009-05-29 01:53:02 (b6c1bb90): Received a message from daap server<br />2009-05-29 01:53:02 (b6c1bb90): Rendezvous socket closed (daap server crashed?) Aborting.<br />2009-05-29 01:53:02: Aborting<br /></blockquote><span style="font-family:verdana;">So, no, mt-daapd is not a solution to my problems.</span><br /><br /><span style="font-family:verdana;">I'll just go back to the Samba shares and NFS exports... </span><span style="font-family:verdana;">But it's all so lame.</span><br /><br /><span style="font-family:verdana;">Of course, there might be lots of defenders of mt-daapd who have 2,000 tracks in their collection. </span><br /><br /><span style="font-family:verdana;">I have 40,000 and that's barely a "big" number.</span><br /><br /><span style="font-family:verdana;">The irony of these advanced times... we now have storage devices that can hold terabytes of information. However, open-source applications scale to the 2000s information capacity. </span><br /><br /><span style="font-family:verdana;">Long live alternatives! :-/</span><br /><br /><span style="font-family:verdana;">However, it seems I'm </span><a style="font-family: verdana;" href="http://ihatemtdaapd.blogspot.com/">not the only one</a><span style="font-family:verdana;"> who is frustrated in regards to mt-daapd.</span>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6337741957437560735.post-66774273400762300722009-05-13T00:31:00.001+03:002009-11-29T05:29:33.023+02:00Migrating from KMail to Evolution<span style="font-family:verdana;">I've decided to give Gnome one more go (I've been a KDE user so far) so I installed Ubuntu 9.04 on my <a href="http://plug-and-pray.blogspot.com/2009/05/asus-pro57vr-notebook-m51vr-and-linux.html">laptop</a>. What's more is that I decided to use <span style="font-style: italic;">only</span> GTK applications, nothing Qt whatsoever. At least for a while, to see how it goes : )<br /><br />So far, nothing but confusion. What was notable though was the painful migration of my e-mails from KMail to Evolution.<a name='more'></a><br /><br />Evolution can import inboxes... but only in a few formats.<br /><br />In simple words, KMail uses the <span style="font-style: italic;">maildir</span> format (each e-mail is an individual file), whereas Evolution uses the <span style="font-style: italic;">mailbox</span> format (the inbox is one huge file where all e-mails are appended).<br /><br />So, in order to import the e-mails from KMail into Evolution, I first had to convert the maildir-ed e-mails to a big mailbox.<br /><br />First off, install <span style="font-style: italic;">procmail</span> -- it provides <span style="font-style: italic;">formail</span> (which is an e-mail (re)formatter):<br /><br /><span style="font-family:courier new;">sudo aptitude install procmail</span><br /><br />Then, create the following simple script:<br /><br /><span style="font-family:courier new;">#!/bin/bash</span><br /><br /><span style="font-family:courier new;"># $1 is the file name (e-mail in maildir format);</span><br /><span style="font-family:courier new;"># $2 is the name of the resulting mbox file.</span><br /><br /><span style="font-family:courier new;">echo -n "."</span><br /><span style="font-family:courier new;">cat "$1" | formail -ds >> "$2"</span><br /><br />Save it as <span style="font-family:courier new;">mdir2mbox.sh</span> and make it executable:<br /><br /><span style="font-family:courier new;">chmod 755 mdir2mbox.sh</span><br /><br />What the script does is it accepts a first parameter (which is the path and file name of an e-mail in maildir format) and a second one (which is the name of the resulted mailbox file); it creates a big <span style="font-style: italic;">.mbox</span> file.<br /><br />Next, KMail keeps the e-mails in <span style="font-family:courier new;">/home/yourusername/.kde/share/apps/kmail/mail</span>. Now, we want to create a mailbox for each of the folders you've had in KMail and you're interested in.<br /><br />Suppose we want to create 5 mailboxes (according to the folders from KMail that you need to import into Evolution): "tech", "announcements", "tasks", "meetings" and "offtopic".<br /><br />What you need to do is:<br /><br /><span style="font-family:courier new;">for email_folder in tech announcements tasks meetings offtopic ; do echo "=== $email_folder ===" ; find /home/yourusername/.kde/share/apps/kmail/mail/"$email_folder" -type f -exec ./mdir2mbox.sh "{}" "$email_folder.mbox" ";" ; echo ; done</span><br /><br />If the above long line looks unreasonable to you, it's because I wrote it like that in order to allow a simple copy/paste in a console. If you feel more comfortable with a proper formatting, here's how it would look like as a script:<br /><br /><span style="font-family:courier new;">#!/bin/bash</span><br /><br /><span style="font-family:courier new;"># You need to do 2 things here:</span><br /><span style="font-family:courier new;"># 1. replace the list "tech announcements tasks meetings offtopic"</span><br /><span style="font-family:courier new;"># with the list of folders in *your* KMail instance;</span><br /><span style="font-family:courier new;"># 2. replace "/home/yourusername" with the location of your home</span><br /><span style="font-family:courier new;"># directory and the actual user name you have.</span><br /><br /><span style="font-family:courier new;">for email_folder in tech announcements tasks meetings offtopic</span><br /><span style="font-family:courier new;">do</span><br /><span style="font-family:courier new;">echo "=== $email_folder ==="</span><br /><span style="font-family:courier new;">find /home/yourusername/.kde/share/apps/kmail/mail/"$email_folder" -type f -exec ./mdir2mbox.sh "{}" "$email_folder.mbox" ";" </span><br /><span style="font-family:courier new;">echo</span><br /><span style="font-family:courier new;">done</span><br /><br />That's it. Now, go to Evolution: File >> Import... >> Forward >> select the "Import a single file" radio button >> Forward >> click on the "Filename" drop-down and navigate to the place you created your brand new .mbox files and select one of them >> if it's not already selected, select the "Berkeley Mailbox (mbox)" option from the "File type" drop-down >> Forward >> choose the destination folder (where the .mbox will be imported >> Forward >> click "Import".<br /></span>Unknownnoreply@blogger.com5tag:blogger.com,1999:blog-6337741957437560735.post-67169235310734123462009-05-11T00:25:00.002+03:002010-02-12T13:42:34.680+02:00Asus Pro57Vr notebook (M51VR) and Linux<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEge9qgdJzewNwiI96l5fh3XkZ_Vn7LtffZXVGWfNgP8J-_prD2zUjkPA0IAGPqaw7pySOHO7FNPpkjyFBeqlAIwG46NPm0hhRUM-88pt5Z4oa9vap5XltfVJ8izRY7FY-CipcO80fEu8MA/"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 425px; height: 402px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEge9qgdJzewNwiI96l5fh3XkZ_Vn7LtffZXVGWfNgP8J-_prD2zUjkPA0IAGPqaw7pySOHO7FNPpkjyFBeqlAIwG46NPm0hhRUM-88pt5Z4oa9vap5XltfVJ8izRY7FY-CipcO80fEu8MA/" alt="" border="0" /></a><br /><br /><span style="font-family:verdana;">I bought this <a href="http://www.asus.com/product.aspx?P_ID=pzTyT383lwvGbXRZ">Asus Pro57Vr notebook</a> (scroll and click "Specifications") about 10 days ago; it's reported as M51VR on Ubuntu.<br /><br />It's very nice, for its price. Plus, I've grown fond of Asus over the pas</span><span style="font-family:verdana;">t years, due to the great quality/price balance. </span><span style="font-family:verdana;">After I've stuffed my desktop system with a lot of Asus components, I thought I'd buy a laptop from them as well.<a name='more'></a><br /><br /><span style="font-size:130%;"><span style="font-style: italic; font-weight: bold;"><br />Operating system and drivers</span></span><br /><br />I was glad to find it at a local distributor with no operating system installed whatsoever.<br /><br />Asus recommend Vista for it and of course it forces this upon customers -- the CD with the drivers is for Vista (32b) only. Still, you can download the Windows (XP, 2000 etc.) drivers from their website.<br /><br /><br />I set it up as a dual boot between Windows 7 RC (which I was curious to try) and Ubuntu 9.04.<br /><br />I have to mention the fact that on Windows 7 RC I didn't need to install additional drivers - everything was handled by Windows *somehow* and when there were a few unrecognized devices left in "Device Manager", just as I began to wonder how to handle them, the operating system somehow automatically downloaded and installed them. Very nice.<br /><br /><br /><span style="font-weight: bold; font-style: italic;font-size:130%;" >Things that didn't go as expected</span><br /><br />Two annoying things here:<br /><br /><span style="font-weight: bold;">1. The ambient light sensor</span> -- it's designed so stupidly -- it's probably meant for <span style="font-style: italic;">outdoors</span> situations (when you have more direct sunlight, the display will be bad so you'd need more brightness and, respectively, when it's not too sunny you can see the screen quite well so you don't need so much brightness).<br /><br />However, for <span style="font-style: italic;">indoor</span> use, this ambient light sensor behavior makes no sense -- it's quite the opposite! When the lights are turned off, I need more brightness and the other way around.<br /><br />The thing that is annoying from Asus' part is the fact that, while on Windows turning off the ambient light sensor is done easily ('Fn' key + 'a'), they didn't bother to draw any blue symbol on the "A" key to show you can use it in a "Fn" combination (whereas all other possible "Fn" options are drawn on the keyboard).<br /><br />On Linux however, surprise! this doesn't work. So you will have to do (as root):<br /><br /><span style="font-family:courier new;">echo 0 > /sys/devices/platform/asus_laptop/ls_switch</span><br /><br />in order to turn off the ambient light sensor.<br /><br />Obviously, this is necessary because as long as the stupid sensor is turned on, you can't adjust the brightness manually.<br /><br /><span style="font-weight: bold;">2. Built-in microphone.</span> As of Ubuntu 9.04 and Alsa v. 1.0.18 (and 1.0.19, which I've also tried), the built-in microphone doesn't work.<br /><br />The problem is the Intel ICH9 device and the Realtek ALC663 codec.<br /><br />I've tried editing <span style="font-family:courier new;">/etc/modprobe.d/alsa-base.conf</span> and adding (among other things)<br /><br /><span style="font-family:courier new;">options snd-hda-intel model=m51va</span><br /><br />also changing the model to the ones available in Alsa's configuration (ALC662/663 section <a href="http://www.kernel.org/doc/Documentation/sound/alsa/HD-Audio-Models.txt">here</a>), but still no go. Also, everything in alsamixer is unmuted and properly volume-d.<br /><br />It simply won't work. Maybe... someday...<br /><br />Anyhow, I can always plug in an external microphone (from my headset) -- the jack controller is infallible. Still, this issue is annoying.<br /><br /><br /><span style="font-size:130%;"><span style="font-weight: bold; font-style: italic;">Pros</span></span><br /><br />Everything else : ) I really love this notebook. For its price, it does a lot of things.<br /><br /><br /></span>Unknownnoreply@blogger.com22tag:blogger.com,1999:blog-6337741957437560735.post-86958440176471843842009-02-25T16:32:00.001+02:002009-11-29T05:31:45.733+02:00svn bad commit?<span style="font-family: verdana;">Suppose you do a bad svn commit. Here is a quick hands-on.</span><a name='more'></a><br /><br /><span style="font-family: verdana;">Suppose you have the following revisions:</span><br /><br /><span style="font-family: verdana;">- r532 - a good commit</span><br /><span style="font-family: verdana;">- r533 - a "bad" commit</span><br /><span style="font-family: verdana;">- r534 - another good commit</span><br /><br /><span style="font-family: verdana;">Now, you realize you shouldn't have svn-committed revision number r533.</span><br /><br /><span style="font-family: verdana;">What to do? Well, "</span><span style="font-family: courier new;">svn revert</span><span style="font-family: verdana;">" will not be of much help here -- you use "</span><span style="font-family: courier new;">svn revert</span><span style="font-family: verdana;">" just if you mess up a file locally and you want to get the correct one from the svn server.</span><br /><br /><span style="font-family: verdana;">The answer is:</span><br /><br /><span style="font-family: verdana;">* cd to the working branch, otherwise you'd get:</span><br /><span style="font-family: courier new;">svn: Cannot replace a directory from within</span><br /><br /><span style="font-family: verdana;">* from here, run:</span><br /><span style="font-family: courier new;">svn merge -r 534:532 file.sh<br /><br /><span style="font-family: verdana;">* next, you should see:<br /><span style="font-family: courier new;">U file.sh</span><br /><br />* after making sure the updated file.sh is fine, you should commit your changes and you will therefore have the new revision, r535:<br /><span style="font-family: courier new;">svn commit</span><br /></span></span>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6337741957437560735.post-91914504919817167612009-02-19T17:24:00.001+02:002009-11-29T05:32:06.271+02:00Pidgin bug -- update<span style="font-family:verdana;">After <span style="font-family:verdana;"><a href="http://plug-and-pray.blogspot.com/2008/06/pidgin-bug.html">more than half of year</a> after noticing the issue and getting frustrated with the <a href="http://developer.pidgin.im/ticket/4795">"can't set new Yahoo! avatar in Pidgin"</a> bug, it seems that things have finally gotten a move on!<a name='more'></a><br /><br />Testing whether the avatar updates for the Yahoo protocol in Pidgin 2.5.4 -- this finally works, with no other user intervention! Just go to Accounts >> Manage accounts and change the display picture.<br /><br />However, the previous version of Pidgin that I used, 2.4.1, didn't do that automatically. To sum it all up:<br /><br />The workaround for the avatar not updating for the Yahoo! protocol for Pidgin builds prior to version 2.5.3, was to:<br /><br />- quit pidgin;<br />- edit <span style="font-style: italic; font-weight: bold;">~/.pidgin/accounts.xml</span>, where I removed the values attached to the Yahoo! account, for the following settings: <span style="font-style: italic;">picture_url</span>,<span style="font-style: italic;"> picture_checksum</span>,<span style="font-style: italic;"> buddy_icon</span>,<span style="font-style: italic;"> picture_expire</span>, and<span style="font-style: italic;"> buddy_icon_timestamp</span>.<br /><br />The next time I ran it and set a picture, the values for the settings mentioned above were computed instantly and handled properly.<br /><br />Also, the picture displayed as the user avatar on the Yahoo! servers looked fine: <a href="http://img.msg.yahoo.com/avatar.php?yids=Your_YM_ID_here">http://img.msg.yahoo.com/avatar.php?yids=Your_YM_ID_here</a>.<br /></span></span>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6337741957437560735.post-76879344303732923372008-11-17T16:42:00.002+02:002010-06-11T23:00:29.606+03:00Midnight Commander transparent color scheme<span style="font-family: verdana;">Midnight Commander (or "mc") can have transparent panels instead of the ugly, dull default blue. So can "mcedit", its text editor.</span><br />
<br />
<span style="font-family: verdana;">Here's how to do it. Edit the file <span style="font-family: 'courier new';">~/.mc/ini</span> and add at the end the following:</span><br />
<a name='more'></a><br />
<br />
<span style="font-family: 'courier new';">[Colors]</span><br />
<span style="font-family: 'courier new';">base_color=normal=,default:selected=,:marked=,default:\</span><br />
<span style="font-family: 'courier new';">markselect=,:menu=,:menuhot=,:menusel=,:\</span><br />
<span style="font-family: 'courier new';">menuhotsel=,:dnormal=,:dfocus=,:dhotnormal=,:dhotfocus=,:\</span><br />
<span style="font-family: 'courier new';">input=,:reverse=,:executable=,default:directory=,default:\</span><br />
<span style="font-family: 'courier new';">link=,default:device=,default:special=,:core=,:helpnormal=,:\</span><br />
<span style="font-family: 'courier new';">helplink=,:helpslink=,:editnormal=,default:</span><br />
<span style="font-family: verdana;"><br />
<span style="font-weight: bold;">Note #1:</span> In the above 'code' block, there is only one line below <span style="font-family: 'courier new';">[Colors]</span>. I truncated the line with the backslash because of blogspot rendering issues. You just write all that on one single line, without the "\" (backslash-es).<br />
<br />
<span style="font-weight: bold;">Note #2:</span> At the end of this line, the "<span style="font-family: 'courier new';">editnormal,=default:</span>" option means that mcedit will have transparent background in your console, as well.<br />
<br />
<span style="font-weight: bold;"><span class="Apple-style-span" style="color: #cc0000;">UPDATE:</span> If you want to see a more in-depth look upon color customization in Midnight Commander, check out <a href="http://plug-and-pray.blogspot.com/2009/09/editing-midnight-commanders-color.html">this post</a>.</span><br />
</span>Unknownnoreply@blogger.com8tag:blogger.com,1999:blog-6337741957437560735.post-61399901699816215882008-09-02T14:09:00.001+03:002009-11-29T05:33:25.060+02:00Postfix on FreeBSD - Maildir delivery<p><span style="font-family:verdana;">Suppose you have a clean FreeBSD install and you want to get </span><span style="font-family:courier new;">Postfix</span><span style="font-family:verdana;"> as your MTA.</span></p><p><span style="font-family:verdana;">Current setup:</span></p><ul><li><span style="font-family:verdana;">OS: FreeBSD 7.0-RELEASE</span></li><li><span style="font-family:verdana;">SHELL: bash</span></li><li><span style="font-family:verdana;">no previously installed MTA present on the system</span></li></ul><p><span style="font-family:verdana;"><a name='more'></a>Create a system user, say </span><span style="font-family:courier new;">test</span><span style="font-family:verdana;">. Then create the </span><span style="font-family:courier new;">Maildir</span><span style="font-family:verdana;"> for this user:</span></p><p><span style="font-family:verdana;"></span></p><blockquote><p><span style="font-family:courier new;"># su test<br />$ cd ~<br />$ mkdir -p Maildir/{cur,new,tmp}<br />$ chmod -R 700 Maildir<br />$ exit<br />#</span></p></blockquote><p><span style="font-family:verdana;"></span></p><p><span style="font-family:verdana;">Then let's get on with the Postfix thing:</span></p><p style="font-family: courier new;"></p><blockquote><span style="font-family:courier new;"># pkg_add -rv postfix</span></blockquote><p></p><p><span style="font-family:verdana;">If this line is not present in</span><span style="font-family:courier new;"> /etc/rc.conf</span><span style="font-family:verdana;">:</span></p><p style="font-family: courier new;"></p><blockquote><span style="font-family:courier new;"># echo 'sendmail_enable="YES"' >> /etc/rc.conf<br /># /usr/bin/newaliases<br /># postconf -e home_mailbox="Maildir/"<br /># postfix start</span></blockquote><p></p><p><span style="font-family:verdana;">You're done. Now every mail sent to a user (who of course has his "</span><span style="font-family:courier new;">Maildir/</span><span style="font-family:verdana;">" in place) will arrive in the </span><span style="font-family:courier new;">/home/user/Maildir/new</span><span style="font-family:verdana;"> directory.</span></p>Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-6337741957437560735.post-39334314730455386182008-06-29T15:39:00.002+03:002010-06-11T23:24:33.162+03:00Triple boot pain<span class="Apple-style-span" style="font-family: Verdana, sans-serif;">Today I went at a friend's place to help him set up a triple boot system. The PC is brand new and bleeding edge (it will be used primarily as a gaming device), but the guy was still curious about Linux. So I told him about Linux in general and offered to install Ubuntu. He agreed and we went on with the partitioning scheme.</span><br />
<span class="Apple-style-span" style="font-family: Verdana, sans-serif;"><br />
</span><br />
<span class="Apple-style-span" style="font-family: Verdana, sans-serif;">The HDD had 500 GB and we agreed to set up the partitions as follows:</span><br />
<blockquote><span class="Apple-style-span" style="font-family: Verdana, sans-serif;">* primary partition - 50 GB - Vista Business x64</span><br />
<span class="Apple-style-span" style="font-family: Verdana, sans-serif;">* primary partition - 50 GB - XP Professional x64</span><br />
<span class="Apple-style-span" style="font-family: Verdana, sans-serif;">* primary partition - 25 GB - Kubuntu 8.04</span><br />
<span class="Apple-style-span" style="font-family: Verdana, sans-serif;">* extended partition - ~375 GB</span><br />
<span class="Apple-style-span" style="font-family: Verdana, sans-serif;">- 4 GB - Linux swap</span><br />
<span class="Apple-style-span" style="font-family: Verdana, sans-serif;">- the rest - big storage partition</span></blockquote><span class="Apple-style-span" style="font-family: Verdana, sans-serif;">OK, so when all this was settled, I started the Vista install. It went OK, no troubles whatsoever. Then came Kubuntu - all went fine. I used GRUB in order to be able to choose between the two operation systems.</span><br />
<a name='more'></a><span class="Apple-style-span" style="font-family: Verdana, sans-serif;"><br />
</span><br />
<span class="Apple-style-span" style="font-family: Verdana, sans-serif;"><br />
</span><br />
<span class="Apple-style-span" style="font-family: Verdana, sans-serif;">After customizing the two operating systems, adding all the necessary applications etc. we thought we should finish the setup and have XP installed as well.</span><br />
<span class="Apple-style-span" style="font-family: Verdana, sans-serif;"><br />
</span><br />
<span class="Apple-style-span" style="font-family: Verdana, sans-serif;">Surprise! Just after the reboot - after I chose the partition I was going to install XP unto and formatting it as NTFS and after the setup disk copied the necessary files and drivers on the HDD before the graphical installer could be launched - the PC came up with a gross error:</span><br />
<blockquote><span class="Apple-style-span" style="font-family: Verdana, sans-serif;">A disk read error has occurred. Press CTRL+ALT+DEL to restart.</span></blockquote><span class="Apple-style-span" style="font-family: Verdana, sans-serif;">"Whoa! And it didn't even get to the bootloader!" I said to myself with disdain.</span><br />
<span class="Apple-style-span" style="font-family: Verdana, sans-serif;"><br />
</span><br />
<span class="Apple-style-span" style="font-family: Verdana, sans-serif;">So, what to do? I googled for the error and came up with an </span><a href="http://support.microsoft.com/kb/919529"><span class="Apple-style-span" style="font-family: Verdana, sans-serif;">"explanatory" article on the Microsoft support website</span></a><span class="Apple-style-span" style="font-family: Verdana, sans-serif;">. In short, you </span><span style="font-style: italic;"><span class="Apple-style-span" style="font-family: Verdana, sans-serif;">are not supposed</span></span><span class="Apple-style-span" style="font-family: Verdana, sans-serif;"> to dare to attempt to install another Microsoft Windows operating system </span><span style="font-style: italic;"><span class="Apple-style-span" style="font-family: Verdana, sans-serif;">after</span></span><span class="Apple-style-span" style="font-family: Verdana, sans-serif;"> you installed any version of Vista. Hah! What do you think about that?</span><br />
<span class="Apple-style-span" style="font-family: Verdana, sans-serif;"><br />
</span><br />
<span class="Apple-style-span" style="font-family: Verdana, sans-serif;">What to do? I thought about the alternatives. My first go was to try to boot again from the XP install disk and attempt a repair (a "fixmbr" or "fixboot" something). Fired up the XP recovery console, chose the </span><span style="font-style: italic;"><span class="Apple-style-span" style="font-family: Verdana, sans-serif;">right</span></span><span class="Apple-style-span" style="font-family: Verdana, sans-serif;"> partition (the one that had the XP GUI installer ready to start if I managed to boot of that HDD) and came to face a horror like surprise... the administrator password, which I </span><span style="font-style: italic;"><span class="Apple-style-span" style="font-family: Verdana, sans-serif;">didn't</span></span><span class="Apple-style-span" style="font-family: Verdana, sans-serif;"> set, because I didn't have the chance to, was not blank. Under normal circumstances, I should have been faced with the opportunity to pick (and set) an administrator password after the first boot off the HDD (off the XP partition), but since this didn't happen, I thought the password shouldn't exist. Well, apparently it did. I'm not so much into Windows internals so if anyone has an explanation for this, please let me know (yes, I tried some "admin" and "administrator" variations but they didn't work).</span><br />
<span class="Apple-style-span" style="font-family: Verdana, sans-serif;"><br />
</span><br />
<span class="Apple-style-span" style="font-family: Verdana, sans-serif;">So the XP recovery console repair solution was off the list... moving on.</span><br />
<span class="Apple-style-span" style="font-family: Verdana, sans-serif;"><br />
</span><br />
<span class="Apple-style-span" style="font-family: Verdana, sans-serif;">I was trying with all means necessary to follow Microsoft's indications and completely remove both operating systems and then only install XP (or the 'old' Windows version) and in the end Vista.</span><br />
<span class="Apple-style-span" style="font-family: Verdana, sans-serif;"><br />
</span><br />
<span class="Apple-style-span" style="font-family: Verdana, sans-serif;">So it only seemed natural to load the Kubuntu Live CD and restore GRUB. For this, you need to boot off the Live CD, wait until it loads, start a konsole or a terminal and then</span><br />
<span class="Apple-style-span" style="font-family: Verdana, sans-serif;"><br />
</span><br />
<span class="Apple-style-span" style="font-family: Verdana, sans-serif;">$ sudo grub<br />
grub> find /boot/grub/stage1<br />
grub> root (hd?,?)<br />
grub> setup (hd?)<br />
grub> quit</span> <br />
<span class="Apple-style-span" style="font-family: Verdana, sans-serif;">and then restart. (For more info on restoring GRUB after Windows overwrote the MBR using a Linux Live CD, check </span><a href="http://ubuntuforums.org/showthread.php?t=224351"><span class="Apple-style-span" style="font-family: Verdana, sans-serif;">here</span></a><span class="Apple-style-span" style="font-family: Verdana, sans-serif;">.)</span><br />
<span class="Apple-style-span" style="font-family: Verdana, sans-serif;"><br />
</span><br />
<span class="Apple-style-span" style="font-family: Verdana, sans-serif;">Using the Live CD, I mounted the partition with the Kubuntu install and manually edited /boot/grub/menu.lst in order to add the XP entry there, too.</span><br />
<span class="Apple-style-span" style="font-family: Verdana, sans-serif;"><br />
</span><br />
<span class="Apple-style-span" style="font-family: Verdana, sans-serif;">Then rebooted. Vista was fine, Kubuntu was fine, XP yielded a "NTLDR not found" error. Grrr.</span><br />
<span class="Apple-style-span" style="font-family: Verdana, sans-serif;"><br />
</span><br />
<span class="Apple-style-span" style="font-family: Verdana, sans-serif;">Next off, booted Ubuntu, manually mounted the XP partition, insterted the XP install disk, copied (disk)\i386</span><cdrom><span class="Apple-style-span" style="font-family: Verdana, sans-serif;">\ntldr</span></cdrom><cdrom><span class="Apple-style-span" style="font-family: Verdana, sans-serif;"> and </span><cdrom><span class="Apple-style-span" style="font-family: Verdana, sans-serif;">(disk)</span><cdrom><span class="Apple-style-span" style="font-family: Verdana, sans-serif;">\i386\ntdetect.com</span></cdrom></cdrom><cdrom><cdrom><span class="Apple-style-span" style="font-family: Verdana, sans-serif;"> to the root of the XP filesystem, i.e. something like:<br />
</span> </cdrom><cdrom><cdrom><span class="Apple-style-span" style="font-family: Verdana, sans-serif;">cp /media/cdrom0/i386/ntldr /media/xp<br />
cp /media/cdrom0/i386/ntdetect.com /media/xp</span></cdrom></cdrom><cdrom><cdrom><span class="Apple-style-span" style="font-family: Verdana, sans-serif;"><br />
<br />
and then rebooted. Now XP didn't complain anymore about the missing NTLDR, but apparently it had no </span> <span style="font-style: italic;"><span class="Apple-style-span" style="font-family: Verdana, sans-serif;">boot.ini</span></span><span class="Apple-style-span" style="font-family: Verdana, sans-serif;"> file. So I booted in Ubuntu once more, mounted the XP partition once more and wrote a </span><span style="font-style: italic;"><span class="Apple-style-span" style="font-family: Verdana, sans-serif;">boot.ini</span></span><span class="Apple-style-span" style="font-family: Verdana, sans-serif;"> file that contained:<br />
</span> </cdrom><cdrom><cdrom><span class="Apple-style-span" style="font-family: Verdana, sans-serif;">[boot loader]<br />
timeout=30<br />
default=multi(0)disk(0)rdisk(0)partition(2)\WINDOWS<br />
[operating systems]<br />
multi(0)disk(0)rdisk(0)partition(2)\WINDOWS="Microsoft Windows XP Professional" /noexecute=optin /fastdetect</span></cdrom></cdrom><cdrom><cdrom><span class="Apple-style-span" style="font-family: Verdana, sans-serif;"><br />
<br />
The "partition(2)" part there was OK, since XP was installed on the 2nd partition of the HDD.<br />
<br />
This way, I finally managed to boot XP and the GUI installer started off the HDD. It all went fine from there on.<br />
<br />
Still, this was a challenging experience. Overall, in the end (and in the end solely!) I enjoyed a good laugh on the gay-ness of the whole "Windows Vista no longer starts after you install an earlier version of the Windows operating system in a dual-boot configuration" thing. Mwhaha!</span> </cdrom></cdrom></cdrom></cdrom></cdrom><br />
<h1 class="title"><br />
</h1>Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-6337741957437560735.post-49662559818008898822008-06-26T18:52:00.001+03:002009-11-29T05:35:25.082+02:00Manually modifying a .deb package<p><span style="font-family:verdana;">From time to time, you might be facing a binary .deb package that you have to tweak for suiting your own needs or for testing purposes. By "a binary .deb package" I mean the final .deb, with a few configuration files and pre/post-inst/rm scripts and not the source files for the .deb themselves.</span></p><p><span style="font-family:verdana;">So, what to do if you only want to change, say, the behavior of a <em>postinst</em></span><span style="font-family:verdana;"> file and then have the .deb prepared for installation?</span></p><p><span style="font-family:verdana;">First of all, the .deb itself is a kind of an archive. This is why you can browse its contents while in <em>mc</em></span><span style="font-family:verdana;">, for instance ("<a href="http://www.ibiblio.org/mc/">Midnight Commander</a>").</span></p><a name='more'></a><p><span style="font-family:verdana;"><span style="font-weight: bold;">Step 1.</span> So, in order to operate upon the files contained within your .deb, you need to unpack it. Suppose your .deb package is called <em>your_package.deb</em></span><span style="font-family:verdana;">. You need to unpack it using the </span><a href="http://sourceware.org/binutils/docs/binutils/ar.html"><span style="font-family:verdana;"><em>ar</em></span></a><span style="font-family:verdana;"><em> </em></span><span style="font-family:verdana;">command, which is part of binutils.</span></p><p><span style="font-family:courier new;">ar x your_package.deb</span></p><p><span style="font-family:verdana;">This will result in 3 files: </span></p><ul><li><span style="font-family:verdana;">debian-binary: ASCII text</span></li><li><span style="font-family:verdana;">control.tar.gz: gzip compressed data, from Unix</span></li><li><span style="font-family:verdana;">data.tar.gz: gzip compressed data, from Unix</span><br /></li></ul><p><span style="font-family:verdana;">Now, a brief explanation on the two gzip files:<br /></span></p><p><span style="font-family:verdana;"><strong>data.tar.gz </strong></span><span style="font-family:verdana;">is the archive that contains the files that actually get installed (in </span><span style="font-family:courier new;">/usr</span><span style="font-family:verdana;"> or </span><span style="font-family:courier new;">/opt</span><span style="font-family:verdana;"> etc.), while </span><span style="font-family:verdana;"><strong>control.tar.gz<em> </em></strong></span><span style="font-family:verdana;">is an archive containing other important files. Usually, this latter archive has to contain:</span></p><ul><li><span style="font-family:verdana;"><span style="font-family:courier new;">control: UTF-8 Unicode English text</span></span></li><li><span style="font-family:verdana;"><span style="font-family:courier new;">md5sums: ASCII text</span> (a text file that contains the md5 sum for every file contained within the <em>data.tar.gz</em> archive)</span></li><li><span style="font-family:verdana;"><span style="font-family:courier new;">postinst: Bourne shell script text executable</span> (a script that is to be executed after installing the package)</span></li><li><span style="font-family:verdana;"><span style="font-family:courier new;">postrm: Bourne shell script text executable</span> (a script that is to be executed after removing the package)</span></li><li><span style="font-family:verdana;"><span style="font-family:courier new;">preinst: Bourne shell script text executable</span> (a script that is to be executed before installing the package)</span></li><li><span style="font-family:verdana;"><span style="font-family:courier new;">prerm: Bourne shell script text executable</span> (a script that is to be executed before removing the package)<br /></span></li></ul><p><span style="font-family:verdana;">Just a quick note: it's not necessary to have all of the </span><span style="font-family:courier new;">preinst</span><span style="font-family:verdana;">, </span><span style="font-family:courier new;">postinst</span><span style="font-family:verdana;">, </span><span style="font-family:courier new;">prerm</span><span style="font-family:verdana;"> and </span><span style="font-family:courier new;">postrm</span><span style="font-family:verdana;"> scripts (sometimes there's no need for some of them and they can be omitted).<br /></span></p><p><span style="font-family:verdana;"><span style="font-weight: bold;">Step 2.</span> OK so now that you've gotten this straighted out, it's time to unpack one of the two archives and modify the file or files you need to customize. Suppose your file is one that actually gets 'installed', so it's in <span style="font-style: italic;">data.tar.gz</span>. To unpack this archive in a 'safe' way (to be able to easily re-pack it), execute:</span></p><p><span style="font-family:courier new;">mkdir extras-data<br />cd extras-data<br />tar xfz ../data.tar.gz</span><span style="font-family:verdana;"><br /></span></p><p style="font-family:verdana;"><span style="font-weight: bold;">Step 3.</span> Now go on and modify the file or files you need to change.</p><span style="font-family:verdana;"><span style="font-weight: bold;">Step 4.</span> Remember, since you changed the contents of at least one file in the <span style="font-style: italic;">data.tar.gz</span> archive, its md5sums have changed as well. So it's time to update the <span style="font-family:courier new;">md5sums</span> file in <span style="font-style: italic;">control.tar.gz</span>.</span><p style="font-family: courier new;font-family:courier new;" ><span style="font-family:courier new;">mkdir extras-control<br />cd extras-control<br />tar xfz ../control.tar.gz</span></p><p style="font-family:verdana;">Now, edit the file <span style="font-family:courier new;">md5sums</span>, carefully replacing each modified file's md5 sum with the new one.</p><p style="font-family:verdana;"><span style="font-family:verdana;"><span style="font-weight: bold;">Step 5.</span> Next, repack</span> <span style="font-family:courier new;">control.tar.gz</span>:</p><p style="font-family:courier new;"><span style="font-family:courier new;">tar cfz control.tar.gz *<br />mv control.tar.gz .. #</span><span style="font-family:verdana;"> Warning: this will overwrite the original control.tar.gz archive</span></p><p style="font-family:verdana;"><span style="font-weight: bold;">Step 6.</span> Next step is to repack the <span style="font-style: italic;">data.tar.gz</span> archive:</p><p style="font-family:verdana;"><span style="font-family:courier new;">cd ../extras-data<br />tar cfz data.tar.gz *<br />mv data.tar.gz .. </span><span style="font-family:verdana;"># Warning: this will overwrite the original data.tar.gz archive</span></p><p style="font-family:verdana;"><span style="font-weight: bold;">Step 7.</span> Then clean up:</p><p style="font-family: courier new;"><span style="font-family:courier new;">cd ..<br />rm -fr extras*</span></p><p style="font-family:verdana;"><span style="font-weight: bold;">Step 8.</span> The final step is to actually rebuild your .deb package:</p><p style="font-family: courier new;"><span style="font-family:courier new;">ar r your_new_package.deb debian-binary control.tar.gz data.tar.gz</span><br /></p><p style="font-family:verdana;">That's it, you're done. You will now have your custom .deb package, called <span style="font-family:courier new;">your_new_package.de</span><span style="font-family:courier new;">b</span>.</p><span style="font-family:verdana;">Good luck.</span><br /><p><span style="font-weight: bold;">LATER EDIT: </span>Be careful, when repackaging the <span style="font-style: italic;">ar</span> archive, always do it in the order specified above (i.e. 1) <span style="font-style: italic;">debian-binary</span>, 2) <span style="font-style: italic;">control.tar.gz</span> and 3) <span style="font-style: italic;">data.tar.gz</span>). Otherwise it won't work. I noticed the mistake when a colleague told me the resulted archive is not a valid Debian package if the 'instructions' were followed exactly.<br /></p>Unknownnoreply@blogger.com3tag:blogger.com,1999:blog-6337741957437560735.post-87373410620849328212008-06-22T16:59:00.001+03:002009-11-29T05:36:05.868+02:00Ubuntu 8.04 Live CD and weird SATA HDD<span style="font-family: verdana;">Today I went at a friend's to help her set up a new PC in a dual boot configuration (Windows XP, which was already installed, and Kubuntu 8.04).</span><br /><br /><span style="font-family: verdana;">XP came preinstalled so I burned a CD with Kubuntu 8.04 and booted from it... just to find out that there was no normal way of detecting the HDD as device.<a name='more'></a> Indeed,</span><br /><br /><span style="font-family: courier new;">sudo fdisk -l </span><br /><br /><span style="font-family: verdana;">showed nothing at all. Also, in <span style="font-style: italic;">dmesg</span> there were some errors regarding an ATA port error. </span><br /><br /><span style="font-family: verdana;">So I booted back in XP and saw the HDD model was a HD502IJ Samsung on SATA that just </span><span style="font-style: italic; font-family: verdana;">might</span> <span style="font-family: verdana;">pose boot problems (not being detected).</span><br /><br /><span style="font-family: verdana;">I managed to have the HDD detected only by specifying at the boot prompt the option</span><br /><br /><span style="font-family: courier new;">all_generic_ide</span><br /><br /><span style="font-family: verdana;">After this, the HDD was visible, its partitions were visible and I could operate on it normally.</span>Unknownnoreply@blogger.com0