title: Where does ext4 store directory sizes?

text: Where does ext4 store directory sizes? Are they stored in the directory inode? For example, when I run `du -h`, it returns directories' size instantly, so I don't believe it calculates it at that time. I'm using ext4 on Linux.


title: How to add Public IP to Cent OS

text: I am trying to configure a Public(Static) IP in Cent OS 6.4. For this, I made a copy of eth0(added local IP, so that I can connect the system to Internet) and named it to eth0:0(added Public IP, so that the system can be accessible via SSH). After restarting the network devices, am still not able to get the required result. I want to access this system via SSH with the configured public IP.


title: How to install linux (with crypto /Home + / partition) with enough swap space to hibernate

text: What are the steps to install Linux (with cryoto /Home + / partition) Mint on a empty hard drive with 1.5x swap space as RAM. I am aware that the CD allows this as a default option but it doesn't give me the ability to specify the swap space size. I know I could do that after the install but would prefer to do so at OS install time. My main reason is I just want to be able to hibernate out of the box.


title: Wget images issue from api_key

text: We have a vendor that sends us xml feeds of new items with the appropriate path and image name. I created script that will strip the web address path for the image, but if I try to obtain these with wget I get a protocol error. I tried using `wget -i list.txt`. If I use other tools similar I do not have an issue. What would be causing the issue and what is best suggested?


title: use CEC with my TV

text: When I plug my Raspberry Pi to my TV (which supports SimpLink, or respectively CEC) the TV automatically turns on from standby. This is due to the fact that the Raspberry Pi also supports CEC: http://www.raspberrypi.org/archives/1839 I would like to see this working with my HTPC aswell. It runs Debian Wheezy - the HDMI-connector is on a ASUS P8H77-I-board. How can I   1. check, if CEC is supported by my mainboard?   2. make CEC work if it's supported?


title: Convert discus output into readable HTML mail

text:
How can I take the DISCUS command output below: ![Screenshot of colored discus output](http://i.stack.imgur.com/7TOr1.png) and convert it into something HTML email friendly? I've bash scripted something like this:               #!/bin/sh     discus > /tmp/discus.log     touch /tmp/diskchart.log         echo "To: myaddy@domain.com" > /tmp/diskchart.log         echo "Subject: Weekly Disk Report" >> /tmp/diskchart.log         echo "MIME-Version: 1.0" >> /tmp/diskchart.log         echo "Content-Type: text/html; charset=\"us-ascii\"" >> /tmp/diskchart.log         echo "Content-Disposition: inline" >> /tmp/diskchart.log         echo "<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">" >> /tmp/diskchart.log         echo "" >> /tmp/diskchart.log         echo "
" >> /tmp/diskchart.log         cat /tmp/discus.log | grep / | grep -v run | /usr/bin/awk '{print $1}{print $9}' >> /tmp/diskchart.log         echo "
" >> /tmp/diskchart.log         echo "" >> /tmp/diskchart.log         mail -s "SAT Weekly Disk Report" myaddy@domain.com < /tmp/diskchart.log     #rm  /tmp/discus.log /tmp/diskchart.log      but that produces an output which looks like this: ![Screenshot of output with escape characters](http://i.stack.imgur.com/ilSqx.png) Anyone know how to deal with the escape characters showing up in the actual mail? I'd ideally like to see the bar graph as shown above. I'm running Ubuntu 12.04.1 LTS


title: How should I prevent data corruption on an NTFS partition shared by Windows and Linux?

text: I use Linux for most of the things but I still need Windows sometimes. So, I have Linux Mint 14 and Windows 8 installed (dual-booting) on my computer with the following disk setup:   * `sda1`: The 350 MB partition Windows 8 allocates (I still don't know why.)   * `sda2`: Windows installation   * `sda3`: My shared NTFS drive   * `sda5`: Linux Mint 14 installation   * `sda6`: Swap area for Linux Mint Most of my files are in `sda3` which I share between the two OSs (kind of like my backup partition). I can access it from both operating systems. However, sometimes my files get corrupted. Example: I recently downloaded Eclipse and extracted it to a folder in sda3 drive in Linux Mint. It was working fine. Then when I switched to Windows, it asked me to repair my drives because there were some errors. I accepted, Windows did some scanning and restarted. When I switched back to Linux Mint, I noticed that Eclipse wasn't working. When I checked, most of the files in Eclipse folder were corrupted. Similar things happen other way around as well. Sometimes I'm not able to see and/or open files in Windows that I created/downloaded in Linux Mint. I'm tired of losing files like this. Is it a hardware issue? (My computer is kind of old) If not related to hardware, is there a better way to share data between OSes than what I currently have? (a separate NTFS partition for both)


title: Decrease crypted LVM partition

text: On a Linux Mint install, I used the option to use whole disk and encrypt it.   Now, I want to install Windows on another partition.   How I can safely decrease size of this encrypted LVM? Of course, partitions created by installer.


title: On OpenBSD, how do I recompile OpenSSL with md2 support?

text: I searched but couldn't find any similar questions. I need to recompile OpenSSL with md2 support so that I can compile and install libpki. I can't for the life of me figure out how recompiling OpenSSL should be done. Should I download the current sources and compile then install?


title: How to read characters from a serial keyboard on /dev/inputs/eventX (Speed?)

text: I'm trying to read from a second keyboard whose inputs can be read from /dev/inputs/eventX, but I get rubbish and not the character expected. I'm accessing my target by using Putty. I can connect to my target through serial debug port 115200 or SSH through IP connection. From that moment I have my terminal where I type `cat /dev/input/eventX` and when typing from my 2nd keyboard a character sush as 'a', 'b' or 'c', all I get is nonsense (multiple bytes) and it's never the same input. I tried changing the read speed but no better results. (9200Bps for instance but still nonsense). Is there a speed configuration or communication settings to change? How can I get my ASCII characters?               root@SANTARO:~ od -x < /dev/input/eventX     0000000     1569    0000    a3ba    0004    0004    0004    0005    0007     0000020     1569    0000    a3c6    0004    0001    0030    0001    0000     0000040     1569    0000    a3ca    0004    0000    0000    0000    0000     0000060     1569    0000    b0ee    0007    0004    0004    0005    0007     0000100     1569    0000    b0f5    0007    0001    0030    0000    0000     0000120     1569    0000    b0f7    0007    0000    0000    0000    0000      ![enter image description here](http://i.stack.imgur.com/xYvYx.png)


title: how to check health of hard drives?

text: How do I check the health of my hard drives? I know that you can do it with system rescue, but is there a way to do it from root without booting onto system rescue?


title: Debian Squeeze not booting anymore

text: My machine is not booting anymore. It is a debian squeeze server on amd64 with 4 hard disks and 2 software raids (md4 and md5). You can watch this video of the screen after switching it on. (The video says "ubuntu" in the title but it is debian squeeze) Could this be a hardware issue? Maybe an SATA cable? It happened after moving the box to another location.


title: Package name suggestion in fedora

text: In Ubuntu when an app is not installed and in Terminal you type for example `gvim` it says that this app is contained in package `vim-gnome` and try installing that but in fedora that doesn't happen with yum and it just says `command not found`. My question is: is there any way to add this feature or something similar to fedora? and if not how should I install an app that I don't know it's package name.


title: Customize bash to always include a certain parameter

text: When using the "ls" command, bash prints in the following format:               file1 file2 file3 file4     file5 file6 file7 file8      But when given the parameter "-1", it prints:               file1     file2     file3      etc... Is there a way to somehow "customize" bash to always include the "-1" parameter automatically when using the "ls" command? (I.e. making "ls" equivalent to "ls -1")


title: Does pipe's link target exist somewhere in the filesystem?

text: I'm talking about this:               $ readlink <(echo test)     pipe:[80076194]      Is `pipe:[80076194]` a path to the target or just indication that the file descriptor is connected to the pipe and doesn't exist in filesystem? The main reason I'm asking is due to `php` for one trying to dereference it:               $ strace -f php -r 'var_dump(file_get_contents($_SERVER["argv"][1]));' -- <(echo test)     ...     [pid   654] lstat("/dev/fd/63", {st_mode=S_IFLNK|0500, st_size=64, ...}) = 0     [pid   654] readlink("/dev/fd/63", "pipe:[80095114]", 4096) = 15     [pid   654] lstat("/dev/fd/pipe:[80095114]", 0x7fff9c3628a0) = -1 ENOENT (No such file or directory)     [pid   654] lstat("/dev/fd", {st_mode=S_IFLNK|0777, st_size=13, ...}) = 0     [pid   654] readlink("/dev/fd", "/proc/self/fd"..., 4096) = 13     [pid   654] lstat("/proc/self/fd", {st_mode=S_IFDIR|0500, st_size=0, ...}) = 0     [pid   654] lstat("/proc/self", {st_mode=S_IFLNK|0777, st_size=64, ...}) = 0     [pid   654] readlink("/proc/self", "654"..., 4096) = 3     [pid   654] lstat("/proc/654", {st_mode=S_IFDIR|0555, st_size=0, ...}) = 0     [pid   654] lstat("/proc", {st_mode=S_IFDIR|0555, st_size=0, ...}) = 0     [pid   654] open("/proc/654/fd/pipe:[80095114]", O_RDONLY) = -1 ENOENT (No such file or directory)     [pid   654] write(2, "PHP Warning:  file_get_contents("..., 125PHP Warning:  file_get_contents(/dev/fd/63): failed to open stream: No such file or directory in Command line code on line 1     ) = 125     [pid   654] write(1, "bool(false)\n", 12bool(false)     ) = 12


title: Create a file that's really a network port

text: I have a program running on a cluster, and the output of the program is written to a log file which I specify. However, instead of writing it to a file, I want to write it to a network port, so that it can be read with e.g. Node.js. For example, I want to be able to specify a file along the lines of /dev/127.0.0.1:3000 Currently, I'm using Node.js to watch the log file, re-read all the data when it changes, compare the new data with the old data to see what was added, and then process that. But that's quite inefficient.


title: Cyber Security and stop hacking

text: A friend of mine is accessing my pc without my knowings. Even he got webcam acceess. No malware is detected. Antivirus are up to date. He told me that he is using my mac address to accesd my pc. How to stop this access and secure my pc He is not only pranking cause he told me what i was doing on pc live on phone.


title: If "fsck -n /PATH" says errors, then it's 100% true that the FS has errors?

text: HOSTNAME:~ # fsck -n /FSMOUNTPOINT     fsck 1.38 (30-Jun-2005)     e2fsck 1.38 (30-Jun-2005)     Warning!  /dev/vgname/lvname is mounted.     Warning: skipping journal recovery because doing a read-only filesystem check.     /dev/vgname/lvname contains a file system with errors, check forced.     Pass 1: Checking inodes, blocks, and sizes     Pass 2: Checking directory structure     Pass 3: Checking directory connectivity     Pass 4: Checking reference counts     Inode 12845121 ref count is 1, should be 2.  Fix? no          Inode 12845122 ref count is 1, should be 2.  Fix? no          Inode 12845123 ref count is 1, should be 2.  Fix? no          Inode 12845124 ref count is 1, should be 2.  Fix? no          Pass 5: Checking group summary information     Free blocks count wrong (38829073, counted=37828469).     Fix? no          Free inodes count wrong (22658484, counted=22658235).     Fix? no               /dev/vgname/lvname: ********** WARNING: Filesystem still has errors **********          /dev/vgname/lvname: 16972/22675456 files (0.3% non-contiguous), 6521839/45350912 blocks     fsck.ext3 /dev/vgname/lvname failed (status 0x4). Run manually!     HOSTNAME:~ #       OS: SUSE LINUX Enterprise Server 9.4 FS: EXT3 with only rw options **Question** : So if there is the "WARNING: Filesystem still has errors" message, I can be 100% sure that the FS has problems, and needs to be umount/fsck/mount'ed? UPDATE:               $ tune2fs -l /dev/vgname/lvname | grep 'Filesystem state:'     Filesystem state:         clean     $


title: Are threads which are executing blocking system calls awoken by interrupts?

text: I've been reading a bit about threads and interrupts. And there is a sections which says that parallel programing using threads is simpler because we don't have to worry about interrupts. However, what is the mechanism in which signals the release of the blocking system call if not an interrupt? **Example** I read i file in my thread which use a blocking system call to read the file from the disk. During that time, other threads are running. At some point the file is ready to be read from the hard disk. Does it notify the processor of this via a hardware interrupt, so that it can do a context switch ti the thread which asked for the file?


title: Linux curl request for SOAP webservice call

text: I have a SOAP webservice WSDL and when I make a call with SOAP-UI tool, it works perfectly fine.... Now, Im trying to mimic the same call using LINUX CURL but get a 404 error, Here is my CURL request               curl  -v --header "Content-Type: text/xml; charset=utf-8" \          --header "SOAPAction:""" \          --form "filename=@soap.csv" \          --form "data=cid:112871000" \          -X POST https://webservice.test:443/sotest/FileAttachmentService  \          -u 3user1 \          -sL -w "%{http_code} %{url_effective}\\n"      The webservice takes the following items as input - Webservice paramters : - 1.filename 2.data Here is a snapshot from the SOAPUI tool,               <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v1="http://webservices.test/services/Attachment/v1.0">        <soapenv:Header/>        <soapenv:Body>           <v1:attachment>              <filename>Test.csv</filename>              <data>cid:138641430598</data>           </v1:attachment>        </soapenv:Body>     </soapenv:Envelope>


title: Using Wireshark on Linux to observe coupled HTTP-request and HTTP-respond

text: I use Wireshark on Linux to observe my HTTP traffic. Other programms like Firefox Live Http Headers show coupled http-request from my browser and http- respond from any server. How using programs like Wireshark understand that one is request and another is respond to certain request? Is there a methodology which I can use for any traffic manager program?


title: Ubuntu server boot assigns names to NICs erratically but all traffic is handled on only one NIC

text: I have two NICs, em1 and p3p1 on my Ubuntu 14.04 Server. During boot, network interface eth0 is renamed to both em1 and p3p1 but the order is not consistent from one boot to another. In use ALL traffic is through only one NIC. In my /etc/network/interfaces file em1 is assigned to 192.168.1.211 and p3p1 to 192.168.219 and both NICs are cabled to the same router. I need to know if this is a configuration problem that can be fixed or, probably less likely, a bug. Is it normal for eth0 to be renamed twice? I'm not overly familiar with LINUX or networking. Filtered dmesg output. All traffic goes through em1 (on this boot). Sometimes the boot will pick p3p1 as the default and then all traffic goes through that nic. $ dmesg | grep eth0               [    0.757972] igb 0000:02:00.0: added PHC on eth0     [    0.760159] igb 0000:02:00.0: eth0: (PCIe:2.5Gb/s:Width x1) 00:01:05:19:7d:59     [    0.761214] igb 0000:02:00.0: eth0: PBA No: FFFFFF-0FF     [    0.781601] systemd-udevd[144]: renamed network interface eth0 to p3p1     [    0.870697] e1000e 0000:00:19.0 eth0: registered PHC clock     [    0.871618] e1000e 0000:00:19.0 eth0: (PCI Express:2.5GT/s:Width x1) 00:01:05:19:7d:58     [    0.872508] e1000e 0000:00:19.0 eth0: Intel(R) PRO/1000 Network Connection     [    0.873425] e1000e 0000:00:19.0 eth0: MAC: 11, PHY: 12, PBA No: FFFFFF-0FF     [    0.893679] systemd-udevd[144]: renamed network interface eth0 to em1      Route:               $ route -n     Kernel IP routing table     Destination     Gateway         Genmask         Flags Metric Ref    Use Iface     0.0.0.0         192.168.1.1     0.0.0.0         UG    0      0        0 em1     192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 em1     192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 p3p1      ping (works for em1)               $ ping -c 3 -I p3p1 www.google.com     PING www.google.com (74.125.227.180) from 192.168.1.219 p3p1: 56(84) bytes of data.     From nic2 (192.168.1.219) icmp_seq=1 Destination Host Unreachable     From nic2 (192.168.1.219) icmp_seq=2 Destination Host Unreachable     From nic2 (192.168.1.219) icmp_seq=3 Destination Host Unreachable          --- www.google.com ping statistics ---     3 packets transmitted, 0 received, +3 errors, 100% packet loss, time 2014ms     pipe 3


title: How to install apt-get or YUM on Mac OS X

text: I am new to Mac OS command line, I want to use either of `apt-get` or `yum`. Can anyone help me to install them and make them successful running?


title: Portable way to find inode number

text: At first I used `stat -c %i file` (to help detect the presence of a jail), which seemed to work on any Linux distribution under the sun. On OS X' I had to use `ls -i file | cut -d ' ' -f 1`. Is there some way to find the inode number of a file in a shell script which is portable across *nix platforms and does not depend on the notoriously capricious `ls`?


title: Why does the "she-bang" begin with a "#!"?

text: Why does the "she-bang" begin with a `#!`, like `#!/bin/bash`? I have always accepted that this how it is done, but is there a reason behind it? Why start with `#`; isn't that usually a comment? Or is it the point that it should be comment?


title: CURL command execution

text: Can anyone explain me the below curl command and how it works :               STATUS_CODE=`curl –output /dev/null –silent –head –write-out ‘%{http_code}\n’ $next`     # If you want to set a timeout then add –max-time 15, here 15 is 15seconds


title: Is there any way to see how much data I sent via Internet?

text: A big German ISP (Telekom) recently decided to volume limit their DSL internet connection to 75GB per month. Now I would like to know how much I download / upload. I use Linux Mint 14 Nadia and I have a D-LINK DI-524 router. How can I get the amount of data I upload / download per month?


title: Shell script or command to Strip text and Binary files excerpts from large Log Files

text: I need to remove a large binary file (PDF file) from a large log file which is generated daily.This is seriously hogging space on our servers.I need to remove the large PDF from the logs to make the logs smaller and manageable I need to take out the texts (or binary file) between the strings   * `<my:PDF>` and `</my:PDF>`   * `<applicationForm>` and `</applicationForm>`   * `<image>` and `</image>`   * `<extractedSignature>` and `</extractedSignature>` I am not sure whether the sed utility can do this, these are large files and need to be pruned. I am not seeking log rotation advice, just a script or command that can strip these large logs of texts between the characters above. I am not sure how to do this. These files are rather large. I am not sure how to achieve this with sed , tail, head , tr or any other facility.


title: Has the launcher security issue in KDE and Gnome been fixed?

text: One of the first things I heard about Linux is that it doesn't get any kind of malware. Now, I see it can get malware through WINE and e-mail (although I don't even open attachments or follow links from entities I don't know). So, as far as this goes, one simply should use common sense regarding e-mail, and chose carefully what to run on WINE (and possibly use a separate account for it). Linux is further protected by the fact that all files are set to not be executable, so even if you get malware, it can't execute. This is what I used to think, but it turns out that in KDE and Gnome environments (according to what I read; it's from 2009, so I don't know if it also happens elsewhere or if it was fixed) have special treatment for something called "launchers", that can only have one command, but this may run a malicious script. I'd like to know exactly why (if) launchers get special treatment (today and in 2009), how do they look on the terminal (do they seem normal files; what happens if you enter `ls -l`, etc.), and if this has received any attention from the developers of these platforms.


title: How to have autocomplete ignore a specific completion

text: I've got auto-completion working for bash. When I type part of a program name, and then TAB, I get the full command. Works like expected, no complaints. However on my setup I've got an alias defined called `flexo` (which logs me in to a machine with the same name). When I type `fle``TAB` I only get `flex`, because that's a perfectly valid program on the machine. How do I instruct complete to ignore this specific completion? In other words I want `fle``TAB` to complete to `flexo` and ignore `flex` completely. Thanks.


title: What's a convenient way of checking what's being added to a log file in realtime?

text: Right now I'm essentially executing `tail /var/log/syslog` manually every once in a while. Is there something that lets me see what's being added continuously, or do I need to write something myself?


title: Eglibc cannot compile suffix of object files while trying to cross compile

text: I'm currently making my way through Trac's CLFS book. When trying to configure the 32-bit version of EGLIBC-2.15, using the options: > >     BUILD_CC="gcc" CC="${CLFS_TARGET}-gcc ${BUILD32}" \ >     AR="${CLFS_TARGET}-ar" RANLIB="${CLFS_TARGET}-ranlib" \ >     CFLAGS="-march=$(cut -d- -f1 <<< $CLFS_TARGET32) -mtune=generic -g -O2" > \ >     ../eglibc-2.15/configure --prefix=/tools \ >     --host=${CLFS_TARGET32} --build=${CLFS_HOST} \ >     --disable-profile --enable-add-ons \ >     --with-tls --enable-kernel=2.6.0 --with-__thread \ >     --with-binutils=/cross-tools/bin --with-headers=/tools/include \ >     --cache-file=config.cache >   I get the following output:               configure: loading cache config.cache     checking build system type... x86_64-cross-linux-gnu     checking host system type... i686-pc-linux-gnu     checking for i686-pc-linux-gnu-gcc... x86_64-unknown-linux-gnu-gcc -m32     checking for suffix of object files... configure: error: in `/mnt/lfs/sources/eglibc-build':     configure: error: cannot compute suffix of object files: cannot compile     See `config.log' for more details.      The config.log reads:               configure:1879: loading cache config.cache     configure:2029: checking build system type     configure:2047: result: x86_64-cross-linux-gnuconfigure: loading cache config.cache     checking build system type... x86_64-cross-linux-gnu     checking host system type... i686-pc-linux-gnu     checking for i686-pc-linux-gnu-gcc... x86_64-unknown-linux-gnu-gcc -m32     checking for suffix of object files... configure: error: in `/mnt/lfs/sources/eglibc-build':     configure: error: cannot compute suffix of object files: cannot compile     See `config.log' for more details.     configure:2069: checking host system type     configure:2084: result: i686-pc-linux-gnu     configure:2115: checking for i686-pc-linux-gnu-gcc     configure:2142: result: x86_64-unknown-linux-gnu-gcc -m32     configure:2414: checking for C compiler version     configure:2422: x86_64-unknown-linux-gnu-gcc -m32 --version >&5     ../eglibc-2.15/configure: line 2424: x86_64-unknown-linux-gnu-gcc: command not found     configure:2426: $? = 127     configure:2433: x86_64-unknown-linux-gnu-gcc -m32 -v >&5     ../eglibc-2.15/configure: line 2435: x86_64-unknown-linux-gnu-gcc: command not found     configure:2437: $? = 127     configure:2444: x86_64-unknown-linux-gnu-gcc -m32 -V >&5     ../eglibc-2.15/configure: line 2446: x86_64-unknown-linux-gnu-gcc: command not found     configure:2448: $? = 127     configure:2452: checking for suffix of object files     configure:2478: x86_64-unknown-linux-gnu-gcc -m32 -c -march=i686 -mtune=generic -g -O2  conftest.c >&5     ../eglibc-2.15/configure: line 2480: x86_64-unknown-linux-gnu-gcc: command not found     configure:2482: $? = 127     configure: failed program was:     | /* confdefs.h.  */     | #define PACKAGE_NAME "GNU C Library"     | #define PACKAGE_TARNAME "glibc"     | #define PACKAGE_VERSION "(see version.h)"     | #define PACKAGE_STRING "GNU C Library (see version.h)"     | #define PACKAGE_BUGREPORT "http://sourceware.org/bugzilla/"     | /* end confdefs.h.  */     |      | int     | main ()     | {     |      |   ;     |   return 0;     | }     configure:2496: error: in `/mnt/lfs/sources/eglibc-build':     configure:2499: error: cannot compute suffix of object files: cannot compile     See `config.log' for more details.      Trying to compile with the CC parameter set to just "gcc $BUILD32" gets me much further, although it does complain about the loss of a triplet. Doing so, however, gives me:               checking for __builtin_expect... no     configure: error: support for __builtin_expect needed      I'm lost at this point, so any suggestions would be greatly appreciated.


title: Best Touchscreen Monitor for Linux under $500

text: Looking for a 17" or larger touchscreen monitor that works with Linux. It will be used outdoor and I hear capacitive and optical screens are more durable. It doesn't need to be multi-touch. Please advise because I don't see Linux compatibility on the models I've seen, except for the expensive ELOS ones. Thanks


title: Create symbolic links with wildcards

text: I have multiple hard drives with the same directory hierarchy, for example:               /media/sda/dir1     /media/sda/dir2     ...     /media/sdb/dir1     /media/sdb/dir2      Two hard drives with similar names and similar directory names. I want to create separate symbolic links to dir1 and dir2 on every hard drive. The easiest way I have found is to use `cp -sR`:               cp -sR /media/sd*/dir1 /somedir/dir1     cp -sR /media/sd*/dir2 /somedir/dir2      However, this creates new directories in /somedir which has various side effects, for example, the directory timestamps are useless. How can I create symbolic links named dir1 and dir2 which link to /media/sd*/dir1 and /media/sd*/dir2? Files are regularly added to the hard drives so I would need to run these commands on a regular basis.


title: What could cause a cron to run twice at the same moment?

text: I have a cron that is setup to run every Monday at 1 AM               0 1 * * 1 /script/dir/script >> /script/dir/file.log      After two years of running as expected, it ran twice on June 18, with the second call occurring ½ - 1 second after the first. What could cause that to happen? It wasn't run either the first or second time by a human. The script is associated with a website but it is outside of the document root. Is it possible that the clock was synchronized at that same moment, forcing it backwards 1 second and rerunning the cron at 1 AM?


title: Does redirecting output to a file apply a lock on the file?

text: If I have a command               $ ./script >> file.log      that gets called twice, with the second call occurring before the first one ends, what happens? Does the first call get an exclusive lock on the output file? If so, does the second script fail when attempting to write, or does the shell accept the output (allowing the script to end) and throw an error? Or does the log file get written to twice?


title: How does "options" in shell scripting work?

text: I found some code in one of the answers here and accommodated it to my needs but now I have two questions: **Q1:** how can I display the options text after the code in case statement finishes? So the user can see the options again. **Q2:** Can I make it so that every option is displayed on its own line when I run the script? Currently it is not.               options=(             "quit/exit"         "new rational db"         "run php for rational codebase"         "run php for playground codebase"        )          select option in "${options[@]}"; do       case "$REPLY" in            1) break;;            2) sudo -i -u db2inst1 bash -c "db2stop force;";;            3) rm /tmp/createDb2*;;            4)  ;;                      esac     done


title: A single key on keyboard produces extra keypresses for each simultaneously pressed key

text: I recently acquired MK-85 mechanical USB keyboard from QPAD. The keyboard works perfect on Windows. It works perfect in Syslinux. It works almost perfect on Linux. The only issue on Linux is that a single key is misbehaving (Gentoo (3.6.11), Arch Linux and Linux Mint (2.6.38) are all affected). The keyboard is a 105-key German layout keyboard and the key in question is the one between Ä and ENTER. On US layout this corresponds to the key `\`, on German layout this corresponds to `#` and on Scandinavian layout it's `'`. When this key is pressed with other keys, it produces an extra keypress for each other key that is simultaneously pressed. For example, under Scandinavian layout if I want to type the word " **don't** " really fast I end up with: don'''t' The behaviour can be observed with the program showkeys:               kb mode was UNICODE     [ if you are trying this under X, it might not work     since the X server is also reading /dev/console ]          press any key (program terminates 10s after last keypress)...     keycode  28 release     keycode  32 press    // d pressed     keycode  24 press    // o pressed     keycode  49 press    // n pressed     keycode  32 release  // d released     keycode  43 press    // ' pressed     keycode  24 release  // o released     keycode  43 release  // ' released     keycode  43 press    // ' pressed, extra ' produced     keycode  49 release  // n released     keycode  43 release  // ' released     keycode  43 press    // ' pressed, extra ' produced     keycode  20 press    // t pressed     keycode  43 release  // ' released     keycode  43 press    // ' pressed, extra ' produced     keycode  20 release  // t released     keycode  43 release  // ' released     keycode  43 press    // ' pressed, extra ' produced     keycode  43 release  // ' released (REAL)      It only happens with this single key, regardless of keyboard layout. Another way it manifests itself is if I press and hold a key, it repeats, and I press and hold another key which should also start repeating:               aaaaaaaaaakkkkkkkkkkkkk (works as intended)     ¨¨¨¨¨¨¨¨¨¨fffffffffffff (works as intended)     ''''''''''a'''''''''''' (a is not repeated, instead ' continues)      On Windows this issue does not exist:               OnKeyDown, Key code=68, Control keys=, Key name d     OnKeyPress d     OnKeyDown, Key code=79, Control keys=, Key name o     OnKeyPress o     OnKeyDown, Key code=78, Control keys=, Key name n     OnKeyPress n     OnKeyup, Key code=68, Control keys=, Key name d     OnKeyDown, Key code=191, Control keys=, Key name ........OEM specific     OnKeyPress '     OnKeyup, Key code=79, Control keys=, Key name o     OnKeyup, Key code=78, Control keys=, Key name n     OnKeyDown, Key code=84, Control keys=, Key name t     OnKeyPress t     OnKeyup, Key code=191, Control keys=, Key name ........OEM specific     OnKeyup, Key code=84, Control keys=, Key name t      What do you think SE? Hardware issue? It works fine in Syslinux which makes me feel like there'''s' something wrong on Linux side. Any pointers, ideas or better ways to debug? If getting this to work right requires patching the kernel I'm up for it.


title: Load only webpage on logon

text: I would like to know if it's possible to **load only 1 web page when Linux logs on with an automatic user**. This server will be used **only to display information, no interaction is required** and even if the end user wants to interact with the X window / Window Manager (opening another window, running other apps, switching users, switching to Virtual consoles), he'll not be able to do (the Window manager will not let him). I don't have in mind a specific Linux distribution or window manager, but more looking to see first if it's possible or not. I looked on the Internet (Window managers, X window, embedded Linux), but I didn't find anything useful for my case Don't hesitate to contact me if you need more clarification regarding my need.


title: Do journaling filesystems guarantee against corruption after a power failure?

text: I am asking this question on behalf of another user who raised the issue in the Ubuntu chat room. Do journaling filesystems guarantee that no corruption will occur if a power failure occurs? If this answer depends on the filesystem, please indicate which ones do protect against corruption and which ones don't.


title: What is the default permission of folder /var?

text: I am a complete beginner in Linux. I just installed Ubuntu 12.04 in a pendrive, then installed MySQL and Apache PHP and then I tried to install Moodle (a distance learning platform I use at work). The installation in Moodle stopped when the program tried to create a folder called moodledata inside the folder /var, and did not have permission to do so. So I did a chmod 777 to folder /var and removed the blockade, but I fear what I have done is not safe and I want to go back to the previous (initial/default) permission value of /var I can't find anywhere what value should it be. Can you help me? Thanks!


title: 32 bit OS memory limitation on NUMA systems

text: Running 32 bit Rhel 6.5 with kernel 2.6.32-431.el6.i686 on a server with 46 Gb RAM and NUMA support.               CONFIG_X86_PAE=y      Intel(R) Xeon(R) CPU E5-2660 0 @ 2.20GHz OS is not able to see more than 14GB RAM and **lscpu** not showing any NUMA nodes in output. **numastat** complains system as not NUMA aware. **config-2.6.32-431.el6.i686|grep -i numa**               CONFIG_X86_NUMAQ is not set     CONFIG_NUMA is not set      **free -lm**                             total       used     free       shared    buffers     cached     Mem:         14682        697      13985          0         89        408     Low:           242        230         12     High:        14439        466      13972      **numastat**               sysfs not mounted or system not NUMA aware: No such file or directory      **mount|grep sysfs**               sysfs on /sys type sysfs (rw)        * Can there be any limitation for 32 bit OS on NUMA systems?   * Why is OS not able to access 46 GB(2^36 > 46 Gb) even with PAE,is it because of NUMA disabled? **On 64 bit its working fine.**


title: tar and if-statement

text: I have a script that check if a file exist inside a tar file but something's wrong because it always go to the `else` part of the script. I am pretty sure that it shouldn't be that way. The date is in "Mon dd" format (Jan 11).               echo "enter date: \c"     read date     tarfile=`tar -tvf tarfile.tar | grep some_file | grep "$date"`          if [ -f "$tarfile" ]; then         echo "yes"         else         echo "no"     fi


title: What's wrong with my zenity dialog? selector is not extending vertically

text: zenity list dialog looks different after a system upgrade, `%> zenity --text "Select" --list --column="Profile" --list a b c` ![enter image description here](http://i.stack.imgur.com/kldNo.png) Any idea on the extra space in the dialog? The selector should extend to its maximum size vertically. (It doesn't even if I resize the dialog) I'm running `zenity 3.8.0` in openbox (Arch Linux package `zenity-3.8.0-1`)


title: Recover Files Incorrectly Written to a USB?

text: I tried to transfer ('cut and paste') about 2gb of files from my system (running Linux Mint 15, KDE 4.2) onto my USB stick (8gb capacity). The notifications manager indicated that the copy was complete, so I removed the USB drive and mounted it on my other computer. Then it showed that only one of the files had been written to the USB. Is there any way for me to recover the missing files?


title: Added bin directory to my path, can't execute commands in it with 'sudo command'

text: I made a `bin` directory in my home folder where I place all my scripts. Then in my .bashrc I added the following:               export PATH=$PATH:/home/myusername/bin      So I could access files I placed in there from anywhere. But some of the scripts need to be executed as root. So I thought, I could symlink my .bashrc as root, (as in /root/.bashrc points to /home/myusername/.bashrc, don't know if this is smart) so when I need to run a script as root I can just do:               sudo program_that_requires_root      But then I get a:               sudo: program_that_requires_root: command not found      If I login as root and execute the program, it works fine though. So what is the correct way to accomplish what I want?


title: How do I set up a small personal network with Linux?

text: I want to take the time to get into building a useful network for use between my personal machines using Linux. I have spent a lot of time scouring the web for resources on how to do this but I am unable to find any decent, complete guides. Right now, I have an old tower that I want to serve as a server and a laptop. My laptop operates with CrunchBang Linux and the server has CentOs (willing to change the tower's os but #! stays on the laptop for now). Here are some things I hope to achieve with my network:   * I want to use the server as a seed box.   * I want the server to serve files to my laptop or any other guest machine on the network that has a password I define.   * I would like to be able to be served files on the server over the internet (i.e. from out side my personal network).   * I would like to be able to control the server using a remote shell from over the internet.   * I would like the network to be relatively secure. Those are the primary goals. Some secondary goals would be: - Getting the server to perform some automated backup service for clients - The ability to stream media on the server to clients. While building this network I hope to learn a lot about how these networks work. How tcp/ip works in general, and how these networks are made secure. I am hoping to start building a system now that I will tweak and grow through out a lifetime. Mostly what I am asking for from everyone here is resources. What are the best books/sites for learning what I need to learn to do this? What resources did those of you that know how to setup and configure a home/personal small network with the features I listed you use to learn what you needed to learn?


title: How can I bcc with mailx?

text: I'm trying to send unix `mail` (`heirloom-mailx`) via bcc.               $ mail -V     12.5 6/20/10      My MTA is exim, which sends via Gmail SMTP. I can execute the following:               echo -e "body" | mail -s 'subject' -b hidden1@server.com,hidden2@server.com visible@server.com      All addresses receive the email, however the bcc is not hidden. i.e. in the email to `hidden1@server.com`, I still see:               To: visible@server.com     Bcc: hidden1@server.com,hidden2@server.com      How can I make `mail` send bcc properly?


title: How can I script xrandr's scale function to switch to the next or previous resolution in a predefined list?

text: `xrandr` has a nifty feature that lets you scale your entire screen so that your virtual resolution is larger or smaller than your actual resolution. I use it on my netbook's 1024x600 resolution screen to work in a 1280x750 resolution workspace. Can I set up keyboard shortcuts to increase/decrease/reset the scale factor I'm currently using? Some applications do great with the extra space, while some are harder to read. I know how to set up keyboard shortcuts in my distribution already, but I don't know how I can make xrandr accept this sort of differential input


title: autossh in /etc/inittab

text: I have setup ssh tunnel to be able to connect a target computer behind NAT. I have put the following into /etc/inittab on the computer:               tu:2345:respawn:/usr/bin/autossh -M 20000 -f -n -N -T -R 6790:localhost:22 me@servername.cz      It works, ie i can connect by issuing ssh -p 6790 me@localhost. But every now and then i get the following message on the target computer:               INIT: Id "tu" respawning too fast, disabled for 5 minutes      In /var/log/secure on the server, I can see the following:               Oct 29 03:11:15 vm sshd[19725]: Accepted publickey for me from 90.179.155.74 port 37416 ssh2     Oct 29 03:11:15 vm sshd[19727]: Received disconnect from 90.179.155.74: 11: disconnected by user     Oct 29 03:17:04 vm sshd[20892]: Accepted publickey for me from 90.179.155.74 port 40116 ssh2     Oct 29 03:17:15 vm sshd[20896]: error: bind: Address already in use     Oct 29 03:17:19 vm sshd[20896]: error: channel_setup_fwd_listener: cannot listen to port: 20000      And this goes on. Any idea what can be wrong?


title: set read and write permissions to folder and all its parent directories

text: I need to set read and write permissions for `root` user to directory `subfolderN` and all its parent folders till `root`. I can do it by hands:               $ sudo chmod +rx /root/subfolder1/subfolder2/subfolderN     $ sudo chmod +rx /root/subfolder1/subfolder2     $ sudo chmod +rx /root/subfolder1     $ sudo chmod +rx /root      But if `N` is big I am tired. How to do automatically by one command?


title: How to live a Pleskless life?

text: I have always used Linux with Plesk when hosting web projects. It's easy to host multiple websites and setup email accounts but I realized it's overkill sometimes. I think it uses a lot of resources and make customizing the server a hassle. I'm about to publish a new website and I'm thinking about getting a Media Temple VPS Developer hosting (http://mediatemple.net/webhosting/vps/developer/) or something similar. I would like some guidance of how to make this leap, how to do stuff without using Plesk. Setup a new website, create emails, a ftp account, databases... I have already played a bit with doing stuff by hand and it seems to me everything is not as integrated as Plesk makes it look like. The thing that confuses me the most is accounts. Apache accounts, email accounts, database accounts, ftp accounts... I was thinking about using a PaaS provider so I don't have to deal with all of this stuff but I use PHP and I couldn't find a good one that would allow me to customize it with extensions. Also, it seems I can get more performance for cheaper with a VPS/Dedicated server. So basically, how do you guys do without Plesk and alikes?


title: How to use command line to change brightness and color?

text: Is there any way to change the brightness and color? Using any command line tools? I am trying in Fedora and Ubuntu but no luck so far. **Follow up:**               [command]    [conneccted output]   [effects R:G:B, value 0 to 255]             |     /      |            /        |            /     ^    ^       ^            ^        ^           ^     xrandr       --output VGA1         --gamma 0:0:0


title: rsync via ssh from linux to windows sbs 2003 protocol mismatch

text: I am trying to backup my linux webserver to our local windows sbs 2003 server in the office. I have set up ssh and cwrsync on the windows server and have confirmed that the linux server can reach the windows server via the command:               ssh RemoteUser@xxx.xxx.xxx.xxx      It asks for a password and connects fine. However when I run this command to start the backup:               rsync -avz -e ssh home/account/public_html/some/small/directory/ \         remote_user@xxx.xxx.xxx.xxx:/cygdrive/c/backup/destination/directory/      I get this error after entering the password: > protocol version mismatch -- is your shell clean? and then it dies. Has anyone got any ideas?


title: How can I reset all the bind keys in my Bash?

text: I bound some keys by mistake, and they don't work any more, such as `HOME`, `END`, `UP`, `DOWN`, `LEFT`, `RIGHT`. Is there a way to reset all the bound keys to their original state?


title: AIX ftpd - how to set umask for a given user?

text: I know how can I change the umask settings for all the users using ftpd, but how can I change the umask for a given user using FTPD? AIX/6100-05-02-1034 FTP server (Version 4.2)


title: How can I use awk to (sometimes) remove the first character of a column?

text: I run a command and pipe it through awk as below : `mycommand | awk '{print $1,tolower($3),$4}` This gives me the following output:               fred.o: t .abcdefg      fred.o: u .rstuvwxy      fred.o: t .defghi      fred.o: t .jklmnop      fred.o: d abcdefg      fred.o: d zyxwvuts       As you can see the sometimes the third column contains a leading "." but not always. How can I modify my `awk` command to get rid of the leading "." in the third column if it exists ? eg I would like my output to look like this :               fred.o: t abcdefg       fred.o: u rstuvwxy       fred.o: t defghi       fred.o: t jklmnop       fred.o: d abcdefg       fred.o: d zyxwvuts


title: Unix command that takes no arguments

text: Don't ask why, but is there a Unix command that takes no arguments?


title: How to define a Bash function that can be used by different scripts

text: I have defined a `bash` function in my `~/.bashrc` file. This allows me to use it in shell terminals. However, it does not seem to exist when I call it from within a script. How can I define a `bash` function to be used by scripts as well?


title: Extracting tokens from a line of text

text: Using bash scripting and grep/awk/sed, how can I split a line matching a known pattern with a single character delimiter into an array, e.g. convert `token1;token2;token3;token4` into `a[0] = token1` … `a[3]=token4` ?


title: How can I mount a directory of the host system for use inside a FreeBSD jail?

text: I am performing the following on FreeBSD 9.0-STABLE:               mount_nullfs /foo /jail/foo      After that, from _within_ the host system, the mount works. So this works:               touch /foo/bar && ls /jail/foo/bar      But when I change into the jail the mounted directory is empty:               jexec 1 tcsh     ls /foo/bar      I get:               ls: /foo/bar: No such file or directory      `/foo` is completely empty. How can I have the files in the mounted directory show up correctly when mounted inside the chroot as found in the host system?


title: Vim colorize edit mode

text: I'm trying to tailor vim to my needs and I would like vim to visually indicate when it is in some kind of edit mode (insert/replace) by, for example, coloring the background red. Is there any way to achieve this?


title: Change behaviour of the modifier keys system-wide

text: I’d want to make modifier keys (control, alt, shift, meta, super, lv3_switch) to act like usual keys, I mean, without holding one of them to perform associated key combination. Say C-x M-1 can by typed like               press Ctrl key — release Ctrl key      press x key — release x key      press Meta key — release Meta key      press 1 key — release 1 key      so that can be performed even with one hand key-by-key!


title: Why does "chmod 1777" and "chmod 3777" both set the sticky bit?

text: To set the sticky bit on a directory, why do the commands `chmod 1777` and `chmod 3777` both work?


title: Make a linux network device a router

text: I am developing an IPv6 network device driver. It should behaviors like a router, i.e. send router advertisement regularly. But now my device is working like a node, send router solicitation. What should I do to change it to a router? Thanks.


title: Re-installing Windows 7 on a dual boot system with Fedora

text: At present I have a dual boot system with Windows 7 and Fedora 14. I want to re-install windows 7 but most probably it will replace Fedora's boot loader. I have a lot of things set up on Fedora. I want to keep these things intact. In other words, I want to make an image of my present Fedora system, re- install Windows 7 and have my Fedora system retain the exact state it had before re-installation of Windows 7. Can any one discuss the procedure to achieve this?


title: How can you configure a system to be bootable from most modern systems?

text: How can a Linux system be installed on a portable storage medium so that both BIOS systems (e.g. a ThinkPad) and EFI systems (e.g. a Mac Mini) can boot to it? The reason I ask is because I tried installing Debian onto my portable hard drive with an MBR and GRUB. The BIOS systems I tried booted fine from the drive, but when I tried to boot a Mac Mini (EFI) from it the system did not even detect the drive as a boot medium. Is there an easy way to install a system that both interfaces will detect and boot from?


title: How to determine which executable on my path will be run?

text: I run `which` and get the following,               brendan$ which python       /opt/local/bin/python     brendan$ which -a python       /opt/local/bin/python       /usr/bin/python     brendan$ ls -l /opt/local/bin/python       lrwxr-xr-x  1 root  admin  24 22 Jul 00:45 /opt/local/bin/python -> /opt/local/bin/python2.4     brendan$ python       Python 2.6.1 (r261:67515, Jun 24 2010, 21:47:49)        ...       (this is the python version in /usr/local/bin)      My point is, `which` does not tell me the primary executable, i.e. the one that will be executed in preference. How do I find this out? I am running OSX 10.6 on a Macbook although the question is general to UNIX- likes. **Update:** I have been removing lots of redundant versions of Python on my system (I had at least half a dozen) and removing various crufty `PATH` declarations in a bunch of initialisation files. In the process, somehow, a fresh shell now shows the expected output (i.e. `which` shows `/opt/local/bin/python` and that is what is executed). In any case, thanks for the help!


title: Debian Squeeze not whole of package contents installed

text: When I do `apt-get install usb-modeswitch-data`, not all of it's contents are installed under `/etc/usb_modeswitch.d`. I looked inside package and wasn't able to understand how could it be -- there were no special filtering of package contents visible to me. I'm using Debian Squeeze and package in question is `usb-modeswitch- data:20100826-1+squeeze0`. Can somebody explain this effect?


title: Print only lines that are completely numeric

text: I'd like to filter through a text file and _only_ print the lines where each column is a valid floating point number. For example:               3 6 2 -4.2 21.2      3 x 4.2 21.2      3 2 2.2.2      Only the first line would pass as `x`, nor `2.2.2` are valid floats. I can write a python script that simply `.splits()` and runs a `try/except` block over each part, but this is slow for larger files. The input file has an unknown variable length number of columns and no scientific notation will be used. Is there an `awk` solution?


title: How to print a bash variable that has an array as value

text: I wrote a script for my `dwm` statusbar. One part of it is finding the current cpu usage for every single core on my system. I figured out a way myself but I would need some help fixing a bug in this. Here is the command: `top -bn 2 -d 0.5 | grep -F '%Cpu' | tail -n 4 | awk '{print $3}'`. This assumes that your `top` shows every core per default. You can achieve this by issuing `top` then pressing `1` and then pressing `W` to save the current configuration to a `.toprc` file in your home folder. Everytime you open `top` now it will display all of your cores. My aforementioned command has the drawback that when assigned to a variable like this:               CPU=$(top -bn 2 -d 0.5 | grep -F '%Cpu' | tail -n 4 | awk '{print $3}')      and then using `$CPU` with `xsetroot` like this: `xsetroot -name "$CPU"` I will get the output I want in my statusbar but between every cpu percentage there will be two symbols on top of each other separating them `v` and `t`. How do I get rid of them? Has this something to do that I might be using an array instead of a string here? You can see the problem on the left side of the picture. Command:               top -bn 2 -d 0.5 | grep -F '%Cpu' | tail -n 4 | awk '{print $3}'      sample output:               14.3     12.0     8.0     10.0      * * * Note for anyone using this script: When the cpu usage for a core reaches `100%` the array that the command outputs will move the column with the current load from column `3` to column `2`. Hence, with `awk '{print $3}'` you will then see `us,` as output for column `3`. If you're fine with that leave it. If not you could have `awk` print column `2` as well. It will just be `:`. A solution that avoids all those pitfalls is:               top -bn 2 | grep -F '%Cpu' | tail -n 4 | gawk '{print $2 $3}' | tr -s '\n\:\,[:alpha:]' ' '


title: (Vim) How to use TAB for indentation in all file types?

text: I'm using only _TAB_ for indent, so I configure Vim for using only them:               set autoindent     set noexpandtab     set tabstop=4     set shiftwidth=4      But some files (`.py`) still using _spaces_. I've search for it and found:               filetype plugin indent on      But this has not help, and I've try:               au FileType python setlocal noexpandtab      But this has help only for python. So how to apply `noexpandtab` for **all** file types?


title: Package installation and dependancies - how to prevent installation of existing libraries?

text: I'm a relatively new Ubuntu server user, so I'm learning as I go. I have an issue with a software package I'm installing (QGIS) which has several dependancies one of them being `gdal` library. Regardless of the installation manager I use (apt, synaptic or aptitude), this package installs gdal version 1.7.3 which is quite outdated (current stable is 1.9.1). I wouldn't have an issue with this if I hadn't already built/compiled the last version of gdal myself (I chose to do so, so I could include some uncommon raster format support). If I type `dpkg --list`, I can see both libraries existing one beside the other but i dont even want the old one. After some tinkering I used synaptic and manually disabled gdal dependancy during installation and then the my compiled version of gdal 1.9.1 kicked in. Why wouldnt QGIS use the last version from the start? Also is there a way in Linux to check wheter dependancies need to be installed at all? Or perhaps, is there a way to change which libraries certain package uses after its been installed?


title: Why does this exclude pattern for rsync give different results when the source directory has a trailing slash?

text: When I do something like               rsync -a --exclude=/e/garbage /e /dest      the exclusion works, but with               rsync -a --exclude=/e/garbage /e/ /dest/e      it doesn't. I'm using version 3.0.7 protocol version 30 under cygwin, in case it matters.


title: `highlight` command

text: Is there a command which can be used to easily highlight (with colors, bold text or inverted back-/foreground) specific strings in stdin while passing the entire string to stdout? I'm thinking of building it, but I'd rather just use it if it already exists. Some desirable features:   1. Separate highlight strings are highlighted differently, in an automatic way. For example, the first string will be highlighted in red, the second in green, the third in blue _without manual configuration_.   2. Detects color support and falls back to bold/inverted/other highlighting methods where those are available.   3. Allow for matching of regular expressions and literal strings.   4. Preferably does something smart if the matches overlap, such as "foobar" and "barbar".   5. Nothing is modified between stdin and stdout except for the addition of color codes.


title: tar through ssh session

text: > **Possible Duplicate:**   >  What does "-" mean as an argument to a command? When I use this command:                 tar cf - /tmp | ssh test.com tar xf -      What does the '-' mean? And is this the correct interpretation of the above command? tar the tmp directory and ssh the tarball to test.com and untar it.


title: Linux-image-3.2.0.4-amd64 vs linux-image-amd64

text: Installing Debian I have to choose between the kernels   * `linux-image-3.2.0.4-amd64`   * `linux-image-amd64` What's the difference?


title: Horizontal file concatenation

text: Is there a Linux command like `cat` that joins files with the same number of lines horizontally?


title: How to determine a log's source process spawned from a systemd service?

text: I have a systemd service which starts multiple 3rd-party processes which output to standard output. Is there anyway to easily determine which logs are from specific process from the system journal? * * * Diving into systemd recently, I had a question about logging. `man systemd- journald.service` notes that: > It creates and maintains structured, indexed journals based on logging > information that is received from the kernel, from user processes via the > libc syslog(3) call, **from standard input and standard error of system > services** or via its native API. I created a simple service:               [Service]     ExecStart=/home/myself/logtest/runlogtest      And have the script invoke some processes:               #!/bin/bash          ...     /home/myself/logtest/app1 &     /home/myself/logtest/app2 &     ...      When the service is running, I listen for messages using the following command:               journalctl -f | grep runlogtest      The output is seen as the following (for this example, app1 output 'A' and app2 output 'B'):               Aug 07 14:22:04 localhost.localdomain runlogtest[8742]: B     Aug 07 14:22:07 localhost.localdomain runlogtest[8742]: A     Aug 07 14:22:07 localhost.localdomain runlogtest[8742]: B     Aug 07 14:22:10 localhost.localdomain runlogtest[8742]: B     Aug 07 14:22:11 localhost.localdomain runlogtest[8742]: A     Aug 07 14:22:13 localhost.localdomain runlogtest[8742]: B     Aug 07 14:22:15 localhost.localdomain runlogtest[8742]: A      Is there anyway to know that 'A' logs are coming from app1 (and 'B' messages are from app2)? The only solutions I can see right now is that I would:   * Manage each application in its own service (something I'd like to avoid).   * Make a wrapper for process which I capture their standard output and pump to the journal via syslog.


title: How to raid-mirror existing root partition?

text: I'd like to mirror my existing root (and only) partition on an SSD to another disk. It should be a sort of RAID-1, just asymmetric*. I know there's the option `mdadm --write-behind`, which should do it. But I have no idea if it is possible with preserving the context of the existing partition. I imagine it like   * create the "slave" partition   * setup the RAID telling it that the slave partition is not initialized   * let it initialize it by cloning the master partition but I'm probably too optimistic, aren't I? * * * * All reads should access the first disk and writes should be considered finished when the first disk is written.


title: Set default nice value for a given user (limits.conf)

text: Could someone tell me how to set the default value of `nice` (as displayed by `top`) of a user? I have found that /etc/security/limits.conf is the place but if I put either:               username_of_a_guy  -  nice  19     username_of_a_guy  soft  nice  19     username_of_a_guy  hard  nice  19      It doesn't work (while it should, right?). Note that I've rebooted since then. Thank you _very much_ in advance for any help. I'm using debian unstable (uptodate). Context: At my work, we have a local network: everyone has its own computer and everyone can create an account on someone else's machine if one likes. The rule of thumb is simply that if you work on someone else computer, please nice your processes (`nice 19`). I would like to set the default nice value for a given user to 19 once and for all (he pretends he forgets all the time to nice).


title: Full text search for man pages

text: `apropos` works great for searching manual page names and descriptions. Is there a similar command for searching the entire contents of the manual pages?


title: bash script and local env variable namespace collision

text: I have a `bash script` with a variable called `VAR_A` I also have a local `env variable` called `VAR_A` The `bash script` calls the command:               echo ${VAR_A}      I am not able to change the variable in the script to another name, but I can change how the script calls the `echo` command. How can I modify the `echo` command to ensure it's printing the local `env variable` instead of the one provided in the script? `UPDATE FOR CLARITY:` The situation: User has an existing `.bashrc` file which on login, sets:               VAR_A="someValue"     export VAR_A      This allows the user to:               ~]$ echo ${VAR_A}         someValue      I have a configuration file for some bash scripts               VAR_A="someOtherValue"      I have a bash script:               #!/bin/bash          . ../configuration  # imports config file with some values          #  do stuff          echo ${VAR_A}      Executing the script from the terminal (bash shell as logged in user) prints:               ~]$ ./run_script.sh         someOtherStuff      I need it to print:               ~]$ ./run_script.sh         someStuff      I hope that helps clear things up.


title: How to add file browser or home folder in Lubuntu 12.04 Pannel

text: I am using Lubuntu 12.04. The file browser icon has unfortunately been deleted from the panel bar. How can I add it back again?


title: English Fonts with Persian Glyph

text: I'm trying to solve this problem for sometime. In the title bar of my web browsers and places like that; If there is a Farsi (Persian) string, it is shown like `****` or something similar.   I searched and found out the font that I choose for the job has no Persian glyphs. So I want to know which fonts or font families could I use that has Persian glyphs in them?


title: best bittorrent client on Linux

text: What would people recommend as a free (as in freedom) BitTorrent client on Linux? Wikipedia has a Comparison of BitTorrent clients. For the record, I'm currently using QBittorrent, which I'm quite satisfied with, as of recent versions, which are nicely featured and stable. I'm currently running 2.6.7 on Debian Squeeze. The version on lenny (1.1) was a bit dodgy, but the project was quite young then. However, it does not hurt to learn what else is out there. I'm quite partial to Python software, if any Python BitTorrent clients exist. QBittorrent is written in C++. Many of the most popular BitTorrent clients are proprietary, judging by the Wikipedia page. EDIT: Thanks for all the recommendations. If the recommenders would like to explain why they like their preferred clients, I'd be happy to hear it. I know very little about what makes a bittorrent client good and would be glad to be educated. Also it would be nice if something could be said about Linux distribution support and possibly other OS's like FreeBSD and OS X, though I only use Debian and am unlikely to change.


title: How to change mount points

text: I'm not very deep into this mounting/unmouting think on Linux, so here goes my question: With `df -h` I get the following overview:               Filesystem            Size  Used Avail Use% Mounted on     /dev/sda1             323M  306M     0 100% /     tmpfs                 502M     0  502M   0% /lib/init/rw     udev                  497M  116K  497M   1% /dev     tmpfs                 502M     0  502M   0% /dev/shm     /dev/sda9              47G  181M   44G   1% /home     /dev/sda8             368M   12M  338M   4% /tmp     /dev/sda5             8,3G  1,1G  6,8G  14% /usr     /dev/sda6             2,8G  433M  2,2G  17% /var      I'm using this machine as web server where all web related stuff resides under `/srv/`. As this is part of `/` I'm out of disk space here. I saw `/home` having 44G available web space, which is pure nonsense in my case. So I want to have `/home` not as own partition (rather part of `/`), but `/srv` as own partition, grabbing the space consumed by `/home`. So after that `df -h` should look like this (`/home` replaced by `/srv`):               Filesystem            Size  Used Avail Use% Mounted on     /dev/sda1             323M  306M     0 100% /     tmpfs                 502M     0  502M   0% /lib/init/rw     udev                  497M  116K  497M   1% /dev     tmpfs                 502M     0  502M   0% /dev/shm     /dev/sda9              47G  181M   44G   1% /srv     /dev/sda8             368M   12M  338M   4% /tmp     /dev/sda5             8,3G  1,1G  6,8G  14% /usr     /dev/sda6             2,8G  433M  2,2G  17% /var      What have to do to get here?


title: A shell tool to “tablify” input data containing ANSI escape codes

text: I have input containing ANSI color codes that I'd like to tablify. I want the output to remain colored, so the tablified output should maintain the ANSI color codes. Hence, naively stripping them away does not meet my requirements. For example, for this input,               \033[0;32;1mgreen_apple\033[0m 1 100     orange 20 19     pineapple 1000 87     avocado 4 30      The output I expect would be similar to               green_apple 1    100     orange      20   19     pineapple   1000 87     avocado     4    30      In the above output, "green_apple" should be colored according to the color codes from the input i.e. green. I'd like to know how this can be accomplished. I've tried column, but it doesn't handle ANSI codes. The output of               echo '\033[0;32;1mgreen_apple\033[0m 1 100     orange 20 19     pineapple 1000 87     avocado 4 30' | column -t      is unfortunately               green_apple  1     100     orange                  20    19     pineapple               1000  87     avocado                 4     30      Notice the non-tablification.


title: scp permission denied after 'hardening' with bastille

text: I recently 'hardened' two Ubuntu servers using Bastille, and now I get _permission denied: scp_ whenever I try to scp files in.   * SSH login works fine.    * I've tried adding an _/scp-dump_ folder with 777 permissions and still get the same error, so I don't believe it is a permission issue.   * Tailing _/var/log/auth.log_ doesn't really give any information, apart from               Oct  1 23:08:39 localhost sshd[20876]: Accepted publickey for some-user from [redacted ip] port 49250 ssh2     Oct  1 23:08:40 localhost sshd[20884]: Received disconnect from [redacted ip]: 11: disconnected by user        * Using the _-v_ flag with scp outputs the following:              Executing: program /usr/bin/ssh host some-domain.com, user (unspecified), command scp -v -t -- /scpdump     OpenSSH_5.9p1, OpenSSL 0.9.8r 8 Feb 2011     debug1: Reading configuration data /Users/some-user/.ssh/config     debug1: Reading configuration data /etc/ssh_config     debug1: /etc/ssh_config line 20: Applying options for *     debug1: Connecting to some-domain.com [12.34.56.78] port 22.     debug1: Connection established.     debug1: identity file /Users/some-user/.ssh/id_rsa type 1     debug1: identity file /Users/some-user/.ssh/id_rsa-cert type -1     debug1: identity file /Users/some-user/.ssh/id_dsa type -1     debug1: identity file /Users/some-user/.ssh/id_dsa-cert type -1     debug1: Remote protocol version 2.0, remote software version OpenSSH_5.9p1 Debian-5ubuntu1     debug1: match: OpenSSH_5.9p1 Debian-5ubuntu1 pat OpenSSH*     debug1: Enabling compatibility mode for protocol 2.0     debug1: Local version string SSH-2.0-OpenSSH_5.9     debug1: SSH2_MSG_KEXINIT sent     debug1: SSH2_MSG_KEXINIT received     debug1: kex: server->client aes128-ctr hmac-md5 none     debug1: kex: client->server aes128-ctr hmac-md5 none     debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent     debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP     debug1: SSH2_MSG_KEX_DH_GEX_INIT sent     debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY     debug1: Server host key: RSA 8e:83:21:4a:9c:be:57:56:b1:07:5a:14:68:8a:47:dc     debug1: Host 'some-domain.com' is known and matches the RSA host key.     debug1: Found key in /Users/some-user/.ssh/known_hosts:17     debug1: ssh_rsa_verify: signature correct     debug1: SSH2_MSG_NEWKEYS sent     debug1: expecting SSH2_MSG_NEWKEYS     debug1: SSH2_MSG_NEWKEYS received     debug1: Roaming not allowed by server     debug1: SSH2_MSG_SERVICE_REQUEST sent     debug1: SSH2_MSG_SERVICE_ACCEPT received     debug1: Authentications that can continue: publickey,password     debug1: Next authentication method: publickey     debug1: Offering RSA public key: /Users/some-user/.ssh/id_rsa     debug1: Server accepts key: pkalg ssh-rsa blen 277     debug1: read PEM private key done: type RSA     debug1: Authentication succeeded (publickey).     Authenticated to some-domain.com ([12.34.56.78]:22).     debug1: channel 0: new [client-session]     debug1: Requesting no-more-sessions@openssh.com     debug1: Entering interactive session.     debug1: Sending environment.     debug1: Sending env LANG = en_US.UTF-8     debug1: Sending env LC_CTYPE = C     debug1: Sending env LC_MESSAGES = en_AU.utf-8     debug1: Sending env LC_TIME = en_AU.utf-8     debug1: Sending env LC_MONETARY = en_AU.utf-8     debug1: Sending env LC_NUMERIC = en_AU.utf-8     debug1: Sending env LC_COLLATE = en_AU.utf-8     debug1: Sending command: scp -v -t -- /scpdump     zsh:1: permission denied: scp     debug1: client_input_channel_req: channel 0 rtype exit-status reply 0     debug1: client_input_channel_req: channel 0 rtype eow@openssh.com reply 0     debug1: channel 0: free: client-session, nchannels 1     debug1: fd 0 clearing O_NONBLOCK     debug1: fd 1 clearing O_NONBLOCK     Transferred: sent 2880, received 2504 bytes, in 0.6 seconds     Bytes per second: sent 4563.7, received 3967.9     debug1: Exit status 126     lost connection      Any idea where the permission denied might be coming from, config files I can look into, or other logs I should be looking at?


title: Getting webcam to work in Raspberry Pi

text: I am trying to get a HAMA webcam to work with my raspberry pi with the raspbian os. When I type usb-devices I get:               pi@raspberrypi ~ $ usb-devices          T:  Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=480 MxCh= 1     D:  Ver= 2.00 Cls=09(hub  ) Sub=00 Prot=01 MxPS=64 #Cfgs=  1     P:  Vendor=1d6b ProdID=0002 Rev=03.01     S:  Manufacturer=Linux 3.1.9+ dwc_otg_hcd     S:  Product=DWC OTG Controller     S:  SerialNumber=bcm2708_usb     C:  #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=0mA     I:  If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub          T:  Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  2 Spd=480 MxCh= 3     D:  Ver= 2.00 Cls=09(hub  ) Sub=00 Prot=02 MxPS=64 #Cfgs=  1     P:  Vendor=0424 ProdID=9512 Rev=02.00     C:  #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=2mA     I:  If#= 0 Alt= 1 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=02 Driver=hub          T:  Bus=01 Lev=02 Prnt=02 Port=00 Cnt=01 Dev#=  3 Spd=480 MxCh= 0     D:  Ver= 2.00 Cls=ff(vend.) Sub=00 Prot=01 MxPS=64 #Cfgs=  1     P:  Vendor=0424 ProdID=ec00 Rev=02.00     C:  #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=2mA     I:  If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=ff Driver=smsc95xx          T:  Bus=01 Lev=02 Prnt=02 Port=02 Cnt=02 Dev#=  4 Spd=12  MxCh= 0     D:  Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1     P:  Vendor=0c45 ProdID=6142 Rev=01.01     S:  Product=USB camera     C:  #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=500mA     I:  If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)      I guess that last one is the camera. What are my next steps to get it to take some pictures?


title: Running sha1sum into several directories

text: I have several directories that share a common parent directory. In each directory there are regular files, but no other subdirectories. Something like this:               top/dir-1     top/dir-1/file-11     top/dir-1/file-12     top/dir-2     top/dir-2/file-21     top/dir-2/file-22     top/dir-3     top/dir-3/file-31     top/dir-3/file-32      I'd like to run `sha1sum` on those files and obtain the following checksum files:               top/dir-1/sha1sum     top/dir-2/sha1sum     top/dir-3/sha1sum      `top/dir-1/sha1sum`, for example, should contain only the checksums for `file-11` and `file-12`:               xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx file-11     yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy file-12      I have tried several commands involving `find`, `sha1sum`, `cd`, a `for` loop and subshells, but without much success. Last thing: both directories and files can have spaces in their names, so any solution should consider this. Any ideas? * * * Edit. I finally tried with:               cd top     for i in *; do cd "${i}"; (sha1sum * > sha1sum); cd ..; done      It seems to work, but I'm still not sure if it's the right way for doing this kind of job.


title: Launching app over SSH with DISPLAY when user not logged in

text: After searching and searching without any luck I'm hoping someone here can enlighten me. I have a PC (Ubuntu with encrypted home dir). I wake this PC up from a shell script on my phone, the PC shows the login screen. I do not physically log in to the PC. I run another shell script on my phone where:   * I connect through SSH   * decrypt my user's home dir   * `export DISPLAY=:0.0`   * launch app the script completes and exits. The app is successfully launched because when I manually log in on the PC in the morning and do a `ps -ef` it shows the process.The thing is however I can't see the GUI. I have to kill the process and start the app again. I think it has something to do with the fact that there is no GUI session when starting the app over SSH so `DISPLAY` doesn't matter. If I manually log in first and then run a script from my phone which:   * I connect through SSH   * `export DISPLAY=:0.0`   * launch app the script completes and exits, and I see the GUI of the application showing up on my PC.


title: Bumblebee (Optimus) Service Won't Start w/ 3.4 Kernel on Fedora 16

text: I'm using an ASUS laptop (MUXless graphics) w/ a GT 630M (re-branded 540M) GPU and only Fedora 16 installed. I installed bumblebee and the NVIDIAdrivers using the instructions described here: http://duxyng.wordpress.com/2012/01/26/finally-working-nvidia-optimus-on- fedora-16/ These instructions worked perfectly with the bumblebee service running properly between different subversion of the Linix kernel 3.3. If I load the kernel version 3.3.7 and 3.3.8 the bumblebee service will start and allow the `optirun` command to work. This does not happen with kernel version 3.4.2, and the bumblebee service fails to start. This issue seems to have been brought up here: https://github.com/Bumblebee- Project/bbswitch/issues/23 I'm perfectly fine using the older kernels, but now I have to avoid any kernel updates. I'm wondering if anyone has any familiarity with this issue, it seems to be a rather recent one.


title: Setting up SMTP-AUTH & TLS in Postfix

text: So I have been in the process of installing a Postfix Server on my CentOS 6.2 Virtual Private Server. I have been following this tutorial: http://www.howtoforge.com/virtual-users-and-domains-with-postfix-courier- mysql-and-squirrelmail-centos-6.2-x86_64 Because, I have never set up a Mail Server before.. So everything has worked fine up until the 5th page. I am on step 15. It shows how to verify that Postfix is ready for SMTP-AUTH and TLS, but when I run the commands:               telnet localhost 25      and get:               Trying ::1...     Connected to localhost.     Escape character is '^]'.     220 server1.example.com ESMTP Postfix      So I type:               ehlo localhost      I get:               250-server.cdevelop.info Hello localhost [127.0.0.1], pleased to meet you     250-ENHANCEDSTATUSCODES     250-PIPELINING     250-8BITMIME     250-SIZE     250-DSN     250-ETRN     250-DELIVERBY     250 HELP      So there is no:               250-STARTTLS     250-AUTH PLAIN LOGIN     250-AUTH=PLAIN LOGIN      Which by the guide, and common sense, shows that it isnt ready for SMTP-AUTH nor TLS.. Everything has been installed in the Guide, and cofigured the way stated, but I am still getting this problem.. Would someone Kindly help me work this out? What should I be looking into? either configurations, or verify packages are installed or Error logs, etc.? Is there anymore information I should provide to you folks? Or just anything else anyone would like to say about this that may help my situation. And if you cant provide any help or information, would someone mind pointing me to some good tutorials on setting up a lightweight mail server on my CentOS VPS? I really like the tutorial I am following now, because it allows Virtual Domains and Virtual Users, making it lighter, and more customizable. So if I could integrate virtual users and domains into another tutorial that would work too. :) Thanks guys. Hope Someone could help out. Take Care.


title: Alternative to xmllint to check xml validity

text: Sometimes, I have to check the validity of some big xml files against a xsd file. The biggest xml file I received had a size close to 1.5GB. `xmllint` took all my RAM and almost all the swap space, for a total memory usage of 18GB. Consequently, the validation process lasted for 24 hours. My question: Is there an alternative to `xmllint --schema` that consumes less memory, perhaps making use of some streaming features instead of loading the file to memory?


title: Zip file using tar on linux server

text: I'm trying to make a zip file out of some files but when I extract the zip I only get 1 file.               tar cfvz test.zip file1.mp3 file2.mp3 file3.jpg      And after I extract test.zip I only get a "test" file.The size of the zip size is ok, I just don't know how to make this work so that on extract I get the same files:"file1.mp3 file2.mp3 file3.jpg"


title: equivalent of `grep -a /dev/sda1` on Darwin?

text: I want to run something like               % sudo grep -i -a 'some-string' <drive device>      On Linux, `<drive device>` would be something like `/dev/sda1`. How can I find the equivalent on Darwin? (In case it's not obvious, I'm on a last-ditch-effort hunt for accidentally deleted data.)


title: Issues configuring sarg. which of sarg.conf or sarg-report.conf got executed at the end of the day

text: But it doesn't run at all on every hours. It runs rather on every 6 AM in the morning for me to notice that sarg seems have installed the following in /etc/cron.d/{daily,weekly,monthly} folders. I have 3 questions. **Question 1** : what is the proper way of setting up sarg. **Question 2** : why my hourly cron doesn't work **Question 3** : why weekly folder doesn't have an html index page I have squid and dansguardian packaged as one with zentyal 3.2 (ubuntu desktop 12.04) and I have installed sarg and configure it. see on pastie.org my configurations. I intentionally output_dir to a different place in sarg.conf               output_dir /var/www/sarg      And HTMLOUT to a different place on the sarg-reports.conf               HTMLOUT=/var/www/squid-reports       The reason for that is that I would like to know what got generated by what. So `sarg -x` generates the files in /var/www/sarg . but when I run `/usr/sbin/sarg-reports daily` on the shell nothing happens. I have then put in root crontab the following:                @hourly /usr/sbin/sarg-reports daily      00 01 * * 1 /usr/sbin/sarg-reports weekly      03 02 1 * * /usr/sbin/sarg-reports monthly      But it doesn't run at all on every hours. It runs rather on every 6 AM in the morning for me to notice that sarg seems have installed the following in /etc/cron.d/{daily,weekly,monthly} folders. I have 3 questions. **Question 1** : what is the proper way of setting up sarg. **Question 2** : why my hourly cron doesn't work **Question 3** : why weekly folder doesn't have an html index page


title: Noob Kernel Image Question

text: I'm playing about with CM-FX6 , an iMX6 based SOC. The chip comes with the following: http://www.compulab.co.il/workspace/mediawiki/index.php5/CM- FX6:_Linux:_Kernel               **images**     uImage-cm-fx6 - ready to run Linux kernel image binary for CM-FX6     debian-image.tar.bz2 - archive of the Debian root file system     debian-image-squeeze.tar.bz2 - archive of the Debian root file system with:     FreeScale GPU support libraries     Fluxbox window manager     kernel.img - Kernel image required for installation onto the NAND flash or the SSD     ramdisk.img - Ramdisk image required for installation onto the NAND flash or the SSD     bootscr.img - U-Boot script used for image installation          **kernel**     uImage-3.0.35-cm-fx6-6.bin - ready to run Linux kernel version 3.0.35-cm-fx6-6 for CM-FX6     linux-3.0.35-cm-fx6-6.config - Linux kernel 3.0.35-cm-fx6-6 configuration file     linux-3.0.35-cm-fx6-6.patch - patch vs. Linux stable kernel 3.0.35 with support for CM-FX6 peripherals     patches - ordered collection of patches, that form the single patch above (linux-3.0.35-cm-fx6-6.patch)     modules_3.0.35-cm-fx6-6.tar.gz - a modules tarball, that matches the ready to run Linux kernel (uImage-3.0.35-cm-fx6-6.bin)      My question is, what is the difference between uImage-cm-fx6 and uImage-3.0.35-cm-fx6-6.bin? Why is Compulab giving me 2 of them? And why does uImage-3.0.35-cm-fx6-6 has a .bin extension? The instructions at http://www.compulab.co.il/workspace/mediawiki/index.php5/CM- FX6:_Linux:_Getting_started say to use uImage-cm-fx6, but I'm wondering if the uImage-3.0.35-cm-fx6-6.bin is "patched" with the latest drivers. To add to the confusion, this page gives me instructions to build the linux kernel. http://www.compulab.co.il/workspace/mediawiki/index.php5/CM- FX6:_Linux:_Kernel Do I need to do this or has this been done for me? (if I use the default drivers) Thanks.


title: `ls` fails for directory copied from Win and OSX

text: I'm not able to `ls` on a folder that I have just transferred from win7 to OSX via a FAT32 drive. I don't know how to search for an answer for this issue. I've attempted the following:               sudo chmod u=rwx myfolder/     sudo chmod a+rx myfolder/      ...to no avail. I have found that `sudo ls` seems to work. Why would this be?


title: TAB autocomplete on sudo sh

text: When I say `sudo sh`, `TAB` stops working as autocomplete signal on my Debian. How can I enable `TAB` key autocomplete after I say `sudo sh` ?


title: Let grub re-scan disks?

text: I placed a entry like this in grub4dos,               rootnoverify (hd1)     chainloader +1     boot      But sometimes when I plug in my USB key too late, grub will not detect this usb key, is there anyway to let grub re-scan disk list? I need to know for both grub0.9X and grub1.9X


title: How does copy-on-write in fork() handle multiple fork?

text: According to wikipedia (which could be wrong) > When a fork() system call is issued, a copy of all the pages corresponding > to the parent process is created, loaded into a separate memory location by > the OS for the child process. But this is not needed in certain cases. > Consider the case when a child executes an "exec" system call (which is used > to execute any executable file from within a C program) or exits very soon > after the fork(). When the child is needed just to execute a command for the > parent process, there is no need for copying the parent process' pages, > since exec replaces the address space of the process which invoked it with > the command to be executed. > > In such cases, a technique called copy-on-write (COW) is used. With this > technique, when a fork occurs, the parent process's pages are not copied for > the child process. Instead, the pages are shared between the child and the > parent process. Whenever a process (parent or child) modifies a page, a > separate copy of that particular page alone is made for that process (parent > or child) which performed the modification. This process will then use the > newly copied page rather than the shared one in all future references. The > other process (the one which did not modify the shared page) continues to > use the original copy of the page (which is now no longer shared). This > technique is called copy-on-write since the page is copied when some process > writes to it. It seems that when either of the processes tries to write to the page. A new copy of the page gets allocated and assigned to the process that generated the page fault. The original page gets marked writable afterwards. My question is: what happens if the fork gets called multiple times before any of the processes made an attempt to write to a shared page? Thanks a lot


title: Chroot Risks w/ /dev and /proc

text: I am planning to set up a few chroot jails for some users to run/test Java applications (lets just assume each application is untrusted). Is there any risk involved with mounting /dev and /proc into each jail? If there is, what steps can be taken to get rid of this risk?


title: Machine data not displaying every 15 Seconds

text: The following script is meant to output "vmstat" for example every 15 seconds, but for some reason it only does this if there's activity or when I kill the script, in other cases it just sits there.               #!/bin/bash     #!/bin/sh               ps -ef | grep -v grep | grep "vmstat 15" | awk '{ print $2 }' | xargs kill          ps -ef | grep -v grep | grep "iostat 15" | awk '{ print $2 }' | xargs kill          ps -ef | grep -v grep | grep "mpstat 15" | awk '{ print $2 }' | xargs kill          today=`date +%Y-%m-%d.%H:%M:%S`          find /var/log/ -name data_collection -type d -exec mv /var/log/data_collection /home/Beer/"data_collection_${today}" \;          mkdir -p /var/log/data_collection          vmstat 15 | /home/Beer/./addtimestamp.pl > /var/log/data_collection/vm_stat &     iostat 15 | /home/Beer/./addtimestamp.pl > /var/log/data_collection/ios_stat &     mpstat 15 | /home/Beer/./addtimestamp.pl > /var/log/data_collection/mp_stat &      Im guessing the '&' symbol at the end has something to do with this, I only did this so I can execute each command at once.


title: Don't have write permission in partition

text: In my PC I have installs Windows7 and then Ubuntu as OSes. When I try to access other partitions ( E: and F: which I'm using from Winsows7 OS) it get mount without any issue and can read and modify the files. Only thing I can't do is create or rename file on that partitions. How can I fix this issue?


title: ls everything that is _not_ a symlink

text: Does `ls` have a way to show negated conditions like "all files which are **not** a symlink"? I use the latter a lot in a project directory but other negations would be useful as well. For now, my research has only lead to creating an alias to something "like":               find . -maxdepth 1 ! -type l | sort # (...)      but obviously this way I don't get the colouring of `ls`, the column formatting, etc... I am on Bash v3 on OS X 10.8.2 and Bash v4 on Pangolin sometimes.


title: Revo 3610 not doing hdmi handshake

text: I am having a problem with my Revo 3610 witch is connected to my tv via HDMI. For some reason will it not do the HDMI handshake with the tv, so my tv does not think that there are anything in the HDMI port. I have tested the tv and it works fine, with my laptop and DVD. It does work sometimes, but this time it failed for 2 days in a row, and I have tried rebooting, turning the tv off and on, and so on... nothing helps. I can trick the TV to listen to the HDMI with connecting with my laptop and then change the HDMI back to my revo, but this results in a big fat "Check signal cable" on the screen. I have also tried changing the resolution in the revo but that doesn't not help either. Have any one had this problem before, and if so how did you fix it? ![Example](http://i.stack.imgur.com/gguZ4.jpg)


title: How can I find all matches of a string in a directory?

text: Using grep (or some other utility), is it possible to find all matches of a regular expression in a folder (searching the text of each file?) I want to find every match of the regular expression `zenity` within a specific folder, so that I can find the file that contains the string `zenity`.


title: Mapping character keys

text: I really don't understand bash's use of control characters. I understand simple things like adding colors with escape sequences but am at a loss for how to do things like bind keys in `.inputrc`. For example, is there a way to type things like `Shift``a` and see how I should represent it in `.inputrc`? Much like the fellow does here: http://linuxart.com/log/archives/2005/10/13/super-useful-inputrc


title: VoIP dialer for SIP

text: I have some Java, so am biased in that direction, but not overly so. None of the Java suggestions: http://stackoverflow.com/questions/16471795/sip-client-for-java http://stackoverflow.com/questions/498043/what-is-the-currently-popular-java- sip-library jump out as fantastic solution. What's "the" best FOSS dialer? By "best" I mean simplest to deploy. The requirement is preview dialing: > Preview dialing enables agents to first view the available information about > the customer and decide when to place the call. In addition to the > information about the customer, agents may also view all the history of the > customer with the contact center. After viewing the information about the > customer, the agent requests the system to make the call. http://en.wikipedia.org/wiki/Dialer#Preview Currently, hard phones connect with SIP to a hosted Asterisk PBX. The goal is to replace the hard phones with soft phones, such as zoiper, **and** speed up the dialing process. ViciBox looks very interesting, but would, apparently, create a bottleneck with the hosted PBX and is overkill. If I could deploy just the dialer and interface, but use the hosted Asterisk PBX, that would be good. However, it would probably be a bit complex to install. I'm looking for a quick and dirty solution. Down the road, it will probably be ViciBox, but the easiest and quickest to install and configure would best. Of all the FOSS dialers, which can be installed stand-alone easiest, and has a strong community? I suppose it's technically possible to checkout the code for ViciDial, but that's more involved than I would like. Optimally, I would like a FOSS dialer, with a queue, which pops a record from the database, sends it to an agent, the agent dials, edits the file, and updates the record. That's exactly what ViciBox does, except, in this case, Asterisk isn't required.


title: Wrong root shell in /etc/passwd

text: I wanted to change the standard shell for my root user to bash but I got the path wrong. i typed /bin/bash instead of /opt/bin/bash. Now my /etc/passwd looks like this:               root:x:0:0:root:/root:/bin/bash      The problem is that I can no longer login via ssh. Additionally I can't su to root from an other user because of:               >su root     su: must be suid to work properly       Any suggestions?


title: Dark blue color in vim or ls output in linux

text: I have a problem with dark-blue color in `vim` or `ls` output. Because I'm using black background color, words colored in dark-blue are almost completely invisible. How can I address this problem?


title: Meaning of the extra apt-get options in early APT history

text: Following is the first few entries in `/var/log/apt/history.log` from a fresh installation of Debian 7.0:               Start-Date: 2013-05-09  20:02:18     Commandline: apt-get -o APT::Status-Fd=4 -o APT::Keep-Fds::=5 -o APT::Keep-Fds::=6 -q -y --no-remove install locales     Install: locales:amd64 (2.13-38)     End-Date: 2013-05-09  20:02:19          Start-Date: 2013-05-09  22:03:06     Commandline: apt-get -o APT::Status-Fd=4 -o APT::Keep-Fds::=5 -o APT::Keep-Fds::=6 -q -y --no-remove install busybox     Install: busybox:amd64 (1.20.0-7)     End-Date: 2013-05-09  22:03:07          Start-Date: 2013-05-09  22:03:07     Commandline: apt-get -o APT::Status-Fd=4 -o APT::Keep-Fds::=5 -o APT::Keep-Fds::=6 -q -y --no-remove install initramfs-tools     Install: libklibc:amd64 (2.0.1-3.1, automatic), klibc-utils:amd64 (2.0.1-3.1, automatic), initramfs-tools:amd64 (0.109.1)     End-Date: 2013-05-09  22:03:08      What is the meaning of these options:               -o APT::Status-Fd=4 -o APT::Keep-Fds::=5 -o APT::Keep-Fds::=6      I cannot find them in the `apt-get` manpage.


title: What could DUP mean when using ping?

text: What could DUP mean when using ping?


title: Removing all tags from images

text: > **Possible Duplicate:**   >  Batch delete exif info How can I remove all tags from images under a directory (using Linux)? I can find all files with something like `find pictures -type f -iname "*jpg" -exec FOO "{}" \;` but what should `FOO` be?


title: How would I start this public LFS build project?

text: I had an idea. I want a box with some simple Linux distro on there. I want the box to be completely open to anyone. The idea is, I want to see if a community of online users can build LFS on the box cooperatively. I want to see how far it can go. It might end up being a 'count to 10 on 4chan' situation or it may end up being a 'build the Enterprise in Minecraft' situation. Either way I'd like to see. My question is, what are the first steps I would need to take to get this project off the ground? This would be a learning experience for me too.


title: How do I change which version of Qt is used for qmake?

text: I feel like there should be a simple way of doing this, but my googlefu is failing so I'd really appreciate some info on how to switch (or even permanently change) which version of Qt is used when doing qmake. If I ask which version I get the following:               ~ $ qmake --version     QMake version 3.0     Using Qt version 5.0.1 in /usr/lib/x86_64-linux-gnu      I've install QtCreator, but I'm not sure where to go from here.


title: ls for cut -f string not working

text: I have a problem with feeding `cut` output to `ls`.   This doesn't work:               rep="S1_1000,0000-00-00c,0000-00-00d,0000-00-00e"       ls tab_yeast/{`echo $rep | cut -f2- -d','`}*.tab.gz       ls: cannot access tab_yeast/{0000-00-00c,0000-00-00d,0000-00-00e}*.tab.gz: No such file or directory      while ls over that string works:               ls tab_yeast/{0000-00-00c,0000-00-00d,0000-00-00e}*.tab.gz        Any idea?


title: sandbox tcpdump under OpenBSD?

text: From FreeBSD 9.0 tcpdump is sandboxed with Capsicum. Are there any solutions for sandboxing tcpdump under OpenBSD? Just want to secure a running:               tcpdump -w output.pcap      because it can be only used with root :(


title: Installing gcc without root?

text: I'm running OSX, and I don't have root, or an existing compiler. Is there any way I can install gcc?   1. Are there official or trusted unofficial mach-o binaries that can be downloaded for a certain version of OS X?   2. If so, can said binaries be installed to `~/bin` and work properly?


title: Escaping quotes for scp

text: I needed to write a that behaves correctly with nasty (spaces, braces, etc..) filenames.               scp -rv "$1" shiny:/Volumes/Seagate3To/\"$1\"      This function works, but I don't understand why the quotes need escaping in the second argument of `scp`.


title: How do I change Xfce 4 "theme" tab colors?

text: I recently switched over to Xfce and really enjoy it. However, when I went in to my settings to change the appearance, the theme that I liked best was "Xfce-dusk" with one exception: The default colors for application tabs are so dark that it's hard to tell where they are. I hunted around for a little while looking anywhere I could to see where the styles for the tabs are set in the theme configuration file and couldn't find anything that looked like it would do what I need. The file I've found to define the theme was:               /usr/share/themes/Xfce-dusl/gtk-2.0/gtkrc      But looking through that file, I can't find anything that seems to apply. Any suggestions? Normally I'm a command-line only sort of guy and don't really know much about WMs or theming, and don't even know the terms of what I'm trying to modify, so my Google searches are coming up painfully empty. Here is a screenshot of the type of tabs I want to modify![a screenshot of the type of tabs I want to modify](http://i.stack.imgur.com/PjxGk.png).


title: Why does Red Hat Linux use such an old kernel?

text: Why does RHEL (and its derivatives) use such an old kernel? It uses 2.6.32-xxx, which seems old to me. How do they support newer hardware with that kernel? As far as I know these kind of distributions do run on fairly modern hardware.


title: FHS differences between OS X, Linux and FreeBSD

text: I've read that there is a different behavior between FreeBSD and Linux with the `/usr/local`, in FBSD ports are installed there, in Linux not, can someone explain more on this? I'd like to know where MacPorts are installed in OSX, and a list of the most significant differences between the FHS of those three OS (this is mainly what I'm looking for). I've already made a research but I didn't find really much. https://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man7/hier.7.html http://www.freebsd.org/doc/handbook/dirstructure.html http://www.tldp.org/LDP/Linux-Filesystem-Hierarchy/html/index.html


title: How to find binary executables within a directory

text: How do I list all binary executable files recursively within a directory? I use `find` command like this:               find /mydir/mysubdir -executable -type f      All executable files are listed (excluding directory), and including executable script file (like script.sh, etc). What I want to do is list only binary executable files.


title: Is Mac OS X UNIX?

text: I have this argument recently saying Mac OS X was not UNIX, but Unix-like. I know there is a Single Unix Specification and those spec complaint could use the UNIX trade mark. Is Mac OS X an UNIX operating system or is it an Unix-like?