title: How to access web server running on Palm Pre from another machine?

text: I have a Palm Pre, and I've installed my webserver on it, it listens on port 8080. It works, when I open 192.168.1.104:8080 on the Pre's browser (that's the IP address of the device, I've failed with localhost or 127.0.0.1), it shows images, everything is OK. But I can't access the webserver from outside, e.g. from my desktop machine, it shows timeout. Is there a firewall on the Pre, or what's wrong? I can change server's port number, if necessary. I didn't configured the Pre, just installed SSH. Also, I can SSH to Pre, and from Pre to my desktop. **UPDATE:** _ifconfig_ says:               eth0      Link encap:Ethernet  HWaddr 00:1D:FE:B5:99:51                 inet addr:192.168.1.104  Bcast:192.168.255.255  Mask:255.255.0.0               UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1               RX packets:486 errors:0 dropped:0 overruns:0 frame:0               TX packets:284 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:1000                RX bytes:69398 (67.7 KiB)  TX bytes:40051 (39.1 KiB)          lo        Link encap:Local Loopback                 inet addr:127.0.0.1  Mask:255.0.0.0               UP LOOPBACK RUNNING  MTU:16436  Metric:1               RX packets:1248 errors:0 dropped:0 overruns:0 frame:0               TX packets:1248 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:0                RX bytes:128070 (125.0 KiB)  TX bytes:128070 (125.0 KiB)      _iptables -nvL_ says:               Chain INPUT (policy DROP 0 packets, 0 bytes)      pkts bytes target     prot opt in     out     source               destination                370 29404 ACCEPT     tcp  --  eth0   *       0.0.0.0/0            0.0.0.0/0           tcp dpt:22       1248  128K ALLOWED_PACKETS  all  --  lo     *       0.0.0.0/0            0.0.0.0/0                    0     0 INVALID_PACKETS  all  --  !lo    *       127.0.0.0/8          0.0.0.0/0                    0     0 REJECT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:113 flags:0x17/0x02 state NEW reject-with tcp-reset          0     0 DROP       tcp  --  bridge0 *       0.0.0.0/0            0.0.0.0/0           tcp dpts:4444:4445         47 28580 ALLOWED_PACKETS  all  --  *      *       0.0.0.0/0            0.0.0.0/0           state RELATED,ESTABLISHED          0     0 ALLOWED_PACKETS  all  --  bridge0 *       0.0.0.0/0            0.0.0.0/0                    0     0 ALLOWED_PACKETS  all  --  usb0   *       0.0.0.0/0            0.0.0.0/0                    0     0 ALLOWED_PACKETS  icmp --  *      *       0.0.0.0/0            0.0.0.0/0           icmp type 0 state NEW          0     0 ALLOWED_PACKETS  icmp --  *      *       0.0.0.0/0            0.0.0.0/0           limit: avg 1/sec burst 5 icmp type 0          0     0 ALLOWED_PACKETS  icmp --  *      *       0.0.0.0/0            0.0.0.0/0           icmp type 3 state NEW          0     0 ALLOWED_PACKETS  icmp --  *      *       0.0.0.0/0            0.0.0.0/0           limit: avg 1/sec burst 5 icmp type 3          0     0 ALLOWED_PACKETS  icmp --  *      *       0.0.0.0/0            0.0.0.0/0           icmp type 4 state NEW          0     0 ALLOWED_PACKETS  icmp --  *      *       0.0.0.0/0            0.0.0.0/0           limit: avg 1/sec burst 5 icmp type 4          0     0 ALLOWED_PACKETS  icmp --  *      *       0.0.0.0/0            0.0.0.0/0           icmp type 5 state NEW          0     0 ALLOWED_PACKETS  icmp --  *      *       0.0.0.0/0            0.0.0.0/0           limit: avg 1/sec burst 5 icmp type 5          3   252 ICMPFLOOD  icmp --  *      *       0.0.0.0/0            0.0.0.0/0           icmp type 8 state NEW          0     0 ALLOWED_PACKETS  icmp --  *      *       0.0.0.0/0            0.0.0.0/0           icmp type 11 state NEW          0     0 ALLOWED_PACKETS  icmp --  *      *       0.0.0.0/0            0.0.0.0/0           limit: avg 1/sec burst 5 icmp type 11          0     0 ALLOWED_PACKETS  tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:5353          0     0 ALLOWED_PACKETS  udp  --  *      *       0.0.0.0/0            0.0.0.0/0           udp dpt:5353          0     0 ALLOWED_PACKETS  tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:3689          0     0 ALLOWED_PACKETS  udp  --  *      *       0.0.0.0/0            0.0.0.0/0           udp dpt:3689          0     0 ALLOWED_PACKETS  tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp flags:0x04/0x04         36  4604 LOG        all  --  *      *       0.0.0.0/0            0.0.0.0/0           limit: avg 3/sec burst 5 LOG flags 0 level 7 prefix `IPT_PACKET_DROPPED_NO_MATCH: '         36  4604 QUEUE      all  --  *      *       0.0.0.0/0            0.0.0.0/0                     Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)      pkts bytes target     prot opt in     out     source               destination                  0     0 INVALID_PACKETS  all  --  *      *       0.0.0.0/0            0.0.0.0/0           state INVALID           Chain OUTPUT (policy ACCEPT 1541 packets, 166K bytes)      pkts bytes target     prot opt in     out     source               destination                   Chain ALLOWED_PACKETS (20 references)      pkts bytes target     prot opt in     out     source               destination               1298  157K ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0                     Chain ICMPFLOOD (1 references)      pkts bytes target     prot opt in     out     source               destination                  3   252            all  --  *      *       0.0.0.0/0            0.0.0.0/0           recent: SET name: ICMP side: source          0     0 LOG        all  --  *      *       0.0.0.0/0            0.0.0.0/0           recent: UPDATE seconds: 1 hit_count: 6 TTL-Match name: ICMP side: source limit: avg 1/sec burst 1 LOG flags 0 level 4 prefix `IPT_ICMPFLOOD: '          0     0 DROP       all  --  *      *       0.0.0.0/0            0.0.0.0/0           recent: UPDATE seconds: 1 hit_count: 6 TTL-Match name: ICMP side: source          3   252 ALLOWED_PACKETS  all  --  *      *       0.0.0.0/0            0.0.0.0/0                     Chain INVALID_PACKETS (2 references)      pkts bytes target     prot opt in     out     source               destination                  0     0 LOG        all  --  *      *       0.0.0.0/0            0.0.0.0/0           limit: avg 1/sec burst 100 LOG flags 0 level 4 prefix `IPT_INVALID_PACKETS_DROPPED: '          0     0 DROP       all  --  *      *       0.0.0.0/0            0.0.0.0/0                 I assume, TCP should be accepted for port 8080 or whatever I want, just as for 22 (SSH).


title: WordPress image upload error

text: I am using **WordPress Version 3.8.1** with the magazine theme but my problem is when I upload an image using the upload media I get this error > An Error Occurred In The Upload.Please Try Again Later and the image is uploaded to the destination. But the media remains with the blocked image or empty and the post does not display images. This problem occurs on my local web server **(127.0.0.1)** with **Ubuntu** but when I shift to a Windows local server (127.0.0.1) the theme works fine. Again the same problem occurs when I hosted a site on a web server with Unix OS but when I hosted on Bluehost web server the theme works fine. I have tried several times changing the permission by using FileZilla FTP up to **777** level which is not recommended but nothing changed. Is there any other guidance on how to change the permission in **Unix** or **Ubuntu** Can anyone help me please because I am so frustrated with this challenge and I want to host the theme officially in **Unix web server** OS because that is the current in use in my working company.


title: Securely inspect email attachment

text: I received a really classic spam mail stating that I have to pay a bill. The mail included an attachment (.exe). Just for curiosity reasons: What would happen if I click on the attachment? (I am running Crunchbang, no Wine installed)? Is there a way to securely inspect the attachment?


title: Bad argument `127.0.0.1' in iptables

text: -A OUTPUT --destination ! '127.0.0.1' -m state --state NEW -j LOG --log-prefix "new_connection " --log-level 7      gives me               Bad argument `127.0.0.1'      What am I doing wrong? I used this docs : http://www.iptables.info/en/iptables-matches.html


title: Is that possible to integrate zip and tar.gz files as directory into the file system

text: I wonder if there is a way to integrate (it's a bit different from mounting, I think) compressed files as directories into the file system? E.g., one could download a `compressed-file.tar.gz` to his local hard drive, then do `cd compressed-file.tar.gz` and run a script from within the compressed folder or do `cp some-file ..` to extract one of the files. I know that Btrfs supports compression, but I don't want to change the file system that I have (ext3) to support this feature.


title: Command to list assigned dhcp addresses

text: Is there a command I can use to ask the dhcpd server which addresses have been assigned?


title: Redirect grep error output to file

text: I wanted to capture to a file the errors being returned on the command line from `grep`. For example,               grep foo.lookup     No such file in directory      I want to output that to a log file. This is my shell script:               lookUpVal=1     var1=$(grep $lookUpVal foo.lookup) >>lookup.log 2>$1      It creates the file `lookup.log` but doesn't write the error on it.


title: download pdf files from using curl

text: How to download hundereds of .pdf files from http://www.ncbi.nlm.nih.gov/pmc/articles using a loop, for example for the following document ids:               PMC3386155     PMC3625956     PMC3477654     PMC3531051     PMC3114846     PMC3117879     PMC3130560     PMC3531173     PMC3546115     PMC3354575     PMC3771521


title: How to mount '.img' file (extracted cubian file) in ubuntu

text: I used this command               sudo mount -t ext2 -o loop Cubian-desktop-r1-a20.img mountpoint      Output from this command is               mount: wrong fs type, bad option, bad superblock on /dev/loop0,            missing codepage or helper program, or other error            In some cases useful info is found in syslog - try            dmesg | tail  or so


title: unrecognized option 'vf'

text: I'm trying to add SRT subs to an flv video with following code but says unrecognized option 'vf'. Am I missing something or is there a workaround? I read somewhere you need at least ffmpeg version 7 for vf to work(?)               $ ffmpeg -i takeout.flv -vf subtitles=takeout.srt test.flv          FFmpeg version 0.6.5, Copyright (c) 2000-2010 the FFmpeg developers     built on Jan 29 2012 17:53:48 with gcc 4.4.5 20110214 (Red Hat 4.4.5-6)     configuration: --prefix=/usr --libdir=/usr/lib --shlibdir=/usr/lib --   mandir=/usr/share/man --incdir=/usr/include --disable-avisynth --extra-cflags='-  O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables' --enable-avfilter --enable-avfilter-lavf --enable-libdc1394 --enable-libdirac --enable-libfaac --enable-libfaad --enable-libfaadbin --enable-libgsm --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-librtmp --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libx264 --enable-gpl --enable-nonfree --enable-postproc --enable-pthreads   --enable-shared --enable-swscale --enable-vdpau --enable-version3 --enable-  x11grab      libavutil     50.15. 1 / 50.15. 1      libavcodec    52.72. 2 / 52.72. 2      libavformat   52.64. 2 / 52.64. 2      libavdevice   52. 2. 0 / 52. 2. 0      libavfilter    1.19. 0 /  1.19. 0      libswscale     0.11. 0 /  0.11. 0      libpostproc   51. 2. 0 / 51. 2. 0      [flv @ 0x90ce880]Estimating duration from bitrate, this may be inaccurate           Seems stream 0 codec frame rate differs from container frame rate: 1000.00     (1000/1) -> 30.00 (30/1)     Input #0, flv, from 'takeout.flv':     Metadata:     duration        : 5295     width           : 640     height          : 480     videodatarate   : 973     framerate       : 30     videocodecid    : 2     audiosamplerate : 44100     audiosamplesize : 16     stereo          : true     audiocodecid    : 2     filesize        : 661073262     Duration: 01:28:14.89, start: 0.000000, bitrate: 1092 kb/s     Stream #0.0: Video: flv, yuv420p, 640x480, 996 kb/s, 30 tbr, 1k tbn, 1k tbc         Stream #0.1: Audio: mp3, 44100 Hz, 2 channels, s16, 96 kb/s     Unrecognized option 'vf'      I tried converting the SRT to ASS because I have latest version of libass installed with:               $ ffmpeg -i takeout.srt takeout.ass      but am getting: > Invalid data found when processing input Then I tried downloading `mencoder` as another workaround but it ran out of mirror options for download.


title: LS Command output to file

text: I want to capture to a file the output of the ls command               ls >> lsOutput.log      This one works if executed in the command line. But when put inside a shell script (`lsOutput.sh`), returns               ./lsOutput.sh: 3: ./lsOutput.sh: total: not found      `lsOutput.sh` code               #!/bin/sh          `ls -lrt` >> lsOutput.log


title: How to run Firefox in a chroot jail?

text: I've got this chroot jail all setup. I try to run Firefox in it, and get the message: **"Gtk-WARNING ** cannot open display: "** I know I have to invoke Firefox with --display= something. I probably also have to set the DISPLAY environmental variable to something as well. But I've tried all kinds of combinations, and can't get it to work in the chroot jail. Thanks.


title: Run nmap via Tor

text: Is it possible to run`nmap` via Tor? When I googled around, I got the impression that Tor uses Polipo / Privoxy, which are socks5 proxies. So any TCP / UDP aware applications should be able to use them as a gateway to route their traffic. But somewhere it also said that nmap uses raw packets, so it can't be run over Tor!


title: How do I screencap another Xorg display?

text: I started another x session from my current one like so:               xinit xterm -- :128      An x session starts in display :128, xterm gets run in it and everything is fine. I switched back to screen :0 (the default), though, and tried to screencap the new display:               $ xwd -root -screen -out screencap.xwd -display :128      and the resulting file was just a big black rectangle. I also tried with imagemagick `import`, to no avail. What is going wrong? Thanks!


title: Is there a tmux shortcut to go read only?

text: I've been using screen for years now as a way of ensuring that any remote work is safely kept open in after disconnects/crashes. In fact, as a matter of course, I use screens even when working locally. Recently, my requirements have progressed to the stage that I switched to tmux because of the beauty of:               tmux attach -r      Attaching to my own sessions in readonly mode (-r) means that I don't have to worry about accidentally:   * pasting lines of garbage in IRC   * halting an important compile/deploy process   * typing a password in full view for passersby Of course the issue is that I have to open a session, C-b + d to detach, and then reopen it with the -r flag to go readonly. And then, when I occasionally want to chime in to an IRC conversation, interrupt a task or anything else, I have to detach again and reconnect normally. Does anyone know of a way to make a key binding to switch between modes?


title: Why doesn't “ping -l” works when ping works?

text: Bye all,               ping AddressIp     64 bytes from indirizzoIp: icmp_req=1 ttl=42 time=149 ms      while if               ping AddressIp -l 1400      ping: cannot set preload to value > 3          ping AddressIp -t -l 1400     ping: can't set unicast time-to-live: Invalid argument      Why can't I ping?


title: Search mp3 collection for songs with a certain song length

text: How would I search a directory of mp3 files for songs between a certain length. Ex:               findmp3 -min=03:00 -max=03:15 /music/mp3/ebm/      Would return all mp3 files in the `emb/` directory having a song length between 3:00 and 3:15 minutes in length. I use Linux Mint, Ubuntu, as well as CentOS.


title: How to stop application from being suspended by Ctrl+z?

text: Currently I'm running `dvtm` inside a terminal, and `vim` inside `dvtm`. When I press `Ctrl`+`z` intending to suspend `vim`, `dvtm` got suspended instead. I didn't have this problem with `screen` or `tmux`, so I think it must be `dvtm` doing something wrong (or not doing something right). How can I fix that? Update: I was wrong, this is not a problem with `dvtm`. Indeed I was using the `dtach`+`dvtm` combo and wrongly assumed that dvtm was at fault. The problem is really with `dtach`.


title: How to run a shell script containing an awk command

text: How to run this script (called `count.sh`)?               awk 'BEGIN{ x=0 ; while (x < 5) { x+=1 ; print x ; } }'      I'm trying to run it with `sh count.sh` but it's giving me an error.


title: Faster way than ping for checking if computer online?

text: I'm writing a wake on lan script for a set of our lab computers. We have sqlite db with a list of the computer hostnames, IPs, and MACs and currently I ping each of them with '-c1' so it doesn't run endlessly - but even that takes some waiting, is there a quicker way to get answer rather than ping? Using ping seems to slow the script quite a bit as it needs the ping answers to continue. Thanks much for any suggestions!


title: Use case of providing file-like API to terminal/console

text: It was explained in this Stack Overflow thread that each logical terminal has a "pseudo-terminal", and that writing to one:               $ cat some-file.txt > /dev/ttys002      will cause the data to appear in that terminal window. What's the reason for providing a file-like API to terminal windows? Is there any use case where this is helpful? Till here copied verbatim. Not limited to pseudo-terminals, it is available to `/dev/tty*` as well.


title: permissions 755 on /home/<user>/

text: I am wondering why by default my directory `/home/<user>/` has permissions set to `755`. This allows other users to enter into directories and read files in my home. Is there any legitimate reason for this ? Can I set the permissions to `700` for my home and all sub directories , for example:               chmod -R o-xw /home/<user>/      chmod -R g-xw /home/<user>/      without breaking anything ? Also, is it possible to set the permissions on my home, so that all new files created will have `600` and directories `700` ?


title: btrfs partition not detected

text: I have some distros installed on a BTRFS partitions under different subvolumes ( for distro-hopping, separate ext4 boot). This btrfs partition is now not getting detected on boot, while I can access them after I boot to another distro living in another ext4 partition. I believe its because I did a `tune2fs` on this BTRFS partition mistakenly assuming its an `ext4` so as to disable journalling. Using `testdisk`, it wrongly identified the partition as ext4. But after an incomplete _deeper_ search, it showed up as btrfs correctly. I think this is problem - the partition getting identified as ext4 on a _quick breeze_. But the boot message is actually saying `dev/sda9` not found. One solution I _should_ try is to fire up `fdisk` and change the type to BTRFS, but I doubt if I will loose the data. Is this operation safe? How can I fix the partition for it to get detected as BTRFS at boot?


title: Why does SSH show protocol as tcp6 *and* tcp in netstat?

text: $ netstat -nat     Active Internet connections (servers and established)     Proto Recv-Q Send-Q Local Address           Foreign Address         State           tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN          tcp        0      0 127.0.0.1:53            0.0.0.0:*               LISTEN          tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN          tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN          tcp6       0      0 :::22                   :::*                    LISTEN        Why are there two records of port 22 (`:::22` and `0.0.0.0:22`) and why does one use protocol as `tcp` and the other as `tcp6` This is on Ubuntu 12.04.4


title: How to recover the partition table (Windows, Ubuntu) of an unallocated disc?

text: The following screenshot shows the current state of my hard disc. ![GParted](http://i.stack.imgur.com/OCmDH.png) The **unallocated part** of the disc used to contain two operating systems:   * Windows and Ubuntu, in this order. Windows has been installed first. Ubuntu used Grub.   * I do not have information about specific partitioning.   * There was a home partition of Ubuntu was encrypted. I wrote down the passphrase. The **NTFS partition** is not of interest for this question. I already managed to recover data stored there. Do you know any tool for Linux or Windows which is capable of recovering the partitions? I assume that I lost the partition table or just Grub. * * * # Interim results * * * ## Running testdisk After running the `Quick Search` the following shows up:               Disk /dev/sdb - 500 GB / 465 GiB - CHS 969021 16 63          Warning: the current number of heads per cylinder is 16     but the correct value may be 255.     You can use the Geometry menu to change this value.     It's something to try if     - some partitions are not found by TestDisk     - or the partition table can not be written because partitions overlaps.          [Continue]      Then ...               Disk /dev/sdb - 500 GB / 465 GiB - CHS 969021 16 63          Partition             Start        End    Size in sectors      * HPFS - NTFS               2   0 33    205   3 19     204800      P HPFS - NTFS             205   3 20 203174   9 41  204593152      P Linux                203176  10 11 305359   3 51  103000064      L Linux                313112   6  7 373707   2 50   61079552        HPFS - NTFS          373707   2 51 969022  15 47  600078336        HPFS - NTFS          373707   2 58 969020  15 63  600076329      * * * # Success story * * * Finally, I was able to recover the partition table. I cloned the drive using `dd` and had to change the geometry settings of the target drive. Then I was able to detect the Linux partitions on the cloned hard drive. Finally, I wrote the partition table via TestDisk to the clone hard drive. I did not want to alter the original drive to avoid total damage. To actually mount and copy the data from the encrypted home partition I followed this post by rausch. Helpful background information can be read in: Unwrapping passphrase and inserting into the user session keyring failed.


title: Leave directory out using ls

text: I am trying to get a vertical list from `ls`, that is recursive but leaves a out a single directory called `node_modules`. I've used:               ls -lt -h -R      This gets me a very long list that is vertical, human readable and recursive. But it has the directory `node_modules` included and that just has too many files and directories.


title: restore from tar file

text: I took a backup using: `cd /usr/CCS` `tar cvfz /usr/LARGE/BKUP/hms.tar.gz *` Now I would like to restore `HMS` and overwrite at `/usr/CCS/HMS`. `HMS` is one of the subfolders under `/usr/CCS` Can I get some help in restoring only the `HMS` folder from the tar and overwriting it at `/usr/CCS/HMS`.


title: log all the email send by the root

text: I'm new in Linux and just installed a private script and want to capture all traffic, to know if this script send my logs or other things via email.


title: How to install cacti in SUSE Linux Enterprise Server?

text: I want to install cacti in my SUSE Enterprise Server 11 Edition. What steps do I need to do to accomplish that?


title: Any tricks to speed up sort?

text: For example for `bzip` there is pbzip, a parallel version of `bzip`. Is there any such parallelization tools for `sort` to improve performance?


title: How to set up the login screen to ask for keyboard layout

text: I just upgraded my distro, now it no longer has a menu to set the keyboard layout in the login screen (gdm). Previously a user could select there icon, then change the keyboard layout (it would also remember previous choice of this user), and then type in password and continue the session, using there selected layout. I have users using dvorak and qwerty uk. I have looked at various pages of help on the subject of configuring gdm, but have found nothing on keyboard layouts. Can you help with how to add the keyboard layout selector?


title: What does mdadm's "spare" number mean?

text: I created a mdadm-based RAID 5 from six hard drives using the following command:               # mdadm --create /dev/md0 --level=5 --raid-devices=5 \     /dev/sdb1 /dev/sdc1 /dev/sdd1 /dev/sde1 /dev/sdf1 \     --spare-devices=1 /dev/sdg1      I expected the array to have one hot spare, namely /dev/sdg1. However, checking `mdadm --detail` shows 2 spares:               # mdadm --detail --scan      ARRAY /dev/md0 metadata=1.2 spares=2 name=...      Also, the array size as shown by `df` is 2 TB, which would correspond to only four of my 500 GB drives being used. So what exactly is the semantics of `\--spare-devices`? The man page states that it "Specif[ies] the number of spare (eXtra) devices in the initial array.", but that does not seem to be the case here.


title: Is there a difference between these two commands?

text: cat a > b      and               cp a b      If they are functionally the same for all intents and purposes, which one is faster?


title: Postfix vs Google SMTP servers inconsistency

text: I wanted to host my own mail server and in order to do so I've installed Postfix 2.7.0 and Dovecot 1.2.9 on Ubuntu Server 10.04. I had fun reading the docs and configuring all these great tools, I am also hosting locally a DNS server and a Web server but right now I am stuck on something regarding Postfix. One big problem I face right now is that Google SMTP servers reject my mail **ONLY WHEN** it is being sent remotely. Strange, right? So if I `telnet localhost 25`, issue `AUTH LOGIN`(not an open relay of course) then send the mail I get a `status = sent` and I **actually receive** the mail message in my Gmail's account Inbox. Works like a charm. On the other hand, if I want to send the mail from a remote host, I use               openssl s_client -connect mail.mydomain.com:465      Then I issue `AUTH LOGIN`, the login process is successful. So I don't have a problem communicating with my server. I can see what happens in the log files. But when I try to send mail like this, Google replies with: > Our system has detected an unusual rate of 421-4.7.0 unsolicited mail > originating from your IP address. To protect our 421-4.7.0 users from spam, > mail sent from your IP address has been temporarily 421-4.7.0 rate limited. Why Google accepts my mail if being sent locally but rejects it when I `openssl` to my server and send it remotely? It's like Postfix on my server makes Google aware of how the email it forwards got to it. Any ideas?


title: How to move or copy list of files referenced in a csv file to a new folder

text: I'd like to write a shell script (OSX) which copies files listed in a csv file to a particular directory. I need to strip quotes from each line in the csv file. My attempt               for i in $(cat myfile.csv)       temp="${$i%\"}"       temp="${temp#\"}"          do       cp foldername/$temp foldername/subfoldername     done      I get this error:               ./mfcsv.sh: line 2: syntax error near unexpected token `temp="${$i%\"}"'     ./mfcsv.sh: line 2: `  temp="${$i%\"}"'


title: Comparing two columns with two columns

text: I have a file that I need to compare the values in two columns with another two columns. For examples:               Item  A     B     C    D     1    201  3101   3101 201     2   3101   201    202 3101       3   3101   201    201 3102      4   3101   201   3202 202       So what I trying to do is comparing column _A_ & _B_ to _C_ & _D_ , but values in column _A_ & _B_ and _C_ & _D_ are interchangeable. And I would like to have a output like _2_ if both values are the same, _1_ if only one is match and _0_ if both are not match. The answer would be something like this               Item  A     B     C      D   Output     1    201  3101   3101   201    2     2   3101   201    202  3101    1     3   3101   201    201  3102    1     4   3101   201   3202   202    0      How would I be able to achieve this?


title: Some questions compiling linux kernel with make-kpkg

text: I'm doing my first steps compiling the linux kernel and adding a new system call. I've managed to do it, but I still have some questions. For this task, I has set up a Virtual Machine guesting debian 7 64 bits. I am following a tutorial found in Internet of how to do this (http://arvindsraj.wordpress.com/2012/10/05/adding-hello-world-system-call-to- linux/) And as documentation, overall, a manual of how to create a custom linux kernel in Debian GNU/Linux and the manual page for make-kpkg. So far, I am using the next script to compile:               #!/bin/sh     make-kpkg clean     INSTALL_MOD_STRIP=1 CONCURRENCY_LEVEL=2 time make-kpkg --initrd --append-to-version=-$1 kernel_image      And, well, I have the following questions:   1. Right now, I'm defining kernel_image only as target. Should I include also kernel_headers? when should I compile and install the kernel_headers? what are they for?   2. If I use as target: binary_arch, is exactly the same than using kernel_image and kernel_headers?   3. I put INSTALL_MOD_STRIP=1 because I read that it compiles it faster and the output is much smaller. I know it reduces the number of modules being compiled. how much is this reduction? Should I use this flag for a final compilation for a final use of the kernel in my computer?? Thank you in advance!


title: kswapd0 takes 99% to 100% CPU in RHEL 6.3

text: I have 5 systems on which I have just installed RHEL6. System configuration is > CPU-i7   >  HDD-500 GB   >  RAM-2 GB   >  Swap- 4 GB I have installed the same software's and all the configuration as per old systems. But my New systems running very slow! `top` command output is as below:               [root@localhost ~]# top          top - 12:27:56 up 24 min,  3 users,  load average: 1.00, 1.00, 0.82     Tasks: 214 total,   2 running, 212 sleeping,   0 stopped,   0 zombie     Cpu(s):  1.1%us, 13.0%sy,  0.0%ni, 85.9%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st      I don't have such problem in my old systems which are having less configuration than new systems! **Update 1:** I agree with Michael and Vonbrand.. But I still have my system very very slow. Specially when I am compiling something in my QtCreator. Even my mouse movement got slow. I checked by adding comment before swap partition in `/etc/fstab` and rebooting, The swap shows 0.0GB but kswapd0 still using 99% to 100%. Why other processors are not utilizing full! My RAM (2GB) is less OR Is there any service, which manages CPU, is not started? **Update 2:** The output of `dmesg` is:                 ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver       alloc irq_desc for 16 on node -1       alloc kstat_irqs on node -1     alloc irq_2_iommu on node -1     ehci_hcd 0000:00:1a.0: PCI INT A -> GSI 16 (level, low) -> IRQ 16     ehci_hcd 0000:00:1a.0: setting latency timer to 64     ehci_hcd 0000:00:1a.0: EHCI Host Controller     ehci_hcd 0000:00:1a.0: new USB bus registered, assigned bus number 1     ehci_hcd 0000:00:1a.0: debug port 2     ehci_hcd 0000:00:1a.0: cache line size of 64 is not supported     ehci_hcd 0000:00:1a.0: irq 16, io mem 0xf7c38000     ehci_hcd 0000:00:1a.0: USB 2.0 started, EHCI 1.00     usb usb1: New USB device found, idVendor=1d6b, idProduct=0002     usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1     usb usb1: Product: EHCI Host Controller     usb usb1: Manufacturer: Linux 2.6.32-71.el6.x86_64 ehci_hcd     usb usb1: SerialNumber: 0000:00:1a.0     usb usb1: configuration #1 chosen from 1 choice     hub 1-0:1.0: USB hub found     hub 1-0:1.0: 3 ports detected       alloc irq_desc for 23 on node -1       alloc kstat_irqs on node -1     alloc irq_2_iommu on node -1     ehci_hcd 0000:00:1d.0: PCI INT A -> GSI 23 (level, low) -> IRQ 23     ehci_hcd 0000:00:1d.0: setting latency timer to 64     ehci_hcd 0000:00:1d.0: EHCI Host Controller     ehci_hcd 0000:00:1d.0: new USB bus registered, assigned bus number 2     ehci_hcd 0000:00:1d.0: debug port 2     ehci_hcd 0000:00:1d.0: cache line size of 64 is not supported     ehci_hcd 0000:00:1d.0: irq 23, io mem 0xf7c37000     ehci_hcd 0000:00:1d.0: USB 2.0 started, EHCI 1.00     usb usb2: New USB device found, idVendor=1d6b, idProduct=0002     usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1     usb usb2: Product: EHCI Host Controller     usb usb2: Manufacturer: Linux 2.6.32-71.el6.x86_64 ehci_hcd     usb usb2: SerialNumber: 0000:00:1d.0     usb usb2: configuration #1 chosen from 1 choice     hub 2-0:1.0: USB hub found     hub 2-0:1.0: 3 ports detected     ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver     uhci_hcd: USB Universal Host Controller Interface driver     PNP: PS/2 Controller [PNP0303:PS2K,PNP0f03:PS2M] at 0x60,0x64 irq 1,12     serio: i8042 KBD port at 0x60,0x64 irq 1     serio: i8042 AUX port at 0x60,0x64 irq 12     mice: PS/2 mouse device common for all mice     rtc_cmos 00:06: RTC can wake from S4     rtc_cmos 00:06: rtc core: registered rtc_cmos as rtc0     rtc0: alarms up to one month, y3k, 242 bytes nvram, hpet irqs     cpuidle: using governor ladder     cpuidle: using governor menu     usbcore: registered new interface driver hiddev     usbcore: registered new interface driver usbhid     usbhid: v2.6:USB HID core driver     TCP cubic registered     Initializing XFRM netlink socket     NET: Registered protocol family 17     registered taskstats version 1     IMA: No TPM chip found, activating TPM-bypass!     rtc_cmos 00:06: setting system clock to 2013-03-04 14:10:29 UTC (1362406229)     Initalizing network drop monitor service     Freeing unused kernel memory: 1220k freed     Write protecting the kernel read-only data: 7176k     dracut: dracut-004-32.el6     dracut: rd_NO_LUKS: removing cryptoluks activation     dracut: rd_NO_LVM: removing LVM activation     device-mapper: uevent: version 1.0.3     device-mapper: ioctl: 4.17.0-ioctl (2010-03-05) initialised: dm-devel@redhat.com     udev: starting version 147     dracut: Starting plymouth daemon     dracut: rd_NO_DM: removing DM RAID activation     dracut: rd_NO_MD: removing MD RAID activation     ahci 0000:00:1f.2: version 3.0     ahci 0000:00:1f.2: PCI INT B -> GSI 19 (level, low) -> IRQ 19       alloc irq_desc for 31 on node -1       alloc kstat_irqs on node -1     alloc irq_2_iommu on node -1     ahci 0000:00:1f.2: irq 31 for MSI/MSI-X     ahci 0000:00:1f.2: AHCI 0001.0300 32 slots 6 ports 6 Gbps 0x5 impl SATA mode     ahci 0000:00:1f.2: flags: 64bit ncq pm led clo pio slum part ems apst      ahci 0000:00:1f.2: setting latency timer to 64     scsi0 : ahci     scsi1 : ahci     scsi2 : ahci     scsi3 : ahci     scsi4 : ahci     scsi5 : ahci     ata1: SATA max UDMA/133 abar m2048@0xf7c36000 port 0xf7c36100 irq 31     ata2: DUMMY     ata3: SATA max UDMA/133 abar m2048@0xf7c36000 port 0xf7c36200 irq 31     ata4: DUMMY     ata5: DUMMY     ata6: DUMMY     usb 1-1: new high speed USB device using ehci_hcd and address 2     usb 1-1: New USB device found, idVendor=8087, idProduct=0024     usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0     usb 1-1: configuration #1 chosen from 1 choice     hub 1-1:1.0: USB hub found     hub 1-1:1.0: 6 ports detected     ata3: SATA link up 1.5 Gbps (SStatus 113 SControl 300)     ata1: SATA link up 6.0 Gbps (SStatus 133 SControl 300)     ata1.00: ACPI _SDD failed (AE 0x5)     ata3.00: ACPI _SDD failed (AE 0x5)     usb 2-1: new high speed USB device using ehci_hcd and address 2     usb 2-1: New USB device found, idVendor=8087, idProduct=0024     usb 2-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0     usb 2-1: configuration #1 chosen from 1 choice     hub 2-1:1.0: USB hub found     hub 2-1:1.0: 8 ports detected     usb 2-1.3: new low speed USB device using ehci_hcd and address 3     usb 2-1.3: New USB device found, idVendor=04ca, idProduct=0062     usb 2-1.3: New USB device strings: Mfr=0, Product=2, SerialNumber=0     usb 2-1.3: Product: USB Optical Mouse     usb 2-1.3: configuration #1 chosen from 1 choice     input: USB Optical Mouse as /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3/2-1.3:1.0/input/input3     generic-usb 0003:04CA:0062.0001: input,hidraw0: USB HID v1.11 Mouse [USB Optical Mouse] on usb-0000:00:1d.0-1.3/input0     usb 2-1.4: new low speed USB device using ehci_hcd and address 4     usb 2-1.4: New USB device found, idVendor=03f0, idProduct=0024     usb 2-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=0     usb 2-1.4: Product: HP Basic USB Keyboard     usb 2-1.4: Manufacturer: CHICONY     usb 2-1.4: configuration #1 chosen from 1 choice     input: CHICONY HP Basic USB Keyboard as /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.4/2-1.4:1.0/input/input4     generic-usb 0003:03F0:0024.0002: input,hidraw1: USB HID v1.11 Keyboard [CHICONY HP Basic USB Keyboard] on usb-0000:00:1d.0-1.4/input0     ata3: SATA link up 1.5 Gbps (SStatus 113 SControl 300)     ata3.00: ACPI _SDD failed (AE 0x5)     ata3.00: ACPI: failed the second time, disabled     ata1: SATA link up 6.0 Gbps (SStatus 133 SControl 300)     ata3.00: ATAPI: hp      DVD-RAM GH82N, R204, max UDMA/100, ATAPI AN     ata1.00: ACPI _SDD failed (AE 0x5)     ata1.00: ACPI: failed the second time, disabled     ata1.00: ATA-8: ST500DM002-1BD142, HP73, max UDMA/100     ata1.00: 976773168 sectors, multi 16: LBA48 NCQ (depth 31/32)     ata1.00: configured for UDMA/100     ata3.00: configured for UDMA/100     scsi 0:0:0:0: Direct-Access     ATA      ST500DM002-1BD14 HP73 PQ: 0 ANSI: 5     scsi 2:0:0:0: CD-ROM            hp       DVD-RAM GH82N    R204 PQ: 0 ANSI: 5     sd 0:0:0:0: [sda] 976773168 512-byte logical blocks: (500 GB/465 GiB)     sd 0:0:0:0: [sda] 4096-byte physical blocks     sd 0:0:0:0: [sda] Write Protect is off     sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00     sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA      sda: sda1 sda2 sda3 sda4 < sda5 sda6 sda7 >     sd 0:0:0:0: [sda] Attached SCSI disk     sr0: scsi3-mmc drive: 40x/40x writer dvd-ram cd/rw xa/form2 cdda tray     Uniform CD-ROM driver Revision: 3.20     sr 2:0:0:0: Attached scsi CD-ROM sr0     EXT4-fs (sda7): INFO: recovery required on readonly filesystem     EXT4-fs (sda7): write access will be enabled during recovery     EXT4-fs (sda7): orphan cleanup on readonly fs     EXT4-fs (sda7): ext4_orphan_cleanup: deleting unreferenced inode 15341115     EXT4-fs (sda7): ext4_orphan_cleanup: deleting unreferenced inode 1835089     EXT4-fs (sda7): ext4_orphan_cleanup: deleting unreferenced inode 1835088     EXT4-fs (sda7): ext4_orphan_cleanup: deleting unreferenced inode 1835087     EXT4-fs (sda7): ext4_orphan_cleanup: deleting unreferenced inode 1835085     EXT4-fs (sda7): ext4_orphan_cleanup: deleting unreferenced inode 1835081     EXT4-fs (sda7): ext4_orphan_cleanup: deleting unreferenced inode 1835080     EXT4-fs (sda7): ext4_orphan_cleanup: deleting unreferenced inode 1835079     EXT4-fs (sda7): ext4_orphan_cleanup: deleting unreferenced inode 1835076     EXT4-fs (sda7): ext4_orphan_cleanup: deleting unreferenced inode 1835075     EXT4-fs (sda7): ext4_orphan_cleanup: deleting unreferenced inode 1835067     EXT4-fs (sda7): 11 orphan inodes deleted     EXT4-fs (sda7): recovery complete     EXT4-fs (sda7): mounted filesystem with ordered data mode     dracut: Mounted root filesystem /dev/sda7     dracut: Loading SELinux policy     SELinux:  Disabled at runtime.     SELinux:  Unregistering netfilter hooks     type=1404 audit(1362406240.622:2): selinux=0 auid=4294967295 ses=4294967295     dracut: /sbin/load_policy: Can't load policy: No such file or directory     dracut: Switching root     udev: starting version 147     e1000e: Intel(R) PRO/1000 Network Driver - 1.2.7-k2     e1000e: Copyright (c) 1999 - 2009 Intel Corporation.       alloc irq_desc for 20 on node -1       alloc kstat_irqs on node -1     alloc irq_2_iommu on node -1     e1000e 0000:00:19.0: PCI INT A -> GSI 20 (level, low) -> IRQ 20     e1000e 0000:00:19.0: setting latency timer to 64       alloc irq_desc for 32 on node -1       alloc kstat_irqs on node -1     alloc irq_2_iommu on node -1     e1000e 0000:00:19.0: irq 32 for MSI/MSI-X     0000:00:19.0: eth0: (PCI Express:2.5GB/s:Width x1) 6c:3b:e5:13:26:21     0000:00:19.0: eth0: Intel(R) PRO/1000 Network Connection     0000:00:19.0: eth0: MAC: 10, PHY: 11, PBA No: 0100ff-0ff     sd 0:0:0:0: Attached scsi generic sg0 type 0     sr 2:0:0:0: Attached scsi generic sg1 type 5     ACPI: WMI: Mapper loaded     EXT4-fs (sda5): mounted filesystem with ordered data mode     microcode: CPU0 sig=0x306a9, pf=0x2, revision=0x12     platform microcode: firmware: requesting intel-ucode/06-3a-09     microcode: CPU1 sig=0x306a9, pf=0x2, revision=0x12     platform microcode: firmware: requesting intel-ucode/06-3a-09     microcode: CPU2 sig=0x306a9, pf=0x2, revision=0x12     platform microcode: firmware: requesting intel-ucode/06-3a-09     microcode: CPU3 sig=0x306a9, pf=0x2, revision=0x12     platform microcode: firmware: requesting intel-ucode/06-3a-09     microcode: CPU4 sig=0x306a9, pf=0x2, revision=0x12     platform microcode: firmware: requesting intel-ucode/06-3a-09     microcode: CPU5 sig=0x306a9, pf=0x2, revision=0x12     platform microcode: firmware: requesting intel-ucode/06-3a-09     microcode: CPU6 sig=0x306a9, pf=0x2, revision=0x12     platform microcode: firmware: requesting intel-ucode/06-3a-09     microcode: CPU7 sig=0x306a9, pf=0x2, revision=0x12     platform microcode: firmware: requesting intel-ucode/06-3a-09     Microcode Update Driver: v2.00 <tigran@aivazian.fsnet.co.uk>, Peter Oruba     Microcode Update Driver: v2.00 removed.     ip_tables: (C) 2000-2006 Netfilter Core Team     NET: Registered protocol family 10     lo: Disabled Privacy Extensions     e1000e 0000:00:19.0: irq 32 for MSI/MSI-X     e1000e 0000:00:19.0: irq 32 for MSI/MSI-X     ADDRCONF(NETDEV_UP): eth0: link is not ready     e1000e: eth0 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: None     ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready     eth0: no IPv6 routers present     RPC: Registered udp transport module.     RPC: Registered tcp transport module.     RPC: Registered tcp NFSv4.1 backchannel transport module.     Bridge firewalling registered     virbr0: starting userspace STP failed, starting kernel STP     nf_conntrack version 0.5.0 (16384 buckets, 65536 max)     Ebtables v2.0 registered     fuse init (API version 7.13)     ip6_tables: (C) 2000-2006 Netfilter Core Team     lo: Disabled Privacy Extensions     tun: Universal TUN/TAP device driver, 1.6     tun: (C) 1999-2004 Max Krasnyansky <maxk@qualcomm.com>     device vnet0 entered promiscuous mode     virbr0: topology change detected, propagating     virbr0: port 1(vnet0) entering forwarding state     vnet0: no IPv6 routers present     kvm: 3639: cpu0 unimplemented perfctr wrmsr: 0xc1 data 0x0     kvm: 3639: cpu0 unimplemented perfctr wrmsr: 0x186 data 0x130079     kvm: 3639: cpu0 unimplemented perfctr wrmsr: 0xc1 data 0xffcc3e1a     kvm: 3639: cpu0 unimplemented perfctr wrmsr: 0x186 data 0x530079     kvm: 3639: cpu1 unimplemented perfctr wrmsr: 0xc1 data 0x0     kvm: 3639: cpu1 unimplemented perfctr wrmsr: 0x186 data 0x130079     kvm: 3639: cpu1 unimplemented perfctr wrmsr: 0xc1 data 0xffcc3e1a     kvm: 3639: cpu1 unimplemented perfctr wrmsr: 0x186 data 0x530079     kvm: 3639: cpu2 unimplemented perfctr wrmsr: 0xc1 data 0x0     virbr0: port 1(vnet0) entering disabled state     device vnet0 left promiscuous mode     virbr0: port 1(vnet0) entering disabled state      I didn't noticed anything related to `swap` here. **Update 3:** See my Answer Below, `Its a kernel bug`!


title: Automatically copy PDF.plugin to Chromium.app

text: I'm using Chromatic.app to update my Chromium.app recently. I'd like to use Chrome.app's PDF.plugin in Chromium.app. Therefore I need to copy PDF.plugin to the following directory:               /Applications/Chromium.app/Contents/Versions/$VERSION/Chromium\ Framework.framework/Internet\ Plug-Ins/      Maybe you guys have an idea for a bash-script (or something else) which runs after Chromatic.app updated my chromium and copies PDF.plugin to the new Chromium-Internet-Plug-Ins-directory. The clue here is, that the version-number ("$VERSION" in my path above) always changes...


title: How to extend my wireless network with OpenWrt

text: I have two routers, both running OpenWRT 10.04 The first is a WRT160NL router connected to my ISP. I am using it as an access point with the ESSID of "160AP". It's WEP password is "AAAAA" and it's broadcasting on on channel 5. My purpose: extend the range of this first router with another router. My other router is an Asus WL500GPv2. Documentation for bridging is on the OpenWRT wiki here. Following Step 1 I edited `/etc/config/wireless` to look like this:               config 'wifi-device' 'wl0'         option 'type' 'broadcom'         option 'channel' '5'         option 'disabled' '0'          config 'wifi-iface'         option 'device' 'wl0'         option 'network' 'lan'         option 'ssid' '160AP'         option 'mode' 'sta'         option 'encryption' 'wep'         option 'key' 'AAAAA'      Now I am trying to run the wifi command:               root@OpenWrt:~# wifi     Command 'set wepkey' failed: -1     root@OpenWrt:~#       What am I missing? The 5 character password for the WEP is **good**. The SSID and channel of the WRT160NL is good too. If try to continue: (XX:XX:XX:XX:XX:XX is the MAC of the WT160NL wlan0):               root@OpenWrt:~# iwconfig wl0     wl0       IEEE 802.11-DS  ESSID:"160AP"             Mode:Managed  Frequency:2.432 GHz  Access Point: XX:XX:XX:XX:XX:XX           Bit Rate=54 Mb/s   Tx-Power:32 dBm              RTS thr:off   Fragment thr:off           Power Management:off           Link Quality=5/5  Signal level=-52 dBm  Noise level=-92 dBm           Rx invalid nwid:0  Rx invalid crypt:7  Rx invalid frag:0           Tx excessive retries:0  Invalid misc:0   Missed beacon:0      So does this mean that the "Command 'set wepkey' failed: -1" message was just a warning, and it actually connected? So I continued as follows: Editing `/etc/config/network`:               #### LAN configuration     config interface lan         option type     bridge         option ifname   "eth0.0"         option proto    static         option ipaddr   192.168.1.2         option netmask  255.255.255.0      Disabled the firewall:               $ /etc/init.d/firewall stop     $ /etc/init.d/firewall disable      Edit `/etc/config/dhcp`               config dhcp lan         option interface        lan         option start    100         option limit    150         option leasetime        12h         option ignore   1      Restarting DNS services:               $ /etc/init.d/dnsmasq restart      Then I rebooted the router and scaned the available wireless networks from my notebook. But here comes the fun part (At this point I've been trying to solve this for about ~2 hours now, so yes, very funny): I can Only see the "160AP" Access Point which is the original WT160NL router. (I think this because the signal strength is the same... my notebook is next to the WL500GPv2). What is the problem with my setup? What am I missing?


title: How to cd into a directory as part of shell script and do a word count of files?

text: I am trying to get the latest folder inside my directory in machineB and machineC. So I came up with the below command which will find me the latest folder inside -               `/bat/data/snapshot`      And that latest folder will be in the form of `YYYYMMDD`. Below is my shell script -               #!/bin/bash          readonly FILERS_LOCATION=(machineB machineC)     readonly MAPPED_LOCATION=/bat/data/snapshot          dir1=$(ssh -o "StrictHostKeyChecking no" david@${FILERS_LOCATION[0]} ls -dt1 "$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 "$MAPPED_LOCATION"/[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9] | head -n1)          echo $dir1     echo $dir2      Now `dir1` will look like in `machineB` as -               /bat/data/snapshot/20131222      And `dir2` will look like in `machineC` as -               /bat/data/snapshot/20131222      Now I need to `cd` into these two directory and do a word count of files and store them in length1 and length2 variable -               ls | wc -l      I thought I can do this but I thought before that I need to cd into those two directory and then do a word count -               echo $dir1     echo $dir2          length1=$(ssh -o "StrictHostKeyChecking no" david@${FILERS_LOCATION[0]} ls | wc -l "$dir1")     length2=$(ssh -o "StrictHostKeyChecking no" david@${FILERS_LOCATION[1]} ls | wc -l "$dir2")          echo $length1     echo $length2         So now I am not sure how to do cd into those two directory and then do a `ls` and find the count of files as part of that shell script?


title: Partially remove formatting from text in clipboard

text: I need to delete the formatting in the text contained in the clipboard, but keeping some elements. The most important are the "new line" characters. In a simple script, the effect of               variable=$(xsel --clipboard)      is that the text appears to be all in the same line, so it has lost all the "new line" characters. 1) Is there a way to avoid this? Sometimes I copy text from Windows format (so the newline is "\r\n") and sometimes from *nix (and so the newline is just "\n"). 2) The previous question was the most important, but: there is also a way to preserve the "bold", "italic" and "underlined" formatting elements? Because they are all lost too with that shell command. Thank you anyway!


title: ZSH autocompletion gives seemingly random errors after some time

text: My zsh autocompletion is broken in a strange way. For clean logins everything works but after some time I will get seemingly random autocompletion errors, for different "kinds" of autocompletion. Sometimes `ls foo<tab>` works but `rm foo<tab>` won't. I am completely lost on how to debug this. I could not find a pattern to a particular command causing it. Neither could I see a pattern on what completion works and what doesn't. In my routine I use gnu modules, run make, compilers, nano etc.. The errors I get upon autocompletion look like this:               /bin/zsh:4: _main_complete: function definition file not found      or               (eval):1: _autocd: function definition file not found     (eval):1: _autocd: function definition file not found     (eval):1: _autocd: function definition file not found     _main_complete:173: _ignored: function definition file not found     _main_complete:173: _ignored: function definition file not found     _main_complete:173: _ignored: function definition file not found      or               (eval):1: _rm: function definition file not found     (eval):1: _rm: function definition file not found     (eval):1: _rm: function definition file not found      I have seen similar messages for _sudo and _module. I am using zsh (5.0.2) with oh-my-zsh in multiple screen sessions on a machine whose home filesystem is on nfs. I attach to the screen sessions automatically on each login with `screen -xrR` in `.zprofile` Two files $HOME/.zcompdump and $HOME/.zompdump-`hostname`-5.0.2 are created whenever i login. Removing them made no difference.


title: location of the "disk identifier"

text: According to Wikipedia, "disk signature" is a 32 bit value stored in MBR on bytes 440 - 443. According to `fdisk`, my "disk identifier" is _00043afc_ in hex:               # fdisk -lu /dev/sda | grep identi     Disk identifier: 0x00043afc     #       However, I can not confirm this with `dd`:               # dd if=/dev/sda skip=439 bs=1 count=4 2>/dev/null | xxd -ps     c3fc3a04     #       Even if I check the entire MBR, I do not see the "disk identifier":               # dd if=/dev/sda bs=512 count=1 2>/dev/null | xxd -ps | grep 43a     #       Where is the "disk identifier" stored?


title: rsyslogd crashes while running from board.(rsyslogd -M /lib/rsyslog option is running well)

text: when i tried rsyslogd without any option from my board it will give following error.               rsyslog runtime error(-2066): could not load module '/home/vipul_test/lib/rsyslog/lmnet.so', dlopen: /home/vipul_test/lib/rsyslog/lmnet.so: cannot open shared object file: No such file or directory      [try http://www.rsyslog.com/e/2066 ]     Error during class init for object 'conf' - failing...     rsyslogd initializiation failed - global classes could not be initialized.     Did you do a "make install"?      Suggested action: `run rsyslogd with -d -n` options to see what exactly fails.               rsyslogd: run failed with error -2066 (see rsyslog.h or try http://www.rsyslog.com/e/2066 to learn what that number means)      while `rsyslogd -d -n` option is not running and giving segmantation fault as below.               Segmentation fault (core dumped)     ash Get The <Segmentation fault>, Retry!     Segmentation fault (core dumped)     ash Get The <Segmentation fault>, Retry Fail!      only `rsyslogd -M /lib/rsyslogd` option is running. so how to run rsyslogd without any interpretation?


title: Unpack files and directories from an image created by dd?

text: I created an image of an NTFS partition using `dd`. I wonder if I can unload/unpack the files and directories in the image to any partition whose size is larger than the image size, so that I can access the files and directories just in the same way as accessing the original partition? If yes, how shall I do it? * * * **Added:** Just found something useful from a link : > To restore a partition or a hard disk from an image file, just exchange the > arguments "if" and "of". For example, restore the first partition of > /dev/sda from the image file "disk2.img": >   >   >     dd if=disk2.img of=/dev/sda1 >     1. I wonder what will happen, if the partition for `of` is not the original partition from where the image is created?     * Consider the cases when the partition for `of` is smaller or larger than the original partition.     * Also consider the cases when the partition for `of` already has some data in it. Is it possible to restore from a particular position in the partition, so to avoid overwriting any existing data on the partition for `of`?   2. Can the restoration from an image created by `dd` used by other similar applications, even by Windows software? In other words, does the image created by `dd` have some format specific to `dd`? Thanks!


title: Upgrading software in linux

text: I have a program called zlib I need to upgrade. As I've never downloaded it before I suspect it comes with Ubuntu. Normally I'd just download and compile it, but a different tool (vcftools) is going to use it so I can't just install it locally. I suspect I either need to   1. Install the new version of zlib somewhere and tell the system to look for zlib in the folder I installed it. If zlib is backwards compatible this should be ok, I hope.   2. Upgrade the current version (but sudo apt-get install tells me I have the most recent version) How do I do this? Thanks.


title: Issues with router Amper ASL-26555 in Linux Mint 13

text: I have an issue with the wireless network. I have a new router and it seems to work right, but sometimes, the wireless network is disconnected. When I try to connect again I get the error: `Bad Password`. But the password is correct. Then, I need to restart the PC so that the wireless network works again. I had the same issue a long time ago with Network Manager, and I solved it replacing with Wicd. Now I'm using Wicd. I'm using Linux Mint 13 Maya. The router is an Amper ASL-26555. `wicd.log` says:               2013/10/16 11:39:33 :: Connecting to wireless network MyNetwork     2013/10/16 11:39:33 :: attempting to set hostname with dhclient     2013/10/16 11:39:33 :: using dhcpcd or another supported client may work better     2013/10/16 11:39:34 :: attempting to set hostname with dhclient     2013/10/16 11:39:34 :: using dhcpcd or another supported client may work better     2013/10/16 11:39:34 :: Putting interface down     2013/10/16 11:39:34 :: Releasing DHCP leases...     2013/10/16 11:39:34 :: attempting to set hostname with dhclient     2013/10/16 11:39:34 :: using dhcpcd or another supported client may work better     2013/10/16 11:39:34 :: Setting false IP...     2013/10/16 11:39:34 :: Stopping wpa_supplicant     2013/10/16 11:39:34 :: Flushing the routing table...     2013/10/16 11:39:34 :: Putting interface up...     2013/10/16 11:39:36 :: Generating psk...     2013/10/16 11:39:36 :: Attempting to authenticate...     2013/10/16 11:40:12 :: wpa_supplicant authentication may have failed.     2013/10/16 11:40:12 :: connect result is failed     2013/10/16 11:40:12 :: exiting connection thread     2013/10/16 11:40:12 :: Sending connection attempt result bad_pass     2013/10/16 11:40:12 :: attempting to set hostname with dhclient     2013/10/16 11:40:12 :: using dhcpcd or another supported client may work better     2013/10/16 11:40:12 :: attempting to set hostname with dhclient     2013/10/16 11:40:12 :: using dhcpcd or another supported client may work better      Any idea of how to solve it? **Update:** I've talked with my Internet provider and said that probably it is due to the encryption type. It is WPA and they require me to use WEP. But I'd prefer not to use a weaker encryption. ¿Anyone has had this kind of issue?


title: How can i get five seconds of data appended to the end of file?

text: suppose if a shell script appends a data to a file.txt like               1...........     2...........     3.............     4.............     5..............      Now i want another script that could check the fresh data appended to file.txt within five seconds not the complete data. I don't know if there is any otpion for `tail -f` which shows complete data. for understanding something like `tail -5 file.txt` where -5 is not number of lines but number no seconds. NOTE : I don't want to miss any data each time it should give me the data from where it left the last time.This is important.


title: Can't open display: 192.168...

text: Recently I stumbled across the problem with remote X display (without `ssh`). I have two hosts   * 192.168.0.3 - which runs xclients   * 192.168.0.4 - which has xserver My configuration of lightdm.conf               #     # General configuration     #     [LightDM]     [SeatDefaults]     xserver-allow-tcp=true     greeter-session=unity-greeter     greeter-hide-users=true     user-session=default     session-wrapper=/etc/X11/Xsession     autologin-user=debian     autologin-user-timeout=0          [XDMCPServer]     enabled=true      On 192.168.0.104 I've executed `xhost +`. I've also checked with telnet if port 6000 is open for connection by executing `telnet 192.168.0.104 6000` telnet successfully connected to remote computer. But when I am trying to display something on remote X by command: `xeyes -display 192.168.0.104` I got: `Error: Can't open display` both machines have Debian installed with lxde. Any suggestions why it doesn't work?


title: /etc/vfstab in Solaris 11

text: I would like to mount a folder from the remote server `10.12.13.2`. When I type: `mount -F nfs 10.12.13.2:/username /remote/username`, the folder username gets mounted in the directory `/remote/username`. Now I would like to make an entry in the `/etc/vfstab`, but without **mount at boot**.               10.12.13.2:/username   -       /remote/username       nfs     -       no      rw      Now, how can I mount the directory? When I type mount `/remote/username`, I always get: `mount: mount point cannot be determined`


title: How to leave only given characters in a file?

text: **Q:** How can I leave only the following characters in a file?   * the ASCII decimal 10, the ENTER, so the so called "line feed"   * ASCII printable characters (character code 32-127)   * The extended ASCII codes (character code 128-255) We need it to clear text files that contains many garbage.. Example garbage chars: ![enter image description here](http://i.stack.imgur.com/Jfhjf.png) UPDATE:               $ printf 'árvíztűrő tükörfúrógép\n'     árvíztűrő tükörfúrógép     $      $ printf 'árvíztűrő tükörfúrógép\n' | tr -dc '[\x0A\x20-\xFF]' && echo     rvtrtkrfrgp     $


title: How to configure Unbound to use DNSSEC?

text: I'm having a local caching DNS server: Unbound:               [root@localhost /etc/unbound] cat unbound.conf     server:         interface: 127.0.0.1         access-control: 127.0.0.1 allow          verbosity: 1         harden-referral-path: yes           use-caps-for-id: yes         prefetch: yes           prefetch-key: yes     [root@localhost /etc/unbound]       Rebooted the notebook, cleaned the browser, and go to: http://dnssec.vs.uni-due.de/ it says: **No, your DNS resolver does NOT validate DNSSEC signatures.** ..What am I missing? UPDATE: http://dnssectest.sidn.nl/ - says this too.. according to "dig" I'm using 127.0.0.1 for DNS server.. I tried service iptables stop..didn't worked. BTW, why do stackexchange look like this ( http://i.imgur.com/4eTxo3M.png ) when I'm using a local DNS cache?


title: What does :p[rint] do in vim?

text: The help text is a little vague as to what this command achieves.                                   Print [range] lines (default current line).                         Note: If you are looking for a way to print your text                         on paper see |:hardcopy|.  In the GUI you can use the                         File.Print menu entry.                         See |ex-flags| for [flags].      I know I've used it by mistake to mean :p[rev] several times in the past, but I've never heard the whirring of a printer. Nor have any strange files appeared, nor have I found the line I am on appear in stdout. So what then, does typing _:print_ do in vim?


title: Copying Linux NFS files to a standard consumer external hard drive

text: I am a graduate student and a relative Linux novice. My institution has an in- house Linux cluster on which I run many scientific simulations. I have a Windows desktop computer from which I access the Linux cluster via SSH. I have a large amount (~1 TB) of simulation results data on the Linux cluster's file server. When the project is finished, the research group probably will not have the space to save the simulation results. However, I would like to save the files (with the group's permission, of course) on an external drive that I myself will purchase. My question is, if I purchase a standard Windows external hard drive with a USB connection, will I be able to copy the files from the Linux cluster's files server to the external drive? (I am assuming that the Linux cluster has a USB port, but this is something that I will need to verify.) It looks like many standard Windows external hard drives are formatted in either NTFS or FAT32, whereas our Ubuntu Linux file server uses NFS. Here are some examples from Amazon:   * Seagate Backup Plus 4 TB USB 3.0 Desktop External Hard Drive STCA4000100 (NTFS)   * WD My Book 4TB External Hard Drive Storage USB 3.0 File Backup and Storage (NTFS)   * BUFFALO MiniStation Plus 1 TB USB 3.0 Portable Hard Drive - HD-PNT1.0U3BS Silver (FAT32) Do you think any or all of the above hard drives will be able to be **_easily_** reformatted in NFS for use with the Linux cluster? On the other hand, Amazon _does_ have a section for "Linux platform support" external hard drives, such as:   * LaCie 3 TB Minimus Hard Disk USB 3.0 (302004) (file system not specified, as far as I can tell; perhaps it is unformatted?) But, even if standard Windows external hard drives are easily reformatted, the problem is that I may subsequently want to copy the files from the external hard drive to a Windows computer, which is NTFS. This part of the question may require a separate question or a question on SuperUser, but is it possible to copy NFS files from an external hard drive to a Windows NTFS computer? Thanks for your time.


title: How to run APB Infinite on Linux?

text: I want to use Raspberry Pi to run the APB Infinite Neverwinter bot. I cannot make in work using Wine even on Ubuntu.


title: Laptop shutting off randomly

text: My laptop randomly shuts off occasionally when using Linux Mint 16 Cinnamon (64 bit) It's not overheating because it has shut off when I am just watching a video, but it has also shut off when trying to launch a game (DOTA 2). I'm not sure what is causing this. Battery is not an issue because it was plugged into the wall with 100% battery. This never happens on Windows (dual boot)


title: Retrieve system commands without reading sources

text: Sometimes I wonder how Linux programs achieve certain results knowing that they internally use system calls (`system()` or `exec()` in C programs). Given a working binary I wonder if it is possible to know easily which commands where executed. In a concrete example I use the genealogy tool `gramps` to build a family tree. I assume that it generates certain graphs using `graphviz` (using command line tools rather than libraries). Now I want to reproduce the same manually on the command line. This task would be simplified a lot if I knew the commands used by `gramps`. I could download and look at the sources to find out, but I wonder if I can obtain this information more easily using debugging tools such as `strace`, something like `strace gramps 2>/dev/stdout | grep system`. Note that I would not like to search the binary using a hex editor unless this can be automated. Looking at the sources directly should be easier in this case.


title: 100% open source linux distro

text: Do 100% open source linux distro's exist? i.e. distros which contain absolutely no closed source components anywhere at all? Apparently distros like Ubuntu contains bits and pieces which are closed source. Please note, I am not asking for 100% free software based linux distribution, I am specifically asking for 100% open source linux distributions, distributions which have absolutely nothing within them which is closed source.


title: How do I deploy Node on my domain

text: I have a remote dedicated Centos machine that uses cPanel and WHM. I know how to use ssh also. I just want to know how I can map my domain to node. I need to know where I put my server.js file, etc. My hosting structure is setup like this:               /home/mydomain/public_html/      The mydomain directory has these folders:               ./  .bash_history  .bashrc  .cpanel/    .emacs    logs/   .nvm/     public_html/      ../  .bash_logout   .contactemail  cpanel3-skel/  etc/    mail/      perl5/       tmp/     access-logs@  .bash_profile  .cpaddons/   .dns  .htpasswds/  .mozilla/  public_ftp/  www@      Now I tried this tutorial https://gist.github.com/stagas/754303 But when I go to my IP address I get a page with the following:               Apache/2.2.26 (Unix) mod_ssl/2.2.26 OpenSSL/0.9.8e-fips-rhel5 mod_bwlimited/1.4 Server at 111.111.111.111 Port 80      Is there a guide or video on actually accomplishing mapping my domain to a node server?


title: Can't install Crunchbang

text: I wanted to install Crunchbang 11 x64 from my USB (8GB, fat32), but when the installer starts, it aborts because the installer doesn't find a Crunchbang CD in my drive. I tried it via the `dd` command on Kubuntu and I tried it with Unetbootin on Kubuntu and Windows and I tried the universal USB installer on Windows, but nothing works. Is there any way to get rid of this problem without installing from a CD? (I don't have one and don't want to buy one right now :D)


title: How to install [ gcc ] without internet connection?

text: I simply ran                yum install gcc      this is what came up:               ================================================================================          Package             Arch        Version                     Repository    Size         ================================================================================         Installing:          gcc                 x86_64      4.4.7-3.el6                 base          10 M         Installing for dependencies:          cloog-ppl           x86_64      0.15.7-1.2.el6              base          93 k          cpp                 x86_64      4.4.7-3.el6                 base         3.7 M          glibc-devel         x86_64      2.12-1.107.el6_4.4          updates      974 k          glibc-headers       x86_64      2.12-1.107.el6_4.4          updates      605 k          kernel-headers      x86_64      2.6.32-358.18.1.el6         updates      2.3 M          mpfr                x86_64      2.4.1-6.el6                 base         157 k          ppl                 x86_64      0.10.2-11.el6               base         1.3 M         Updating for dependencies:          glibc               x86_64      2.12-1.107.el6_4.4          updates      3.8 M          glibc-common        x86_64      2.12-1.107.el6_4.4          updates       14 M              Transaction Summary         ================================================================================         Install       8 Package(s)         Upgrade       2 Package(s)              Total download size: 37 M         Is this ok [y/N]: n      so i ran               repoquery --location      on each one of those items. and got their downloadable url. i simply created a new folder and then downloaded all these files like this.               # wget http://mirrors.kernel.org/centos/6.4/updates/x86_64/Packages/glibc-common-2.12-1.107.el6_4.4.x86_64.rpm     # wget http://mirrors.kernel.org/centos/6.4/updates/x86_64/Packages/glibc-2.12-1.107.el6_4.4.x86_64.rpm     # wget http://mirror.wiredtree.com/centos/6.4/os/x86_64/Packages/ppl-0.10.2-11.el6.x86_64.rpm     # wget http://mirror.wiredtree.com/centos/6.4/os/x86_64/Packages/mpfr-2.4.1-6.el6.x86_64.rpm     # wget http://mirrors.kernel.org/centos/6.4/updates/x86_64/Packages/kernel-headers-2.6.32-358.18.1.el6.x86_64.rpm     # wget http://mirrors.kernel.org/centos/6.4/updates/x86_64/Packages/glibc-headers-2.12-1.107.el6_4.4.x86_64.rpm     # wget http://mirrors.kernel.org/centos/6.4/updates/x86_64/Packages/glibc-devel-2.12-1.107.el6_4.4.x86_64.rpm     # wget http://mirror.wiredtree.com/centos/6.4/os/x86_64/Packages/cpp-4.4.7-3.el6.x86_64.rpm     # wget http://mirror.wiredtree.com/centos/6.4/os/x86_64/Packages/cloog-ppl-0.15.7-1.2.el6.x86_64.rpm     # wget http://mirror.wiredtree.com/centos/6.4/os/x86_64/Packages/gcc-4.4.7-3.el6.x86_64.rpm      but it appears they were not in any particular order by the               yum install gcc      so i started installing some of them but i got stuck.               rpm -ivh mpfr-2.4.1-6.el6.x86_64.rpm     rpm -ivh cpp-4.4.7-3.el6.x86_64.rpm     rpm -ivh ppl-0.10.2-11.el6.x86_64.rpm     rpm -ivh kernel-headers-2.6.32-358.18.1.el6.x86_64.rpm     rpm -ivh cloog-ppl-0.15.7-1.2.el6.x86_64.rpm     #     rpm -ivh glibc-common-2.12-1.107.el6_4.4.x86_64.rpm     rpm -ivh glibc-2.12-1.107.el6_4.4.x86_64.rpm     rpm -ivh glibc-headers-2.12-1.107.el6_4.4.x86_64.rpm     rpm -ivh glibc-devel-2.12-1.107.el6_4.4.x86_64.rpm     rpm -ivh gcc-4.4.7-3.el6.x86_64.rpm      in other words everything was installed fine ( i sorted them out based on what was installed without problems. right under `#` is where the problems start. i can not run anything after the # because nothing is installing after that line. what should i do ? # UPDATE they are failing after the #   because.. the first one depends on the second one   and second one depends on the first one.   in other words..               rpm -ivh glibc-common-2.12-1.107.el6_4.4.x86_64.rpm      is asking for               rpm -ivh glibc-2.12-1.107.el6_4.4.x86_64.rpm      while that one is asking for the first one again.


title: Facelifting XClock while using Xrender: A long and winding road

text: Basically, `xclock` is a great tool, and every basic X setup would have it "onboard". However, _configuring_ `xclock` (analog) _while_ keeping `XRender` active is definitely not for the faint of heart. In particular, beginners will not have any chance to configure the _analog_ clock without delving deeply into the `.Xresource` realm, since everything you set at the command line will be _for the non-rendered mode only_ (requires option `-norender`) and ignored by default (which means, that `XRender` is being used). Plus, the documentation about it is abysmal, and examples which actually _deal_ with `XRender` are rare as hen's teeth. Hence, I decided to start my own approach.   I wish there was an easier way to do all this, but there apparently isn't. For one, this question will probably help new users as a guide how to set things up for "their" `xclock`; on the other hand, I'd also like to ask you guys if there is any way to improve my "configuration file" (mind the quotes). Oddly enough, `.Xresources` is widely deemed "obsolete" and "last century", but what if the application you use _does_ rely on the old-fashioned way, using `xrdb`, `.Xresources` and the whole caboodle? I personally fancied a _" **night design** "_ because it fit perfectly to my desktop style. So this is what I did:               $ touch ~/.Xresources     $ vi ~/.Xresources          XClock*foreground: #fbfbfb     XClock*background: #000018     XClock*update: 1     XClock*geometry:          210x210+1020+12     XClock.Clock.majorColor:  rgba:f0/f0/19/7b     XClock.Clock.minorColor:  rgba:a0/c0/f0/c0     XClock.Clock.hourColor:   rgba:c9/66/11/72     XClock.Clock.minuteColor: rgba:00/82/9f/72     XClock.Clock.secondColor: rgba:50/93/30/6f      `rgba` stands for "red, green, blue, alpha" - where the fourth parameter, _alpha_ , will indicate the opacity level in hexadecimal notation: a `00` will make the clock hand or tick mark invisible; a `ff` will turn any opacity off.   So far, so good. Since we do not want to restart the `X` server for these things to come into effect, we will simply merge our settings into those that may (or, as usual, may not) be already there:               $ xrdb -merge ~/.Xresources && xclock &      Although I hate to brag, I honestly think it looks _way_ better than the boring design which is default on my desktop. But during my efforts in getting this to work the way I wanted to, there has also a question come up from my side: I actually "stole" the syntax `XClock.Clock.<parameter>` from `/etc/X11/app-defaults/XClock-color`.   Interestingly enough, ALL parameters that end in `...Color` require the same `XClock.` **Clock**`.<parameter>` syntax as in `app-defaults`; e. g. `XClock*hourColor: rgba:ff/ff/ff/80` will NOT get the hour hand white, nor set the opacity to `0x80`. Why is that so?   Up to now, I thought the `*` was simply a wildcard meaning `XClock<whatever><parameter>`.


title: Debian segfault in libc2.7

text: I am running a test on my machine in which I assigned a lot of IPs to some tap interfaces (created by me before the test) on my debian machine and tried to run curl commands with the source being these IPs. I get lots of seg faults similar to the following:               kernel: [14390.470990] curl[25526]: segfault at bf150ff0 ip b76aee93 sp bf150fd4 error 6 in libc-2.7.so[b75c4000+138000]      I even get segfaults while trying to do ssh to the machine, trying to create a file, and for a bunch of other commands. This is a Debian Lenny machine. I came across this debian bug report which concerns the same issue. It says that a workaround is to remove the "unstable" entry from sources.list. I don't haven't pointed it to unstable ever since the beginning. Could someone with more expertise in linux go through the link I gave and explain to me what is going on and what I should do to resolve this?


title: Fatal error: Class 'HttpRequest' not found

text: Whilst trying to make this request I have this error. I have tried to run "`sudo pecl install pecl_http`" but always fails.               Could not find curl/curl.h      After I have tired(yum instead of apt-get because I am running centOS):               sudo yum install libcurl4-gnults-dev      But this sends:               No package libcurl4-gnutls-dev avaliable Error: Nothing to do.      Any more ideas guys I'm a bit stuck.


title: Skype won't start on xfce with Slackware 64 bit multilib

text: I'm trying to install Skype under Slackware 14.0 x64 multilib with xfce 4.10 but I get issue that I can't resolve. I have installed various versions of Skype (static, dynamic, newer, older, etc.) but they all have one thing in common - they won't appear when I'm on xfce. If I will start KDE everything works fine. There is no error, any trace in logs, `ps aux|grep skype` shows running process named `skype` but nothing appears and I can't make Skype window appear. I don't know what to include as it seems to me that Skype is working (on KDE) but there is some issue with xfce, but I've no idea where to start resolving this. Any ideas? Edit: If I will try running Skype as root I receive such output:               bash-4.2# skype     bash-4.2# No protocol specified     *** glibc detected *** /usr/share/skype/skype: double free or corruption      (!prev): 0xf9370e48 ***     ======= Backtrace: =========     /usr/share/skype/lib32/libc.so.6(+0x78027)[0xf2d91027]     /usr/share/skype/lib32/libstdc++.so.6(_ZdlPv+0x1f)[0xf2f2e9bf]     /usr/share/skype/lib32/libstdc++.so.6(_ZdaPv+0x1b)[0xf2f2ea0b]     [0xf673f2f7]     ======= Memory map: ========     (...)      After quick googling I've found a lot of various possible causes of that behavior (most of which vere related to some old versions - 2.x and such), but neither running               QT_IM_MODULE="" skype      nor               MALLOC_CHECK_=1 skype      helped. Creating `Logs` directory in Skype's directory also didn't help. Edit: Half year later and I still can't get it working, I've updated Skype to 4.2.0.13 and Slackware to 14.1, and now it throws no error, but of course doesn't work too, running `LD_DEBUG=all skype` stops at:                    13254: symbol=dup2;  lookup in file=/lib64/libc.so.6 [0]          13254: binding file /usr/libexec/gconfd-2 [0] to /lib64/libc.so.6 [0]: normal symbol `dup2' [GLIBC_2.2.5]      But I don't know how to resolve that since this throws no error, so I have to use osme else windows manager now. Unfortunately all other managers on my system are able to run skype, only xfce is failing here.


title: Mysterious repeating of entered command in shell

text: After booting up my system and logging in (before starting X, I start it manually via startx) I suddenly get the following output after entering a command:               $ cmd     ;user@host: cmd;cmd;cmd;          [output of 'cmd']          $      After starting X and starting up a terminal this stops; after terminating X it happens again on the plain TTY. I'm currently using zsh with 'oh-my-zsh'. It only occures there, when using bash it does not occur, there's just a semicolon in front of the username. Anyone a clue what happens here and how to avoid it?


title: In a Bash if condition, how to check whether any files matching a simple wildcard expression exist?

text: Stupidly, I had been using a condition like this as part of a script:               if [ $(ls FOO* 2> /dev/null) ] # if files named "FOO*" were downloaded      then         echo "Files found"          # ... process and email results     else         echo "Not found"         # ... email warning that no files were found (against expectations)     fi      That works for **zero and one files** named `FOO*`, but **fails if there are more than one**. From logs I found several different error messages stemming from this:               [: FOO_20131107_082920: unary operator expected     [: FOO_20131108_070203: binary operator expected     [: too many arguments      My question is: what is the correct way to check, in a Bash `if` condition, whether _one or more_ files whose name begins with `FOO` exist? GNU bash, version 4.2.25(1)-release (x86_64-pc-linux-gnu)


title: What is a command to find priority of process in Linux?

text: How can i view the priority of a specific process ?


title: sqlite fts quoting problem

text: I can do this in sqlite tool:               sqlite> select caption  from notes_fts where notes_fts MATCH '"perl install"';      but cannot from the Linux shell i.e., this fails:               user@host:~$ sqlite3 sqldb  "select caption  from notes_fts where notes_fts MATCH '"it perl install  "';"      I tried different versions of quoting `"` but it didn't work.


title: SSHFS seems to be working, but Sublime + SSHFS doesn't?

text: I use the command, to mount my remote filesystem using SSHFS:               $ sshfs -o uid=1000 -o gid=1000 root@10.0.1.198:/ "/home/chendy/my_mount"      Everything seems to be happy, unless I try and open and save a file with Sublime... **View and rename files? YES:** ... I can view my files in the file explorer, and I can successfully rename files using the file explorer. **Permissions/Users/Groups? YES** ... When checking permissions, everything seems in order:               $ ls -l '/home/chendy/my_mount/home/kano/test.py'     -rwxrwxrwx 1 chendy chendy 927 Apr 15 16:24      **Edit file with VIM? YES** ... I can also open the file with VIM and save it. **Edit file with Sublime? ERROR** ... But when I open the file in Sublime (Sublime Text 3 Build 3059) by loading it through the file explorer, or using the command line:                $ /opt/sublime_text/sublime_text '/home/chendy/my_mount/home/kano/test.py'      I get the same error: > Unable to save ~/my_mount/home/kano/test.py Error: > rename(/home/chendy/my_mount/home/kano/.subl979.tmp, > /home/chendy/my_mount/home/kano/test.py) failed: Operation not permitted What's going on? Is there any way to solve?


title: Make mistakenly thinks rule succeeded because of 0-sized file generated by output redirect

text: In a makefile, I have several rules that look like this:               out.txt: foo.sh input.txt       ./foo.sh -i input.txt > out.txt      If `foo.sh` fails, then `out.txt` will be created as a 0-sized file. If I run _make_ again, it will mistakenly assume that the `out.txt` file was created successfully, and it won't run the rule again. What's the right way to handle this sort of scenario?


title: Is there a way to use curl interactively? Or is there an interactive curl/wget shell?

text: Imagine something like this:               $ curlsh http://www.example.org     > GET /foo/bar/bam     ...output here...     > POST /thing/pool ...     ... result here....       is there a tool that lets me do that?


title: How to transfer Windows application to Ubuntu on Virtualbox?

text: I have Matlab on Windows 7 and I need to use it in my Ubuntu system installed on Virtualbox because I am working on files only compatible in Linux. How can I transfer Matlab into my Ubuntu system?


title: Difference between /bin and /usr/bin

text: I read this up on this website and it doesn't make sense. http://rcsg-gsir.imsb-dsgi.nrc-cnrc.gc.ca/documents/basic/node32.html > When UNIX was first written, `/bin` and `/usr/bin` physically resided on two > different disks: `/bin` being on a smaller faster (more expensive) disk, and > `/usr/bin` on a bigger slower disk. Now, `/bin` is a symbolic link to > `/usr/bin`: they are essentially the same directory. But when you `ls` the `/bin` folder, it has far less content than the `/usr/bin` folder (at least on my running system). So can someone please explain the difference?


title: ps aux |grep 'asdf' grep: asdf: No such file or directory

text: For some reason a while back, the behavior of my command line changed, and I don't know why. Using OSX, now Mountain Lion(although this behavior was present before the switch). Using standard terminal, I would expect back some results from `ps`, but I get an error:               $ ps aux |grep 'asdf'     grep: asdf: No such file or director      This also shows up, for example, here:               ln -s "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" ~/bin/subl     ln: /Users/peter/bin/subl: No such file or directory


title: wgetpaste alternatives?

text: Are there any wgetpaste alternatives?


title: Understanding system load

text: I was looking at the system load of my shared hosting account.               $ uptime      09:14:37 up 21 days,  5:38,  4 users,  load average: 3.85, 4.96, 5.21      I'm not worried by the first and second values, they represent peaks of work. But `5.21` for the last 15 minutes seems a bit high. Or maybe not? How do I know that? I'd like to read some answers to this last question. **UPDATE:** then, what is the unit of measurement of those numbers?


title: root directory almost full but still lots of free space on the partition

text: Some time ago I installed 12.04 from windows xp on a separate "linux" partition via wubi. this partition was allocated 50 GB. my problem now is that obviously the root directory does not have access to the entire volume but only to about 10 gigs which is now not very far from being exhausted. when I call partition monitor I get this: ![system monitor](http://i.stack.imgur.com/9LCQr.png) the hard drive is divided into 3 partitions altogether: the windows volume (sda1) with 146 gigs, a "save" volume (sda6) for backups and stuff with some 103 gigs and the linux volume (sda5) with about 50 gigs of space however being host of this strange subdivision "loop0" where the root directory seems to be placed (so this 10 gigs of the loop0 division seem to belong to the sda5 partition, at least thats what I get) my question is: how can I make the ubuntu root directory to have access to the full 50 gigs of the partition instead of being restricted to the loop0 subdivision to give you some more info heres what the df and mount comments tell me: ![terminal](http://i.stack.imgur.com/ehb6D.png)


title: libxml linker error

text: I've got an app which won't link, giving error:               /usr/lib64/libcroco-0.6.so.3: undefined reference to `xmlGetProp@LIBXML2_2.4.30'     /usr/lib64/libcroco-0.6.so.3: undefined reference to `xmlFree@LIBXML2_2.4.30'     /usr/lib64/libcroco-0.6.so.3: undefined reference to `xmlHasProp@LIBXML2_2.4.30'      I've got libxml installed:               libxml++.x86_64                  2.33.2-1.fc15      @koji-override-    0/$releasever     libxml++-devel.x86_64            2.33.2-1.fc15      @fedora                          libxml2.i686                     2.7.8-6.fc15       @fedora                          libxml2.x86_64                   2.7.8-6.fc15       @koji-override-0/$releasever     libxml2-devel.x86_64             2.7.8-6.fc15       @fedora                          libxml2-python.x86_64            2.7.8-6.fc15       @koji-override-0/$releasever      Any ideas? Maybe libcroco was compiled with older version and I need older libxml installed?


title: Installing packages after the RedHat installation?

text: I was installing the RedHat 5.5 64 bit. But in hurry I forgot to install the Packages needed. And I don't want to install RH again. How can I install packages after installation?


title: Process java still being killed

text: I need to run a java program on my university servers. I'm remotely logging in through their servers via ssh So I used nohup like so:               nohup java -jar project.jar &      However when I logout and close the terminal then log back into the server my process is missing/got killed off.


title: How to view and edit the code of a pdf file

text: I was wondering how to view and edit the code of a pdf file?   1. By viewing, I don't want to see the binary format, so I think hexdump may not be what I want. I tried gedit, but no encoding method can be used to decode the pdf content.   2. By editing, I would like to search for `/Fit` and change them to `/XYZ` by for example sed. But my command `sed s/\/Fit/\/XYZ/ < 1.pdf > 2.pdf` seem not change the appearance of my pdf as I expected, although it doesn't report any error. I was wondering if sed can actually work on pdf files as if they were plain text? The context of my questions can be found from this question. My OS is Ubuntu 10.10.


title: Did I delete the whole debian root server?

text: I installed a new debian 6 system a few days ago - today I wanted to create a CSR request for a SSL certificate and wanted to delete the CSR file afterwards. In the root of my server I was typing               rm * /etc/apache2/sslstuff      then I noticed that I cannot use `ls` or `top` anymore, did I delete everything? I thought I needed to do `rm -R` to delete folders as well. Now I can't even login using SSL because putty will always close after I type in the password of my login user. What can I do here? Do I have to re-install the system or is there a more time-saving way? (root login is not allowed, I login with a different user and then use `su`) * * * Okay, I used another user to login because I set permitrootlogin to NO for security reasons. When I open Putty to login via SSH then I put in the user name and after I enter the PW putty will close.. So what can I do to at least connect to that server? FTP still works, website is still up and running, so I guess I only deleted some symbolic links and stuff. What to do now?


title: How can I split a text file into multiple text files using Perl?

text: I have a file ABC_TabDelim.txt that contains the following:               00:00:00:00 00:00:05:00 01SC_001.jpg     00:00:14:29 00:00:19:29 01SC_002.jpg     00:01:07:20 00:01:12:20 01SC_003.jpg     00:00:00:00 00:00:03:25 02MI_001.jpg     00:00:03:25 00:00:08:25 02MI_002.jpg     00:00:35:27 00:00:40:27 02MI_003.jpg     00:00:00:00 00:00:05:00 03Bi_001.jpg     00:00:05:19 00:00:10:19 03Bi_002.jpg     00:01:11:17 00:01:16:17 03Bi_003.jpg     00:00:00:00 00:00:05:00 04CG_001.jpg     00:00:11:03 00:00:16:03 04CG_002.jpg     00:01:12:25 00:01:17:25 04CG_003.jpg      I would like to split this into multiple files for each instance of 00:00:00:00, outputting it as ABC01_TabDelim.txt, ABC02_TabDelim.txt, ABC03_TabDelim.txt, etc. So 00:00:00:00 would indicate a new file should begin. Is there any way I can accomplish this with a Perl script?


title: How to flash U-Boot to a Devkit8500?

text: When I try running this:               make CROSS_COMPILE=/root/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi- omap3devkit8000_config      I get this error:               make: *** No rule to make target `omap3devkit8000_config'.  Stop.     make: *** [omap3devkit8000_config] Error 1      How do I flash U-Boot to a Devkit8500? I'm using CentOS 6.3.


title: How to order files by date in tab completion list

text: $ 7z l ~/Downloads/Tab How to make the resulting list to be sorted by date, not by name? I currently use special script to list N most recent files in a given directory (and copy the filename manually into command line), but want to make it seamless and more convenient.


title: How to configure an anonymously writable ftp server with vsftpd?

text: Sometimes we need to copy things between notebooks fast, and therefore it would be a great solution to have an anonymous ftp server running on notebook "A" that is writable by anonymous (of course chrooted, not allowing links), so that notebook "B" can copy/write there.. we need this with vsftpd.. I tried several configs, but it looks like SELinux is preventing this thing to work.. I googled for it (modifying SELinux booleans/SELinux permissions for the /var/ftp directory) but I'm still getting the same error message.. **Q: Can someone please copy/paste here a working short config for vsftpd.conf and the SELinux related settings to get this thing working?** OS is Scientific Linux 6.3 and vsftpd-2.2.2-11.el6.x86_64..


title: Keep patch in sync with changing source

text: Is there any standard option to create 'patch' P that works on file F in such way that it will keep working correctly when file F changes into F'. So I will either have some mechanism that will change P into P' so that P'(F') produces the same change as P(F), or, preferably, I will have resilient P so that it can be used for both F & F'. Currently I am using the regular expression search and replace to create such patch, but I wonder is there any standard way to do such thing.


title: Kali Linux internet connection

text: I'm pretty new to site and networking overall. I got interested in this topic and I've installed KaliLinux on my VirtualBox. Then I faced a problem: I couldn't connect to the internet. I was going through many tutorials, that's what I did: `-Went to Settings->Network`, enabled network adapter, changed it to `"Bridged Adapter"` and made it `"AllowAll"`. Didn't help. `Airmon-ng` shows empty result set. Next thing is that `"ifconfig"/"iwconfig"` shows `Eth0` for me, while ppl showing tutorials had Wlan0 there. On my notebook I'm using wifi, no cables or anything. Furthermore, on `Devices->UsbDevices`, I have my mouse device detected + "Unknown Device" clicking on which causes an error. Does anyone have any tips for a beginner? Cheers! # edit I'd forget: I also change the boolean in NetworkManager.conf file to true.


title: How to revert to the original config files in OS X?

text: How can I revert config files in OS X 10.8.2 to their original state? I want to discard any changes made to /etc/hosts, /etc/sshd_config, etc.


title: User gets rejected after system crash on CentOS

text: The power went out on my PC running CentOS 6.3 while I was logged in as a regular user. Since then, when I try to login from the GUI, my screen flashes to black then returns to the login screen, without any message (as if my user was rejected). I can still login as root. I checked the /etc/passwd file and everything is fine. Here is a partial dump of the /var/log/messages lines, linked to the login and immediate logout:               Jan  7 09:06:59 localhost acpid: client connected from 3054[0:0]     Jan  7 09:06:59 localhost acpid: 1 client rule loaded     Jan  7 09:07:00 localhost rtkit-daemon[2701]: Sucessfully made thread 3107 of process 3107 (/usr/bin/pulseaudio) owned by '42' high priority at nice level -11.     Jan  7 09:07:00 localhost rtkit-daemon[2701]: Sucessfully made thread 3109 of process 3107 (/usr/bin/pulseaudio) owned by '42' RT at priority 5.     Jan  7 09:07:00 localhost gdm-simple-greeter[3094]: Gtk-WARNING: gtkwidget.c:5460: widget not within a GtkWindow     Jan  7 09:07:00 localhost rtkit-daemon[2701]: Sucessfully made thread 3113 of process 3107 (/usr/bin/pulseaudio) owned by '42' RT at priority 5.     Jan  7 09:07:00 localhost rtkit-daemon[2701]: Sucessfully made thread 3114 of process 3107 (/usr/bin/pulseaudio) owned by '42' RT at priority 5.     Jan  7 09:07:08 localhost acpid: client 3054[0:0] has disconnect      Any suggestion as to debug/solve this issue?


title: Excluding files in etckeeper with .gitignore doesn't work

text: I use etckeeper for changes in my configfiles (on debian squeeze) Since I also have an ircdeamon running, there are some files, that change every minute in the folder               /etc/hybserv/      I don't want to version control them anymore, so i added               hybserv/*      to the end of               /etc/.gitignore      but they are not ignored! They keep showing up every hour in the hourly commit. what am I doing wrong?


title: Install `mpl_toolkit.basemap` on RedHat without compiling from source

text: I need to install `matplotlib` and `mpl_toolkit.basemap` on a RedHat machine. `matplotlib` is already installed but for `mpl_toolkit.basemap` the only way I could find was to download the source and compile it and then running `python setup.py install` from terminal. The trouble is the aforementioned server is remote and the disk quota is very limited that I can't download and install `mpl_toolkit.basemap`. Is there any prepared package I could install? If so, would you please provide the actual command to install it? I don't seem to find any.


title: Compile Linux Application for Windows

text: I want to use a Linux Application under Windows. It is my understanding that the application is Linux only and to use it in Windows I have to compile the application from the source using Cygwin or MinGW. My question is which to use: Cygwin or MinGW? Should i setup Cygwin or MinGW in Windows and then compile the Linux Application there? Should i setup Cygwin or MinGW in Linux and then compile the Linux Application there? Any guide/tutorial?


title: Difference between “/export/home” and “/home”

text: In our UNIX machine my home path looks like `/home/<userid>` and we have another batch user whose home looks like `/export/home/<userid>` I want to know whats the difference between `/export/home/<userid>` and `/home/<userid>`? Why there are difference in folders when both are some user in UNIX?


title: Force new permissions on files after rsync from seedbox

text: I have a seedbox-account which I use for torrenting. I have set up a cron job that uses rsync to download all files from the seedbox to my 14.04.1 ubuntu server. The download folder is a samba share, as I have previously used windows to organize the content into folders before moving it to a more permanent place on my server. Before upgrading to 14.04, I used 12.04 and everything worked ok. The problem is that the files I get from the seedbox is owned by a user called "544" (this is the user name generated by the seedbox, not some octal thing) and can not be deleted by my user on my server. After changing permissions on the download folder, I can delete them. Also, I have given all users permissions to read/write in the samba folder upon sharing it. So my question is this: Is it possible through some elegant command executed to make rsync change user/permissions on the files when downloading it? Or is it possible to make the folder function in a way that all new files will automatically change user when copied/moved to it? I guess I could put the chmod command in sudo cron to run every once in a while to change the owner of the files, but since sometimes the amount of data to be downloaded can be rather large, it is difficult to know when to trigger it in relation to the rsync-job to make sure all files are downloaded. Thanks in advance, guys.. :)