title: recovery data from RAID and disk failure (Linux)

text: ### Some background A friend of mine was using in his office a NAS Buffalo-LS-WVL with two disks of 1TB each. It seems that the two disks were mounted as raid 1, but, as you will read, probably they have been not. The NAS gave some problems of extremely slowness and then suddenly didn't work anymore. I've been called in to rescue his data. Both disk have exactly the same partitioning: one physical and 6 logical, and in the 6th data lives in (aprox 80GB out of 0,95TB). Disk `/dev/sdd` seems to give hardware problems (slowliness, sector reading error, etc.), whereas /dev/sde is a well-physically functioning disk. The goal is to extract data that were contained in the NAS. If not all data, the most to be extracted, the better. These data are vital for the company of this friend of mine. ### What I have tried already   1. 1st attempt: Mounting disks alone This is the very first try, hoping it works, I've tried to get each disk and mount it alone, and I got this message:              root@ubuntu:~# mount /dev/sdd6 /mnt/n          -or-          root@ubuntu:~# mount /dev/sde6 /mnt/n      both gave me the same message:              mount: unknown filesystem type 'linux_raid_member'        2. 2nd attempt: Creating disk array RAID 1 and try to mount them OK, if I cannot mount them alone, then I need to create an array of disks. Let's suppose (the most logical) the original configuration was raid 1, and use one disk at a time:              root@ubuntu:~# mdadm --create --run --level=1 --raid-devices=2 \                       /dev/md/md-singolo-e6--create-missing /dev/sde6 missing      gives:              mdadm: /dev/sde6 appears to be part of a raid array:         level=raid0         devices=2         ctime=Mon Sep 26 10:23:48 2011         mdadm: Note: this array has metadata at the start and may not be suitable as a boot device.  If you plan to store '/boot' on this device please ensure that    your boot-loader understands md/v1.x metadata, or use    --metadata=0.90         mdadm: Defaulting to version 1.2 metadata         mdadm: array /dev/md/md-singolo-e6--create-missing started.      So, it seems that the original raid was in 0 mode and not 1 mode. Bad new, as a disk is giving sector problems. Anyway, I gave a try to mount the newly created RAID1 array (even if I know it's no-sense):              root@ubuntu:~# mkdir /mnt/md-singolo-e6--create-missing         root@ubuntu:~# mount /dev/md/md-singolo-e6--create-missing \                      /mnt/md-singolo-a6--create-missing/      gave:              mount: /dev/md127: can't read superblock      Exactly the same result has been given for the other disk.   3. 3rd attempt: Creating disk array **RAID 0** and try to mount them OK, as it has been stated that it was Raid0, let's go for it:              root@ubuntu:~# mdadm --create --run --level=0 --raid-devices=2 \                        /dev/md/md001hw /dev/sdd6 /dev/sde6       gives:              mdadm: /dev/sdd6 appears to be part of a raid array:     level=raid1     devices=2     ctime=Mon Oct 14 16:38:33 2013     mdadm: /dev/sde6 appears to be part of a raid array:     level=raid1     devices=2     ctime=Mon Oct 14 17:01:01 2013     mdadm: Defaulting to version 1.2 metadata     mdadm: array /dev/md/md001hw started.      OK, once created I try to mount it:              root@ubuntu:~# mount /dev/md/md001hw /mnt/n          mount: you must specify the filesystem type      At this point all ext2,3,4 specified with `-t` gave error.   4. 4th attempt: Creating disk images and work with them OK, as a disk has problem it is much better to work on a copy (dd) of the data partition, padded with 0 (sync) in case of block read error (error). I therefore created the two images: This one for the good disk (block of 4MB, to be faster):              root@ubuntu:~# dd bs=4M if=/dev/sde6 of=/media/pietro/4TBexthdd/sde6-bs4M-noerror-sync.img conv=noerror,sync      and this one for the disk with problems (minimum block size, to be safer)              root@ubuntu:~# dd if=/dev/sde6 of=/media/pietro/4TBexthdd/sdd6-noerror-sync.img conv=noerror,sync      Once I got the two images I've tried to use them as RAID 0, with the command specified above. Nothing to do, the answer that came is that the images "is not a block device" and it does not create the array.   5. 5th attempt: going byte-a-byte to rescue some data OK, if a proper mounting is not working, let's go to extract data trough byte- a-byte reading and header and footer info. I used ***foremost** *to do this job, both on each single disk: for disk 1:              root@ubuntu:~# foremost -i /dev/sde6 -o /media/pietro/4TBexthdd/foremost_da_sde6/      it creates sub-folders with file extensions, but no population at all in them. Whereas for disk 2 (the damaged one):              root@ubuntu:~# foremost -i /dev/sdd6 -o /media/pietro/4TBexthdd/foremost_da_sdd6_disco2/      neither the sub-folder structure is created by foremost. Same result when I tried foremost on RAID 0 array:              root@ubuntu:~# foremost -i /dev/md/md001hw -o /media/pietro/4TBexthdd/foremost_da_raid_hw/      Neither sub-folder structure has been created. ### Where I need some help / My Questions   * First and foremost question: **how to rescue data?** Does anyone has any hint I've not tried?   * Could anyone of you suggest anything different of what I've done? Other questions:   * I'm new to `mdadm`, did I do everything correctly?    * Was effectively the original array created on Sept 26th, 2011 in Raid 0 mode?    * Why I cannot use the partition images to create an array? ### Appendix This is the output of `dmesg` in case of reading from the failing disk (`/dev/sdd`):               [  958.802966] sd 8:0:0:0: [sdd] Unhandled sense code     [  958.802976] sd 8:0:0:0: [sdd]       [  958.802980] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE     [  958.802984] sd 8:0:0:0: [sdd]       [  958.802987] Sense Key : Medium Error [current]      [  958.802994] sd 8:0:0:0: [sdd]       [  958.802999] Add. Sense: Unrecovered read error     [  958.803003] sd 8:0:0:0: [sdd] CDB:      [  958.803006] Read(10): 28 00 00 d5 c7 e0 00 00 f0 00     [  958.803021] end_request: critical target error, dev sdd, sector 14010336     [  958.803028] quiet_error: 36 callbacks suppressed     [  958.803032] Buffer I/O error on device sdd, logical block 1751292     [  958.803043] Buffer I/O error on device sdd, logical block 1751293     [  958.803048] Buffer I/O error on device sdd, logical block 1751294     [  958.803052] Buffer I/O error on device sdd, logical block 1751295     [  958.803057] Buffer I/O error on device sdd, logical block 1751296     [  958.803061] Buffer I/O error on device sdd, logical block 1751297     [  958.803065] Buffer I/O error on device sdd, logical block 1751298     [  958.803069] Buffer I/O error on device sdd, logical block 1751299     [  958.803074] Buffer I/O error on device sdd, logical block 1751300     [  958.803078] Buffer I/O error on device sdd, logical block 1751301     [  961.621228] sd 8:0:0:0: [sdd] Unhandled sense code     [  961.621236] sd 8:0:0:0: [sdd]       [  961.621238] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE     [  961.621241] sd 8:0:0:0: [sdd]       [  961.621243] Sense Key : Medium Error [current]      [  961.621248] sd 8:0:0:0: [sdd]       [  961.621251] Add. Sense: Unrecovered read error     [  961.621254] sd 8:0:0:0: [sdd] CDB:      [  961.621255] Read(10): 28 00 00 d5 c8 d0 00 00 10 00     [  961.621266] end_request: critical target error, dev sdd, sector 14010576     [  964.791077] sd 8:0:0:0: [sdd] Unhandled sense code     [  964.791084] sd 8:0:0:0: [sdd]       [  964.791087] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE     [  964.791090] sd 8:0:0:0: [sdd]       [  964.791092] Sense Key : Medium Error [current]      [  964.791096] sd 8:0:0:0: [sdd]       [  964.791099] Add. Sense: Unrecovered read error     [  964.791102] sd 8:0:0:0: [sdd] CDB:      [  964.791104] Read(10): 28 00 00 d5 c8 00 00 00 08 00     [  964.791114] end_request: critical target error, dev sdd, sector 14010368     [  964.791119] quiet_error: 22 callbacks suppressed     [  964.791122] Buffer I/O error on device sdd, logical block 1751296


title: Preserve modified time stamp after edit

text: For files within a specific folder, I would like vim to never touch "modified" timestamp at all. The background is that I use Bloxsom for blogging, which uses plain text files in `~/bloxsom` as source of all articles. The article date (and therefore order of appearence) is based on modification date of the text file. I don't want article pop up like if it's _new_ whenever I just fix a typo. (I do _lots_ of them... :D) So far, vim changes timestamp and the original stamp is lost forever. This is OK and I want to keep it that way for most of files on the system. But I don't want that for the blog files - I can always `touch` the file if I need. Any ideas on how to tweak vim into this behavior?


title: Force Bash 4 'globstar' option to ignore symlinks

text: Bash 4 has a fantastic option called 'globstar' that emulates (i.e. was stolen from) zsh's `**` syntax for globbing across multiple directories. However, it's somewhat crippled (for my usage, at least) by the fact that it always follows symlinks. Is there a way to prevent `**` from following symlinks? If not, is there any plan to add this feature to Bash in a future release? Until then (or if there is no such plan), can anyone suggest a decent (and convenient) workaround? I think I've read that zsh's implementation is more flexible and doesn't have this problem, but unfortunately I can't just switch to zsh because we source a lot of bash scripts at my workplace, and I don't have the time or the know-how to convert all of them to zsh and keep them up-to-date. (I suppose it might be possible to start a Bash subshell, source the desired script, then somehow backport all the changed env vars, aliases, functions, etc into zsh, but I'm not sure how to do that, either.) I know that I could write a function using `find` that would behave the way I want and then alias `**` to this function, but then I couldn't do something like `path/to/parent/**/child/paths` and have it work correctly; the closest I could come would be something like `$(** path/to/parent child/paths)`, where `**` is aliased to a function that takes the parent path as a first argument and then includes `--wholename */child/paths/*` as an argument to the `find` command that it constructs and executes. This is awkward and ugly, and I'd really like something better. (In particular, I like that the `path/**/path` format easily allows the variations `path/**` and `**/path` easily and intuitively, whereas a function would turn this into `** path/` and `** '.' /path`, respectively, the second of which is just terrible.) Any thoughts?


title: Locate and delete all temporary files in user directory

text: I use vim a lot, and my area has power failure a lot. So the resultant is I get many `*.swp` files scattered over my PC. I want an alias of `rm` command that removes all files with either `.swp`, `~`, `.netrwhist`, `.log` or `.bak` extensions system wide _(or atleast in my home directory)_. The command should delete the files system wide/home directory even when I am on `~/Desktop`. How can I implement so?


title: Detecting kernel thread on pre-3.0 kernels

text: Looking at the proc man page (http://man7.org/linux/man- pages/man5/proc.5.html) it is possible to detect which processes are kernel threads in `/proc/<pid>/stat` by looking at the `flags` value (`PF_KTHREAD`)               flags %u (%lu before Linux 2.6.22)          (9) The kernel flags word of the process.  For bit          meanings, see the PF_* defines in the Linux kernel          source file include/linux/sched.h.  Details depend          on the kernel version.      This process flag (`PF_KTHREAD`) doesn't seem to exist in kernel version 2.6.18 (used in RHEL5), the value is used by a different flag. Is there another method to determine if a pid is a kernel thread?


title: is there a web app for returning results to a search on an indexed database?

text: I would very much like to allow users in a small office environment harness the power of `slocate` indexed database on the file server. Currently when users are looking for a file in our fileserver, they need to run `find` from their Windows workstations on the network shares that are available from the server. **This loads up the server while other are working.** Alternatively, I could set the indexers in every workstation to index the server locations. This is not ideal either, as the server would again be loaded a task that must be **run multiple times a day on the same set of data**! Ideally, the file server will carry out its own indexing and my users (who are oblivious to Linux and its command-line) will be able to log on to a simple website on the file server and run a search in much the same way I run `locate` commands in the command line. Is there something available?


title: How to convert XY to [http://xy.com XY]?

text: Just for editing Wiki's.. So i have this input [from a larget text]:               TEXT TEXT BLA-BLA RANDOMSTRINGS BLA-BLA     TEXT TEXT BLA-BLA RANDOMSTRINGS BLA-BLA     TEXT TEXT XY RANDOMSTRINGS BLA-BLA     TEXT TEXT BLA-BLA RANDOMSTRINGS BLA-BLA     TEXT TEXT BLA-BLA RANDOMSTRINGS BLA-BLA      and i want this output:               TEXT TEXT BLA-BLA RANDOMSTRINGS BLA-BLA     TEXT TEXT BLA-BLA RANDOMSTRINGS BLA-BLA     TEXT TEXT [http://xy.com XY] RANDOMSTRINGS BLA-BLA     TEXT TEXT BLA-BLA RANDOMSTRINGS BLA-BLA     TEXT TEXT BLA-BLA RANDOMSTRINGS BLA-BLA      "http://xy.com" could be e.g.: "https://xy.com" or "http://www.xy.com" or "https://www.xy.com", etc.


title: How do I go about making a wrapper for a driver to be used on FreeBSD?

text: **The situation:** I found myself in need of an additional NIC for my pfSense router/firewall. I had a few choices...   1. shell out over $100 for a dual port gigabit card   2. buy a new motherboard that has dual ports on it   3. buy a 2U server case so I can make use of the remaining PCI slots on the existing motherboard (and thus also buy more single port NICs)  or   4. use a USB NIC.  The cheapest of the 4 was to go USB, so I bought one. However, as I read through what I was getting into, I read a bit too fast. The drivers that are available are for: Mac, Windows, and Linux. Not bad... But, FreeBSD and hence pfSense, won't use any of those drivers. So, I find myself in a position to either scrap the NIC for later use, come up with some kind of a wrapper for one of the existing drivers, or worst case would be writing a whole new driver. If I bench the NIC, I'm stuck with purchasing more expensive hardware, and unless someone convinces me otherwise... writing a completely new driver is a bit more of a challenge than I think I'm up to. That leaves making a wrapper as my best option. **The Question:** Does anyone have any helpful advice on where to start with making a wrapper for drivers to be used in FreeBSD? Are there already turn key solutions for doing this that I just haven't found? The USB NIC uses the Asix Chipset AX88179. Thank you in advance for any help.


title: How to install/remove/upgrade .rpm packages on Red Hat?

text: I am new to linux, and at the university we are using this distribution to mount servers on VM, but I need to install a package that is missing in my virtual machine that is running Red Hat, but how to do that, what command should I use to install/remove/upgrade .rpm packages.


title: Fuzzy screen on startup

text: I recently started getting a fuzzy screen on start up when booting into Fedora. The best way to describe it is to say the screen looks like it has a H-Scroll problem - fuzzy horizontal lines. The mouse pointer is stable however. My current work around is to log out and back in, then I get a nice stable login screen (difficult to do since you are clicking on menu items you cannot see properly). I´m looking for a permanent fix. ![Fuzzy login screen - Fedora](http://i.stack.imgur.com/lIk0q.jpg) Fuzzy login screen - Fedora ![Clear mouse on fuzzy screen - Fedora](http://i.stack.imgur.com/Wlcc2.jpg) Clear mouse on fuzzy screen - Fedora


title: How to resize intel vga card memory?

text: I have a notebook with two VGA cards: Intel and AMD (Radeon), I've disabled the second, and now I want to control my card memory, here is the `lspci -v` VGA output:               00:02.0 VGA compatible controller: Intel Corporation 3rd Gen Core processor Graphics Controller (rev 09) (prog-if 00 [VGA controller])         Subsystem: Dell Device 0598         Flags: bus master, fast devsel, latency 0, IRQ 44         Memory at c1000000 (64-bit, non-prefetchable) [size=4M]         Memory at b0000000 (64-bit, prefetchable) [size=256M]         I/O ports at 4000 [size=64]         Expansion ROM at <unassigned> [disabled]         Capabilities: <access denied>         Kernel driver in use: i915      I use chakra Linux.


title: Is there any alternative to echo daemon to display ip?

text: Is there any alternative to echo daemon to display ip instead of given string? For ex: my ip = 80.1.2.3 server ip = 1.2.3.4               root@my-machine bash$ telnet 1.2.3.4     Trying 1.2.3.4...     Connected to 1.2.3.4.     Escape character is '^]'.     80.1.2.3


title: Logrotate not truncating open file

text: I have a system that is acting simultaneously as a test and demo platform. I'm recording a massive amount of data output by my systems that I wouldn't be recording when this is in deployment and because of that my log files are filling up very rapidly and I eventually run out of partition space on my harddrive. I tried `logrotate`, but it seems to only work if my program isn't running. When the programs are down it properly truncates the file, records a compressed version, and discards the rest. However, when my programs that populate the log file are up and running it will properly create the compressed file, but it won't truncate the active file. I'm trying to figure out how to make it truncate. I'm writing to the log files with a simple redirect. `ProgramA>logA`, `programB>logB` etc. My progam is outputting every time I receive an input vector, so it's outputting very rapidly. My assumption is that the logrotate is failing to truncate because of the constant writes to the field, but can anyone confirm rather that is the reason? Where does logrotate keep it's error file anyways? Also: I want to modify the behavior of logrotate. If it activates and sees a large, say 100 MB, log file I would like it to create a copy of _only_ the last 1 MB of the file (discarding the older 99 MB of content of the file) before truncating the original log file. I need to keep recent data, but I don't care much about anything that is very old. Can anyone tell me how to do this?


title: How do I add custom GPG key to Ubuntu/Debian installer?

text: I'm trying to setup custom Ubuntu install CD using instructions on http://beezari.livejournal.com/191717.html I've added my GPG key to ubuntu- keyring and signed Release file with it (resulting in Release.gpg signature file) But during installation I get               gpgv: Can't check signature public key not found      It looks like to install new ubuntu-keyring with my key I need to have it already installed (in debian-installer maybe?). I can get around with `debian- installer/allow_unauthenticated=false` but it seems to be quite bad practice. **Update** This installer CD is supposed to be used for unattended installation using PXE


I'm trying to build some drivers for a TV tuner and I am getting this error when I build:               make -s -C /lib/modules/3.2.0-23-generic/build SUBDIRS=/home/jtp/IT9135_SRC modules     In file included from /home/jtp/IT9135_SRC/it9135-core.c:21:0:     /home/jtp/IT9135_SRC/it9135.h:11:28: fatal error: linux/smp_lock.h: No such file or directory     compilation terminated.     make[2]: *** [/home/jtp/IT9135_SRC/it9135-core.o] Error 1     make[1]: *** [_module_/home/jtp/IT9135_SRC] Error 2     make: *** [default] Error 2      What am I missing?


title: How can I use bash's if test and find commands together?

text: I have a directory with crash logs, and I'd like to use a conditional statement in a bash script based on a find command. The log files are stored in this format:               /var/log/crashes/app-2012-08-28.log     /var/log/crashes/otherapp-2012-08-28.log      I want the if statement to only return true if there is a crash log for a specific app which has been modified in the last 5 minutes. The `find` command that I would use is:               find /var/log/crashes -name app-\*\.log -mmin -5      I'm not sure how to incorporate that into an `if` statement properly. I think this might work:               if [ test `find /var/log/crashes -name app-\*\.log -mmin -5` ] then      service myapp restart     fi      There are a few areas where I'm unclear:   * I've looked at the if flags but I'm not sure which one, if any, that I should use.   * Do I need the `test` directive or should I just process against the results of the find command directly, or maybe use `find... | wc -l` to get a line count instead?   * Not 100% necessary to answer this question, but `test` is for testing against return codes that commands return? And they are sort of invisible - outside of `stdout` / `stderr`? I read the `man` page but I'm still pretty unclear about when to use `test` and how to debug it.


title: How can a Linux machine run an exe on a remote Windows server?

text: I need to run an executable on a remote Windows machine from a Linux server. I am using following command but hangs in between:               ssh @server_ip 'exe_name'      After running the `exe` I need to run command on the `exe` command prompt.


title: using sed to replace pattern with hash values

text: I want to search the file and replace specific pattern with its hash (SHA1) values. For example, let ` file.txt` has the following content: `one S56G one two three   four five V67X six ` and I want to replace the pattern `[A-Z][0-9]\{2\}[A-Z]` with SHA1 value of the match. In the example above, the matches are `S56G` and `V67X`. Using `sed`, I tried: `sed "s/[A-Z][0-9]\{2\}[A-Z]/$(echo \& | sha1sum)/g"` without success, as the result is always the hash value of `'&'`. I also tried `ge` flag, with the command: `sed 's/[A-Z][0-9]\{2\}[A-Z]/echo & | sha1sum/ge'` which throws errors: ` sh: 1: one: not found   sha1sum: one: No such file or directory   sha1sum: two: No such file or directory   sha1sum: three: No such file or directory `


title: How to replace a left parenthesis with sed?

text: I have to replace `(` with some character in my file, and I can't do it. `\(` is used for grouping in sed and when I used `\\(` with sed, it treated it as `\(` character not as just `(`. It seems like a tricky case to me.


title: Join problem: throwing error, join extra operand

text: I want to join 3 files on a column which has sorted unique numeric values (those files have only one column of values though) and starts with same prefix for an example "usi". Now, while I am doing this               join -j 1 ../Test_Data/usi* > ../Test_Data/join_output.txt      I am finding following error: > >     join: extra operand `usi_rtree_lw_100000.txt' >     Try `join --help' for more information. >   Any ideas?


title: How do the internals of the cron daemon work?

text: I want to know how `cron` works internally. Does the process keep checking the current time in an infinite while loop (thus continually consuming CPU cycles)? Or does some function generate an interrupt and notifies the `cron` daemon ?


title: Cannot get rsync to keep source file ownership, tried many tricks

text: I'm trying to rsync some directories from a webserver running RHEL5 to a system running Xubuntu. I have rsync, ssh, and keys setup for the machines. I've tried everything so that when i backup from the source, the destination maintains the user and group names,etc. Source: > >     drwx--x--x  8 root     root     4096 Feb  8 03:29 ./ >     drwxr-xr-x 29 root     root     4096 Feb  6 14:46 ../ >     drwxr-xr-x  5 root     root     4096 Dec 19 14:58 .cpan/ >     drwxr-xr-x  3 root     root     4096 Feb  8 03:29 .cpanm/ >     drwx------  6 root     root     4096 Feb  7 03:29 .cpcpan/ >     drwx------  4 root     root     4096 Aug 16  2010 cpeasyapache/ >     drwx--x--x 35 foreve24 foreve24 4096 Feb  6 11:33 foreve24/ >     drwx------  2 root     root     4096 Mar  8  2011 MySQL-install/ >   Destination: > >     drwx--x--x 8 root    root    4096 Feb  8 03:29 . >     drwxr-xr-x 7 sbackup sbackup 4096 Feb  8 12:25 .. >     drwxr-xr-x 5 root    root    4096 Feb  8 12:25 .cpan >     drwxr-xr-x 3 root    root    4096 Feb  8 12:25 .cpanm >     drwx------ 6 root    root    4096 Feb  8 12:25 .cpcpan >     drwx------ 4 root    root    4096 Feb  8 12:25 cpeasyapache >     drwx------ 2 root    root    4096 Feb  8 12:25 foreve24 >     drwx------ 2 root    root    4096 Mar  8  2011 MySQL-install >   As you can see everything is kept as root. Here's my insane rsync command i'm using:               sudo /usr/bin/rsync --rsync-path="sudo /usr/bin/rsync" -azvrpogRHAX --fake-super --numeric-ids --rsh='ssh -l root -p 14308' --files-from=/home/foreve24/backup_files/movelist / rsync://root@xxx.xxx.xxx.xxx:/sitebackup/      I started with:               rsync -azvrR --rsh='sudo ssh -p 14308' --files-from=/home/foreve24/backup_files/movelist / rsync://sbackup@xxx.xxx.xxx.xxx/sitebackup      This has about every suggestion i've seen but I still can't get 'foreve24' as user and group for example. The xubuntu server is using rsyncd i believe; is there configuration or do i have to disable to that in order to properly copy permissions? Is /etc/passwd containing the same users the only way? if so, how do i properly deal with already assigned and conflicting UID and GID in the passwd files? I have a file/script method to re-replicate the permissions but my understanding is I can get rsync to preserve them somehow in this instance. Any help would be greatly appreciated!


title: How to add a carriage return before every newline?

text: I have a file that only uses `\n` for new lines, but I need it to have `\r\n` for each new line. How can I do this? For example, I solved it in Vim using `:%s/\n/\r\n/g`, but I would like to use a script or command-line application. Any suggestions? I tried looking this up with `sed` or `grep`, but I got immediately confused by the escape sequence workarounds (I am a bit green with these commands). If interested, the application is related to my question/answer here


title: Need minimal linux distro, with install size less atmost 250 - 300 mb

text: I need a distro of Linux which occupies 250-300 MB of hard drive space. It should be able to run C programs (NOT COMPILE!! just execute)... and must be compatible with grub2 (NEED TO USE 'GRUB-REBOOT'). NOTE: I have tried DSL (Damn Small Linux), but its not compitable with grub2.


title: Delete files based on year

text: I need to delete all files in a directory that were created in 2009. What command can I use to do that?


title: vmware player usb device on slackware 14.0

text: I just installed Slackware 14.0. I installed vmware player using this command:               sh VMware-$NAME-$VERSION.bundle --console --ignore-errors      Which I found from this website: > http://www.linuxquestions.org/questions/slackware-14/installation-of-vmware- > player-4-on-slackware-13-37-32-bit-909539/ That allowed me to install a guest version of Windows XP (microcontroller programming). But I'm unable to connect a usb device to the guest xp vm. The usb device is acting like a serial device. Any thoughts?


title: Beaglebone: Backup image mounts root as Read-only

text: After I had completed creating applications for my BB white (running ubuntu), I created a backup of the SD card using->               sudo dd if=/dev/disk2 of=/Volumes/BONE/bone_custom.img      Recently, I tried to burn this image onto a new SD card, using->               sudo dd if=/Volumes/BONE/bone_custom.img of=/dev/disk2 bs=1m      Now, I see that the rootfs is mounted RO. I have made no change to uboot or fstab. Why is this? I tried to remount (and force remount), but I get `"mount: cannot remount block device /dev/mmc*** read-write, is write-protected"`. How can I solve this?


title: what does 1d0 mean in diff output?

text: Say you have two files **file1**               a     b     c     d      **file 2**               b     c     d     e      The first line of               diff file1 file2      would be               1d0      I've read up on this and found that it means delete the lines in the first file at position 1, which would have appeared at line 0 in the second file. I understand the explanation of the number to the left but the second part is doing my head in. What does it mean line 0 (does that even exist)?


title: Upgrade to latest version of firefox in RHEL 5.6

text: I have **RHEL 5.6** ( _32 bit OS_ ) in my system. I have **firefox** ( _17.0.10_ ) installed in my system. I tried to upgrade the **firefox** to the latest version. First I did, `yum update firefox` and got no packages marked for update. So, I did the following commands.               wget Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm          rpm -Uvh epel-release-6-8.noarch.rpm      However, when I ran the above commands I got the failed dependencies error as below.               error: Failed dependencies:             redhat-release >= 6 is needed by epel-release-6-8.noarch             rpmlib(FileDigests) <= 4.6.0-1 is needed by epel-release-6-8.noarch             rpmlib(PayloadIsXz) <= 5.2-1 is needed by epel-release-6-8.noarch      When I run the below command, I get the latest version is already installed in my system.               yum --enablerepo=remi list firefox      The above command gives me only version **17.0.10**. I am trying to install the latest version in my RHEL system.


title: Booting a Knoppix ISO from Grub - device/uri madness

text: I'm trying to boot a Knoppix ISO from Grub like so:               loopback loop /boot/iso/knoppix.iso     linux (loop)/boot/isolinux/linux lang=en bootfrom=/mnt-iso//boot/iso/knoppix.iso     initrd (loop)/boot/isolinux/minirt.gz      My question is the `bootfrom` parameter. If I don't include the double slash the system will never boot. It will complain that it couldn't find the `KNOPPIX` folder on the drive (Because it's inside the ISO). It will search the drives in an attempt to locate this folder - by the end of which drives have appeared in `/dev/` from `sda1` to `sdz15`.   * If I include the double-slash in the `bootfrom` parameter it will search the drives a few times, then (presumably after mounting `/mnt-iso`) it will triumphantly state "Yay! I found it in `/dev/sdd5/boot/iso/knoppix.iso`"   Of course by this time `sda1` through `sdh15` have been generated in `/dev/` so this can't be a good thing.   * If I use `bootfrom=/dev/sdd5/boot/iso/knoppix.iso` it works straight away, but I can't guarantee it will be this device on all systems. Can I use UUID?   I read that in fedora 15 you could use `root=live:UUID={uuid}:{isofile}` but this doesn't seem to be the case any more   * Why does it behave differently if I have only one slash? This is very confusing. **Edit:** Progress! With the following menuentry I've managed to get knoppix to claim to open and check an ISO file, only to claim it can't find the KNOPPIX folder therein. > Cannot find KNOPPIX dir in iso image:               loopback loop /boot/iso/knoppix.iso     linux (loop)/boot/isolinux/linux lang=en bootfrom=UUID=<uuid>/boot/iso/knoppix.iso     initrd (loop)/boot/isolinux/minirt.gz      It's hard to tell what's going on because the TTY is small and the text doesn't wrap. **Edit:** Yet more progress. After going through half the the knoppix repo with a fine tooth `grep` I decided to see if the problem was in the kernel since obviously the rest of the system wasn't being loaded anyway. `strings linux | grep "Cannot find"` \- No results Well what about initrd.gz? (Note that I have no idea what's in here, I heard somewhere that it was an actual chunk of memory) Ooh there's another archive in there... Ooh there's a filesystem! What's in this big file named init?...                  if [ ! -r "$BOOTSYS/$knoppix_dir/KNOPPIX" ]; then         message  "${CRE}${RED}Cannot find $knoppix_dir dir in ISO image ${MAGENTA}${BOOTDEV}${YELLOW}/${BOOTFILE}${NORMAL} "      REALLY? Who on earth makes the error message use a clearly separate variable from the condition? All right, at least I know the exact line of the problem (591) but the only way I see out of this is an extremely hackish attempt to mess with this bash and hardcode it to let me through... Or to set my partition in question to sda. And of course I don't know how to do either yet. Yay! So. How do I go about editing `init`?


title: What is the benefit of compiling your own linux kernel?

text: What benefit could I see by compiling a Linux kernel myself? Is there some efficiency you could create by customizing it to your hardware?


title: Ensure /etc/export contains rule using bash

text: What's a working example of modifying /etc/export using bash? Example: I want to ensure the following rule is present and valid:               /export/home 2400:123::/32(rw,no_root_squash)      And it should:   1. Add only if it doesn't exist already (in any form)   2. If it partly exists, it shold update existing entry (e.g options update) Possible syntaxes in existing file:   * _Multiple whitespaces, and different options_ `/export/home 2400:123::/32(rw,no_root_squash,no_subtree_check)`   * _Multiple allow on same line_ `/export/home 2400:123::/32(rw,no_root_squash,no_subtree_check) 2400:321::/32(rw,no_root_squash,no_subtree_check)` In addition to combinations of the above. Initially I wanted to use augeas for this, but there's a bug with IPv6 adresses in the /etc/exports file. The /etc/exports file should allow independent modifying witout breaking the script (which should ensure only the rule in question is correct and valid, and leave the rest of the rules alone)


title: auto-delete fluxbox menu entries

text: I want to delete fluxbox menu commands that are in the form of -               [exec] (foobar) {/usr/lib/xscreensaver/foobar -root}      and there are 50+ commands to be deleted. But, how do I do it please? I need a command that I can put into my menu generation script, which will auto-delete them in the future.


title: Fixed mount point of external usb hdd

text: I'm doing a backup script and need to have a fixed mount point for an external usb drive. If it is the first usb connected it will mount in /media/usb0/, however if it is the second, third... it will mount in /media/LABEL_OF_THE_DISK/. The same apply for sdX. If it is the first will be sdc1 (I have two disks already), but if it is the second will be sdd, third sde.... The hdd is disconnected and only will be connected when is the backup time (once a week) I may look where is it mounted and pass a parameter to the script as "actual_mount_point", but I'd like to connect the hdd, run the script and backup done, without need be writing anything. So the question is: Is it possible to have a fixed mount point for an external drive?


title: Installing Arch Linux alongside Windows 8

text: I already have Ubuntu 12.04 and Windows 8 alongside. (Dual boot) Now I would like to install Arch Linux instead Ubuntu. I have seen many Video tutorials about installing Arch Linux but all was about installing in Virtual Machines.   * Do I need to remove Ubuntu before installing Arch ?   * Can I remove Ubuntu when I'm installing Arch in `fdisk` section ? It's my first trying to install Arch-Linux. I should be careful. Because I don't want to lose Windows 8. Any helps would be appreciated.


title: pf out interface?

text: I'm trying to figure out how to allow all hosts in $dmz to reach any host when egressing $extif. I can't seem to find the equivalence of netfilters "-o $extif", and I'd like to avoid specifically blocking everything and allow the rest. To illustrate, I'd like to:               pass in on $dmz from $dmz:network to any via $extif keep-state      Thus, not allowing $dmz:network -> $lan. pf version is that of FreeBSD 9.2, by the way.


title: Will mount search fstab for a best match?

text: I have several external harddrives that I want to mount to the same point: /media/ext_hd So I have this in my fstab:               # EXTERNAL HDS     LABEL=Elements          /media/ext_hd           ntfs-3g defaults,user,noauto 0 0     LABEL=olddata           /media/ext_hd           auto    rw,user,noauto 0 0     LABEL=Seagate%202T      /media/ext_hd           auto    rw,user,noauto 0 0     UUID=335F-0049          /media/ext_hd           auto    rw,user,noauto 0 0      I would like to just type "mount /media/ext_hd" and have mount find which label or UUID matches whatever is currently connected, and mount that. But, instead it balks that label "Elements" can't be found - the first entry. Mount doesn't appear to search for a best match. Am I missing something? That would seem like a useful feature.


title: Is there a way to find out which program is segfault-ing?

text: I have a Busybox/Linux system where a mystery program is segfaulting rarely. Is there a way to find which program is doing this?


title: I am failing to clone a git repo when behind a proxy

text: When I run `git clone git://git.gnome.org/tracker`, I get:               Cloning into tracker...     git.gnome.org[0: 209.132.180.173]: errno=Connection refused     fatal: unable to connect a socket (Connection refused)      This doesn't happen when I'm not behind a network proxy I'm currently at.


title: How do I choose a graphics card for Linux?

text: I'm building or buying a new Linux system, and I'm trying to select the best graphics card for my needs. How do I go about making this decision? There's dozens of computer-gear review sites which drool over every detail of new graphics hardware and perform detailed benchmarks and pros and cons — for Microsoft Windows. Are these ever useful sources of information for Linux too? Does any site at least give Linux a cursory look? I'm primarily interested in good 2D performance, but with fancy new desktop environments now requiring hardware-accelerated 3D, I need to consider that too. Where can I find pre-purchase information on that? I strongly prefer having an open source driver. How do I judge which open source drivers are the best in terms of features support and performance, without joining a dozen different mailing lists? Are specific companies almost always the best bet, or does it change? What are the advantages and drawbacks of a closed-source driver? Is this mostly about 3D performance, or are there other features enabled by proprietary drivers that I might miss out on? Since a closed-source driver will mark the Linux kernel as tainted, are the closed-source companies good at providing direct end-user support for related problems? Is the state-of-the- art finally such that I can choose between open or closed for any given graphics card, or do some models require one or the other? It'd be great if the card just worked hassle-free with whatever modern Linux distribution I choose, with no need to go through a long how-to process. Is this a reasonable hope, and how can I best find a card that'll work that way? How do I find if a specific graphics driver fits a given model on the market? Is it best to buy older cards in order to insure that support is available?


title: I am failing to use XChat when behind a proxy

text: So I set my HTTP proxy via **Settings** -> **Preferences** -> **Network setup** , and am getting this error:               Looking up irc.us.gimp.org     Looking up <IP>     Connecting to <IP> (<IP>) port <PORT>...     HTTP/1.1 502 Proxy Error ( The specified Secure Sockets Layer (SSL) port is not allowed. ISA Server is not configured to allow      Proxy traversal failed.     Stopped previous connection attempt (pid=4696)      (`<IP>` and `<PORT>` are substitutions) Without that setting (the IP:PORT is left empty), I'm getting this error:               Looking up irc.us.gimp.org     Connecting to irc.us.gimp.org (192.219.30.200) port 6667...     Connection failed. Error: Connection refused


title: Using newest kernel version on an older system

text: I always compile my own kernel, and therefore I am not reliant on the distribution kernel (in my case `Debian`). I have always wondered, whether there is an optimal combination of userspace and kernelspace versions. Let's say I am using `Debian stable` (Wheezy), which by default comes with an `3.2 kernel`. I have compiled my own custom `kernel 3.9`, because it has features which I want (X.509 module signing). Can this potentially have any drawbacks?


title: Fast way to copy a large file on a LAN

text: I am having some trouble with NFS, and I'd like to try using just plain old TCP. I have no idea where to begin, though. Hardware-wise, I am using an ethernet crossover cable to network two netbooks. To network them, I type               $ sudo ifconfig eth0 192.168.1.1 up && ping -c 10 -s 10 192.168.1.2 && sudo /etc/init.d/nfs-kernel-server start      on the first netbook and               $ sudo ifconfig eth0 192.168.1.2 up     $ ping -c 10 -s 10 192.168.1.1     $ mount /mnt/network1      on the second where `/mnt/network1` is specified in /etc/fstab as `192.168.1.1:/home /mnt/network1 nfs noauto,user,exec,soft,nfsvers=2 0 0` as well as in `/etc/exports` (using the syntax of that file), on the first netbook. The above works fine, but the files and directories are huge. The files average about half a gigabyte a piece, and the directories are all between 15 and 50 gigabytes. I'm using `rsync` to transfer them, and the command (on `192.168.1.2`) is               $ rsync -avxS /mnt/network1 ~/somedir      I'm not sure if there's a way to tweak my NFS settings to handle huge files better, but I'd like to see if running an `rsync` daemon over plain old TCP works better than `rsync` over NFS. So, to reiterate, how do I set up a similar network with TCP? **UPDATE:** So, after a good at few hours of attempting to pull myself out of the morass of my own ignorance (or, as I like to think of it, to pull myself up by my own bootstraps) I came up with some useful facts. But first of all, what led me on this rabbit trail instead of simply accepting the current best answer was this: `nc` is an unbelievably cool program that resolutely fails to work for me. I've tried the `netcat-openbsd` and `netcat- traditional` packages with no luck whatsoever. The error I get on the receiving machine (`192.168.1.2`) is:               me@netbook:~$ nc -q 1 -l -p 32934 | tar xv     Can't grab 0.0.0.0:32934 with bind     tar: This does not look like a tar archive     tar: Exiting with failure status due to previous errors      `route` gives:               me@netbook:~$ route     Kernel IP routing table     Destination     Gateway         Genmask         Flags Metric Ref    Use Iface     default         dir-615         0.0.0.0         UG    0      0        0 wlan0     link-local      *               255.255.0.0     U     1000   0        0 eth0     192.168.0.0     *               255.255.255.0   U     2      0        0 wlan0     192.168.1.0     *               255.255.255.0   U     0      0        0 eth0      But, here's the good news: having the static IP addresses set in `/etc/network/interfaces`, which I started doing while trying to get `nc` working, fixed all my NFS problems and rekindled my love for NFS. The exact configuration I used (with `192.168.1.1` for the first netbook, of course) was:               auto eth0     iface eth0 inet static     address 192.168.1.2     netmask 255.255.255.0      With those settings, the two netbooks will be able to ping each other directly after being booted up, without even an `ifup`. Anyway, I'd still really like to see `nc` in action, so I'm hoping someone help me debug this process.


title: How does wc -l `ls` give the actual number of lines?

text: Can anyone explain to me how does this command work.               wc -l `ls`      while this command gives the total number of java lines or txt lines.


title: Tunnel AFP over SSH over Internet

text: I can't seem to figure out how to connect to AFP over SSH. Here is my setup:               [Raspberry Pi] <---> [router] <---> (Internet) <---> [Client] I'd like to be able to connect to my home's WAN IP address on port 5123 to access the AFP server running on my Raspberry Pi over SSH. I've already:   1. Installed AFP and SSH servers on my Raspberry Pi   2. Configured SSH on my Pi to work over port 5123   3. Forwarded port 5123 of my router's WAN to my Raspberry Pi And yes, I've tried googling for instructions but I couldn't get it to work.


title: Unix: find directory filenames listed in a text file and move to new directory

text: I'm a command line novice trying to figure out the appropriate command to execute the following within the Terminal in Mac OS X. Assuming I've placed all files in the same directory, I want to isolate and move a selected set of directory files listed in a text file to a new directory, how do I:   * read the selected list of filenames listed in a .txt file   * find all matches by filename   * isolate and move all file matches to a new directory I've found this command to find (either or both) a filestring.filetype in a current directory and move all matches to a new directory:               find . -type f -iname "filestring.filetype" -print0 |       xargs -0 -J % mv % ~/NewDirectory/      And I've found this `tar` command however it creates an archive copy of each filename listed in `filename.txt`               tar -cf - -T filename.txt | (cd /path/to/new/dir && tar -xvf -)      Any help is much appreciated! The following solution was provided by a trusted source:               cat "filename.txt" | xargs -I % mv % ~/NewDirectory/


title: Linux Permissions vsftpd

text: I have mybb installed and running in `/var/www/forums`. I have two users part of the `www` group, `logan` and `www-data`. I have the recursive permissions of forums directory set to:               chmod -R 755 forums     chown -R www-data:www forums I have `vsftpd` set to `write-enable=YES`. I can't upload a file! I get this on my filezilla:                   Status:  Starting upload of C:\Users\l162student\Desktop\money.png         Command:    PASV         Response:   227 Entering Passive Mode (174,102,254,169,249,243).         Command:    STOR money.png         Response:   553 Could not create file.         Error:  Critical file transfer error If you need any log files or `conf` files just ask. **UPDATE:** I just tried `775` and it lets me write files, BUT... The files are all:               Owner Group  33 1005  -rwxrwxr-x and the new files I upload are showing up as only:               Owner Group  1000 1005  -rw-r--r-- I want new files to INHERIT the folders permissions OR just show up as:               Owner Group  33 1005  -rwxrwxr-x How can I do this?


title: yum: RPM dependency tree

text: I'm going to install an RPM package and I can see that some of dependencies requires X server libraries to be installed as well. I'm absolutely sure that the package I need is a server software and does not need X server. I wonder if there is a way to print a list of RPM dependencies like it's done in Gentoo Linux?    ![enter image description here](http://i.stack.imgur.com/tB4c2.png) This command prints first level dependencies only, so it does not help me:               $ yum deplist <package name>


title: A Reboot() command with failover

text: I'm implementing a Reboot() call in my application. It's an embedded application, so no console, keyboard or power switch. The Reboot() must eventually restart the system no matter what. Ideally, I want it to fail gracefully. I've had systems in the past cause problems where a call to `reboot` or `shutdown` did not result in a reboot of the machine. e.g. failure to sync drives, unmount a removed USB flash drive. My system is embedded, with a read-only mounted root filing system, so a sudden power off isn't a big issue. But I do write logs to a Flash disc and I'd like to preserve this as much as possible. My current Reboot() looks like this:               void Reboot()     {         system( "reboot" );     // try the reboot         sleep(2);         system( "reboot -f" );      // force         sleep(2);         system( "reboot -f -n" );   // force and don't try to sync         sleep(2);         system( "kill 1" );     // process 1 is the root process of all         sleep(2);         Reset();     }      The reset command is a hard system reset that will not fail. The system also has a Watchdog timer. Would people care to comment on anything to add/replace/change in my Reboot() function? e.g. should I use Magic SysRq?


title: In what situation would a tarball (.tgz) be almost the same size as the original

text: I just tarballed a dump of some websites (configs, image directory, css directory, and site content (html files etc)) using `tar czf sitedump.tgz backup_folder/`. The original "backup_folder" was about 600MB and so was the tarball, only a little smaller. What scenario presents a challenge for these compression formats, and what is likely the cause of the minimal reduction in size in this case? Tar version 1.23


title: Understanding backtick (`)

text: I am trying out the command               $ b=5; echo `$b`;     -bash: 5: command not found      but it does not print 5 as it is supposed to. What am I missing here? What does ` (backquote/backtick) mean in bash? seems to say that ``` evaluates the commands within and replaces them with the output.


title: Set window manager's meta key depending on connected Xserver

text: # Situation A linux server is running an xdm supporting XDMCP, it is connected to from various different Linux and OS X boxes using XDMCP via an `X -query <server>` command. Once the user is logged in the window manager is started, which is mostly controlled from the keyboard using an assigned meta key. # Problem The assigned meta key needs to depend on the platform of the box that connects to the linux server. How do I figure out what the platform is behind the connected X server? # Thoughts I cannot use the DISPLAY environment variable to switch on, the IPs of the connecting boxes are assigned by DHCP and give no clue what the platform of the box is. I know the -class option to X can be used to set the display class, which then could be used to set defaults for the various display classes in Xresources. However I don't know how to get the class of the connected Xserver from the command line (or a little custom C program) and furthermore, I don't know how to get the value of an Xresource that would be configured with that class. Ideally the used meta key could be configured on the box running the X server, so that the linux server running the xdm does not need any reconfiguration when a new type of platform is introduced in the setup. What is the best way to go about this? Is it possible to determine the platform the X server is running on? Can some configuration option be passed from the Xserver to the window manager scripts? Is there a better way to resolve this?


title: Can I configure specified PEAP in network-manager

text: Here's the wpa_supplicant.conf file:               ap_scan=1     network={         ssid="<SSID Name>"         proto=WPA2         key_mgmt=WPA-EAP         pairwise=CCMP         group=CCMP         eap=PEAP         phase1="peaplabel=0"         phase2="auth=GTC"         identity="<User name>"         password="<Password>"     }      I can use wpa_supplicant to connect the wireless, but unfortunately, when I configured these settings in Network Manager, it failed to connect to the network. I wonder what's wrong with that.


title: Copy a file from a remote server to windows home using scp

text: Is there a way to copy a file from a server to a local folder (i.e. My Documents)? can it be done by `scp`? I have this script that generate some list. I want this script to automatically copy the generated file to my windows home directory. I tried this but it just rename the file as the folder it has to be transferred at. `scp name@some_server:/home/user/file.txt 'somehere\home\home_dir'`


title: Is this a correct way to back up one big drive to two smaller ones?

text: I have a pre-fail drive, and while I'm waiting for replacement I am trying to do full back up to two smaller drives. Given that drive is 3TG and ones I have are 1.5 and 2TB, is this a correct way to do the backup?               dd if=/dev/sda of=/mnt/sda-1G-1270 bs=1G count=1270      then plug in 2nd drive, mount it, and do:               dd if=/dev/sda of=/mnt/sda-1G-rest bs=1G skip=1270      and to recover:               dd if=/mnt/sda-1G-1270 of=/dev/sda bs=1G count=1270     dd if=/mnt/sda-1G-rest of=/dev/sda bs=1G seek=1270      will that work?..


title: How to print whole array in tcsh

text: I want to print the whole array in tcsh, because then i want to pipe it to uniq, is there a way to do it in tcsh. i had `set array` and was printing it:               echo "$array"      but it ended up with error: Word too long, it works for smaller arrrays, Is there some simple way to do it?


title: What are some preferred methods to efficiently edit files on a remote Unix server?

text: I'm looking for a more efficient GUI-based solution to edit root-owned and root-only writable files than using either `nano` or `vim`, both of which of course limit your cursor to navigate one character at a time with very limited cut/copy/paste capabilities. Some of the methods I've heard of so far have been `rsync`ing files to my local machine and back again, as well as `sshfs`. The tricky part is being able to get to root files without initial logging in as the root user, because root login is, of course, disabled, meaning that I couldn't just SFTP into the machine and make edits over a client.


title: Editor for markdown tables

text: Is there any tool for linux which makes it easier to generate and edit tables for markdown?


title: Find information about popup in ubuntu12.04 (unity)

text: i'd like to ask, since it is not first time it happens to me: _Is there a way to check last popup message (from what program/and its contents), after it has been closed promptly by spacebar BEFORE it rendered its inside text/contents?_ I'm often running virtualbox in background, typing something else in {insert editor of Your choice}, thus my machine gets laggy. Im ok with that (knowing it's possible to limit cpu usage per virtualbox), since i know i will be typing for quite some time. But sometimes when a popup ...er,popups,and i'm in the middle of sentence, i press spacebar before it gets to display it contents. I'm pretty sure it is not possible to view "what was it", but maybe i'm wrong. I've checked ~/.xsession-errors, and /var/log/X* but results were as expected. Ubuntu 12.04 with Unity. Does this happen only to me, or perhaps anyone have a solution?


title: GetMail with multiple accounts

text: How can I check multiple accounts with getmail. I have 50 accounts on the same external server. Can I use other solution than separate config file for each account ?


title: How do I use a font in .ttc format as the console font?

text: I rather dislike the available `tty` fonts and would rather use Menlo, which is what I use in OS X's Terminal. Menlo is in a `.ttc` format, but (from the contents of `/usr/share/consolefonts`) Linux seems to require `.psf.gz` fonts, with different files for each combination of style and size. How do I convert it to the proper format and set it to be used as the font in `tty`s? (I have a PowerBook G4 running Ubuntu Server 12.04 and an Intel MacBook Pro running OS X Mountain Lion.)


title: PuTTY X11 forwarding can't forward Google Chrome

text: I'm using PuTTY with Windows to connect a remote Linux (Mint desktop) server. It's correct to forward Firefox, Banshee and other applications, however, when I want to use Google Chrome, it shows a message: > Created new window in existing browser session And nothing happened. So, what could cause such a problem?


title: How to work with libtool?

text: I try to install MapServer and have a problem with last command in tutorial:               libtool: install: /usr/bin/install -c .libs/mapserv /usr/local/bin/mapserv      Terminal says that cannot find command `libtool`/ I went and installed libtool. But still command not work. I try:               libtool install: /usr/bin/install -c .libs/mapserv /usr/local/bin/mapserv      And get an error:               libtool: you must specify a MODE      What am I doing wrong? OS:Mint. PS: First time see a Linux system.


title: SSH key-based authentication: known_hosts vs authorized_keys

text: I read about setting up ssh keys in Linux and have some questions. Correct me if I'm wrong… Let's say host tr-lgto wants to connect to host tr-mdm using ssh. If we want to be sure that it's the real tr-mdm, we generate a pair of keys on tr-mdm and we add the public key to `known_hosts` on tr-lgto. If tr-mdm wants to check that it's the real tr-lgto, then tr-lgto has to generate a keypair and add the public key to `authorized_keys` on tr-mdm. **Question 1** : There is no _user_ field in file known_hosts, just IP addresses and hostnames. tr-mdm might have a lot of users, each with their own `.ssh` folder. Should we add the public key to each of the `known_hosts` files? **Question 2** : I found that `ssh-keyscan -t rsa tr-mdm` will return the public key of tr-mdm. How do I know what user this key belongs to? Moreover, the public key in `/root/.ssh/` is different from what that command returns. How can this be?


title: Ubuntu kernel source code package

text: Can somebody explain me the difference between the following files:               drwxr-xr-x  28 root root      4096 Apr 22 12:04 linux-lts-raring-3.8.0     -rw-r--r--   1 root root  15209788 Mar 14 03:38 linux-lts-raring_3.8.0-38.56~precise1.diff.gz     -rw-r--r--   1 root root      6333 Mar 14 03:38 linux-lts-raring_3.8.0-38.56~precise1.dsc     -rw-r--r--   1 root root 107018407 May  8  2013 linux-lts-raring_3.8.0.orig.tar.gz      I want to write a simple driver and so would give the path of one of these in my driver Makefile. **OS Info**               #lsb_release -a     No LSB modules are available.     Distributor ID: Ubuntu     Description:    Ubuntu 12.04.4 LTS     Release:    12.04     Codename:   precise      Also:               3.8.0-38-generic #56~precise1-Ubuntu SMP Thu Mar 13 16:23:47 UTC 2014 i686 i686 i386 GNU/Linux


title: Difference between tar and star

text: I've been learning about the syntax and usage of `tar` and came across `star`. I've read this paragraph from the `star` manpage: > Star includes the first free implementation of POSIX.1-2001 extended tar > headers. The POSIX.1-2001 extended tar headers define a new standard way for > going beyond the limitations of the historic tar format. They allow (among > others) to archive all UNIX time stamps in sub-second resolution, files of > arbitrary size and filenames without length limitation using UNICODE UTF-8 > coding for best exchange compatibility. and **I'm wondering if this still remains true at the present time** , or whether `tar` has caught up in this aspect. Most of the documentation that I've found is at least a decade old. I've also looked at the `tar` changelog over the last 10 years and can't find anything that states that it follows the above "extended tar headers".


title: bash: Accessing function call stack in trap function

text: Working on a bash function call stack trace... Script traps errors and runs a `callStack()` function. But on trapping, It always shows a call stack for the `callStack()` function itself instead of the function where the trap occurred as in ...               /share/sbin/zimdialog: line 647: status: command not found         Function call stack ( command.function() ) ...           /share/sbin/zimdialog.main()             /share/sbin/include.callStack()      Looking to get a stack trace that includes the `errantFunction()` like...               /share/sbin/zimdialog: line 647: status: command not found         Function call stack ( command.function() ) ...           /share/sbin/zimdialog.main()             /share/sbin/zimdialog.errantFunction()               /share/sbin/include.callStack()      The trap is coded as...               trap callStack HUP INT QUIT TERM ERR      The `callStack()` function is coded as...               function callStack () {       { isNotNull "$1" && isHelp "$1"; } && {         helpShow 'callStack         Diagnostics regarding where the call to this function came from'         return       }       local T="${T}  "       local STACK=       i=${#FUNCNAME[@]}       ((--i))       printf "${T}Function call stack ( command.function() ) ...\n" >&2       T="${T}  "       while (( $i >= 0 ))       do         STACK+="${T}${BASH_SOURCE[$i]}.${FUNCNAME[$i]}()\n"         T="${T}  "         ((--i))       done       printf "$STACK" >&2     }      * * * **Supplemental: set -E, etc. not working** In `/share/sbin/gshlib` ...               set -e     set -E     set -T     shopt -s extdebug          trap $(callStack) ERR          function initialize () {         :       logstatus                         #<<< ERROR FOR TESTING trap     }     export -f initialize      Misnaming `logStatus` to `logstatus` within `/share/sbin/gshlib.initialize()` to spring the `trap ERR`, the best I get is...                   Function call stack ...         | /share/sbin/archive.main()         |   /share/sbin/include.include()         |     /share/sbin/gshlib.source()         |       /share/sbin/include.callStack()     /share/sbin/gshlib: line 109: logstatus: command not found      What I'm looking to get is...                   Function call stack ...         | /share/sbin/archive.main()         |   /share/sbin/include.include()         |     /share/sbin/gshlib.source()         |       /share/sbin/gshlib.initialize()         |         /share/sbin/include.callStack()     /share/sbin/gshlib: line 109: logstatus: command not found


title: Arch linux wifi works manually, how to make it automatic?

text: Running Arch Linux with kernel 3.6.11-12-ARCH+ on my Raspberry Pi. I have a Linksys wifi usb dongle (WUSB54GC v3) that is running and working after I execute the following commands:               $> sudo ifconfig wlan0 up     $> sudo iwlist scan     $> sudo iwconfig wlan0 mode managed essid myssid key "mykey" retry 7        # Only had to do this next one the first time     $> sudo wpa_passphrase myssid "mypassword" > /etc/wpa_supplicant/wpa_supplicant.conf      $> sudo wpa_supplicant -B -Dwext -iwlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf     $> sudo dhcpcd wlan0      How do I get wifi on this device to work everytime after booting? Eventually I want to deploy it in location without a wired connection (hence the wifi), but I obviously can't do that if I have to manually start/connect the wifi everytime.


title: Setting up Proxy Settings on Debian

text: During installation of Debian I was asked for a Standard Proxy String in the form of `http://user:password@host:port/`, which I entered. apt-get ran and retrieved files during update, and now Debian is installed. However, when I tried running `sudo apt-get install ...`, I get an error message containing the message `Could not resolve proxy_host` where `proxy_host` is the host I entered during installation. Are there other places where I have to set up the proxy information?


title: Arithmetic operations on a particular column of a CSV file in Bash

text: I am having a file whose contents are as follows:               A,10,20,30,40,50     B,20,40,10,30,60     C,30,50,20,40,10     D,40,50,20,10,30      I wish to perform some arithmetic operation (say Division by 10) on a particular column (say Column 3) of above CSV file. So that, it reads :               A,10,2,30,40,50     B,20,4,10,30,60     C,30,5,20,40,10     D,40,5,20,10,30      How can this be done?


title: How do I run a shell command from .tmux.conf

text: How do I run a shell command from `.tmux.conf`, or otherwise automatically when tmux launches, without having to hit any other command? How can I create an alias, a function, or a script which boils down to, for example tmuxirc -> tmux + irssi


title: rename files maching specific mtime value within directory

text: I use simple set of shell commands to in order to create mysqldumps daily. The script is called by cron daemon. It looks like:               presentdate="`date +%d-%m-%Y_%H:%M.%S`"     basedir="/var/db_my_backup"     mysqldump -u username -ppassword --all-databases |       gzip -9 -c > $basedir/mysqlbackup.$presentdate.sql.gz |        find -L $basedir/'*' -type f -mtime +7 exec rm -f {} \; |       chown -R user:group $basedir | (         cat <<EOF     Copy of MySQL successfully placed in $basedir directory as file named mysqlbackup.$presentdate.sql.gz.      Now it is ready to be moved to QNAP backup device as scheduled.     EOF         cat       ) | /bin/mail -s "Report from scheduled job for mysqldumps" root      My concern is: how can I possibly make it more elegant? Would it be possible to build a function for selecting and renaming files that are older than 7 days? I don't like using find as it produces strange warnings like for example:               find: paths must precede expression     Usage: find [-H] [-L] [-P] [path...] [expression]      that are hard to deal with (at least for me) in such a script.


title: How to send all output to a pager by default?

text: `git` has a very nice feature for many of its commands: The output on an interactive terminal is passed to a pager by default, in such a way that it only keeps the pager open if there's more than one screenful of output, and it leaves the output on the terminal instead of clearing it when you exit. Is there some way to configure this to be the default for Bash in GNOME Terminal? That is, to **send all TTY output (ideally including standard error) of every command to a pager.** The idea is that sometimes commands unexpectedly produce tons of output (especially in case of syntax or other errors), and some of that might even be lost because of the history settings of the terminal. It would be better to get half a chance to know what actually happened by seeing the output in a pager.


title: netcat in shell script giving invalid connection

text: I have a shell script that uses `netcat` to listen to `localhost` on port 1111 for web requests. Every time I try accessing `localhost:1111/index.html` for example I get:               invalid connection to [127.0.0.1] from localhost [127.0.0.1] 60038      the number at the end (60038) seems to be increasing every time I access `localhost`. Any suggestions on what's going wrong? And what is the `default localhost` directory? Where should I put an `index.html` so that `localhost:1111/index.html` would work? EDIT here is the full script:               #!/bin/sh     while true     do     netcat -vvl localhost -p 1111 -c '         set -x         read http_request         echo HTTP/1.0 200 OK         echo         echo "Received HTTP request: $http_request"     '        done


title: Acroread Firefox plugin Ubuntu 12.04 issues

text: Since I upgraded to Ubuntu 12.04, every time I try to open a PDF through Firefox (which I like to do quite often as I read a lot of PDF documents and downloading each then deleting is tiresome) I get the error message: > Could not launch Adobe Reader 9.5.1. Please make sure it exists in PATH > variable in the environment. If the problem persists, please reinstall the > application. If I launch Firefox from the terminal the message it gives when attempting to open a PDF is:               (firefox:5989): Gtk-CRITICAL **: IA__gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed          (firefox:5989): Gdk-CRITICAL **: IA__gdk_window_set_back_pixmap: assertion `GDK_IS_WINDOW (window)' failed     /usr/bin/acroread: 23: exec: /opt/Adobe/Reader9/Reader/intellinux/bin/acroread: Permission denied      How can I fix this? * * * I should mention loading a PDF from say the Desktop is fine. I only get error when loading a PDF via the browser. ADDITIONAL INFO:               ldd /opt/Adobe/Reader9/Reader/intellinux/bin/acroread | grep not           libBIB.so => not found     libBIBUtils.so => not found     libACE.so => not found     libAGM.so => not found     libCoolType.so => not found     libAXE8SharedExpat.so => not found     libJP2K.so => not found     libAdobeXMP.so => not found     libicuuc.so.36 => not found     libResAccess.so => not found


title: Setxkbmap turns off NumLock LED - but not NumLock.

text: Whenever I use setxkbmap in a terminal (or my .bashrc), the next time I press any modifier keys (ctrl, shift, alt) the NumLock LED on my keyboard goes off, but NumLock itself is still active so it's in some kind of inconsistent state. If I now press NumLock, the LED stays off but NumLock turns off, and a second press on NumLock turns both the numpad and the LED on again. Curiously, while the LED is in this inconsistent state, pressing caps lock turns both the NumLock and CapsLock LEDs on. The command that I have in my .bashrc causing this is `setxkbmap -option compose:ralt` but it also happens if I issue a plain `setxkbmap` with no parameters, or do anything else with that command. Why is this happening (and am I doing something wrong)? Dump of `Xorg -version` in case it helps (I'm running Xubuntu/XFCE):               X.Org X Server 1.7.6     Release Date: 2010-03-17     X Protocol Version 11, Revision 0     Build Operating System: Linux 2.6.24-30-server x86_64 Ubuntu     Current Operating System: Linux xxxxx 2.6.32-41-generic #94-Ubuntu SMP Fri Jul 6 18:00:34 UTC 2012 x86_64     Kernel command line: BOOT_IMAGE=/boot/vmlinuz-2.6.32-41-generic root=UUID=xxxxx ro quiet splash     Build Date: 25 February 2012  06:57:33AM     xorg-server 2:1.7.6-2ubuntu7.11 (For technical support please see http://www.ubuntu.com/support)      Current version of pixman: 0.16.4


title: What's the most appropriate way of parsing values from this output?

text: I have some netstat output I'm scripting and want to parse. What's the most efficient way of parsing values from the output below? It's important to point out that I'm using the old `/bin/sh` shell and not `bash` I'm generating this output from the command: `netstat -d -K O30S1O1`               MVS TCP/IP NETSTAT CS V1R11       TCPIP Name: NCDTCP          10:12:39     DevName: OSAQO130          DevType: MPCIPA       DevStatus: Ready         CfgRouter: Non  ActRouter: Non       LnkName: O30S1O1           LnkType: IPAQENET    LnkStatus: Ready         Speed: 0000001000         IpBroadcastCapability: No         ArpOffload: Yes                ArpOffloadInfo: Yes         ActMtu: 8992         VLANid: None                   VLANpriority: Disabled         ReadStorage: GLOBAL (4096K)    InbPerf: Balanced         ChecksumOffload: Yes           SegmentationOffload: Yes         SecClass: 255                  MonSysplex: No       Routing Parameters:         MTU Size: 1500              Metric: 10         DestAddr: 0.0.0.0           SubnetMask: 255.255.255.192       Multicast Specific:         Multicast Capability: Yes         Group             RefCnt      SrcFltMd         -----             ------      --------         224.0.0.5         0000000001  Exclude           SrcAddr: None         224.0.0.1         0000000001  Exclude           SrcAddr: None       Link Statistics:         BytesIn                           = 13545386         Inbound Packets                   = 129630         Inbound Packets In Error          = 0         Inbound Packets Discarded         = 0         Inbound Packets With No Protocol  = 0         BytesOut                          = 81424019         Outbound Packets                  = 520188         Outbound Packets In Error         = 0         Outbound Packets Discarded        = 0               IPv4 LAN Group Summary     LanGroup: 00006       Name              Status      ArpOwner          VipaOwner       ----              ------      --------          ---------       O30S1O1           Active      O30S1O1           Yes      For example, let's say I want to fetch several values such as `DevName`, `BytesIn` and `BytesOut`. I plan on running the netstat command every minute or so on four interfaces and writing the output to a csv file for importing to excel.


title: How to mount ext3,ext4 sitting on VDI VirtualBox HDD?

text: How to mount ext3, ext4 partition sitting on "Fixed-Size VDI" VirtualBox HardDisk ? To be more specific, I ma interested in case when VM is not running.


title: Out of Swap - What happens?

text: On my debian VM machine with 512MB RAM and 348MB Swap, what will happen if i open a 1GB file in an editor and get out of memory? Will it crash the system? Or if not, how will linux handle this? Wouldn't it be wise to install Swapspace so if needed there will be created enough swap automatically and dynamically?               sudo apt-get install swapspace


title: Why doesn't GCM HTTPS work with nginx?

text: Since these two are using GCM (Galois/Counter Mode):               www.ssllabs.com: ECDHE-RSA-AES256-GCM-SHA384     www.google.com: ECDHE-RSA-AES128-GCM-SHA256      We wanted to make our webserver's HTTPS connection more secure (Don't look at the self-signed certificate, that doesn't count right now...). We are using an OpenBSD 5.4 64bit OS, and the `openssl ciphers` command says that it supports the `ECDHE-RSA-AES256-GCM-SHA384` cipher. On client side there is Firefox 30 at least. So here is how we setup the HTTPS server:               # generate self signed certificate         openssl genrsa -aes256 -out /etc/ssl/private/server.key 4096         openssl req -new -key /etc/ssl/private/server.key -out /etc/ssl/private/server.csr         openssl x509 -sha512 -req -days 365 -in /etc/ssl/private/server.csr -signkey /etc/ssl/private/server.key -out /etc/ssl/server.crt      The config:               vi /etc/nginx/nginx.conf         ssl_protocols TLSv1.2;         ssl_ciphers ECDHE-RSA-AES256-GCM-SHA384;         ssl_prefer_server_ciphers   on;      But Firefox says (I translated it from my language..): > A connection to the www.foo.hu is interrupted and ssllabs says: > Assessment failed: Failed to communicate with the secure server   * How can we set GCM in nginx?   * Why couldn't a fresh Firefox connect via HTTPS to `www.foo.hu` (`ECDHE-RSA-AES256-GCM-SHA384`, TLSv1.2)? It can connect to `www.ssllabs.com` via HTTPS (`ECDHE-RSA-AES256-GCM-SHA384`, TLSv1.2), so maybe it's not a client side problem?               [user@localhost ~] openssl s_client -connect www.foo.hu:443     CONNECTED(00000003)     depth=0 C = HU, CN = www.foo.hu     verify error:num=18:self signed certificate     verify return:1     depth=0 C = HU, CN = www.foo.hu     verify return:1     ---     Certificate chain      0 s:/C=HU/CN=www.foo.hu        i:/C=HU/CN=www.foo.hu     ---     Server certificate     -----BEGIN CERTIFICATE-----     .... here goes the cert..     -----END CERTIFICATE-----     subject=/C=HU/CN=www.foo.hu     issuer=/C=HU/CN=www.foo.hu     ---     No client certificate CA names sent     ---     SSL handshake has read 2137 bytes and written 389 bytes     ---     New, TLSv1/SSLv3, Cipher is ECDHE-RSA-AES256-GCM-SHA384     Server public key is 4096 bit     Secure Renegotiation IS supported     Compression: NONE     Expansion: NONE     SSL-Session:         Protocol  : TLSv1.2         Cipher    : ECDHE-RSA-AES256-GCM-SHA384         Session-ID: ...bla-bla         Session-ID-ctx:          Master-Key: ...bla-bla         Key-Arg   : None         Krb5 Principal: None         PSK identity: None         PSK identity hint: None         TLS session ticket lifetime hint: 300 (seconds)         TLS session ticket:     ...bla-bla              Start Time: 1404296744         Timeout   : 300 (sec)         Verify return code: 18 (self signed certificate)     ---     read:errno=0     [user@localhost ~]


title: Passing all files of specific filetype in current and subdirectories

text: I have constructed an elaborate 500+ character command with many arguments and switches to autosign multiple PDF documents. I'm using JSignPDF and I'd like to use it's batch mode including the current directory and subdirectories. The relevant part of the command I'm having trouble with is:               java -jar ../jsignpdf-1.4.3/JSignPdf.jar *.pdf -a      ...which of course works great for all PDF files in the current directory. How can I make it so it picks up all .pdf files in all the subdirectories as well? I've tried a few things which haven't worked... novice and not even worth mentioning...things like -r (obviously would-/did-n't work). I'm wondering if this is a simple answer or in need of some awk magic, if that would even be valid. Any help is greatly appreciated.


title: bash -e exits when let or expr evaluates to 0

text: I have a bash script that sets -e so the script will exit on any exit status != 0. I'm trying to do some basic shell arithmetic assigned to variables and sometimes the expression equals 0 which causes the exit status of the let or expr command to be "1". Here's an example:               #!/bin/bash -ex     echo "Test 1"     Z=`expr 1 - 1` || true     echo "Z will print"     let "A=4 - 4"     echo "A WILL NEVER PRINT $A"     Y=`expr 1 - 1`     echo "Y WILL NEVER PRINT $Y"     X=$(expr 2 - 2)     echo "X WILL NEVER PRINT $X"      The output is:               $ ./test_error.sh      + echo 'Test 1'     Test 1     ++ expr 1 - 1     + Z=0     + true     + echo 'Z will print'     Z will print     + let 'A=4 - 4'      My question is what's the idiomatic bash scripting way to allow the script to fail on real exit errors and not on basic arithmetic equaling 0. I could suffix all those expressions with:               A=`expr $C - $D`    || true      But that seems hacky.


title: How to install Debian on a loopback device?

text: I'd like to install Debian on a loopback device (`/dev/loop0`). I can easily access the command prompt by booting off the DVD and asking for a shell, and I'm assuming it should also be easy to mount the loopback device on `/`. The part that I don't know is: how do I manually run the installer, after I have mounted `/`?


title: How can I get the address of my local machine?

text: I'm on a macbook running Lion. In `Terminal` I'm connected to my schools server with `ssh`. I navigated to a folder on the server and have a file I want to copy to my local machine, but I don't know what the IP address of my local machine is. How can I get it? I'm in the folder on the server, and I want to copy `read.txt` onto my local machine's hard drive. I've tried `scp ./read.txt [my computer name].local/newRead.txt` but it doesn't work.


title: How to identify a website's form parameter

text: In THC Hydra, when you type `Hydra -U` you get the following syntax (template): `<url>:<form parameters>:<condition string>` What I'm wondering is how to determine the form parameter. Is there a way to do it with just THC Hydra or do you need burp suite as well? OR, even better, is there a way to do it just by viewing the site's HTML form? and how would you do that? If this isnt clear enough, please let me know and ill try and make it clearer.


Can't use gcc on x64 debian:               $ gcc a.cpp     Assembler messages:     Fatal error: No compiled in support for x86_64      what should I do? Some people propose installing binutils, but they are already there. (Adding -m64 doesn't change anything). Where does this message come from? a.cpp is just an empty file. \--help=target gives               The following options are target specific:       -m128bit-long-double        sizeof(long double) is 16       -m32                        Generate 32bit i386 code       -m3dnow                     Support 3DNow! built-in functions       -m3dnowa                    Support Athlon 3Dnow! built-in functions       -m64                        Generate 64bit x86-64 code       -m80387                     Use hardware fp       -m8bit-idiv                 Expand 32bit/64bit integer divide into 8bit                                   unsigned integer divide with run-time check       -m96bit-long-double         sizeof(long double) is 12       -mabi=                      Generate code that conforms to the given ABI       -mabm                       Support code generation of Advanced Bit                                   Manipulation (ABM) instructions.       -maccumulate-outgoing-args  Reserve space for outgoing arguments in the                                   function prologue       -maes                       Support AES built-in functions and code generation       -malign-double              Align some doubles on dword boundary       -malign-functions=          Function starts are aligned to this power of 2       -malign-jumps=              Jump targets are aligned to this power of 2       -malign-loops=              Loop code aligned to this power of 2       -malign-stringops           Align destination of the string operations       -mandroid                   Generate code for the Android platform.       -march=                     Generate code for given CPU       -masm=                      Use given assembler dialect       -mavx                       Support MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1,                                   SSE4.2 and AVX built-in functions and code                                   generation       -mavx2                      Support MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1,                                   SSE4.2, AVX and AVX2 built-in functions and code                                   generation       -mavx256-split-unaligned-load Split 32-byte AVX unaligned load       -mavx256-split-unaligned-store Split 32-byte AVX unaligned store       -mbionic                    Use Bionic C library       -mbmi                       Support BMI built-in functions and code generation       -mbmi2                      Support BMI2 built-in functions and code                                   generation       -mbranch-cost=              Branches are this expensive (1-5, arbitrary units)       -mcld                       Generate cld instruction in the function prologue.       -mcmodel=                   Use given x86-64 code model       -mcpu=                      This switch lacks documentation       -mcrc32                     Support code generation of crc32 instruction.       -mcx16                      Support code generation of cmpxchg16b instruction.       -mdispatch-scheduler        Do dispatch scheduling if processor is bdver1 or                                   bdver2 and Haifa scheduling is selected.       -mf16c                      Support F16C built-in functions and code                                   generation       -mfancy-math-387            Generate sin, cos, sqrt for FPU       -mfentry                    Emit profiling counter call at function entry                                   before prologue.       -mfma                       Support MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1,                                   SSE4.2, AVX and FMA built-in functions and code                                   generation       -mfma4                      Support FMA4 built-in functions and code                                   generation        -mforce-drap                Always use Dynamic Realigned Argument Pointer                                   (DRAP) to realign stack       -mfp-ret-in-387             Return values of functions in FPU registers       -mfpmath=                   Generate floating point mathematics using given                                   instruction set       -mfsgsbase                  Support FSGSBASE built-in functions and code                                   generation       -mfused-madd                This switch lacks documentation       -mglibc                     Use GNU C library       -mhard-float                Use hardware fp       -mieee-fp                   Use IEEE math for fp comparisons       -mincoming-stack-boundary=  Assume incoming stack aligned to this power of 2       -minline-all-stringops      Inline all known string operations       -minline-stringops-dynamically Inline memset/memcpy string operations, but                                   perform inline version only for small blocks       -mintel-syntax              This switch lacks documentation       -mlarge-data-threshold=     Data greater than given threshold will go into                                   .ldata section in x86-64 medium model       -mlwp                       Support LWP built-in functions and code                                   generation        -mlzcnt                     Support LZCNT built-in function and code                                   generation       -mmmx                       Support MMX built-in functions       -mmovbe                     Support code generation of movbe instruction.       -mms-bitfields              Use native (MS) bitfield layout       -mno-align-stringops        This switch lacks documentation       -mno-fancy-math-387         This switch lacks documentation       -mno-push-args              This switch lacks documentation       -mno-red-zone               This switch lacks documentation       -mno-sse4                   Do not support SSE4.1 and SSE4.2 built-in                                   functions and code generation       -momit-leaf-frame-pointer   Omit the frame pointer in leaf functions       -mpc32                      Set 80387 floating-point precision to 32-bit       -mpc64                      Set 80387 floating-point precision to 64-bit       -mpc80                      Set 80387 floating-point precision to 80-bit       -mpclmul                    Support PCLMUL built-in functions and code                                   generation       -mpopcnt                    Support code generation of popcnt instruction.       -mprefer-avx128             Use 128-bit AVX instructions instead of 256-bit                                   AVX instructions in the auto-vectorizer.       -mpreferred-stack-boundary= Attempt to keep stack aligned to this power of 2       -mpush-args                 Use push instructions to save outgoing arguments       -mrdrnd                     Support RDRND built-in functions and code                                   generation       -mrecip                     Generate reciprocals instead of divss and sqrtss.       -mrecip=                    Control generation of reciprocal estimates.       -mred-zone                  Use red-zone in the x86-64 code       -mregparm=                  Number of registers used to pass integer arguments       -mrtd                       Alternate calling convention       -msahf                      Support code generation of sahf instruction in                                   64bit x86-64 code.       -msoft-float                Do not use hardware fp       -msse                       Support MMX and SSE built-in functions and code                                   generation       -msse2                      Support MMX, SSE and SSE2 built-in functions and                                   code generation       -msse2avx                   Encode SSE instructions with VEX prefix       -msse3                      Support MMX, SSE, SSE2 and SSE3 built-in                                   functions and code generation       -msse4                      Support MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1 and                                   SSE4.2 built-in functions and code generation       -msse4.1                    Support MMX, SSE, SSE2, SSE3, SSSE3 and SSE4.1                                   built-in functions and code generation       -msse4.2                    Support MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1 and                                   SSE4.2 built-in functions and code generation       -msse4a                     Support MMX, SSE, SSE2, SSE3 and SSE4A built-in                                   functions and code generation       -msse5                      This switch lacks documentation       -msseregparm                Use SSE register passing conventions for SF and                                   DF mode       -mssse3                     Support MMX, SSE, SSE2, SSE3 and SSSE3 built-in                                   functions and code generation       -mstack-arg-probe           Enable stack probing       -mstackrealign              Realign stack in prologue       -mstringop-strategy=        Chose strategy to generate stringop using       -mtbm                       Support TBM built-in functions and code generation       -mtls-dialect=              Use given thread-local storage dialect       -mtls-direct-seg-refs       Use direct references against %gs when accessing                                   tls data       -mtune=                     Schedule code for given CPU       -muclibc                    Use uClibc C library       -mveclibabi=                Vector library ABI to use       -mvect8-ret-in-mem          Return 8-byte vectors in memory       -mvzeroupper                Generate vzeroupper instruction before a transfer                                   of control flow out of the function.       -mx32                       Generate 32bit x86-64 code       -mxop                       Support XOP built-in functions and code                                   generation             Known assembler dialects (for use with the -masm-dialect= option):         att intel            Known ABIs (for use with the -mabi= option):         ms sysv            Known code models (for use with the -mcmodel= option):         32 kernel large medium small            Valid arguments to -mfpmath=:         387 387+sse 387,sse both sse sse+387 sse,387            Known vectorization library ABIs (for use with the -mveclibabi= option):         acml svml            Valid arguments to -mstringop-strategy=:         byte_loop libcall loop rep_4byte rep_8byte rep_byte unrolled_loop            Known TLS dialects (for use with the -mtls-dialect= option):         gnu gnu2


title: Making Bootable USB, problems copying /proc

text: I'm creating a bootable usb as a cloned partition and am running into problems copying `/proc` to the usb. I know `/proc` contains a lot of virtual files, but I'm not sure how to copy them over. It seems that if I use `cp` it doesn't treat them as virtual files. So with large virtual files like `kcore` it uses all the usbs disk space right away. However if I try and boot with just the folders created, it fails. What would be the best way to copy them over and still keep them as virtual files? Or, what are the minimal files I can copy to the usb to allow it to boot? The distro is fedora 12. I should mention the process I'm using:   1. create partitions on usb to match the installation you want to clone    2. copy the files from the installation to the usb partitions   3. install bootloader on the boot partition (grub) Everything has gone fine so far except for copying `/proc`. I've done this before and haven't had this problem until now.


title: Revert commits and commit them to a branch?

text: I'm cloning a popular open source project into GitHub, and I only realized this after it was too late. I'm also trying to convert this project over to use Maven instead of Ant/Ivy for a build tool. I was able to convert the repository from SVN to Git via the aptly-named `svn2git`, then started making changes toward the Maven migration. I failed to realize at the get-go that I needed to create a separate branch for my Maven migrations. Is there a way for me to take my revisions, remove them from `master`, and send them to a new branch?


title: log out/in because of google-chrome-stable package update?

text: After i configured my Fedora 14 to do auto updates:               gconftool-2 -t string -s /apps/gnome-packagekit/update-icon/auto_update all     gconftool-2 -t integer -s /apps/gnome-packagekit/update-icon/frequency_get_updates 3600     gconftool-2 -t bool -s /apps/gnome-packagekit/update-icon/notify_available 0     gconftool-2 -t bool -s /apps/gnome-packagekit/update-icon/notify_complete 0     gconftool-2 -t bool -s /apps/gnome-packagekit/update-icon/notify_critical 0     gconftool-2 -t bool -s /apps/gnome-packagekit/update-icon/notify_update_complete_restart 0     gconftool-2 -t bool -s /apps/gnome-packagekit/update-icon/notify_update_started 0      I get this funny message. Why do i have to log out/in because of the google-chrome-stable package has been updated?


title: RAMDISK incomplete write error kernel panic

text: I am building Linux Kernel 2.6.36.4 on a Dell Laptop which has Linux Kernel 2.6.35.11 running. BTW I got the source from kernel.org. The source had few syntax errors which I fixed in the process and finished building Kernel. After reboot, I keep getting following error: > RAMDISK: incomplete write error(6022 != 28860)   >  write error   >  Kernel Panic - not syncing: VFS: Unable to mount root fs on unknown- > block(0, 0)   >  Pid: 1, comm: swapper Not tainted 2.6.36.4 #2   >  Call Trace:   >  ? printk.... I followed following steps while building the source: >   1. tar xvf linux-2.6.36.4.tar.bz2 >   2. sudo cp /boot/config-2.6.35.11generic ~/linux-2.6.36.4/.config >   3. cd ~/linux-2.6.36.4 >   4. make menuconfig >   5. sudo make >   6. sudo make modules_install >   7. sudo make install >   8. sudo update-initramfs -k 2.6.36.4 -c >   9. sudo update-grub > I tried following things after my internet search:   * After reboot with working kernel, ran `sudo update-initramfs -u -k all`   * Ran `fsck` However I still get this error for every attempt to boot using 2.6.36.4 Has anybody come across such an issue and what do you suggest in this context? Thank you in advance! EDIT:   Some developers have increased the ramdisk size to few MBs from 4096 default. Is that a good idea?


title: L2TP IPsec VPN client configuration

text: I have Linux (Fedora) box and I want to conject to VPN described as "L2TP IPsec VPN" one. I have got following credentials: * * * user=xxxxxxxxx pass=xxxxxxxxx VPN server= XXX.XXX.XXX.XXX IPsec key=xxxxxxxxx * * * I tried to use NetworkManager, vpnc with no luck. What software to use?


title: iptables log file

text: I have ubuntu and I want to know where can I find the log file of iptables?   I find out `/var/log/messages`, but I am not sure this is a correct log file or not. And I also want to know when this log file is changed? I add one rule to prevent my machine to respond to ping message but when I ping my machine I didn't see any changes to `/var/log/messages`


title: Linux distro that contains Windows fonts in default

text: I personally don't like Linux and Mac OS X fonts. **They are too cartoonish and childish (fat, bold).** So, I would like to find a Linux distribution that contains Windows fonts in default. I know it may not be legal, but I am sure such distros exist; or at least I hope ;). I tried to install MS fonts on Ubunty and it's better. but still the fonts are not the same as on Windows. The gnome interface don't bother me such. I am worried mostly about rendering in browsers in Ubuntu. Do you know about such distribution that has all Windows fonts and renders pages in the firefox the same way as on windows? Is KDE rendering better than Gnome rendering in browsers? **UPDATE:** Here is a comparison, so you see what I mean. The top picture is from Win 7 Firefox and the second from Ubuntu 13.04 Firefox browser. You can clearly see that on Ubuntu the text under the title is deformed and not so high as it supposed to be on Wndows. How to fix that, so proportion of the fonts on Ubuntu are the same? I have installed the MS fonts on Ubuntu. But it is not helping. ![enter image description here](http://i.stack.imgur.com/s4ObR.jpg)


title: asound.conf file is corrupted does not allow the play with the correct sound card as a result it keeps failing

text: I have this following asound.conf file, but when i play $ speaker-test it fails. How can you tell asound.conf that each and every time on restart of pc also use this sound card only?               "card 2: PCH [HDA Intel PCH], device 0: ALC892 Analog [ALC892 Analog]       Subdevices: 1/1"??               $ aplay -l     **** List of PLAYBACK Hardware Devices ****     ALSA lib conf.c:1220:(parse_def) default is not a compound     ALSA lib conf.c:1686:(snd_config_load1) _toplevel_:2:13:Invalid argument     ALSA lib conf.c:3406:(config_file_open) /etc/asound.conf may be old or corrupted: consider to remove or fix it     card 1: Device [C-Media USB Audio Device], device 0: USB Audio [USB Audio]       Subdevices: 1/1       Subdevice #0: subdevice #0     card 2: PCH [HDA Intel PCH], device 0: ALC892 Analog [ALC892 Analog]       Subdevices: 1/1       Subdevice #0: subdevice #0     card 2: PCH [HDA Intel PCH], device 1: ALC892 Digital [ALC892 Digital]       Subdevices: 1/1       Subdevice #0: subdevice #0     card 2: PCH [HDA Intel PCH], device 3: HDMI 0 [HDMI 0]       Subdevices: 1/1       Subdevice #0: subdevice #0     card 2: PCH [HDA Intel PCH], device 7: HDMI 1 [HDMI 1]       Subdevices: 1/1       Subdevice #0: subdevice #0          $ cat /etc/asound.conf         pcm.default {             type hw # Kernel PCM             card 2             device 0 # Device number (default 0)             #[subdevice] INT # Subdevice number, -1 first available (default -1)             #mmap_emulation BOOL # enable mmap emulation for ro/wo devices              }         pcm.!default {             type hw # Kernel PCM             card 2             device 0 # Device number (default 0)             #[subdevice] INT # Subdevice number, -1 first available (default -1)             #mmap_emulation BOOL # enable mmap emulation for ro/wo devices         }      I tried this it works but how to avoid using the hw:2,0 but use some static string so that on reboot it does not get lost?               pcm.!default {              type asym              playback.pcm {                      type plug                      slave.pcm "hw:0,1"              }      }


title: How can I determine if HTML5 player is running in browser?

text: I would like to find a command-line or a **script** that will show me if HTML5 player is running or not in a browser (firefox or chromium). For example, to determine if Flash player is running in a browser, I use next command:               pgrep -lfc ".*((c|C)hrome|chromium|firefox|).*flashp.*"


title: Display the function body in Bash

text: I have setup several functions in my `.bashrc` file. I would like to just display the actual code of the function and not execute it, to quickly refer to something. Is there any way, we could see the function definition?