title: usb partition creation

text: When I am doing dmesg after plug in my SD card to do partition               [ 4611.940660] sd 7:0:0:0: [sdb] Assuming drive cache: write through     [ 4611.944440]  sdb: unknown partition table     [ 4611.949411] sd 7:0:0:0: [sdb] No Caching mode page present     [ 4611.949419] sd 7:0:0:0: [sdb] Assuming drive cache: write through     [ 4611.949424] sd 7:0:0:0: [sdb] Attached SCSI removable disk     [ 4966.868425] end_request: I/O error, dev fd0, sector 0      First of all I think this is because of Linux kernel it can't reading (some problem with kernel) but when I just run a command for partition details               sudo /dev/sdb [sdb is my device name ]     Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel     Building a new DOS disklabel with disk identifier 0x9b17bdaf.     Changes will remain in memory only, until you decide to write them.     After that, of course, the previous content won't be recoverable.     Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)      Can anybody give me a solution for this?


title: Is it possible to tell df to use /proc/mounts instead of /etc/mtab?

text: Installing gentoo in chroot I found that commands like `mount` and `df` doesn't work: they try to read file `/etc/mtab` (which of course is empty). Can I (for future use) setup or even recompile them so, that they won't read `/etc/mtab`, taking all needed info from `/proc`?


title: What is the correct way of setting up a Squid Proxy in front of wireless router

text: We are a small office of 20 users. Our current network is like below. We have a static IP on the Wireless Router's WAN port.               Local network <-> Wireless Router <-> Cable Internet      I want to put in a Linux box that will run Squid and ownCloud, like below. The ISP's static IP will shift to the Linux box, which will connect to the router's WAN port.               Local network <-> Wireless Router <-> Linux box <-> Cable Internet        1. Is it possible to configure Squid such that users who connect to the Router do not have to configure any proxy for themselves but (and?) are forced to go through the proxy?   2. I want to set up whitelists for certain users. Is it possible to enforce whitelists based on ACLs?   3. How will the ACLs work on mobile devices?


title: How to find out how much of internet bandwidth is used by all processes except one specific process?

text: As a followup question to this one: I am downloading a file on multiple remote computers using `curl` command and am using the `\--limit-rate` parameter to limit the download speed on the ones whose internet is being used: > curl --limit-rate 10k -r 104857601-209715200 -o distro2.iso > 'http://files.cdn/distro.iso' So I have to periodically monitor the internet usage of each computer (like every 5 seconds), and dynamically decrease the `\--limit-rate` once the internet is being used by the user and increase it as the internet usage becomes idle. So the only thing that I need to know is whether the user of remote computer is using their internet (like browsing the web, or downloading a file). Is there any easy way to find out this? I think I have to obtain the PID of `curl` and exclude it from the list of applications that are using internet to find out whether any other application is using internet. I just don't know which command is better to use. Using commands that do not require sudo privileges are preferred. Any advice would be greatly appreciated!


title: Debian: Is it possible/safe to install packages from an older version of the repository?

text: I'm currently running Debian testing (Wheezy) and am trying to get SCIM working. I want to install the scim-pinyin package, but there is no such package available in the testing repository, although there was one in the previous stable (Squeeze) repository. There is a copy of the package in unstable but not for my architecture (amd64). Looking at the package versions, I notice that the version in the stable repositories is the same as that in unstable. This being the case, I have two questions:   1. Is there any reason why I can't install a package from an older repository since I would assume that most Squeeze packages will probably have their dependencies met by the package versions currently in testing?   2. What is the best way to achieve this? (Add the Squeeze repository to `sources.list`? Download the Squeeze package and install it manually?)


title: call a script if a zenity window is minimized, resized or moved

text: I would like to add an event-catcher, if my the `zenity` window gets minimized, resized or moved. I already call a script if the window is closed or the button is pressed in my typebreak script But I would also like to catch minimizing, resizing and moving of the zenity window too, so I can then also call the `mouse-speed` script inside my `typebreak` script. I use Unity on Ubuntu but the script already works on different window- managers too.


title: Problem with patching file with .diff

text: I having some trouble adding .diff patch to a file. Patch file itself seems to be fine but it keeps giving error:               root@pipiripi:/home/tomek/mad# patch mifare-mad.pl < pastie1.diff     patching file mifare-mad.pl     patch: **** malformed patch at line 434:        And the code of patch is:               --- mifare-mad.pl   2011-02-06 08:41:06.000000000 +0100     +++ mifare-mad.pl   2012-06-28 10:59:36.000000000 +0200     @@ -7,16 +7,20 @@      # MIFARE Application Directory (MAD)      # http://www.nxp.com/acrobat_download2/other/identification/MAD_overview.pdf          -use Data::Dump qw(dump);     +use Data::Dumper;           my $debug = $ENV{DEBUG} || 0;           my $function_clusters;      my $mad_id;     +my $wkm_ttid;     +my $wkm_pos;     +my $wkm_line;           while(<DATA>) {         chomp;         next if m/^#?\s*$/;     +   $_=~s/\s+#.*//;         my ( $code, $function ) = split(/\s+/,$_,2);         my $h = '[0-9A-F]';         if ( $code =~ m/^($h{2})-($h{2})$/ ) {     @@ -25,6 +29,15 @@             }         } elsif ( $code =~ m/^($h{2})$/ ) {             $function_clusters->{ lc $code } = $function;     +   } elsif ( $code =~ m/^WKM_TTID:($h{2})$/i ) {     +       my (undef,$ttid) = split(/:/,$code,2);     +       $wkm_ttid->{lc $ttid}=$function;     +   } elsif ( $code =~ m/^WKM_POS:($h{2})$/i ) {     +       my (undef,$pos) = split(/:/,$code,2);     +       $wkm_pos->{lc $pos}=$function;     +   } elsif ( $code =~ m/^WKM_LINE:(\d+|\d+x\d+)$/i ) {     +       my (undef,$line) = split(/:/,$code,2);     +       $wkm_line->{lc $line}=$function;         } elsif ( $code =~ m/^($h{4})$/ ) {             $mad_id->{ lc $1 } = $function;         } else {     @@ -32,6 +45,10 @@         }      }          +sub bin2dec {     +    return unpack("N", pack("B32", substr("0" x 32 . shift, -32)));     +}     +      my $access_condition_data = {      0b000 => 'R:AB W:AB I:AB DTR:AB transport conf',      0b010 => 'R:AB W:-- I:-- DTR:-- r/w block',     @@ -62,8 +79,10 @@                if ( $debug ) {     -   warn "# function_clusters ",dump($function_clusters);     -   warn "# mad_id ", dump($mad_id);     +   warn "# function_clusters ",Dumper($function_clusters);     +   warn "# mad_id ", Dumper($mad_id);     +   warn "# wkm_ttid ", Dumper($wkm_ttid);     +   warn "# wkm_line ", Dumper($wkm_line);      }           local $/ = undef;     @@ -76,6 +95,9 @@           my $pos = 0;          +my $wkm=0;     +my $zdm=0;     +      foreach my $sector ( 0 .. 39 ) {              my $blocks = $sector < 32 ? 4 : 16;     @@ -151,6 +173,7 @@             ;              my $condition = '';     +         foreach my $j ( 0 .. $blocks - 1 ) {             my $offset = $pos + $j * 0x10;             my $block = substr($card, $offset, 0x10);     @@ -188,6 +211,7 @@                  my $hex = unpack('H*',$block);             $hex =~ s/(....)/$1 /g;     +       $hex =~ s/0000/..../g; #/k./                  if ( $ENV{SWAP} ) {                 my $hex_sw = unpack('h*',$block);     @@ -196,6 +220,100 @@             }                  printf "%x %03x  %s%s\n", $j, $offset, $hex, $condition;     +     +       # -----------------     +     +       if ($sector == 1 and $j == 0 and substr($block,0,1) eq "\x10") {     +           $wkm = 1;     +           my (undef,$ttid,undef,$pos,undef) = unpack('H2 H2 H8 H2 H*',$block);     +           my ($card_b1, $card_b2, $card_b3, $card_b4) = unpack('H2 H2 H2 H2',substr($card,0,4));     +           printf "# WKM: karta nr %03d %08d\n# WKM: [numer kontraktu %d] %s (%s) POS: %s\n", hex($card_b4), hex($card_b3 . $card_b2 . $card_b1), hex($ttid), ($wkm_ttid->{$ttid})?$wkm_ttid->{$ttid}:'kontrakt nieznany', (hex($ttid)%2==1)?'stara taryfa':'nowa taryfa',($wkm_pos->{$pos})?$wkm_pos->{$pos}:$pos;     +       }     +     +       if ($wkm and $sector == 1 and $j == 1) {     +           my $selector = unpack('H*',substr($block,0,1));     +           printf "# WKM: ostatnie skasowanie w sektorze %s\n", $selector+2;     +       }     +     +       if ($wkm and ($sector == 2 or $sector == 3) and $j == 0 and substr($block,0,1) eq "\x10") {     +           my (undef,$ti,$ty,$tm,$td,$th,$tt,$vy,$vm,$vd,$vh,$vt,$vl,$vb,$vs)=unpack('A8 A8 A7 A4 A5 A5 A6 A7 A4 A5 A5 A6 A14 A10 A*',unpack('B*',$block));     +           # print Dumper($tt,$ti,$ty,$tm,$td,$th,$tt,$vy,$vm,$vd,$vh,$vt,$vl,$vb,$vs);     +           printf "# WKM: [skasowanie %d]\n# WKM:   kontrakt wazny do: 20%02d/%02d/%02d %02d:%02d\n# WKM:   bilet skasowany w: 20%02d/%02d/%02d %02d:%02d linia: %s %s: %s%s\n",      +               &bin2dec($ti),     +               &bin2dec($ty),     +               &bin2dec($tm),     +               &bin2dec($td),     +               &bin2dec($th),     +               &bin2dec($tt),     +               &bin2dec($vy),     +               &bin2dec($vm),     +               &bin2dec($vd),     +               &bin2dec($vh),     +               &bin2dec($vt),     +               # &bin2dec($vl),     +               ($wkm_line->{&bin2dec($vl)})?$wkm_line->{&bin2dec($vl)}:&bin2dec($vl),     +               # &bin2dec($vb),     +               ($wkm_line->{(&bin2dec($vl).'x'.&bin2dec($vb))})?'stacja':'brygada',     +               ($wkm_line->{(&bin2dec($vl).'x'.&bin2dec($vb))})?$wkm_line->{(&bin2dec($vl).'x'.&bin2dec($vb))}:&bin2dec($vb),     +               ($vs>0)?(' extra dane: '.&bin2dec($vs)):'';     +       }     +     +       # -----------------     +     +       if ($sector == 7 and $j == 0 and substr($block,0,2) eq "\x01\x01") {     +           $zdm = 1;     +           my (undef, # trailer \x01\x01     +               $loadno,     +               undef, # always \x00     +               $loadday,     +               $loadmonth,     +               $loadyear,     +               $validday,     +               $validmonth,     +               $validyear,     +               $pos_group,     +               $pos_no,     +               $unknown1,     +               $unknown2) # ???     +               = unpack('v c c c c v c c v c c H2 H2', $block);     +           printf "# ZDM: karta zaladowana %d raz, data ladowania: %04d/%02d/%02d, data waznosci %04d/%02d/%02d, punkt sprzedazy: %03d\\%d extra 2 bajty: %s %s\n", $loadno, $loadyear, $loadmonth, $loadday, $validyear, $validmonth, $validday, $pos_no, $pos_group, $unknown1, $unknown2;     +       }     +     +       if ($zdm and $sector == 7 and ($j == 1 or $j == 2)) {     +           my ($credits1,     +               $const_0000,     +               $checksum,     +               $const_ffff,     +               $credits2,     +               $const_000000ff00ff)     +               = unpack ('v H4 v H4 v H12', $block);     +           printf "# ZDM: Unexpected value %s - should be 0000\n", $const_0000 if $const_0000 ne '0000';     +           printf "# ZDM: Unexpected value %s - should be ffff\n", $const_ffff if $const_ffff ne 'ffff';     +           printf "# ZDM: Unexpected value %s - should be 000000ff00ff\n", $const_000000ff00ff if $const_000000ff00ff ne '000000ff00ff';     +           printf "# ZDM: Credits mismatch\n" if $credits1 ne $credits2;     +           printf "# ZDM: Verify mismatch\n" if 65535 - $credits1 ne $checksum; # (0xffff - credits = checksum)     +           printf "# ZDM: [%s] %.2f zl\n", ($j==1)?'srodki na karcie':'wartosc doladowania', $credits1/10;     +       }     +     +       if ($zdm and $sector == 8 and $j == 0) {     +           my ($transday,     +               $transmonth,     +               $unknown1,     +               $transhour,     +               $transminute,     +               $const1,     +               $transno,     +               $transval,     +               $const2,     +               $transid,     +               $unknown2)     +               = unpack ('c c H2 c c H6 c v H4 v H2', $block);     +           printf "# ZDM: Unexpected value %s - should be 000000\n", $const1 if $const1 ne '000000';     +           printf "# ZDM: Unexpected value %s - should be 0000\n", $const2 if $const2 ne '0000';     +           printf "# ZDM: [ostatnia tranzakcja] dzien=%02d miesiac=%02d godzina=%02d:%02d numer=%d identyfikator=%d oplata=%.2f zl, extra 2 bajty: %s %s\n", $transday, $transmonth, $transhour, $transminute, $transno, $transid, $transval/10, $unknown1, $unknown2 if $transval ne 0;     +       }     +     +       # -----------------         }              printf "KEY A:%s | %s GDP: %s | B:%s %s\n"     @@ -292,3 +410,243 @@      887C - electronic purse MIKROELEKTRONIKA spol.s.r. MIKROELEKTRONIKA spol.s.r.o. Europe         4 01.05.2009 electronic purse      887D - electronic purse Mikroelektronika spol.s r.o Mikroelektronika spol.s r.o EUROPE,Czech R 4 01.08.2009 Electronic purse          +WKM_TTID:00 czysty bilet     +WKM_TTID:02 bilet jednorazowy strefa 1, normalny     +WKM_TTID:16 bilet dobowy strefa 1, normalny     +WKM_TTID:18 bilet trzydniowy strefa 1, normalny     +WKM_TTID:21 bilet dobowy strefa 1, normalny (nowa)     +WKM_TTID:22 bilet trzydniowy strefa 1, normalny     +WKM_TTID:23 bilet dobowy strefa 1, normalny     +WKM_TTID:24 bilet trzydniowy strefa 1, normalny     +WKM_TTID:25 bilet siedmiodniowy strefa 1, normalny     +WKM_TTID:27 bilet 14-dniowy strefa 1, normalny     +WKM_TTID:29 bilet 30-dniowy imienny na 1 linie strefa 1, normalny     +WKM_TTID:2a bilet 30-dniowy imienny na wszystkie linie strefa 1, normalny     +WKM_TTID:2b bilet 30-dniowy imienny na wszystkie linie strefa 1, normalny     +WKM_TTID:2e bilet 90-dniowy imienny na wszystkie linie strefa 1, normalny     +WKM_TTID:2f bilet 90-dniowy imienny na wszystkie linie strefa 1, normalny     +WKM_TTID:34 bilet jednorazowy strefa 1, ulgowy 50     +WKM_TTID:48 bilet dobowy strefa 1, ulgowy 50     +WKM_TTID:4a bilet trzydniowy strefa 1, ulgowy 50     +WKM_TTID:53 bilet dobowy strefa 1, ulgowy 50     +WKM_TTID:54 bilet trzydniowy strefa 1, ulgowy 50     +WKM_TTID:55 bilet dobowy strefa 1, ulgowy 50     +WKM_TTID:56 bilet trzydniowy strefa 1, ulgowy 50     +WKM_TTID:57 bilet siedmiodniowy strefa 1, ulgowy 50     +WKM_TTID:59 bilet 14-dniowy strefa 1, ulgowy 50     +WKM_TTID:5b bilet 30-dniowy imienny na 1 linie strefa 1, ulgowy 50     +WKM_TTID:5c bilet 30-dniowy imienny na wszystkie linie strefa 1, ulgowy 50      +WKM_TTID:5d bilet 30-dniowy imienny na wszystkie linie strefa 1, ulgowy 50     +WKM_TTID:60 bilet 90-dniowy imienny na wszystkie linie strefa 1, ulgowy 50     +WKM_TTID:61 bilet 90-dniowy imienny na wszystkie linie strefa 1, ulgowy 50     +WKM_TTID:66 bilet jednorazowy strefa 1+2, normalny     +WKM_TTID:6f bilet 20 minutowy strefa 1+2, normalny     +WKM_TTID:70 bilet 40 minutowy strefa 1+2, normalny     +WKM_TTID:71 bilet 60 minutowy strefa 1+2, normalny     +WKM_TTID:7a bilet dobowy strefa 1+2, normalny     +WKM_TTID:7c bilet trzydniowy strefa 1+2, normalny     +WKM_TTID:85 bilet dobowy strefa 1+2, normalny     +WKM_TTID:86 bilet trzydniowy strefa 1+2, normalny     +WKM_TTID:87 bilet dobowy strefa 1+2, normalny     +WKM_TTID:88 bilet trzydniowy strefa 1+2, normalny     +WKM_TTID:89 bilet siedmiodniowy strefa 1+2, normalny     +WKM_TTID:8b bilet 14-dniowy strefa 1+2, normalny     +WKM_TTID:8d bilet 30-dniowy imienny na 1 linie strefa 1+2, normalny     +WKM_TTID:8e bilet 30-dniowy imienny na wszystkie linie strefa 1+2, normalny     +WKM_TTID:8f bilet 30-dniowy imienny na wszystkie linie strefa 1+2, normalny     +WKM_TTID:90 bilet 30-dniowy na okaziciela na wszystkie linie strefa 1+2, normalny     +WKM_TTID:91 bilet 30-dniowy na okaziciela na wszystkie linie strefa 1+2, normalny     +WKM_TTID:92 bilet 90-dniowy imienny na wszystkie linie strefa 1+2, normalny     +WKM_TTID:93 bilet 90-dniowy imienny na wszystkie linie strefa 1+2, normalny     +WKM_TTID:94 bilet 90-dniowy na okaziciela na wszystkie linie strefa 1+2, normalny     +WKM_TTID:95 bilet 90-dniowy na okaziciela na wszystkie linie strefa 1+2, normalny     +WKM_TTID:96 bilet seniora, waĹźny 365 dni na wszystkie linie strefa 1+2     +WKM_TTID:98 bilet jednorazowy strefa 1+2, ulgowy     +WKM_TTID:a1 bilet 20 minutowy strefa 1+2, ulgowy     +WKM_TTID:a2 bilet 40 minutowy strefa 1+2, ulgowy     +WKM_TTID:a3 bilet 60 minutowy strefa 1+2, ulgowy     +WKM_TTID:ac bilet dobowy strefa 1+2, ulgowy     +WKM_TTID:ae bilet trzydniowy strefa 1+2, ulgowy     +WKM_TTID:b7 bilet dobowy strefa 1+2, ulgowy     +WKM_TTID:b8 bilet trzydniowy strefa 1+2, ulgowy     +WKM_TTID:b9 bilet dobowy strefa 1+2, ulgowy     +WKM_TTID:ba bilet trzydniowy strefa 1+2, ulgowy     +WKM_TTID:bb bilet siedmiodniowy strefa 1+2, ulgowy     +WKM_TTID:bd bilet 14-dniowy strefa 1+2, ulgowy     +WKM_TTID:bf bilet 30-dniowy imienny na 1 linie strefa 1+2, ulgowy     +WKM_TTID:c0 bilet 30-dniowy imienny na wszystkie linie strefa 1+2, ulgowy     +WKM_TTID:c1 bilet 30-dniowy imienny na wszystkie linie strefa 1+2, ulgowy     +WKM_TTID:c2 bilet 30-dniowy na okaziciela na wszystkie linie strefa 1+2, ulgowy     +WKM_TTID:c3 bilet 30-dniowy na okaziciela na wszystkie linie strefa 1+2, ulgowy     +WKM_TTID:c4 bilet 90-dniowy imienny na wszystkie linie strefa 1+2, ulgowy     +WKM_TTID:c5 bilet 90-dniowy imienny na wszystkie linie strefa 1+2, ulgowy     +WKM_TTID:c6 bilet 90-dniowy na okaziciela na wszystkie linie strefa 1+2, ulgowy     +WKM_TTID:c7 bilet 90-dniowy na okaziciela na wszystkie linie strefa 1+2, ulgowy     +WKM_TTID:d2 ??? 210 bilet nieznany - pokazuje wersje kasownika bez blokowania (pracowniczy?) - waĹźny 3 lata od skasowania     +WKM_TTID:d3 "przepustka na stacje metra" (pasazerska/HDK/70+)     +WKM_TTID:d4 "przepustka na stacje metra" (pasazerska/HDK/70+)     +WKM_TTID:d6 "przepustka na stacje metra" (SOM/policja/obsluga techniczna), waĹźny rok od skasowania     +WKM_TTID:dd "ZTM pass - karta testowa", waĹźny rok od skasowania     +WKM_TTID:e7 bilet pracowniczy ZTM, waĹźny rok od skasowania     +WKM_TTID:e8 bilet pracowniczy MZA, waĹźny rok od skasowania     +WKM_TTID:e9 bilet pracowniczy TW, waĹźny rok od skasowania     +WKM_TTID:ea bilet pracowniczy MW, waĹźny rok od skasowania     +WKM_TTID:eb bilet pracowniczy SKM, waĹźny rok od skasowania     +WKM_TTID:ef bilet dzieci z rodzin wielodzietnych, waĹźny rok od skasowania     +WKM_TTID:f0 bilet osoby niepeĹnosprawnej, waĹźny rok od skasowania     +WKM_TTID:f5 ??? 245 bilet nieznany - "poza dozwolonym terminem uzycia"     +WKM_TTID:fa "precode" (nie rozpoznawany przez kasowniki)     +WKM_TTID:fe "navette" (karta kontrolerska)     +WKM_TTID:ff admin     +     +WKM_POS:01 POP ZTM     +WKM_POS:15 Mennica     +WKM_POS:2a ASEC     +     +WKM_LINE:81 WKD # prooved     +     +WKM_LINE:91 METRO LINIA 1 # prooved     +WKM_LINE:91x1 Kabaty # prooved     +WKM_LINE:91x2 Natolin # prooved     +WKM_LINE:91x3 Imielin # prooved     +WKM_LINE:91x4 Stoklosy # prooved     +WKM_LINE:91x5 Ursynow # prooved     +WKM_LINE:91x6 Sluzew # prooved     +WKM_LINE:91x7 Wilanowska # prooved     +WKM_LINE:91x8 Wierzbno # prooved     +WKM_LINE:91x9 Raclawicka # prooved     +WKM_LINE:91x10 Pole Mokotowskie # prooved     +WKM_LINE:91x11 Politechnika # prooved     +WKM_LINE:91x12 Centrum # prooved     +WKM_LINE:91x13 Swietokrzyska # prooved     +WKM_LINE:91x14 Ratusz Arsenal # prooved     +WKM_LINE:91x15 Dw. Gdanski # prooved     +WKM_LINE:91x16 Pl. Wilsona # prooved     +WKM_LINE:91x17 Marymont # prooved     +WKM_LINE:91x18 Slodowiec # prooved     +WKM_LINE:91x19 Stare Bielany # prooved     +WKM_LINE:91x20 Wawrzyszew # prooved     +WKM_LINE:91x21 Mlociny # prooved     +WKM_LINE:92 METRO LINIA 2 # guess     +     +WKM_LINE:1001 Z-1 # guess     +WKM_LINE:2901 Z-1 # prooved     +WKM_LINE:1005 Z-5 # prooved (wk)     +WKM_LINE:2905 Z-5 # prooved (wk)     +WKM_LINE:1009 Z-9 # prooved     +WKM_LINE:2909 Z-9 # guess     +WKM_LINE:1019 Z19 # guess     +WKM_LINE:2919 Z19 # guess     +WKM_LINE:1019 Z19 # guess     +WKM_LINE:2919 Z19 # guess     +     +WKM_LINE:3001 L-1 # guess     +WKM_LINE:3002 L-2 # guess     +WKM_LINE:3003 L-3 # guess     +WKM_LINE:3004 L-4 # guess     +WKM_LINE:3005 L-5 # guess     +WKM_LINE:3006 L-6 # guess     +WKM_LINE:3007 L-7 # prooved (wk)     +WKM_LINE:3008 L-8 # guess     +WKM_LINE:3009 L-9 # guess     +WKM_LINE:3010 L10 # guess     +WKM_LINE:3011 L11 # guess     +WKM_LINE:3013 L13 # guess     +WKM_LINE:3014 L14 # guess     +WKM_LINE:3015 L15 # guess     +WKM_LINE:3016 L16 # guess     +WKM_LINE:3017 L17 # guess     +WKM_LINE:3018 L18 # guess     +     +WKM_LINE:601 N01  # guess     +WKM_LINE:6001 N01 # guess     +WKM_LINE:602 N02  # guess     +WKM_LINE:6002 N02 # guess     +WKM_LINE:603 N03  # guess     +WKM_LINE:6003 N03 # guess     +WKM_LINE:611 N11  # guess     +WKM_LINE:6011 N11 # prooved     +WKM_LINE:612 N12  # guess     +WKM_LINE:6012 N12 # guess     +WKM_LINE:613 N13  # guess     +WKM_LINE:6013 N13 # prooved     +WKM_LINE:614 N14  # guess     +WKM_LINE:6014 N14 # guess     +WKM_LINE:622 N22  # guess     +WKM_LINE:6022 N22 # guess     +WKM_LINE:624 N24  # guess     +WKM_LINE:6024 N24 # prooved     +WKM_LINE:625 N25  # guess     +WKM_LINE:6025 N25 # prooved     +WKM_LINE:631 N31  # guess     +WKM_LINE:6031 N31 # prooved     +WKM_LINE:632 N32  # guess     +WKM_LINE:6032 N32 # prooved     +WKM_LINE:633 N33  # guess     +WKM_LINE:6033 N33 # prooved     +WKM_LINE:634 N34  # guess     +WKM_LINE:6034 N34 # prooved     +WKM_LINE:635 N35  # guess     +WKM_LINE:6035 N35 # prooved     +WKM_LINE:636 N36  # guess     +WKM_LINE:6036 N36 # prooved     +WKM_LINE:637 N37  # prooved     +WKM_LINE:6037 N37 # guess     +WKM_LINE:638 N38  # guess     +WKM_LINE:6038 N38 # guess     +WKM_LINE:641 N41  # guess     +WKM_LINE:6041 N41 # guess     +WKM_LINE:642 N42  # prooved     +WKM_LINE:6042 N42 # guess     +WKM_LINE:643 N43  # guess     +WKM_LINE:6043 N43 # prooved     +WKM_LINE:644 N44  # guess     +WKM_LINE:6044 N44 # prooved     +WKM_LINE:645 N45  # guess     +WKM_LINE:6045 N45 # guess     +WKM_LINE:646 N46  # prooved     +WKM_LINE:6046 N46 # guess     +WKM_LINE:650 N50  # guess     +WKM_LINE:6050 N50 # guess     +WKM_LINE:652 N52  # guess     +WKM_LINE:6052 N52 # guess     +WKM_LINE:653 N53  # guess     +WKM_LINE:6053 N53 # guess     +WKM_LINE:658 N58  # guess     +WKM_LINE:6058 N58 # guess     +WKM_LINE:661 N61  # guess     +WKM_LINE:6061 N61 # guess     +WKM_LINE:662 N62  # prooved     +WKM_LINE:6062 N62 # guess     +WKM_LINE:663 N63  # guess     +WKM_LINE:6063 N63 # guess     +WKM_LINE:664 N64  # guess     +WKM_LINE:6064 N64 # guess     +WKM_LINE:671 N71  # guess     +WKM_LINE:6071 N71 # prooved     +WKM_LINE:672 N72  # guess     +WKM_LINE:6072 N72 # prooved     +WKM_LINE:675 N75  # guess     +WKM_LINE:6075 N75 # guess     +WKM_LINE:681 N81  # guess     +WKM_LINE:6081 N81 # guess     +WKM_LINE:683 N83  # guess     +WKM_LINE:6083 N83 # guess     +WKM_LINE:685 N85  # guess     +WKM_LINE:6085 N85 # guess     +WKM_LINE:688 N88  # guess     +WKM_LINE:6088 N88 # guess     +WKM_LINE:691 N91  # guess     +WKM_LINE:6091 N91 # guess     +WKM_LINE:695 N95  # guess     +WKM_LINE:6095 N95 # guess     +     +WKM_LINE:9002 E-2 # prooved (wk)     +WKM_LINE:9004 E-4 # guess     +WKM_LINE:9006 E-6 # guess     +WKM_LINE:9008 E-8 # guess     +     +WKM_LINE:9101 S1 # prooved     +WKM_LINE:9102 S2 # guessed     +WKM_LINE:9109 S9 # guessed      So I belive patch code is ok as it contains + at line 434, so am I using wrong arguments? What is the reason I get this error code?


title: mc: edit skin color

text: I am trying to edit color skins for midnight commander. When using 256 color palette, the colors are called `color1` to `color255`. I am looking for particular tone of blue. Is there a palette of all 256 colors, where I can choose from? So that I can actually see that `color24` is dark blue, etc.


title: How to use specify version of ruby for shell script with rbenv?

text: I'm going to write some short script in ruby. And I want to specify ruby version by shebang or in another way. I'll use the script in many environments. I'm using rbenv in the evironments, but it's not sure which version of ruby is installed. The script must fail if the specify version of ruby is not installed. How can I do it? Is there good way that I should follow?


title: Do we need to enable G++ on RHEL 6.1

text: I have RHEL6.1 but I can't compile using `g++`, when I execute `g++`, I get the below :               -bash: g++: command not found      so I assume I don't have g++ but I do have gcc installed. When I run `gcc -v`. I get :               gcc -v     Using built-in specs.     Target: x86_64-redhat-linux     Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix       Please suggest. Do I need to install `g++` separately or is it already installed and I have to enable it from somewhere. EDIT : On running : yum install gcc-c++ I get the below output * * *               Loaded plugins: product-id, refresh-packagekit, subscription-manager     Updating Red Hat repositories.     Setting up Install Process     No package gcc-c++ available.     Error: Nothing to do


title: How to alias a command with '

text: I wanted to make an alias turn caps lock off:               python -c 'from ctypes import *; X11 = cdll.LoadLibrary("libX11.so.6"); display = X11.XOpenDisplay(None); X11.XkbLockModifiers(display, c_uint(0x0100), c_uint(2), c_uint(0)); X11.XCloseDisplay(display)'      I wrote this into my .zshrc:               alias caps='python -c 'from ctypes import *; X11 = cdll.LoadLibrary("libX11.so.6"); display = X11.XOpenDisplay(None); X11.XkbLockModifiers(display, c_uint(0x0100), c_uint(2), c_uint(0)); X11.XCloseDisplay(display)' '      But it seems that the problem is that I have `'` in the command (so it make an alias to a part of it). I tried to use:               alias caps=" python -c 'from ctypes import *; X11 = cdll.LoadLibrary("libX11.so.6"); display = X11.XOpenDisplay(None); X11.XkbLockModifiers(display, c_uint(0x0100), c_uint(2), c_uint(0)); X11.XCloseDisplay(display)' "      to see if something changed and I get python's sintax error. So how can I make an alias to a one-liner with `'` inside?


title: USB-ModeSwitch Problem [ Debian Wheezy ]

text: I'm trying to use a D-Link DWM-156 3G "dongle" on Debian Wheezy.I've tried to "UPGRADE" kernel from(3.2 to 3.12),But that's not effective and problem still exist.Now after reinstalling Debian(3.2 - 32bit) and install both of "USB- ModeSwitch" and "USB-ModeSwitch-Data" i get some error at OS boot up process (/var/log/syslog). Somthing like below :               Feb 22 15:21:23 localhost kernel: [  277.898148] usb 2-3: USB disconnect, device number 3     Feb 22 15:21:23 localhost kernel: [  277.898488] generic ttyUSB0: generic converter now disconnected from ttyUSB0     Feb 22 15:21:23 localhost kernel: [  277.898499] usbserial_generic 2-3:1.2: device disconnected     Feb 22 15:21:23 localhost kernel: [  277.898580] generic ttyUSB1: generic converter now disconnected from ttyUSB1     Feb 22 15:21:23 localhost kernel: [  277.898589] usbserial_generic 2-3:1.3: device disconnected     Feb 22 15:21:23 localhost kernel: [  277.898665] generic ttyUSB2: generic converter now disconnected from ttyUSB2     Feb 22 15:21:23 localhost kernel: [  277.898674] usbserial_generic 2-3:1.4: device disconnected     Feb 22 15:21:23 localhost kernel: [  277.898750] generic ttyUSB3: generic converter now disconnected from ttyUSB3     Feb 22 15:21:23 localhost kernel: [  277.898758] usbserial_generic 2-3:1.5: device disconnected     Feb 22 15:21:29 localhost kernel: [  283.860076] usb 2-3: new high-speed USB device number 5 using ehci_hcd     Feb 22 15:21:29 localhost kernel: [  283.996441] usb 2-3: New USB device found, idVendor=2001, idProduct=a706     Feb 22 15:21:29 localhost kernel: [  283.996451] usb 2-3: New USB device strings: Mfr=2, Product=3, SerialNumber=4     Feb 22 15:21:29 localhost kernel: [  283.996458] usb 2-3: Product: D-Link DWM-156     Feb 22 15:21:29 localhost kernel: [  283.996464] usb 2-3: Manufacturer: D-Link,Inc       Feb 22 15:21:29 localhost kernel: [  283.996469] usb 2-3: SerialNumber: 536591508069280     Feb 22 15:21:29 localhost kernel: [  283.997627] scsi7 : usb-storage 2-3:1.0     Feb 22 15:21:30 localhost kernel: [  284.997562] scsi 7:0:0:0: CD-ROM            HSPA USB SCSI CD-ROM      6225 PQ: 0 ANSI: 0 CCS     Feb 22 15:21:30 localhost kernel: [  285.001982] sr1: scsi3-mmc drive: 0x/0x caddy     Feb 22 15:21:30 localhost kernel: [  285.002952] sr 7:0:0:0: Attached scsi CD-ROM sr1     Feb 22 15:21:30 localhost kernel: [  285.003390] sr 7:0:0:0: Attached scsi generic sg2 type 5     Feb 22 15:21:30 localhost kernel: [  285.100863] usb 2-3: USB disconnect, device number 5     Feb 22 15:21:31 localhost kernel: [  285.888332] usb 2-3: new high-speed USB device number 6 using ehci_hcd     Feb 22 15:21:31 localhost kernel: [  286.024830] usb 2-3: New USB device found, idVendor=2001, idProduct=7d01     Feb 22 15:21:31 localhost kernel: [  286.024840] usb 2-3: New USB device strings: Mfr=9, Product=10, SerialNumber=0     Feb 22 15:21:31 localhost kernel: [  286.024847] usb 2-3: Product: D-Link DWM-156     Feb 22 15:21:31 localhost kernel: [  286.024852] usb 2-3: Manufacturer: D-Link,Inc       Feb 22 15:21:31 localhost kernel: [  286.026571] usbserial_generic 2-3:1.0: Generic device with no bulk out, not allowed.     Feb 22 15:21:31 localhost kernel: [  286.026590] usbserial_generic: probe of 2-3:1.0 failed with error -5     Feb 22 15:21:31 localhost kernel: [  286.027307] usbserial_generic 2-3:1.1: Generic device with no bulk out, not allowed.     Feb 22 15:21:31 localhost kernel: [  286.027324] usbserial_generic: probe of 2-3:1.1 failed with error -5     Feb 22 15:21:31 localhost kernel: [  286.027927] usbserial_generic 2-3:1.2: generic converter detected     Feb 22 15:21:31 localhost kernel: [  286.028350] usb 2-3: generic converter now attached to ttyUSB0     Feb 22 15:21:31 localhost kernel: [  286.029031] usbserial_generic 2-3:1.3: generic converter detected     Feb 22 15:21:31 localhost kernel: [  286.029181] usb 2-3: generic converter now attached to ttyUSB1     Feb 22 15:21:31 localhost kernel: [  286.029909] usbserial_generic 2-3:1.4: generic converter detected     Feb 22 15:21:31 localhost kernel: [  286.030082] usb 2-3: generic converter now attached to ttyUSB2     Feb 22 15:21:31 localhost kernel: [  286.030777] usbserial_generic 2-3:1.5: generic converter detected     Feb 22 15:21:31 localhost kernel: [  286.030989] usb 2-3: generic converter now attached to ttyUSB3     Feb 22 15:21:31 localhost kernel: [  286.031819] scsi8 : usb-storage 2-3:1.6     Feb 22 15:21:31 localhost udevd[4057]: failed to execute '/lib/udev/usb_modeswitch' 'usb_modeswitch --symlink-name /devices/pci0000:00/0000:00:1d.7/usb2/2-3/2-3:1.4/ttyUSB2/tty/ttyUSB2 2001 7d01 ': No such file or directory     Feb 22 15:21:31 localhost udevd[4060]: failed to execute '/lib/udev/usb_modeswitch' 'usb_modeswitch --symlink-name /devices/pci0000:00/0000:00:1d.7/usb2/2-3/2-3:1.3/ttyUSB1/tty/ttyUSB1 2001 7d01 ': No such file or directory     Feb 22 15:21:31 localhost udevd[4062]: failed to execute '/lib/udev/usb_modeswitch' 'usb_modeswitch --symlink-name /devices/pci0000:00/0000:00:1d.7/usb2/2-3/2-3:1.5/ttyUSB3/tty/ttyUSB3 2001 7d01 ': No such file or directory     Feb 22 15:21:32 localhost kernel: [  287.030231] scsi 8:0:0:0: Direct-Access     HSPA USB SCSI CD-ROM      6225 PQ: 0 ANSI: 0 CCS     Feb 22 15:21:32 localhost kernel: [  287.032846] sd 8:0:0:0: Attached scsi generic sg2 type 0     Feb 22 15:21:32 localhost kernel: [  287.036759] sd 8:0:0:0: [sdb] Attached SCSI removable disk     Feb 22 15:21:50 localhost udevd[4196]: failed to execute '/lib/udev/usb_modeswitch' 'usb_modeswitch --symlink-name /devices/pci0000:00/0000:00:1d.7/usb2/2-3/2-3:1.2/ttyUSB0/tty/ttyUSB0 2001 7d01 ': No such file or directory      Vendor and Product ID 's in `lsusb` output :               Bus 002 Device 006: ID 2001:7d01 D-Link Corp.      NOTICE : OS detected modem as `cdrom1` I'm confused :-? Could anybody help Regards,


title: What does it mean to install a kernel?

text: What does it mean to install a new version of the kernel. My Linux box gave me this message when I was updating, `NOTE, 3.8.13 was the last maintained maintenance release by Greg Kroah- Hartman. It is recommend to move on to linux310-series.` What I want to know is,   * Is it really that simple to only change the Linux kernel?   * Is the Linux kernel like a simple executable file that can be swapped out for another Linux kernel?   * What happens if I install a new kernel while the box is already running another version of the kernel?   * Right now I'm using Kernel 3.8.13.8-1. Is it really okay to move to the linux310-series as the above update message says?


title: What utilities do I need to begin android development on Ubuntu?

text: I already would work by some Cortex-A boards(for instance Cubieboard, Marsboard,...) I've already started working with integrated circuits:   * Cubieboard   * Marsboard I've been directed to learn linux, but this poses a problem. I don't have enough experience with it - like the changes between distributions. In my case, I'd like to use Android and Ubuntu - but I don't want to scope my knowledge to just Cortex-A boards. Recently I've been turned on to rawbrawb in this question that I can use Android for modules. To sum it up:   1. What toolchain(s) will I **need** to work with Android on Ubuntu?   2. Is the following package suitable for android experimentation? Free Download Android OS 4.1.1 Jelly Bean


title: How could I use Bash to find 2 bytes in a binary file, increase their values, and replace?

text: I'm trying to find two bytes inside binary file, then increase value of those two bytes and replace them inside file. Those two bytes are on positions 0x82-0x83. For now on I have successfully extracted those two bytes using this:               #!/usr/bin/env bash     BYTES=$(tail -c +131 "$1" | head -c 2)      Those bytes have value: `1B 1F`. I'm stuck with:   1. How to convert bytes to integer? It should be `6943` decimal.   2. How to append / echo binary data to file   3. How to write increased bytes inside file on positions 0x82-0x83. I could use `head -c 130 original.bin >> new_file.bin && magic_command_writing_bytes_to_file >> new_file.bin && tail -c +133 original.bin`, but there must be better way. I could do that in PHP, it should be easier, but I'm interested how to do this in bash.


title: when awake from hibernate, will the VIRT column of top command show the swap space used by process?

text: top - 10:43:31 up 8 days,  1:28,  4 users,  load average: 0.72, 0.57, 0.44     Tasks: 180 total,   1 running, 177 sleeping,   0 stopped,   2 zombie     %Cpu(s):  8.9 us,  2.1 sy,  0.0 ni, 88.9 id,  0.0 wa,  0.0 hi,  0.2 si,  0.0 st     KiB Mem:   8078124 total,  3815444 used,  4262680 free,   108300 buffers     KiB Swap:  9437180 total,  2448032 used,  6989148 free,   446248 cached          PID  USER      PR  NI  VIRT SWAP  RES CODE DATA  SHR S  %CPU %MEM    TIME+  COMMAND                           3274 root      20   0  160m 4392 6808 2400  80m 1684 S  13.2  0.1 245:09.29 wicd                              3451 root      20   0 79684 4900 2328 2400 6124  764 S   7.9  0.0 150:21.43 wicd-monitor                      2804 messageb  20   0 30200  232  856  392  756  408 S   6.6  0.0 128:20.46 dbus-daemon                       3856 cifer     20   0  411m 7524  28m 2400 150m 5904 S   1.3  0.4  20:34.23 wicd-client                       4226 cifer     20   0 1499m 197m  52m  86m 1.0g 6504 S   1.3  0.7 227:24.62 chromium        1087 cifer     20   0 1556m 458m 166m  86m 1.2g 9980 D   2.3  2.1   4:27.35 chromium       as you can see, I have 8G physical memory and just used 3.8G, I am sure I have never exceeded the 8G spaces, so, I think the 2.4G swap spaces used is just because of hibernating now, in top command, the VIRT and SWAP column shows that every process has used the swap space, I have add all the processes SWAP column, it seems a little smaller than 2.4G. Am I right? Is the swap using caused by hibernating? I have another question that the two chromium processes 's VIRT DATA columns look so high, is this possible?


title: why doesn't 0 0 * * 1 root hostname >> /tmp/hostname.txt work as a crontab?

text: 0 0 * * 1 root hostname >> /tmp/hostname.txt      The above cron entry should run midnight on monday and create a file in `/tmp` called `hostname.txt` with the output of the `hostname` command. But it is just a blank file that is created. Why?


title: Advantage of symlinks over Windows style shortcuts

text: When I mainly used Windows, to make a shortcut, I could use a regular file detailing where it linked to, with the extension .lnk or .url Now, on Linux, I mainly use symbolic links, which are a filesystem-specific feature. Linux doesn't seem to have much support for file-based shortcuts, and Windows doesn't seem to have much support for symlinks. I can see the advantage to using file based shortcuts (Can be used on any file system). My question is, Why does linux use symlinks over file-based shortcuts, and on linux, how can I create shortcuts on file systems which don't support symlinks (eg FAT32)?


title: exit code of grep in trap where the script is launched by upstart service

text: recently I encountered a problem in ubuntu upstart and trap in bash shell. I use ubuntu 12.04 the upstart script(/etc/init/player.conf) is:               start on (local-filesystems and runlevel [2345])     stop on runlevel [06]          script         /tmp/test.sh     end script      the /tmp/test.sh is:               #!/bin/bash          TOKEN="token"     TOKEN_FILE="/tmp/token"     OUTPUT_FILE="/tmp/test_exit"     func()     {         grep "$TOKEN" "$TOKEN_FILE"; echo $? >> "$OUTPUT_FILE"; exit 0     }          trap 'trap "" INT TERM QUIT EXIT; func' INT TERM QUIT EXIT          rm -f "$OUTPUT_FILE"     echo "$TOKEN" > "$TOKEN_FILE"          grep "$TOKEN" "$TOKEN_FILE"; echo $? >> "$OUTPUT_FILE";          sleep 1000          exit 0      the test procedure is:               $sudo service player start     $sudo service player stop     $cat /tmp/test_exit     0     2      my question is, why the second result is 2, since the file(/tmp/token) is not changed, the grep should find the string("token") in that file("/tmp/token").


title: ISC DHCP Server - A Client's Uplink Is Not Working

text: Running a DHCP server, client(s) does not have up-link (0Mbps) and has a downlink (50Mbps.) I am setting up a gateway/router on a PC running Debian Wheezy with ISC-DHCP. I have 1 WAN (eth0) and 2 LAN (eth1, eth2) interfaces connected. Do I need an IP table rule to allow upload packets on eth1/eth2 to go out of eth0 to the Internet? The problem is that users cannot submit web forms or uploading data to websites. Below is interfaces and iptables outut:               cat /etc/network/interfaces          # This file describes the network interfaces available on your system# and how to activate them. For more information, see interfaces(5).          # The loopback network interface     auto lo     iface lo inet loopback          # The primary network interface     auto eth0     #iface eth0 inet6 auto     iface eth0 inet static             address 173.xxx.xxx.145             netmask 255.255.255.252             gateway 173.xxx.xxx.146          auto eth1     iface eth1 inet static             address 192.168.2.10             network 192.168.2.0             netmask 255.255.255.0          auto eth2     iface eth2 inet static             address 192.168.22.10             network 192.168.22.0             netmask 255.255.255.0                    iptables-save     # Generated by iptables-save v1.4.14 on Tue Jul 15 08:33:07 2014     *mangle     :PREROUTING ACCEPT [5430:3921752]     :INPUT ACCEPT [362:33625]     :FORWARD ACCEPT [5047:3846737]     :OUTPUT ACCEPT [187:27214]     :POSTROUTING ACCEPT [5234:3873951]     COMMIT     # Completed on Tue Jul 15 08:33:07 2014     # Generated by iptables-save v1.4.14 on Tue Jul 15 08:33:07 2014     *filter     :INPUT ACCEPT [285:25527]     :FORWARD ACCEPT [123:23976]     :OUTPUT ACCEPT [165:24524]     -A FORWARD -i eth0 -o eth1 -m state --state RELATED,ESTABLISHED -j ACCEPT     -A FORWARD -i eth0 -o eth1 -j REJECT --reject-with icmp-port-unreachable     -A FORWARD -i eth1 -o eth0 -j ACCEPT     -A FORWARD -i eth0 -o eth2 -m state --state RELATED,ESTABLISHED -j ACCEPT     -A FORWARD -i eth0 -o eth2 -j REJECT --reject-with icmp-port-unreachable     -A FORWARD -i eth2 -o eth0 -j ACCEPT     COMMIT     # Completed on Tue Jul 15 08:33:07 2014     # Generated by iptables-save v1.4.14 on Tue Jul 15 08:33:07 2014     *nat     :PREROUTING ACCEPT [227:16114]     :INPUT ACCEPT [68:5796]     :OUTPUT ACCEPT [2:668]     :POSTROUTING ACCEPT [2:668]     -A POSTROUTING -s 192.168.2.0/24 ! -d 192.168.2.0/24 -j MASQUERADE     -A POSTROUTING -s 192.168.22.0/24 ! -d 192.168.22.0/24 -j MASQUERADE     -A POSTROUTING -s 192.168.50.0/24 -o eth0 -j MASQUERADE     -A POSTROUTING -o eth0 -j MASQUERADE     COMMIT     # Completed on Tue Jul 15 08:33:07 2014


title: What network protocols do database servers use?

text: I have a postgres 9.1 server running on the default port 5432 on an ubuntu 12.04 cloud server. I want to open up the port so I can make remote queries -- but I have to open the port on IP tables, which requires that I specify a protocol. This doc does not mention tcp/udp etc. What protocol should I permit in IP tables?


title: Disk is almost full on a server with CPanel

text: I have VHM system and I have a domain and two subdomain on this system. I tried to take a backup than after sometime I cannot access cpanel but I can access VHM. but some of the VHM options gives disk space error. which is: > The filesystem mounted at / on this server is running out of disk space. > cPanel operations have been temporarily suspended to prevent something bad > from happening. Please ask your system admin to remove any files not in use > on that partition. On VHM the disk information as follow: Disk information               Device  Mount point Usage        /dev/mapper/VolGroup00-home   /home   30% (126,759,988 of 458,391,760)     /dev/mapper/VolGroup00-root   /       100% (19,593,632 of 20,642,428)        /usr/tmpDSK                   /tmp    3% (10,601 of 495,844)


title: How to install dig on CentOS 6?

text: I can't find the dig command on my new CentOS 6 installation. I've tried `yum install dig` but it say it cannot find the package. How do I install dig on CentOS 6?


title: Alternative to /etc/init.d/boot.localnet in opensuse

text: Script /etc/init.d/boot.localnet used to read the hostname value from /etc/hostname file during the boot time and set the hostname variable. Now I see in SUSE linux 12 beta and recent version of opensuse that this file is no longer present. So is there an alternative for this file? My usecase is a script to configure hostname. It used to set hostname value in /etc/hostname and run /etc/init.d/boot.localnet


title: Linux Kernel Compile-time options for Seagate IDE drive

text: I am configuring linux kernel 3.12.14 obtained from linux.org for compiling using 'make gconfig'. My question is what options exactly I need to enable to make it work for my Seagate IDE HDD? I am compiling it for my other PC that has this HDD (not on which I am performing compilation).


title: Get user login name and address on bad login attempt [Dovecot]

text: **Background**   I am trying to develop a method to ban users who exhibit strange behavior when logging into Dovecot by obtaining their POP-ID/login name and IP address. I want to send that information to a separate program/process that is responsible for banning the users. The caveat is this has to be possible through Dovecot (not looking at system logs or other programs, but a program or process that Dovecot spawns on a bad login attempt). **Question**   How do you get the POP-ID/login name and IP address of a user when their authentication fails?


title: Disabling graphical login in Debian wheezy

text: I have installed Debian wheezy on my machine with a netinst image, now I would like to deactivate the desktop and boot straight to the command line, not only that but I would like to not waste any resource on the X11/gnome/gdm at all if not needed. I tried ( as root )               update-rc.d -f gdm remove     update-rc.d -f gdm3 remove     update-rc.d -f wdm remove      but Debian keeps booting into the login manager, I really don't need that, how I can deactivate this kind of boot and start X only when needed ?


title: Not able to copy multiple files using rsync 3.0.9 version?

text: I am trying to copy two files using rsync from a `machineB` but somehow it always copies only one file but not the second file - Here is the syntax I am using -               rsync -avz david@machineB:'/data/pe_t1_snapshot/20140317/t1_weekly_1680_0_200003_5.data :/data/pe_t1_snapshot/20140317/t1_weekly_1680_1_200003_5.data' /data01/primary      It only copies this file `t1_weekly_1680_0_200003_5.data` into `/data01/primary` folder and it didn't copied second file which is `t1_weekly_1680_1_200003_5.data`. I am using Ubuntu 12.04 and rsync version is -               rsync  version 3.0.9  protocol version 30      This is the error I am getting -               receiving incremental file list     rsync: change_dir "/home/david/:/data/pe_t1_snapshot/20140317" failed: No such file or directory (2)     t1_weekly_1680_0_200003_5.data          sent 30 bytes  received 504982813 bytes  6196108.50 bytes/sec     total size is 1761988281  speedup is 3.49     rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1536) [generator=3.0.9]      I started reading the rsync manual but somehow I am not able to understand what wrong I am doing? **Update:-** It works fine on a single command if I run it from the console but I need to run that from the shell script so I added your suggestion in my shell script. I just ran your suggestion on my below example and I got an error. Below is the shell script which simply tries to copy file from `machineB`, if the files are not there in `machineB` then it should be there in `machineC` so it will try to copy from `machineC`. `PRIMARY_PARTITION` and `SECONDARY_PARTITION` will have file numbers. And below shell script I am running on `machineA`.               #!/usr/bin/env bash          readonly PRIMARY=/data01/primary     readonly FILERS_LOCATION=(machineB machineC)     readonly MEMORY_MAPPED_LOCATION=/bexbat/data/be_t1_snapshot     PRIMARY_PARTITION=(0 548)     SECONDARY_PARTITION=(1101 1374)          dir1=$(ssh -o "StrictHostKeyChecking no" david@${FILERS_LOCATION[0]} \       ls -dt1 "$MEMORY_MAPPED_LOCATION"/[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9] |        head -n1)     dir2=$(ssh -o "StrictHostKeyChecking no" david@${FILERS_LOCATION[1]} \       ls -dt1 "$MEMORY_MAPPED_LOCATION"/[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9] |       head -n1)          echo $dir1     echo $dir2          ## Build your list of filenames before the loop.      for n in "${PRIMARY_PARTITION[@]}"     do         primary_files="$primary_files :$dir1"/t1_weekly_1680_"$n"_200003_5.data     done          ## Repeat for $SECONDARY_PARTITION     for n in "${SECONDARY_PARTITION[@]}"     do         secondary_files="$secondary_files :$dir2"/t1_weekly_1680_"$n"_200003_5.data     done          echo "Primary: " $primary_files     echo "Secondary: " $secondary_files               if [ "$dir1" = "$dir2" ]     then         find "$PRIMARY" -mindepth 1 -delete              # this line is giving an exception somehow         rsync -avz david@${FILERS_LOCATION[0]}${primary_files} $PRIMARY/         rsync -avz david@${FILERS_LOCATION[1]}${primary_files} $PRIMARY/          fi      Below is the error I got -               Unexpected remote arg: :/data/pe_t1_snapshot/20140320/t1_weekly_1680_0_200003_5.data     rsync error: syntax or usage error (code 1) at main.c(1232) [sender=3.0.9]     Unexpected remote arg: :/data/pe_t1_snapshot/20140320/t1_weekly_1680_0_200003_5.data     rsync error: syntax or usage error (code 1) at main.c(1232) [sender=3.0.9]     Unexpected remote arg: :/data/pe_t1_snapshot/20140320/t1_weekly_1680_1101_200003_5.data     rsync error: syntax or usage error (code 1) at main.c(1232) [sender=3.0.9]     Unexpected remote arg: :/data/pe_t1_snapshot/20140320/t1_weekly_1680_1101_200003_5.data     rsync error: syntax or usage error (code 1) at main.c(1232) [sender=3.0.9]


title: Failing to apply tc filter

text: I've run the example at ifb both con Centos and on Fedora               tc filter add dev eth0 parent 1: protocol ip prio 10 u32  match ip src 192.168.200.200/32 flowid 1:2  action police rate 10kbit burst 90k drop  action mirred egress mirror dev ifb0      Illegal "action"     bad action parsing     parse_action: bad value (12:police)!     Illegal "action"      Is it about a known bug? Any ideas?


title: Unable to run yum update on virtualized centOS 6.3

text: I am running a virtualized CentOS 6.3 on a Windows 7 computer. The computer (4 GB RAM) is connected to a corporate network. When I run yum update, it shows some progress, then eventually the VM (2 GB RAM) freezes, this has happened nearly 5 times now. I've also tried updating using the graphic package manager, same thing happens, any ideas why this is happening?


title: glTail and Bind9 logs

text: My bind9 server logs queries to syslog and it produces lines like this in /var/log/syslog               Aug 23 17:25:41 serverdns named[1690]: client 10.10.10.20#35495: query: 52.122.168.109.blackholes.easynet.nl IN A + (10.10.10.1)      How can I configure the named.rb parser of glTail to parse such lines? Do I have to change my Bind9 logging configuration? Can you give me an example?


title: One host, two virtual machines that cannot ping each other. How to solve

text: We have Virtual Machines operating within the `KVM` environment. We setup one as a dev server running `Apache` etc., and the other as a `Windows` development environment. The two environments are setup and running fine. However, they cannot ping each other. I am wondering if there is a clear solution to this. This is what is happening. From Host:                 Cannot ping either of 2 VM's (one `Linux`, one `Windows`)      From Either of the VM's:                 Cannot ping host       Cannot ping each other      From other network machines (for instance my laptop from within my company network)                 Successfully ping host at 192.168.0.64       Successfully ping VM1 (Linux) 192.168.0.43       Successfully ping VM2 (Windows) 192.168.0.84


title: Why does getfacl remove the leading / from absolute pathnames?

text: I'm in the midst of learning about ACL's for Centos/Red Hat 6 and when I run `getfacl` using an absolute path I of course get among the output:   `getfacl: Removing leading '/' from absolute path names` Why does it need to do this? In what situations would you need to use the -p or --absolute-names switch? My books by Wale Soyinka and Michael Jang don't even make a passing mention of this, i'm not seeing any clues in the man page, and I can't seem to find any sites that directly address this warning.


title: Is it possible to add CP-1252 support to CentOS?

text: We have a CentOS backend running server software that is processing files generated by our clients. Many of our clients are Windows users, and generate these files on their Windows machines in the CP-1252 (aka "Win-1252") character encoding. Occasionally, when processing these files, we get one that has a CP-1252 character in the file name, and this causing our server code to choke (and throw runtime exceptions). We could implement a code solution where we read files (and their names) in as pure binary and then apply the correct character encoding to them, however if there is an easier (systems-level) fix that doesn't involve coding effort and a new release, that would be optimal. So I ask: is it possible to add CP-1252 support for CentOS machines? Thanks in advance!


title: How to use history commands with readonly PROMPT_COMMAND?

text: I'm sometimes logged in on a host which I do not control and where `PROMPT_COMMAND` is `readonly`. Is there some way to **work around this to run`history` commands anyway**, for example using `PS1`? I've tried `PS1='$(history -a; history -c; history -r; echo finished)'` - It prints `finished` at each prompt, but it doesn't seem to work:   1. Open two terminals A and B on the same host.   2. In terminal A, run a command `a`.   3. In terminal B, run a command `b`.   4. It terminal B, press `↑` twice. On a host where `PROMPT_COMMAND='history -a; history -c; history -r;'`, this will result in terminal B showing `a`. On a host where `PS1` starts with `$(history -a; history -c; history -r; echo finished)` it will instead show whichever command was run before both terminals were opened. The obvious reason is that **the command in`PS1` is run in a subshell.** Another alternative is to bypass the global RC-file altogether:               bash --rcfile ~/.bashrc      However, circumventing the use of the standard value of `PROMPT_COMMAND` will very likely _not be accepted by the sysadmin_ for policy reasons.


title: New files getting wrong permissions from setacl

text: I'm trying to create a file from windows on a mapped samba share, but after creating the file, I'm unable to edit it. For some reason the mask is changing to rw- even though my default is set to rwx. umask is 0022, but I think the ACL overrides the umask. Is something wrong with the permissions of the folder? I want bob and admins to have rwx to files.               [root@server02 folder]# getfacl .     # file: .     # owner: nobody     # group: admins     # flags: -s-     user::rwx     user:bob:rwx     group::---     group:admins:rwx     mask::rwx     other::rwx     default:user::rwx     default:user:bob:rwx     default:group::---     default:group:admins:rwx     default:mask::rwx     default:other::rwx          [root@server02 folder]# getfacl test     # file: test     # owner: bob     # group: admins     user::rwx     user:bob:rwx               #effective:rw-     group::---     group:admins:rwx      #effective:rw-     mask::rw-     other::---


title: headphone/Microphone is not workingLinux mint 15

text: I was using windows and my headphone and speaker was working fine there. Recently I moved to linux mint and having problem to get sound on headphone. Speaker still working fine. I have tried several online solution nothing work for me. When I connect on front panel I can hear sound on my header but my microphone is not working that time. I can't use skype. For that also I have tried few solutions. I was unable to use my microphone. So I switched to rear panel again. Because on windows I used rear panel. Here is my output for this command : `lspci -v | grep -A7 -i "audio" ` Output:               00:1b.0 Audio device: Intel Corporation 5 Series/3400 Series Chipset High Definition Audio (rev 06)         Subsystem: Gigabyte Technology Co., Ltd Device a102         Flags: bus master, fast devsel, latency 0, IRQ 50         Memory at fbff4000 (64-bit, non-prefetchable) [size=16K]         Capabilities: <access denied>         Kernel driver in use: snd_hda_intel        00:1c.0 PCI bridge: Intel Corporation 5 Series/3400 Series Chipset PCI Express Root Port 1 (rev 06) (prog-if 00 [Normal decode])      and command `aplay -l`: Output:               **** List of PLAYBACK Hardware Devices ****     card 0: MID [HDA Intel MID], device 0: ALC889 Analog [ALC889 Analog]       Subdevices: 1/1       Subdevice #0: subdevice #0     card 0: MID [HDA Intel MID], device 1: ALC889 Digital [ALC889 Digital]       Subdevices: 1/1       Subdevice #0: subdevice #0     card 0: MID [HDA Intel MID], device 3: HDMI 0 [HDMI 0]       Subdevices: 1/1       Subdevice #0: subdevice #0     card 0: MID [HDA Intel MID], device 7: HDMI 1 [HDMI 1]       Subdevices: 1/1       Subdevice #0: subdevice #0      I have also checked `alsamixer`: ![alsamixer capture output](http://i.stack.imgur.com/qUt0n.png) any can give any solutions?


title: What is SSTP vpn server and how can I run one?

text: I've read a couple of L2TP and PPTP tutorials on the net and there are just dozens of "running PPTP/L2TP on Linux" guides available out there and I successfully made packages like open-swan or pptpd to work. Now, I've heard that SSTP protocol is also available for creating a VPN. My questions are:   1. What is this protocol? Is it really safer than L2TP?   2. Is it a Windows-specific protocol? (There are no guides available on Google for running such VPN servers on Linux. - as far as I searched)   3. **And the most important question:** how can I run such server on my Cent-OS box? By SSTP I don't mean packages like Open-VPN, I mean the same thing that windows can connect to it without any further clients. just like PPTP and L2TP. Any resource for my reading would be also really appreciated. Thanks in advance.


title: Squeeze/Lenny compilation : Library Link error

text: I've got a problem here : I have a C++ Library ("DataTsBroad") and a C++ Test app ("DataTsBroadTest"), to test it.   Actually, the Lib and the Test app are both compiled an a Debian Lenny. Now, i want to continue to compile my Test app on a Debian Lenny (customer constraint), but I would compile my lib on a Squeeze or a Wheezy to work on the last Debian releases. So, I successfully compiled my Lib on a Squeeze, But, after, when I try to compile my Test app with this Lib on the Lenny, it fails! There is a Link Error: > > Linking CXX executable DataTsBroadTest > /home/nis/pezierg/test/ProductMak/Export/DataTsBroad/L64/Release/libDataTsBroad64.so: > **undefined reference to `std::ctype::_M_widen_init() > const@GLIBCXX_3.4.11'**   >  collect2: ld returned 1 exit status   >  make[2]: *** [DataTsBroadTest] Error 1   >  make[1]: *** [CMakeFiles/DataTsBroadTest.dir/all] Error 2   >  make: _*_ [all] Error 2 The problem is certainly due to **ostream** C++ Lib, I tried to comment all it's uses in my Lib and it works. But how can I really fix the problem?


title: How to fill 90% of the free memory?

text: I want to do some low-resources testing and for that I need to have 90% of the free memory full. How can I do this on a `*nix` system?


title: how does ping zero works?

text: can anybody explain how does `ping 0` works and it translate to `127.0.0.1`.               [champu@testsrv ]$ ping 0     PING 0 (127.0.0.1) 56(84) bytes of data.     64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.039 ms     64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.013 ms          --- 0 ping statistics ---     2 packets transmitted, 2 received, 0% packet loss, time 1000ms     rtt min/avg/max/mdev = 0.013/0.026/0.039/0.013 ms


title: Synchronization of Multiple computers for Ubuntu sing Puppet

text: I have 100 computers in our organization. So when I Install e.g "Apache2"(Ubuntu) on single computer manually it will reflect that installation on all remaining 99 computers.For that I am using Puppet on Ubuntu.So what exactly I have to do for that on Ubuntu.


title: New bash prompt causing issues

text: I changed my bash prompt to this:               PS1="\[\033[1;31m[\[\033[1;33m\$(date +%H:%M)\[\033[1;31m] \u:\[\033[1;32m\W\[\033[1;37m\$\[\033[0m\] "      Sorry for the long line, it is mostly due to colors. Basically when I hit the up arrow to go back in Bash history the prompt disappears and everything screws up. It is similar to this question but I don't know if a `\\[` is missing and where.


title: vim: use string from search in replace command

text: I often use vim `/` search command to verify my regular expressions (just to see what it matches). After that i usually use the `:%s` replace command, where i use that regexp from search as a string to be replaced, e.g. i first look for such string:               /TP-\(\d\{5\}\)-DD-\d\{3\}      It matches exactly what i want, so i do my replace:               :%s/TP-\(\d\{5\}\)-DD-\d\{3\}/\1/g      But i have to write again entire regexp here. Usually that regexp is much longer, that's why I'm looking for solution: Is there any existing shortcut or vim script for pasting that search pattern directly into replace command? P.S. I use vim in terminal (no gvim).


title: What does a "[1]+ Exit 1" response mean?

text: I ran this command to try and get my python program to run in the background and let me exit the SSH connection I am using:               nohup python files.py >> files.log &      I then check `ps` to check it worked               $ ps a       PID TTY      STAT   TIME COMMAND     13059 pts/0    Ss     0:00 -bash     13327 pts/0    R+     0:00 ps a     [1]+  Exit 1                  nohup python files.py >> files.log      What does this `[1]+ Exit 1` mean? And how can I run my program in the background letting me exit correctly?


title: get result text from CLI command

text: I'm writing a bash script and I need to capture the text resulting from the output of the `rsync` command, for instance, the following command:               rsync -av "$FOLDER1" "$FOLDER2"      prints:               ...     sent 109,423 bytes  received 352 bytes  219,550.00 bytes/sec     ...      and I want to capture that line (`sent 109,423 bytes received 352 bytes 219,550.00 bytes/sec`) and put that string in a variable in my script. How can I do that?


title: Which format to use in USB BOOTABLE linux? NTFS or FAT32

text: While formatting USB for making it a BOOTABLE USB for installing LINUX. Which format will be better for my 8gb Pendrive. NTFS or FAT32? Edit: Using LIVE LINUX USB creator


title: Why is $* not working as expected?

text: I'm trying to use $* in a function to expand to all commandline arguments in a function, but it's giving me bizarre behavior:               $ function repeat() {     echo "$*"     }          $ repeat puts hello    # this gives me nothing at all     $ repeat "puts hello"  # this asks me for more input     repeat>      Why would it do that?


title: Where is the setting for sending email to a system user with ssmtp?

text: I'm using `ssmtp` for sending email (the setting is below) Now when i run a `cron` command or an `at` command, mail is sent to               michel@mypi      which is `username @ machinename` Now ofcourse this is not a valid email address, so i get errors in my gmail saying: `can't send email to michel@mypi` How and where should i say that email to the user 'michel' should go to a particular email address? The setting for ssmtp:               #     # Config file for sSMTP sendmail     #     # The person who gets all mail for userids < 1000 # Make this empty to disable rewriting.     root=MYNAME@gmail.com          # The place where the mail goes. The actual machine name is required no      # MX records are consulted. Commonly mailhosts are named mail.domain.com     mailhub=smtp.gmail.com:465          # Where will the mail seem to come from?     #rewriteDomain=gmail.com          # The full hostname     hostname=MyPi          # Are users allowed to set their own From: address?     # YES - Allow the user to specify their own From: address      # NO - Use the system generated From: address      #FromLineOverride=YES      AuthUser=MYNAME     AuthPass=MYPASS     FromLineOverride=YES     UseTLS=YES


title: Wget rename .listing

text: I'm running multiple instances of `wget` from the same directory (and connected to the same ftp). `wget` stores the locations of files on the server in a `.listing` file. I've noticed that many of my files are not downloading and i think what's happening is that `.listing` is being overwritten. Is there a way to change wget to store its file locations into a different file (say `.listing1` ?) ps. There is a `\--no-remove-listing option` (which doesn't delete the file). However i would rather the file was deleted and I reckon this would cause other problems.


title: Partition offset at 63 or 64?

text: I did not wish to use the entire SSD for OpenBSD 5.5. (The SSD is new and pre- formatted with MSDOS using Gparted) During installation and at the fdisk stage, I chose Partition #: 0 to install OpenBSD (I changed the Partition ID to a6). I plan to install other Unix-like OS in Partition #: 1 or 2. When prompted for partition offset (the default is 0), I entered 64 instead of 63 (I read somewhere on the internet that for SSDs, the offset should begin at 64). Is that correct? Below are additional details about the disk geometry of my SSD: ![disk geometry](http://i.stack.imgur.com/km5kx.jpg) The installation proceeded smoothly without a hitch. Upon rebooting my machine, the last few lines were the error messages:               root on sd0a swap on sd0b dump on sd0b     panic: root filesystem has size 0     Stopped at Debugger+0x5 : leave     Run at least 'trace' AND 'ps' AND INCLUDE OUTPUT WHEN REPORTING THIS PANIC! IF RUNNING SMP, USE 'mach ddbcpu <#>' AND 'trace' ON OTHER PROCESSORS TOO.     DO NOT EVEN BOTHER REPORTING THIS WITHOUT INCLUDING THAT INFORMATION!     ddb{0}>


title: Compare file size of multiple files in an array

text: Scenario: Ftp site has 100s of files. Once a day, all the .gz files are copied to an AWS site then renamed. Only the date is kept in the file name. Some of the files corrupted during copy. A txt file was delivered with a snapshot of ALL the files and attributes from the FTP site. I have to write a script that will   1. read the text file only for .gz files   2. convert the name of the file to the filename on the S3 site   3. Compare the file size from the txt file to the file size on the S3 server   4. If the file sizes doen't match, write the filename and percent diff out to a txt file. This is what I have so far, which is not even close to working Suggestions?:               # Create array from files in FTP site text file         f=cat ftpfiles.txt | grep .gz | awk '{print $9,$5}' #this doesn't work          # Start ForEach loop for files in created array         for f in *.gz             do         # Create variable for file size of source file             file1size=$( cat $f | wc -c )              # Create variable for file size of destination file             fiesize2=aws s3 ls s3://folder1/folder2/$f | awk '{print $3}'              #Compare sizes and print result to .txt file by percent diff             echo "$f"                  if [ $file1size -lt $file2size ]; then               size=$file1size             else                 size=$file2size             fi                  dc -e "             3k             $( cmp -n $size -l $file1 $file2 | wc -l )             $size             /             100*             p"          #close loop          done


title: How to encyrpt a message using someone's SSL smime.p7s file

text: I need to send a private key file to someone (a trusted sysadmin) securely. I suggested a couple options, but he replied as follows: > Hi, I don't have neither LastPass nor GnuPGP but I'm using ssl certificates > - this message is signed with such so you will be able to send a message to > me and encrypt it with my public key. I used openssl to obtain his certificate:               openssl pkcs7 -in smime.p7s -inform DER -print_certs      The certificate is issued by:               issuer=/O=Root CA/OU=http://www.cacert.org/CN=CA Cert Signing Authority/emailAddress=support@cacert.org      (Firefox doesn't have a root certificate from cacert.org.) Now, how do I encrypt the key file I wish to send to him? I prefer to use a command line tool available in Ubuntu. @lgeorget:               $ openssl pkcs7 -inform DER -outform PEM -in smime.p7s -out smime.pem     $ openssl smime -encrypt -text -in /home/myuser/.ssh/mykeyfile smime.pem      unable to load certificate     139709295335072:error:0906D06C:PEM routines:PEM_read_bio:no start line:pem_lib.c:696:Expecting: TRUSTED CERTIFICATE      and               $ openssl pkcs7 -in smime.p7s -inform DER -print_certs     subject=/CN=Wojciech Kapcia/emailAddress=someone@example.com/emailAddress=someone@example.com     issuer=/O=Root CA/OU=http://www.cacert.org/CN=CA Cert Signing Authority/emailAddress=support@cacert.org     -----BEGIN CERTIFICATE-----     MIIFzjCCA7agAwIBAgIDDR9oMA0GCSqGSIb3DQEBBQUAMHkxEDAOBgNVBAoTB1Jv     b3QgQ0ExHjAcBgNVBAsTFWh0dHA6Ly93d3cuY2FjZXJ0Lm9yZzEiMCAGA1UEAxMZ     dEBjYWNlcnQub3JnMB4XDTEzMDQxODA3NDEzNFoXDTE1MDQxODA3NDEzNFowcDEY     MBYGA1UEAxMPV29qY2llY2ggS2FwY2lhMSkwJwYJKoZIhvcNAQkBFhp3b2pjaWVj     [snip]     N1lNLq5jrGhqMzA2ge57cW2eDgCL941kMmIPDUyx+pKAYj1I7IibN3wcP1orOys3     amWMrFRa30LBu6jPYy2TeeoQetKnabefMNE3Jv81gn41mPOs3ToPXEUmYU18VZ75     Efd/qu4SV/3SMdySSNmPAVQdXYAxBEXoN5b5FpUW7KeZnjoX4fkEUPeBnNwcptTC     d1w=     -----END CERTIFICATE-----


title: Create a wifi hotspot on Gnome 3 / Arch Linux

text: I'm trying to create a wifi hotspot in gnome shell and Arch Linux. I open "System Settings" > "Network", then I select "wifi" on the LH side and click "Use as Hotspot..." on the bottom. The system tells that the hotspot is on, shows me the SSID, Security Type (WEP only) and a security key. It does not allow me to configure (there's no configure option). Also the hot spot seems actually not being avaiable. If I try to scan for hotspots by any other device, the hotspot is not found and by manually inserting SSID, WEP and password it doesn't work too. I used to do without problems in Ubuntu, so my feeling is that I'm missing some dependencies and/or configuration in Arch Linux. **EDIT:** I made little progress by installing `modemmanager` and enabling it               sudo systemctl start ModemManager.service && sudo systemctl enable ModemManager.service      Now the hotspot starts and divices can connect to it. However there's still no configuration available for the hotspot (i.e. change name, wep etc) and also I noticed that if running some web services on host (hot spot host) consumed by connected devices, not always works as expected and give errors. I guess I'm still missing something to make it complete and working 100%. Any hints?


title: Set PERM_WRITE_PROTECT on an SD card

text: From what I read here and here I gather that there is a bit on SD cards called PERM_WRITE_PROTECT that will allow me to make an SD card read only. Is it possible to set this bit from Linux? If so, how can I do so? P.S. I realize that I could just mount it read only in fstab, but I am looking for a solution that will prevent it from being written to regardless of what device it is in, or what software is accessing it.


title: Changing resolution : with X and without X

text: I'm working on an Ubuntu server without X and I would like to easily change the resolution. In order to do that, I have to specify `GRUB_GFXPAYLOAD_LINUX=1280x800` in the file `/etc/default/grub`, then `sudo update-grub`, and then reboot. On a desktop installation, changing the resolution is muuuch faster : You just click and it changes immediately. How is that? How does this work? Is it possible to do hot swapping like this without X ?


title: What alternatives are there to ipset for blocking large sets of ip addresses / address ranges?

text: Are there alternatives to ipset that offer similar efficiency in handling large sets of ip addresses or ip address ranges? We originally used iptables to selectively block access to our servers for security- and spam-related reasons. As the list of blocked ip addresses and ip address ranges grew, we migrated to ipset. And we've been very happy with it. However, we recently migrated most of websites to a VPS (OpenVZ) environment and, in the process, discovered that ipset is not (may not be) feasible in that environment. So ... Are there alternatives to ipset that   * Efficiently handle large sets of ip addresses and ip address ranges (i.e., more efficiently than iptables)   * Can be run in a standard VPS environment. We run CentOS 6 on our VPS, so alternatives that are available for that distribution would be particularly appealing to us. Just to be clear ... We are perfectly happy with the manual process we have in place right now for managing the blocked ip addresses / address ranges. We're not looking for something to automate that process. Instead, we're concerned primarily with finding a solution similar to ipset that is good about blocking large sets of addresses/ranges without soaking up a huge amount of CPU time.


title: What happens to the files when they are being decrypted?

text: I have the server's webroot directory mounted on a partition which is being protected with LUKS encryption. I want to know what happens to the files within when that partition is being decrypted. Does   * a copy of the unencrypted version of these files goes to the RAM, or;   * a copy of the unencrypted version of these files goes to the temp directory, or;   * the server decrypts the files upon demand each time they are being accessed, or;   * other scenarios I have missed? The reason why I ask this is to have a better understanding on the decryption process and how it affects the server's resource in terms of CPU and RAM and whether disk encryption with LUKS is more efficient compared to file system encryption like eCryptfs. I tried looking at Wikipedia but could not find any such information. Not sure if this is the best place to ask this question. Feel free to migrate if you think otherwise. Thanks.


title: Can not mount samba share from DD-WRT

text: I'm trying to mount a samba share on dd-wrt. I keep getting this in the dmesg and the mount command hangs.               CIFS VFS: Error connecting to IPv4 socket. Aborting operation     CIFS VFS: cifs_mount failed w/return code = -145     CIFS VFS: cifs_mount failed w/return code = -22     CIFS VFS: Error connecting to IPv4 socket. Aborting operation     CIFS VFS: cifs_mount failed w/return code = -145     CIFS VFS: Error connecting to IPv4 socket. Aborting operation     CIFS VFS: cifs_mount failed w/return code = -512     CIFS VFS: Error connecting to IPv4 socket. Aborting operation     CIFS VFS: cifs_mount failed w/return code = -512     CIFS VFS: Error connecting to IPv4 socket. Aborting operation     CIFS VFS: cifs_mount failed w/return code = -512      It doesn't appear that there is any documentation about these error codes out there so i have no idea what i'm doing wrong. My command format is.               mount.cifs //10.0.10.145/<share> /opt/usr/server -o guest -v      On DD-WRT's site it say you can use smbmount but that doesn't appear to be a valid utility.


title: Change Folder Permissions

text: I started off with changing to the folder I want to change permissions for, and that is the opt folder.               $ cd /opt/     test@testVM:/opt$      So I tried changing the permissions for this folder now using:               sudo chmod 775      And that hasn't worked. It showed this message:               Try 'chmod --help' for more information.      There is something I am forgetting or leaving out. Please can you show me what I am doing wrong? Thanks in advance.


title: Read and confirm shell script before piping from curl to sh (curl -s [url] | sh)

text: Whenever I have to execute a shell script from the web `curl -s [url] | sh`, I first open `url` in my web browser to make sure the script isn't malicious and is safe to run. I remember seeing a command line trick that made it was possible to read the script from the command line and then confirm execution after reading the script. If I recall correctly, it looked something like `curl -s [url] | something...here | sh` and didn't require any software install. Does anyone know this trick?


title: How to emulate a KWin effect by command line?

text: I would like to apply the **Toogle Invert Effect** when I start my system. So, I need to know how to call this KWin effect using the terminal. OBS.: I'd tried `xte "keydown Meta_L" "key i" "keyup Meta_L"`, but didn't work.


title: Keep local copy of nfs mount on computer

text: I mount all my home directories and what ever else on my laptop when it is on my home network. I was wondering if there is a way to keep a local copy of the nfs mount when my laptop is off the network. A bonus would be the ability to merge changed folders and files etc.


title: Pixelization of KDE screen

text: I am using Arch Linux on an Acer Aspire 5920G and _KDE 4.6.5_ as WM. All installed packages are up-to-date. Starting some days ago I got few strange artifacts that spread all over the screen. Interestingly they do not affect any open window at all (neither QT nor GTK or a regular X window). Only the three buttons at the top (maximize, minimize, close) are pixelized but the "content" of any window is intact. When starting a "good-old X session" instead of KDE there is not artifact at all. This is a current screenshot. Note that all of the KDE _widgets_ (don't know how they are called) are pixelized while they "eyes" and the whole background image are not at all. Fullscreen apps (games) and Windows work perfect as well. ![My KDE desktop](http://i.stack.imgur.com/s8O1F.png) Do you have any idea what the problem might be? This is a part of the X log:               cat /var/log/Xorg.0.log | grep -i nvidia     [    22.675] (II) Module glx: vendor="NVIDIA Corporation"     [    22.708] (II) NVIDIA GLX Module  275.19  Tue Jul 12 18:31:51 PDT 2011     [    22.764] (II) LoadModule: "nvidia"     [    22.797] (II) Loading /usr/lib/xorg/modules/drivers/nvidia_drv.so     [    22.910] (II) Module nvidia: vendor="NVIDIA Corporation"     [    22.991] (II) NVIDIA dlloader X Driver  275.19  Tue Jul 12 18:15:26 PDT 2011     [    22.991] (II) NVIDIA Unified Driver for all Supported NVIDIA GPUs     [    23.097] (II) Loading /usr/lib/xorg/modules/drivers/nvidia_drv.so     [    23.134] (**) NVIDIA(0): Depth 24, (--) framebuffer bpp 32     [    23.134] (==) NVIDIA(0): RGB weight 888     [    23.134] (==) NVIDIA(0): Default visual is TrueColor     [    23.134] (==) NVIDIA(0): Using gamma correction (1.0, 1.0, 1.0)     [    23.134] (**) NVIDIA(0): Option "TwinView" "0"     [    23.134] (**) NVIDIA(0): Option "MetaModes" "1280x800 +0+0; nvidia-auto-select +0+0"     [    23.134] (**) NVIDIA(0): Option "TwinViewXineramaInfoOrder" "DFP-0"     [    24.334] (II) NVIDIA(GPU-0): Display (AUO (DFP-0)) does not support NVIDIA 3D Vision     [    24.334] (II) NVIDIA(GPU-0):     stereo.     [    24.354] (II) NVIDIA(0): NVIDIA GPU GeForce 8600M GT (G84) at PCI:1:0:0 (GPU-0)     [    24.354] (--) NVIDIA(0): Memory: 524288 kBytes     [    24.354] (--) NVIDIA(0): VideoBIOS: 60.84.41.00.18     [    24.354] (II) NVIDIA(0): Detected PCI Express Link width: 16X     [    24.354] (--) NVIDIA(0): Interlaced video modes are supported on this GPU     [    24.354] (--) NVIDIA(0): Connected display device(s) on GeForce 8600M GT at PCI:1:0:0     [    24.354] (--) NVIDIA(0):     AUO (DFP-0)     [    24.354] (--) NVIDIA(0): AUO (DFP-0): 330.0 MHz maximum pixel clock     [    24.354] (--) NVIDIA(0): AUO (DFP-0): Internal Dual Link LVDS     [    24.391] (II) NVIDIA(0): Assigned Display Device: DFP-0     [    24.391] (II) NVIDIA(0): Validated modes:     [    24.391] (II) NVIDIA(0):     "1280x800+0+0"     [    24.391] (II) NVIDIA(0):     "nvidia-auto-select+0+0"     [    24.391] (II) NVIDIA(0): Virtual screen size determined to be 1280 x 800     [    25.419] (--) NVIDIA(0): DPI set to (98, 96); computed from "UseEdidDpi" X config     [    25.420] (--) NVIDIA(0):     option     [    25.420] (II) NVIDIA: Using 768.00 MB of virtual memory for indirect memory access.     [    25.433] (II) NVIDIA(0): Setting mode "1280x800+0+0"     [    25.864] (==) NVIDIA(0): Disabling shared memory pixmaps     [    25.864] (==) NVIDIA(0): Backing store disabled     [    25.864] (==) NVIDIA(0): Silken mouse enabled     [    25.867] (==) NVIDIA(0): DPMS enabled     [    25.868] (II) NVIDIA(0): [DRI2] Setup complete     [   402.168] (II) NVIDIA(0): Setting mode "1280x800+0+0"


title: Ubuntu 10.04 LTS hangs at 43% of preparing to partition raid 1drives

text: I have set up hardware raid 1 with two SAS drives using the Adptec 6405E controller. I am having a problem when installing Ubuntu 10.04 LTS as it hangs at 43 % when partitioning disk drives. So far my Googling suggests that Ubuntu does not scan raided drives well. What can I do to finish my installation?


title: Different time in Windows and Linux Mint

text: I installed Linux Mint first on my Acer Aspire 4930 and then dual booted with Windows 7. I see the correct time on Linux Mint but on booting into Windows the time is shifted back by a few hours, even after re-setting the time on rebooting it shows the wrong time again. Why is this happening?


title: How to use /etc/fbtab in OpenBSD to secure X11?

text: OpenBSD's man page afterboot(8) suggests: "You might wish to tighten up security more by editing /etc/fbtab as when installing X." How might one do this? What lines when added to `/etc/fbtab` would help to secure X Windows?


title: How to move /usr from one partition to another partition safely

text: Linux, Debian. Now I have:               /dev/sda5   on /     /dev/sda6   on /home     /dev/sda7   on /usr      I would like to use sda6 to hold `/usr`, then free `/dev/sda7` for other use. What is the safest way to do this? I am confused about how to create a `/usr` on `/dev/sda6` and issue copy command without confusing Linux.


title: PowerVM lpar specific cpu/mem info

text: I want to get the CPU and memory allocation information from lpars of PowerVM through HMC. I have used                lshwres -r proc -m <ms> --level lpar      lssyscfg -r proc -m <ms>      The fields of interest are: min_proc_units, desired_proc_units, max_proc_units, min_procs, desired_procs, max_procs curr_min_proc_units, curr_proc_units, curr_max_proc_units, curr_min_procs, curr_procs, curr_max_procs, pend_min_proc_units, pend_proc_units, pend_max_proc_units, pend_min_procs, pend_procs, pend_max_procs My question is how the `min_proc_units` and `curr_min_proc_units` correspond. Are these same information? Or the `curr_` says something else than what the profile of the lpar using `lssyscfg` says.


title: Assign sed result to a variable

text: I have a sed command and I would like to assign the result to a variable. My command is:               sed -n 's/^Release:\s*\(.*\){?dist}/\1/p' file.spec      And I tried               var = $(sed -n 's/^Release:\s*\(.*\){?dist}/\1/p' file.spec)      But then i have the following error: > unary operator expected


title: Run two commands on same argument

text: I was wanting to maybe alias a command such that the command ran as per usual but also did something else on the argument/s before it was executed. An example might be:               alias ls="echo displaying contents of $@; ls $@"      Just a hypothetical, but essentially I was wanting to run a command (ls in this case) and have a static command set to run on it before the standard `ls` happens. A function like:               function ls() {     echo "printing $1"     ls $1     }      didn't seem to be appropriate since I would have to handle switches/options being used on the command in question, i.e., recreating the whole command. PS. I want to use the original command how it is normally used just add functionality to it in the way described above using something like alias or rc (ie something that I can attach permanently)


title: Installing python modules for python2.6

text: On my CentOS 5.8 system (el5 , 64bit), I had python2.4 after OS install and I installed python2.6 now. Now I want to install python modules using `yum`. But whenever I install a new python module it "goes" to the python2.4 and is not installed for python2.6. I tried to replace the python2.4 binary with python2.6 binary. But this broke `yum` and I had to restore python2.4. So I concluded that it is not a good idea to uninstall python2.4 (that came with base OS) as it might break other system dependencies. My question is how do I safely install python modules targeting python2.6 without breaking python2.4?


title: My bash prompt is not working in `screen`

text: On RedHat, `screen` resets my bash prompt. I set `PS1=\u@\h:\w` in `~/.bashrc` and `~/.bash_profile`. I added `shell -$SHELL` as well to `~/.screenrc`. But, when I open a brand new terminal window, the prompt is correct, except in `screen`. In `screen` I always get this prompt format: `\u@\h>` How can I set the same prompt in `screen`?


title: vsftpd with email notification

text: It would be good if `vsftpd` has some kind of features that will send email notification if there are some one who are attempting to connect on ftp server and/or getting a lot of permission denied users. I would like to hear someone who knows of this kind of setup.


title: Using Command Line (Linux) how do I enable the Bluetooth Adapter?

text: I have 1 BlueTooth adapter on my laptop. Using the command line, I want to be able to enable / disable it. This would be the same functionality that is achieved using GUI -> Bluetooth settings -> Bluetooth ON | OFF.


title: Simple Bash Script

text: I have a simple problem, but unfortunately I don't know where to even start (I'm just starting out). So, what I want to do is ultimately increase my vocabulary. I got the idea to strip the most commonly used words out of news articles. I found a list of the 5,000 most commonly used words and saved it. After I get the most commonly used words stripped out, I can create a corpus in TextSTAT and do a word frequency count and choose which words I want to learn that way. But how do I get the words in my most commonly used words list to be removed from the articles I'll be saving?


title: Why does my sudo ask for password only once but evaluate thrice?

text: $ sudo some_command     Password:     Sorry, try again.     Sorry, try again.     Sorry, try again.     sudo: 3 incorrect password attempts     $      This is what my shell prints when I enter a wrong password to a sudoed command. Why could this happen? * * *               $ sudo -V     Sudo version 1.6.7p5     $ uname -a     Linux lazer 2.6.18-164.0.0.0.1.el5xen #1 SMP Thu Sep 3 00:34:43 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux     $


title: what does the -z flag mean here

text: What does the `-z` flag mean in the code below:               if [ -z $TEST_PARAM ]; then      And is there a list of such flags? For a flag like `ls -l`, I know where to find it, but for a single flag, I didn't get any website describes it.


title: How to remove a package built from source that has the same name of another package?

text: I'm running Debian 7.3 and I built Python 2.7.6 from source and it was installed in `/usr/local/lib/python2.7` I used checkinstall to create a .deb package so I can easily uninstall it later, the problem is that I named the package `python`, but if I try to remove it it'll remove all the other packages that depend on `python`, so now I removed the installed files manually but the package is still showing in Synaptic package manager and also if I run:               apt-cache show python      I can see the 2 descriptions, the one I installed and the default one, also in Synaptic I can see it under Status > Installed (local or obsolete). So how can remove this package without removing the original python package ? it's showing 2 versions 2.7.6 (my own version) and 2.7.3 (the system's version), can I remove 1 version and keep the other ?


title: Autoconfig/Automake fails to generate AM_CFLAGS & AM_LDFLAGS for dependent D-BUS library. Why?

text: I want to build a program that use DBUS, using automake/autoconfig tools. But the make command always report an error "dbus/dbus-glib.h": No such file or directory. My OS is ubuntu 10.10. And I installed both "dbus-1" and "dbus-glib-1". I check the generated Makefile and found both AM_CFLAGS and AM_LDFLAGS are empty. Could somebody help? Many thanks! Here is my code: configure.ac:               AC_INIT([my-app], [0.1])     AC_PREREQ([2.59])     AM_INIT_AUTOMAKE([1.10 -Wall no-define])     AC_CONFIG_HEADERS([config.h])     AC_PROG_CC     AM_PROG_CC_C_O     AC_CONFIG_FILES([Makefile])     AC_OUTPUT     DBUS_REQUIRED=1.3.1     DBUS_GLIB_REQUIRED=0.82     GLIB_REQUIRED=2.26.0          PKG_CHECK_MODULES(DBUS, [dbus-1 >= $DBUS_REQUIRED dbus-glib-1 >= $DBUS_GLIB_REQUIRED])     AC_SUBST(DBUS_CFLAGS)     AC_SUBST(DBUS_LIBS)      * * * Makefile.am:               AUTOMAKE_OPTIONS = subdir-objects     ACLOCAL_AMFLAGS = ${ACLOCAL_FLAGS}     bin_PROGRAMS = my_app     my_app_SOURCES = src/my-app.c     AM_CFLAGS= @DBUS_CFLAGS@     AM_LDFLAGS= @DBUS_LIBS@     dist_noinst_SCRIPTS = autogen.sh      * * * my-app.c               ...     "#include" {{{<dbus/dbus-glib.h>}}}     ...


title: How can I install KateSql plugin on ubuntu?

text: I am slightly new to Ubuntu and I just installed kate by typing `sudo apt-get install kate`. Now I want to install this kate sql plugin and google is not helping me. I downloaded a punch of files from here but what should I do with these files ? Where should I put them ? Would you please tell me how can I install this ? Thanks


title: Stop USB mobile broadband automatically mounting as drive

text: **UPDATE 3:** This is what I get from `lsusb`:               oshirowanen@laptop:~$ sudo lsusb     [sudo] password for oshirowanen:      Bus 001 Device 003: ID 19d2:0031 ONDA Communication S.p.A. ZTE MF636      As I have tried the following and it did not work:               SUBSYSTEM=="usb_device", ATTR{idVentor}=="ZTE MF636", ATTR{idProduct}=="19d2:0031",ENV{UDISKS_PRESENTATION_HIDE}:="1"      **UPDATE 2:**               OS = Ubuntu 10.04.2     USB Stick = ZTE MF112      **UPDATE 1:** I've looked at the documentation for usb_modeswitch, but find it to complex to understand. Can someone please point me to a step by step guide on how to use it and setup my usb drive? **ORIGINAL QUESTION:** Is it possible to stop my usb mobile broadband stick from automatically mounting as a drive, yet continue to mount all other usb devices (camera, usb memory stick, usb camera etc) as normal, i.e. usb memory stick, usb harddrive stick should mount as normal usb drives as they currently do, web cam should mount as a cam as it does etc etc? Basically, when I plug in the mobile broadband usb stick, it automatically mounts as a usb drive, and I have to unmount it. It then automatically gets detected as a mobile broadband device. So if it is possible to stop just the mobile broadband usb stick from mounting as a drive, it should automatically get detected as a mobile broadband device. Can this be done? I am using Ubuntu 10.04.


title: Convert file with integers written in ascii to binary file of integers

text: I have a file that contains a long list of integers written in ascii separated with newlines, like such:               -175     2     -19345     345592     -45     2355      etc... I want to convert this file into a "binary" file containing the same integers, written as actual 4 byte integers. What command-line tool can I use to achieve this?


title: Names of copied files from USB device to HDD have all become uppercase. How to fix it?

text: I am currently using OpenBSD 5.5-release. Whenever I copy files or directories from my USB device to the local HDD, the names of the copied files have all become uppercase. What causes it? How do I fix it?


title: Folder with ONLY write permission is useless... right?

text: Having worked with Linux for years, and finding myself with some free time, I decided to revisit some basics. So I re-read the stuff about permissions (without checking source code), and its special cases for folders, and came up with a new (to me at least...) way of thinking about folder permissions (for a specific user/group/others): I imagine a folder as a table with two columns, like so:               filename | inode         foo      | 111       bar      | 222       The **read** permission means you can read (and list) the left column of the table, the **write** permission corresponds to adding and removing entries to the table, and the **execute** permission corresponds to being able to translate from file name to inome; i.e. you can _access_ the contents of the folder. I did some experiments, and the results are all consistent with this "worldview" of mine, but one conclusion seems inescapable: that a folder with permissions `d-w-------`, is totally useless. Elaborating: you can't list its contents, you can't read any files you know exist inside (because you can't translate names into inodes), you can't remove or rename or add files, because again that would imply translation, and you can't even add hardlinks (because, I surmise, that would mean adding a name and an inode number, which means you would know both, which in turn, again surmising, violates the purpose of unsetting execution permission). And of course, if there _are_ files inside one such folder, then you can't delete that folder either, because you can't delete its contents. So... I would like to ask two questions:   1. Is this analogy of mine correct, or is it a big blunder?    2. Irrespective of the previous answer, is there _any_ situation where having a folder with permissions as described is appropriate?


title: Upload file over ssh and execute command on the remote machine

text: I am trying to find the simplest way to upload a file using ssh and after that run a command on the remote machine within the same ssh session for some post- processing, so that I don't need to login again. The upload should, if possible, show some progress indicator. So far I looked into scp and rsync, and both are not capable of running any hooks. (I could use the `\--rsync-path` parameter to execute some script _before_ rsync) but I want to do post-processing. Is there any way to open a ssh session, upload, execute a command and close it again?


title: Installing basic OS on a server without console

text: I'm having a server with some obsolete linux installed. I want to wipe everything out, have a basic Ubuntu installed, and get the IP of the server, and a default username and password. From there I'll use SSH to manage it. Can I do that automatically, without attaching any console (screen and keyboard) to the server? Edit: See here for an up to date answer for Ubuntu.


title: Are there any standards/documents which tell me how to produce such nice help messages?

text: This is a follow up to a previous question, where Silverrocker suggested a nice way to display a help message similar to commands like `ls` or `du`.               program --help          Usage: program [<options>][<arguments> ...]          Options:     --help         show this message, then exit     --something    after some spaces for alignment, an explenation follows.      I really like this approach but I can only guess how to produce such a help message. Are there any GNU/whatever documents/standards on how to produce something like this?


title: getopt, getopts or manual parsing - what to use when I want to support both short and long options?

text: Currently I'm writing a Bash script which has the following requirements:   * it should run on a wide variety of Unix/Linux platforms   * it should support both short and (GNU) long options I know that `getopts` would be the preferred way in terms of portability but AFAIK it doesn't support long options. `getopt` supports long options but the BashGuide recommends strongly against it: > Never use getopt(1). getopt cannot handle empty arguments strings, or > arguments with embedded whitespace. Please forget that it ever existed. So, there still is the option of manual parsing. This is error-prone, produces quite some boilerplate code, and I need to handle errors by myself (I guess `getopt(s)` do error-handling by themselves). So, what would be the preferred choice in this case?


title: preserving extended attributes with cp/rsync

text: When copying with `cp`, the extended attributes are not preserved, even with explicit               cp -a --preserve=all /source /dest      or               cp -a --preserve=xattr /source /dest      The same is with `rsync`, i.e.               rsync -aq -A -X --delete /source /dest      However, on the destination filesystem, I can create extended attribute manually (with `chattr`). This means that the target filesystem supports xattr. Why am I unable to preserve `xattr` with `cp` or `rsync` ? # Additional information:   * Both source and target filesystems are ext4   * Both source and target filesystems are local (not nfs)   * I am using Debian Wheezy


title: Use basename to parse a list of paths held in a file

text: I'm running Mac OSX and trying to use the command line to find the number of files I have with the same name. I tried to use the following command:               find ~ -type f -name "*" -print | basename | sort | uniq -d > duplicate_files      It doesn't work! When I do the following:               find ~ -type f -name "*" -print > duplicate_files      Then duplicate_files does contain the paths of all my files. So I think the issue is with `basename` - it doesn't accept standard input. I then tried the following:               basename $(find ~ -type f -name "*" -print) > duplicate_files      but again that doesn't seem to work. Search on the internet doesn't seem to yield much joy. Any thoughts most welcome.


title: dead key after switching two keys with xmodmap

text: My keyboard switches the (German) keys [^] and [<], so I want to switch the two keys. I identified the keycodes using xev and created a file `~/.xmodmap` containing               keycode 94 = asciicircum degree     keycode 49 = less greater      When executing `xmodmap ~/.xmodmap` hardware key 94 now correctly outputs "^" instead of "<". Unfortunately the other key does not output any character at all. xev returns the following output when the key is pressed               KeyRelease event, serial 32, synthetic NO, window 0x2e00001,         root 0x4b, subw 0x0, time 258843335, (169,-12), root:(185,111),         state 0x4000, keycode 49 (keysym 0x0, NoSymbol), same_screen YES,         XLookupString gives 0 bytes:          XFilterEvent returns: False      do you know what the problem might be? As far as I understand it the man page says that _remove_ only works for modifiers, but I don't care for modifiers, I want to switch regular keys. Might there be another problem that is not related to that 'possible duplicate'?


title: Extract image from a m4a file?

text: I already tried `eyeD3`, but that doesn't work for m4a files, and If I convert the m4a to mp3 format, I lose the image. What other choice do I have?