title: how to use secured port using ssh

text: We have a process that is using a working secured port using this scp command like so: `/usr/bin/scp -P 1234 -i /path/key_rsa /home/path/filename.txt user@remotehost:/tmp` I'm working on a schell script, that will use `ssh`, but not sure how to use that same port of `1234`. I tried `/usr/bin/ssh -D 1234 remotehost '. ~/my_profile; mkdir /test'` and its asking for the user pw. I know the keys are already established since the scp works fine for that user. What am I doing wrong? Thanks.


title: programmatically creating a remote directory using ssh

text: Using a shell script, how can I create a directory remotely from serverA -> serverB using ssh? Can I pass the create directory command with the ssh command? How? I'm basically looking to create a directory remotely based on date (ex. 20110304), if it doesn't already exist.


title: Trying to install Vsphere ESX 4.0 on x86

text: I am trying to install Vsphere ESX 4.0 on my x86 machine. It is asking for Custom Drivers to install ESX. When installed on VMware workstation it takes the current installed Ethernet interface drivers but when installed on the machine for proper set up. It is asking for the Custom Driver. Any link where I can get the driver for ESX 4.0?


title: AWS EMR Bootstrap

text: I need to write a bootstrap action file for my AWS EMR that runs during provisioning and performs:   1. Install latest R version from: http://cran.us.r-project.org   2. Install ‘lme4’ package (and all of its depended packages). This is an R package that you should be able to find from the site above.   3. Create a file somewhere on the master and slave nodes that contains the instance_id and the type (master, core or task). Any suggestions?


title: How can I cut a large file in place?

text: I have a very big text file, about 80GB, and I need to cut a part form it that lies between two given lines. The part I need is not big, and I have not enough space left on the hard drive to do things like:               head -n 10000000 filename > auxiliary_part     tail -n 1000 auxiliary_part > needed_part      How do I do that?


title: Script that keep reading a stream

text: Sometimes I `cat` a stream like `/dev/input/event0`. I want to write a script that does something every time there is more output. The definition of more output might be every time it reads a byte. How can that be done? is there some command that does it?


title: barcode scanner input when running xorg and evdev

text: When I scan a barcode in a text console (CTRL+ALT+F1 or not running X) I get the correct input, but when I try with an application running on X, I don't get the correct barcode. The scanner is configured to return the barcode followed by an 'n'. Under X I only get the 'n', not the preceding barcode. I ran xev to see what is going on. Here is an excerpt of the output:               > KeyPress event, serial 35, synthetic NO, window 0x6800001,     >     state 0x10, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES,     > KeyRelease event, serial 35, synthetic NO, window 0x6800001,     >     state 0x18, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES,     > KeyPress event, serial 35, synthetic NO, window 0x6800001,     >     state 0x10, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES,     > KeyRelease event, serial 35, synthetic NO, window 0x6800001,     >     state 0x18, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES,      There is one KeyPress/KeyRelease event pair for every digit in the barcode, but no events happening between the KeyPress and KeyRelease event for Alt_L? Should I look at compose keys for a solution, or how can I match the behavior of a normal console? ps. I am using a Welch Allyn ST3400 barcode scanner. EDIT: I ran showkey on the command line and scanned in a barcode. This is the output I got:               keycode  28 release     keycode  56 press     keycode  82 press     keycode  76 press     keycode  80 press     keycode  56 release     keycode  56 press     keycode  82 press     keycode  75 press     keycode  73 press     keycode  56 release      It seems that the barcode scanner is using Left-Alt+#+#+# to get the correct characters. It also seems like the barcode scanner never sends a release event for the numpad keys that it used together with Left-Alt? I read something similar on a different forum - without a solution though. If I manually use Left-Alt+#+#+# with showkey, I get press and release for each key. The question now becomes, why is there no KeyPress event when I am running Xorg?


title: Convenient way to name files in Linux

text: I'm a beginner in Linux and want to learn to do things properly in this environment. Since the beginning I've noticed that a lot of people involved in Linux (like tutorials and guides) tend to name files omitting spaces and replacing them with the character "_" and I would like to know if there's a reason to do so. Also I want to know what other characters should be avoided when naming files. What about capital letters? I've seen a preference for lowercase letters. As a last query, what would be the best way to name my songs in Linux. For example, I got a lot of files in the format: `track. artist name - song name.mp3`, like `01\. Crystal Castles - Untrust Us.mp3`. Should I change the format to something like `track._artist_name_-_song_name.mp3` as in `01._Crystal_Castles_-_Untrust_Us.mp3`; it looks a little overloaded for my newbie eyes. I would like to know your opinion on this matter. Thanks.


title: how to access with Linux to the real block size info of a filesystem when it is mounted on nfs?

text: I have a Centos 6.5 and Solaris 5 machines. I'm trying to get the information about block size of a filesystem in the member f_frsize of statvfs. I tried first from Centos but when the filesystem is mounted in nfs, i got a value like 32768 or 65536. I think this value is the nfs data block size and not the block size. And when i try to get the block size info of the same nfs filesystem but from Sun Solaris, i get a value like 1024. So why did i get a different block size (f_frsize) when calling statvfs from Solaris and from Linux ? Is there a way to get the f_frsize info of the nfs filesystem and not this nfs data block size ? i don't know if what i want is possible, but i would like more informations about this. Thanks


title: Linux fails on boot in strange way

text: I have restarted my machine after trying to install Skype, i have reverted changes made to               etc/dbus-1/system.conf      but after starting my machine i receive almost instantly stream of 99 and sometimes 80 and that's all. Nothing is being logged to aby log as it fails even before loading kernel,literally in Second or two after pressing Power. I don't know if my change to above file is relevant,maybe that's just coincidence, where I should start looking for some clue? I even don't know what to Google now, or is it software or hardware (ssd?) failure. Sorry for lack of formatting, I'm writing from my phone.


title: How to check which specific processes (Python scripts) are running?

text: Using the command 'top' I can see 2 python scripts are running. However, how do I check their names or directory/location? I want to identify them so I can see what is running properly and what isn't.


title: Perl alternative for screen/tmux for the UNIX world?

text: What happens when a screen/tmux-like solution is needed (to leave a process running for a long time, but not with `nohup` because interaction could be needed) - but screen/tmux is not available on the given machine, and installing screen/compiling it isn't a solution? **Q: Are there any "short" perl scripts that can be generally (or not generally) used to achieve this goal (on Linux/AIX/etc.)?** only this is needed:   1. start the perl script   2. start the given thing that takes long time   3. de-attach from the terminal, ex.: because working notebook needs to be shut down   4. **re-attach to the console** to see/control the started long running process, just like in screen Does anybody has a perl script like this?


title: How do I prepare Windows NTFS drives on Linux

text: I'm upgrading my windows desktop hardware and doing a clean OS install. I'm using SystemRescueCD to prepare my old drives for the upgrade. Long story short, a bit of an emergency, I coudln't do this in windows before I upgraded the hardware (failed motherboard) and windows doesn't boot with the new hardware. I'm familiar with unix/linux but not so much when it comes to doing things with windows and have some questions. I have 3 drives. 2 old drives that were the system (c:, /dev/sda) and data (d: /dev/sdc) drives before I upgrade the hardware. I have one new drive (/dev/sdb) which I think I might have used briefly in a USB dock because it's formatted as FAT16. I'm currently waiting for /dev/sdb to finish formatting. I used mkntfs /dev/sdb1 to make it an NTFS partition. Is that going to be good enough? I want to copy the contents of /dev/sda1 and /dev/sdc1 into directores on /dev/sdb1 as backups (already have files backed up to other device but faster if on same system). What's the best way to do the copy so that I can easily see the files in windows and not have to worry about hidden files or special permissions? It's also about 0.4TB of data so something that will work fast would be nice. I don't want to move the partition, just copy the contents of those 2 partitions to directories in the new drives partition. Do I need to do anything about assigning drive letters? When I install windows I plan on formatting my c: drive (/dev/sda) as my new system drive/partition. I want the new drive (/dev/sdb) to have a d: drive letter in windows but don't want to reformat it since it will contain the data from my old system drive. My old d: drive (/dev/sdc) I don't want to reformat yet but would like it to be my e: drive.


title: How do I change the Old Directory path to New Directory path using SED command

text: I have the old path it contains the some files.                /home/ubuntu/Desktop/test-dir      Now I want to change the test-dir to new-test-dir directory.                /home/ubuntu/Desktop/new-test-dir       How do I change this


title: apt-file vs apt-cache

text: I've known about `apt-cache` for quite some time, but only yesterday stumbled on `apt-file`. My question is, given this kind of output from the two...               ttsiod@avalon ~     $ apt-cache search setxkb     x11-xkb-utils - X11 XKB utilities     xfce4-xkb-plugin - xkb layout switch plugin for the Xfce4 panel          ttsiod@avalon ~     $ apt-file find setxkb     fish: /usr/share/fish/completions/setxkbmap.fish     fish: /usr/share/fish/functions/__fish_complete_setxkbmap.fish     x11-xkb-utils: /usr/bin/setxkbmap     x11-xkb-utils: /usr/share/man/man1/setxkbmap.1.gz     xmanpages-ja: /usr/share/man/ja/man1/setxkbmap.1.gz     zsh: /usr/share/zsh/functions/Completion/X/_setxkbmap     zsh-beta: /usr/share/zsh-beta/functions/Completion/X/_setxkbmap     zsh-common: /usr/share/zsh/functions/Completion/X/_setxkbmap      ...why would one bother with apt-cache? Isn't apt-file superior in every way? I am probably missing something. **EDIT** : The reason I am asking is because apt-file reported MORE packages than apt-cache. I only use apt-cache for the use case _"I need tool/manpage/whatever named foo - which packages contain foo?"_ and it seems that apt-file seems to do everything apt-cache does, but better - it reports more packages (apt-cache MISSES some), and it also shows the filenames involved.


title: exiting infinte loop

text: This code gets into an infinite loop. How can in troubleshoot it?               PGM=ot_run_hourly     PID=$$     TIMESTAMP=`date +%Y%m%d%H%M%S`     MASTER_DATE_STAMP_BEGIN=`date +%D`     MASTER_TIME_STAMP_BEGIN=`date +%T`     DIR=/var/opt/gogd/ship/na/log          #logfiles /var/opt/gogd/ship/na/log/ot_run_hourly*.log          LOG_FILE=${DIR}/${PGM}_${TIMESTAMP}_${PID}.log     COUNTER=1          date +"Info: %m/%d/%Y %T : Step 1 : Start" | tee -a ${LOG_FILE}          while [ $COUNTER -le 5 ]     do                  date +"Info: %m/%d/%Y %T : Step 2 : Counter $COUNTER" | tee -a ${LOG_FILE}                            COUNTER =`expr $COUNTER + 1`                  sleep 60          done          date +"Info: %m/%d/%Y %T : Step 3 : Complete" | tee -a ${LOG_FILE}/var/opt/gogd/ship/scripts


title: "system is going down for reboot now"

text: I am connected to a beagleboard via tty and I suddenly see this message :               Broadcast message from root@arm             (unknown) at 11:40 ...          The system is going down for reboot NOW!     [  143.036193] Restarting system.      The system is Ubuntu 12.10. Is there a place where I can find why the system decided to go down ? UPDATE: More info   * This actually happens all the time, the board reboots every 1 to 5 minutes.   * I made sure no program or daemon runs at startup.   * I can't find `Restarting` anywhere in any file in `/var/log`   * In `syslog` before a reboot there is consistently a `Feb 10 09:20:00 arm rsyslogd: [origin software="rsyslogd" swVersion="5.8.6" x-pid="317" x-info="http://www.rsyslog.com"] exiting on signal 15.`


title: Graph is too large for cairo-renderer bitmaps Error

text: Im trying to use pyreverse to generate images of UML diagrams for a project source code. When I run the pyreverse command and specify to generate `.png` images, it runs and then after a while, it shows:               dot: graph is too large for cairo-renderer bitmaps. Scaling by 0.271394 to fit     dot: graph is too large for cairo-renderer bitmaps. Scaling by 0.333083 to fit      Then if I open either image, the text is unreadable because it got scaled. Is there a way to just not scale, and let the image be large size?


title: arecord to record what is playing on speakers

text: The command `arecord foo.wav` records from microphone and saves to file foo.wav. Is there a way I can have arecord record what is coming out of speakers instead of recording from microphone? Or perhaps there are other command line tools that can do this? I would rather avoid bloaty graphical tools like Audacity. I am on Arch if it makes any difference.


title: NetworkManager cannot remember my WiFi password

text: My system is Gentoo 64bit, with KDE4. I just updated my Gentoo system. And after reboot, it asks me for my WiFi password. But the next I log in, it asks the password again. I checked the settings, and the _password_ field is empty. And even I type in the password into those fields, it cannot be saved. I checked my system log, and the only line that looks like an error is this one.               Aug 26 12:52:48 dell NetworkManager[251]: get_secret_flags: assertion 'is_secret_prop (setting, secret_name, error)' failed      P.S. I am not using KWallet. I guess this is not required?


title: kernel log in /var/log/messages: task xxx blocked blocked for more than 120 seconds . System frozen

text: Monit sent out emails in the morning that my java app on the server was not responding to HTTP calls made on the 127.0.0.1 interface. App log shows nothing out of the ordinary, nginx log shows no signs of an attack, system log indiacted something was causing the kernel to block the process. I suspect it could be due to lack of resources? I am on a VPS that has only 2Ghz processors (KVM). The app itself is still running but the OS freezes, cant even ssh into the box. here is the stack trace from /var/log/messages (same seen in dmesg)               Aug  1 09:20:13 myserver kernel: INFO: task jbd2/vda1-8:265 blocked for more than 120 seconds.     Aug  1 09:20:13 myserver kernel: Clocksource tsc unstable (delta = -51538573103 ns)     Aug  1 09:20:13 myserver kernel:      Not tainted 2.6.32-431.1.2.0.1.el6.x86_64 #1     Aug  1 09:20:13 myserver kernel: "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.     Aug  1 09:20:13 myserver kernel: jbd2/vda1-8   D 0000000000000001     0   265      2 0x00000000     Aug  1 09:20:13 myserver kernel: ffff880217b63c20 0000000000000046 0000000000000000 000000011954e14a     Aug  1 09:20:13 myserver kernel: ffff880217b63b90 ffff88021c49e670 0000000013117898 ffffffffac2e3bb9     Aug  1 09:20:13 myserver kernel: ffff88021826faf8 ffff880217b63fd8 000000000000fbc8 ffff88021826faf8     Aug  1 09:20:13 myserver kernel: Call Trace:     Aug  1 09:20:13 myserver kernel: [<ffffffff811bf130>] ? sync_buffer+0x0/0x50     Aug  1 09:20:13 myserver kernel: [<ffffffff815280b3>] io_schedule+0x73/0xc0     Aug  1 09:20:13 myserver kernel: [<ffffffff811bf170>] sync_buffer+0x40/0x50     Aug  1 09:20:13 myserver kernel: [<ffffffff81528b7f>] __wait_on_bit+0x5f/0x90     Aug  1 09:20:13 myserver kernel: [<ffffffff811bf130>] ? sync_buffer+0x0/0x50     Aug  1 09:20:13 myserver kernel: [<ffffffff81528c28>] out_of_line_wait_on_bit+0x78/0x90     Aug  1 09:20:13 myserver kernel: [<ffffffff8109b330>] ? wake_bit_function+0x0/0x50     Aug  1 09:20:13 myserver kernel: [<ffffffff811bf126>] __wait_on_buffer+0x26/0x30     Aug  1 09:20:13 myserver kernel: [<ffffffffa00637f1>] jbd2_journal_commit_transaction+0x1181/0x1500 [jbd2]     Aug  1 09:20:13 myserver kernel: [<ffffffff810096f0>] ? __switch_to+0xd0/0x320     Aug  1 09:20:13 myserver kernel: [<ffffffff81084d2b>] ? try_to_del_timer_sync+0x7b/0xe0     Aug  1 09:20:13 myserver kernel: [<ffffffffa0068a48>] kjournald2+0xb8/0x220 [jbd2]     Aug  1 09:20:13 myserver kernel: [<ffffffff8109b2b0>] ? autoremove_wake_function+0x0/0x40     Aug  1 09:20:13 myserver kernel: [<ffffffffa0068990>] ? kjournald2+0x0/0x220 [jbd2]     Aug  1 09:20:13 myserver kernel: [<ffffffff8109af06>] kthread+0x96/0xa0     Aug  1 09:20:13 myserver kernel: [<ffffffff8100c20a>] child_rip+0xa/0x20     Aug  1 09:20:13 myserver kernel: [<ffffffff8109ae70>] ? kthread+0x0/0xa0     Aug  1 09:20:13 myserver kernel: [<ffffffff8100c200>] ? child_rip+0x0/0x20          Aug  1 09:20:13 myserver kernel: INFO: task java:12282 blocked for more than 120 seconds.     Aug  1 09:20:13 myserver kernel:      Not tainted 2.6.32-431.1.2.0.1.el6.x86_64 #1     Aug  1 09:20:13 myserver kernel: "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.     Aug  1 09:20:13 myserver kernel: java          D 0000000000000001     0 12282      1 0x00000080     Aug  1 09:20:13 myserver kernel: ffff88021893d7c8 0000000000000086 0000000000000000 000000011954e14a     Aug  1 09:20:13 myserver kernel: ffff88021893d808 ffff880219800de0 0000000013116f06 ffffffffac2e3bb9     Aug  1 09:20:13 myserver kernel: ffff88021aba7058 ffff88021893dfd8 000000000000fbc8 ffff88021aba7058     Aug  1 09:20:13 myserver kernel: Call Trace:     Aug  1 09:20:13 myserver kernel: [<ffffffff811bf130>] ? sync_buffer+0x0/0x50     Aug  1 09:20:13 myserver kernel: [<ffffffff815280b3>] io_schedule+0x73/0xc0     Aug  1 09:20:13 myserver kernel: [<ffffffff811bf170>] sync_buffer+0x40/0x50     Aug  1 09:20:13 myserver kernel: [<ffffffff8152894a>] __wait_on_bit_lock+0x5a/0xc0     Aug  1 09:20:13 myserver kernel: [<ffffffff811bf130>] ? sync_buffer+0x0/0x50     Aug  1 09:20:13 myserver kernel: [<ffffffff81528a28>] out_of_line_wait_on_bit_lock+0x78/0x90     Aug  1 09:20:13 myserver kernel: [<ffffffff8109b330>] ? wake_bit_function+0x0/0x50     Aug  1 09:20:13 myserver kernel: [<ffffffff811be6c9>] ? __find_get_block+0xa9/0x200     Aug  1 09:20:13 myserver kernel: [<ffffffff811bf316>] __lock_buffer+0x36/0x40     Aug  1 09:20:13 myserver kernel: [<ffffffffa0062293>] do_get_write_access+0x493/0x520 [jbd2]     Aug  1 09:20:13 myserver kernel: [<ffffffff8100bb8e>] ? apic_timer_interrupt+0xe/0x20     Aug  1 09:20:13 myserver kernel: [<ffffffffa006a778>] ? jbd2_journal_add_journal_head+0xd8/0x170 [jbd2]     Aug  1 09:20:13 myserver kernel: [<ffffffffa0062471>] jbd2_journal_get_write_access+0x31/0x50 [jbd2]     Aug  1 09:20:13 myserver kernel: [<ffffffffa00afd98>] __ext4_journal_get_write_access+0x38/0x80 [ext4]     Aug  1 09:20:13 myserver kernel: [<ffffffffa0089bd3>] ext4_reserve_inode_write+0x73/0xa0 [ext4]     Aug  1 09:20:13 myserver kernel: [<ffffffffa0089c4c>] ext4_mark_inode_dirty+0x4c/0x1d0 [ext4]     Aug  1 09:20:13 myserver kernel: [<ffffffffa0061495>] ? jbd2_journal_start+0xb5/0x100 [jbd2]     Aug  1 09:20:13 myserver kernel: [<ffffffffa0089f40>] ext4_dirty_inode+0x40/0x60 [ext4]     Aug  1 09:20:13 myserver kernel: [<ffffffff811b490b>] __mark_inode_dirty+0x3b/0x160     Aug  1 09:20:13 myserver kernel: [<ffffffff811a5012>] file_update_time+0xf2/0x170     Aug  1 09:20:13 myserver kernel: [<ffffffff8118aee0>] ? __sb_start_write+0x80/0x120     Aug  1 09:20:13 myserver kernel: [<ffffffffa008adc0>] ? ext4_da_get_block_prep+0x0/0x3c0 [ext4]     Aug  1 09:20:13 myserver kernel: [<ffffffff811c11eb>] __block_page_mkwrite+0x3b/0x140     Aug  1 09:20:13 myserver kernel: [<ffffffffa008d0b1>] ext4_page_mkwrite+0x121/0x360 [ext4]     Aug  1 09:20:13 myserver kernel: [<ffffffff81149d60>] do_wp_page+0x640/0x920     Aug  1 09:20:13 myserver kernel: [<ffffffff810a0552>] ? hrtimer_cancel+0x22/0x30     Aug  1 09:20:13 myserver kernel: [<ffffffff8114a83d>] handle_pte_fault+0x2cd/0xb00     Aug  1 09:20:13 myserver kernel: [<ffffffff810af1de>] ? futex_wake+0x10e/0x120     Aug  1 09:20:13 myserver kernel: [<ffffffff8114b29a>] handle_mm_fault+0x22a/0x300     Aug  1 09:20:13 myserver kernel: [<ffffffff8104a8d8>] __do_page_fault+0x138/0x480     Aug  1 09:20:13 myserver kernel: [<ffffffff8100bb8e>] ? apic_timer_interrupt+0xe/0x20     Aug  1 09:20:13 myserver kernel: [<ffffffff8100bb8e>] ? apic_timer_interrupt+0xe/0x20     Aug  1 09:20:13 myserver kernel: [<ffffffff8103f9d8>] ? pvclock_clocksource_read+0x58/0xd0     Aug  1 09:20:13 myserver kernel: [<ffffffff8103f9d8>] ? pvclock_clocksource_read+0x58/0xd0     Aug  1 09:20:13 myserver kernel: [<ffffffff8103ea6c>] ? kvm_clock_read+0x1c/0x20     Aug  1 09:20:13 myserver kernel: [<ffffffff8152d46e>] do_page_fault+0x3e/0xa0     Aug  1 09:20:13 myserver kernel: [<ffffffff8152a825>] page_fault+0x25/0x30      I tried to see what other process was hogging the CPU at the same time but no luck. I really suspect it could be the CPU being utilised at 100%.               [root@myserver log]# uname -a     Linux myserver 2.6.32-431.1.2.0.1.el6.x86_64 #1 SMP Fri Dec 13 13:06:13 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux      Any thoughts?


title: Enclose multiple lines in quote Vim

text: I have blocks of the following form:                   String that is not supposed to be enclosed in quotes         String that is supposed to be enclosed in quotes              String that is not supposed to be enclosed in quotes         String that is supposed to be enclosed in quotes              String that is not supposed to be enclosed in quotes         String that is supposed to be enclosed in quotes              String that is not supposed to be enclosed in quotes         String that is supposed to be enclosed in quotes      I need to put the lines that state that they are supposed to be enclosed in quotes in quotes:                   String that is not supposed to be enclosed in quotes         "String that is supposed to be enclosed in quotes"              String that is not supposed to be enclosed in quotes         "String that is supposed to be enclosed in quotes"              String that is not supposed to be enclosed in quotes         "String that is supposed to be enclosed in quotes"              String that is not supposed to be enclosed in quotes         "String that is supposed to be enclosed in quotes"      Is there a semi-automatic way of doing this with Vim? I thought that a possible solution might involve the `g` command.


title: Determining NIC designation from PCI address

text: I am in the process of upgrading a legacy system from RHEL 5.4 to 5.8. There are three NICs installed, each with defined IP addresses and attached wiring. After the upgrade, the cards are on the same PCI addresses but the OS has shuffled the NIC designations:               network old  new     net A   eth0 eth1     net B   eth1 eth2     net C   eth2 eth0      The PCI addresses in use are `05.03.0` for `Net C` and the other two are on `03.03.0` and `03.03.1`. There is no `/etc/udev/rules.d/70-persistent-net.rules` file. Is there a way to specify which PCI addresses are used for each interface? **Update** I have found `/etc/sysconfig/hwconf` and `/etc/sysconfig/network- scripts/ifcfg-eth?` files that contain the IP and MAC address values. hwconf also specifies the PCI address, but seems to get re-written on boot. I would prefer to be able to specify the NICs by PCI position as this is effectively what is used to determine the behaviour rather than MAC address which would be changed if a different card was used.


title: Cannot Recognize ISO in Fedora Core 1 (Yarrow) in VMWare View Player

text: It's a long story of why I am trying to do this (basically supporting a business that has not updated their servers in a LONG time). In any case, I am trying to mount an ISO in VMWare View player so I can get access to it inside a snapshot of Yarrow. (I am using VMWare View Player 5.) When I "Connect" to the ISO, it does see the drive - it even recognizes the name of the image (FC-1 i386). However, when I try to navigate to /mnt/cdrom and perform 'ls', nothing is listed. The application installer keeps asking me for the CD. Here is my /etc/fstab:               /dev/cdrom  /mnt/cdrom  udf,iso9660  noauto,owner,ro  0 0      There was a "kudzu" option in with the noauto,owner,ro, but I removed that after doing some reading. Unfortunately, nothing seems to be working at this point. I know the ROM is good because I used it to install another image of Fedora Core 1 just to test that out. Anybody have any suggestions/pointers?


title: What does the noload option do in fstab?

text: I put `UUID=fb2b6c2e-a8d7-4855-b109-c9717264da8a / ext4 auto,noatime,noload,data=ordered,commit=10,defaults 1 1` in fstab And now server fails to reboot. It can reboot but reject all kind of connections. This is what my provider said:               Yeah, the noload option might be problematic... I can't edit /etc/fstab from     single user mode, but I might be able to edit it using one of my pxe boot tools     to enter the filesystem manually. With regards to your request about     /var/log/messages and /var/log/secure, I'm afraid I can't do that for you     (technically, I'm already bordering on managed services by editing your fstab     for you, but I am justifying it as necessary to restore connectivity)...      I search for the purpose of noload option in google https://www.google.com/search?q=fstab+noload&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en- US:official&client=firefox-a and have no issue. Someone in linux forum says that it disable journaling. > I'm unable to paste the actual error messages without manually typing them > out, but I assure you they're not really very descriptive (basically, system > indicates that it is unable to remount root in read/write mode, and then > errors composed of read/write problems, particularly in /var are printed to > the screen)... It does end in a happy ending: > Your server is back online, and I was able to successfully disable your > iptables (which for reference, I did confirm were causing connectivity > issues), and I am now able to ssh into your server with the credentials > provided earlier in this ticket:


title: Running a local port scan and found open ports but, don't know what they're used for?

text: I wrote a very basic python script to port scan my system. I'm running linux- mint lisa:               open_ports = []     for port in xrange(65536):         conn = socket.socket(socket.AF_INET, socket.SOCK_STREAM)         try:             conn.connect(('localhost', port))             open_ports.append(port)             conn.close()         except socket.error:             pass      I returned a list of 7 ports and I ran netstat on each one:               sudo netstat -anlp | grep :(each port here)      I found that the first four were for `cups, mysql, polipo, and tor` but, the last three `[44269, 46284, 47650]` were much higher numbers and I didn't get anything back. I ran the script a few times more after this but, I would only return the first four. Any ideas what they could be and what they're being used for?


title: Do I need to wipe and reinstall after possible hacker attack

text: Yesterday I noticed that the xterm title I use changed suddenly to something strange. So I suspect that someone hacked my Linux laptop (I'm using Arch). I changed the WiFi parameters (pass, essid) and changed my password on the computer. I also reinstalled all packages to overwrite files that may have been changed. I tried to take a look at the changed files, logs and so on, but I don't have experience in security, so it was like walking in the dark ;) and of course I didn't found any signs of intrusion. Do you think I should wipe the system and install from scratch?


title: Server no longer responsive after reboot

text: I changed my fstab into this:               #     # /etc/fstab     # Created by anaconda on Sat Jan 12 02:12:44 2013     #     # Accessible filesystems, by reference, are maintained under '/dev/disk'     # See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info     #     UUID=fb2b6c2e-a8d7-4855-b109-c9717264da8a /                       ext4    auto,noatime,noload,data=ordered,commit=10,defaults        1 1     UUID=71362665-f627-41e1-a093-de42a0a356e2 /boot                   ext3    defaults        1 2     UUID=8024a5cd-af4b-4776-af0d-65ad80af8649 swap                    swap    defaults        0 0     tmpfs                   /dev/shm                tmpfs   defaults        0 0     devpts                  /dev/pts                devpts  gid=5,mode=620  0 0     sysfs                   /sys                    sysfs   defaults        0 0     proc                    /proc                   proc    defaults        0 0     /usr/tmpDSK             /tmp                    ext3    defaults,noauto        0 0     /dev/sdd1               /home4                  auto    auto,noatime,noload,data=ordered,commit=10,defaults        0 0     /dev/sdc1               /home3                  auto    auto,noatime,noload,data=ordered,commit=10,defaults        0 0     /dev/sdb1               /home2                  auto    auto,noatime,noload,data=ordered,commit=10,defaults        0 0      Basically the boot sector remains ext3. I disabled journaling for most drives because it causes heavy writes. Now after rebooting server I can't even access ssh. The message I got from ssh is connection refused.


title: Is there any rsync parameter for show at the end the changes made?

text: I have a script that sync (mirror mode) four folders between two disks. While it is running it shows the directory where it is in this very moment, and at the end it shows bytes sent, speed, etc. I'm wondering if there is a parameter that shows the changes made at the end. For example:   * Copied a,b,c from A/asd to B/asd   * Deleted d,e,f from B/asd


title: How to check physical device contents

text: I got a server with 2 hard drives. I would like to know what is on 2nd drive. How would I list all contents on physical device ?               lsblk     NAME    MAJ:MIN RM SIZE RO TYPE MOUNTPOINT     xvda    202:0    0  40G  0 disk      └─xvda1 202:1    0  40G  0 part /     xvde    202:64   0  40G  0 disk      └─xvde1 202:65   0  40G  0 part       I run the above code. Does it mean that 2nd drive is empty and not in use ?


title: Confusion on the cp command when creating a new directory

text: Let me explain my problem with a simpler scenario. We have these two directories: `~/Foo` and `~/Bar`. Foo contains the files `test1.txt` and `test2.txt`. If I run the command `cp -R Foo Bar`, the Bar directory now contains a Foo folder containing the two text files. However, if I run the command `cp -R Foo Bar` when the `Bar` directory does not yet exist before the command is run, the newly created `Bar` directory will not contain a `Foo` subdirectory but only the two `.txt` files. Why is it when I run the command in the first situation that it creates a subdirectory with the two files but in the second situation it just copies the two files into the new directory? Is the `cp` program supposed to function in this way?


title: line 7: [: echo: integer expression expected

text: This is my first script for Shell/Bash and I'm struggling with the syntax. The first command line argument is a string while the second is number.               x='echo $1|wc -m'     count=0     while             [ $count -le $x ]                         #line 7     do             count=$(( $count+1 ))             echo $1     done     if             [ $2 -lt 0 ]     then             echo 'Negative'     else             echo 'Positive'     fi


title: Any built-in Linux methods for AXI-burst type devices?

text: I need to communicate with an FPGA device based on an AXI-burst interface. What are the ways to access such a device through Linux without involving a DMA? Burst is an intrinsic property of the AXI standard, which should typically be triggered automatically when large amounts of data are being transferred. And the bigger problem is the FPGA is designed so as to respond only to burst type requests over the AXI bus. So this causes serious issues on Linux when the application tries sequential copy. P.S. I have already tried memcpy and it doesn't work.


title: Multi-Threading/Forking in a bash script

text: I have written a bash script which is in following format:               #!/bin/bash     start=$(date +%s)     inFile="input.txt"     outFile="output.csv"          rm -f $inFile $outFile          while read line     do              -- Block of Commands          done < "$inFile"          end=$(date +%s)          runtime=$((end-start))          echo "Program has finished execution in $runtime seconds."      The `while` loop will read from `$inFile`, perform some activity on the line and dump the result in `$outFile`. As the `$inFile` is 3500+ lines long, the script would take 6-7 hours for executing completely. In order to minimize this time, I am planning to use multi-threading or forking in this script. If I create 8 child processes, 8 lines from the `$inFile` would be processed simultaneously. How can this be done?


title: truncate a log file to zero while another process is continuously writing to it

text: I'm trying to debug this horribly hacky little program and it's writing a trace of all emulated instructions to a logfile which has grown to 2.5 GB in 45 min. I've only got 800 MB free. Can I truncate the file without disturbing the program writing to it? And if so, how? This is running on Cygwin over Windows 8.


title: How to 'strace' a unix domain socket?

text: Kind of hard to explain but I noticed when `strace`ing the PID that has the socket open I cannot see any of the communication. How can I sit in the middle of a socket file to watch communication?


title: Can proxychains proxify VirtualBox?

text: I have my proxychains proxiyfied VirtualBox, the guest OS connects to the internet directly that bypassing the proxy setting in /etc/proxychains .cnf. So, which is proxychains can and can't?


title: How do I get the list of exit codes (and/or return codes) and meaning for a command/utility?

text: Is there a way I can do what stated in the title from the terminal commands, or will I have to look into the codes?


title: How to grep for text in a file and display the paragraph that has the text?

text: Below is the text in the file:               Pseudo name=Apple     Code=42B     state=fault          Pseudo name=Prance     Code=43B     state=good      I need to grep for "42B" and get the output from the above text like:               Pseudo name=Apple     Code=42B     state=fault      Does anyone have idea on how to achieve this using `grep`/`awk`/`sed`?


title: How do I diagnose problems docker deployments (dokku/git push)?

text: I'm new to Docker and dokku, and DigitalOcean, and just trying to figure out how all the pieces fit together. I'm deploying my app with git. When I deploy, it seems to succeed from my end, but when I log in and look for the running process with docker ps, I don't see any. A little investigation shows it tried to do something...               # docker ps -a      ID IMAGE COMMAND CREATED STATUS PORTS      e69021b44e45 app/foo:latest /bin/bash -c /start 12 minutes ago Exit 0      Trying to launch manually:               # docker run e69021b44e45 node app.js      Unable to find image 'e69021b44e45' (tag: latest) locally      Pulling repository e69021b44e45      2013/09/21 04:12:02 Internal server error: 404 trying to fetch remote history for e69021b44e45      What could I be doing wrong, and how do I investigate issues like this? For more information, I'm deploying to Docker using dokku on DigitalOcean's Ubuntu/Docker image.


title: lstat64 fails on existing directory

text: After trying for a while to debug a failing `move_uploaded_file` call, I tried               strace -s 8192 -o strace.log -f /etc/init.d/apache22 restart      This produced, among a lot more output, the following lines:               5069  lstat64("/var", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0     5069  lstat64("/var/apache22", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0     5069  lstat64("/var/apache22/var", 0xbffe0f8c) = -1 ENOENT (No such file or directory)      (Yes, I know the path is a bit strange. It's a legacy application.) The issue is that **"/var/apache22/var" _really exists_**. Pasting verbatim (except for [bracketed text]) from a root session:               # ls -la "/var/apache22/var"           total 24     drwxr-xr-x  6 root root 4096 Mar  7  2011 .     drwxr-xr-x  9 root root 4096 Jan 11 19:18 ..     drwxr-xr-x 10 root root 4096 Mar  7  2011 apache22     drwxr-xr-x  3 root root 4096 Mar  7  2011 log     drwxr-xr-x  2 root root 4096 Jan 11 19:36 run     drwxr-xr-x  3 root root 4096 Mar  7  2011 usr          # stat "/var/apache22/var"       File: `/var/apache22/var'       Size: 4096        Blocks: 8          IO Block: 4096   directory     Device: 804h/2052d  Inode: 539214      Links: 6     Access: (0755/drwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)     Access: 2012-01-11 19:46:47.000000000 +0100     Modify: 2011-03-07 23:27:57.000000000 +0100     Change: 2011-06-06 19:39:40.000000000 +0200          # mount     /dev/sda1 on / type ext3 (rw)     /dev/sda3 on /usr type ext3 (rw)     /dev/sda4 on /var type ext3 (rw)     sysfs on /sys type sysfs (rw)     /var/[product name] on /var/apache22/var/apache22/export/[product name] type none (rw,bind)      There are no symlinks:               # file / /var /var/apache22 /var/apache22/var     /:                 directory     /var:              directory     /var/apache22:     directory     /var/apache22/var: directory          # uname -r     2.6.29.6


title: Yocto project installation error

text: I installed the Yocto project in Ubuntu 12.04 desktop. I followed steps what they given in the yocto website Supported Linux Distributions.               $ sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib       build-essential chrpath     $ sudo apt-get install libsdl1.2-dev xterm     $ sudo apt-get install make xsltproc docbook-utils fop dblatex xmlto     $ sudo apt-get install autoconf automake libtool libglib2.0-dev      After installations I did this steps               $ cd ~     $ git clone git://git.yoctoproject.org/poky     $ cd poky     $ git checkout -b dora origin/dora     $ source oe-init-build-env     $ bitbake adt-installer      I got this errors               Loading cache: 100% |###########################################| ETA:  00:00:00     Loaded 1188 entries from dependency cache.     NOTE: Resolving any missing task queue dependencies          Build Configuration:     BB_VERSION        = "1.20.0"     BUILD_SYS         = "x86_64-linux"     NATIVELSBSTRING   = "Ubuntu-12.04"     TARGET_SYS        = "i586-poky-linux"     MACHINE           = "qemux86"     DISTRO            = "poky"     DISTRO_VERSION    = "1.5.1"     TUNE_FEATURES     = "m32 i586"     TARGET_FPU        = ""     meta                   meta-yocto             meta-yocto-bsp    = "dora:84c2763fa0bf08a83caa2c5ee532b5bef2ff918b"          NOTE: Preparing runqueue     NOTE: Executing SetScene Tasks     NOTE: Executing RunQueue Tasks     WARNING: Failed to fetch URL ftp://ftp.gnu.org/gnu/readline/readline-6.2.tar.gz;name=archive, attempting MIRRORS if available     WARNING: Failed to fetch URL ftp://ftp.gnu.org/gnu/readline/readline-6.2-patches/readline62-001;name=patch1;apply=yes;striplevel=0, attempting MIRRORS if available     ERROR: Fetcher failure: Fetch command failed with exit code 4, no output     ERROR: Function failed: Fetcher failure for URL: 'ftp://ftp.gnu.org/gnu/readline/readline-6.2-patches/readline62-001;name=patch1;apply=yes;striplevel=0'. Unable to fetch URL from any source.     ERROR: Logfile of failure stored in: /home/openstack/poky/build/tmp/work/x86_64-linux/readline-native/6.2-r4/temp/log.do_fetch.32384     ERROR: Task 347 (virtual:native:/home/openstack/poky/meta/recipes-core/readline/readline_6.2.bb, do_fetch) failed with exit code '1'     NOTE: Tasks Summary: Attempted 190 tasks of which 155 didn't need to be rerun and 1 failed.     No currently running tasks (190 of 373)          Summary: 1 task failed:       virtual:native:/home/openstack/poky/meta/recipes-core/readline/readline_6.2.bb, do_fetch     Summary: There were 2 WARNING messages shown.     Summary: There were 2 ERROR messages shown, returning a non-zero exit code.      How to install Yocto project? Anyone help me.


title: How do the internals of sudo work?

text: How does `sudo` work internally? How is it possible that it can become root without having the root password, unlike `su`? What syscalls, etc. are involved in the process? Is it not a gaping security hole in Linux(e.g. why couldn't I compile a heavily-patched `sudo` that just did whatever regular `sudo` did, but didn't ask for the unprivileged user's password)? I have read login and su internals. I have also read How is sudo intended to be used? but despite the title, they mainly deal with the differences between `su` and `sudo`.


title: changing the names of network interfaces, debian wheezy

text: I'm trying to set a name for an interface, "ethLan" instead of eth0. Doing so also ensures that the if's name will remain consistent at every reboot and kernel. I did find some articles in the subject, but they are all a couple of years old:   http://www.debian-administration.org/articles/463   http://www.linuxfromscratch.org/hints/downloads/files/nameif.txt I did as they said and added the **ethLan mac** to **/etc/mactabs/**. At this point I have two problems:   1) The `if [...] && /sbin/nameif` script I put at **/etc/network/if-pre- up.d/** does not run. I solved this by adding this to the _/etc/init.d/networking_ , but why doesn't _if-pre-up.d_ work?   2) The interface won't load unless I manually do **ifconfig ethLan up** , in spite of adding it to _/etc/network/interfaces_. What am I doing wrong?


title: ICMP gives host an impossible redirect

text: I am having trouble with forwarding on a system which hosts a few headless VirtualBox VMs. I have not changed anything but the configuration has stopped working. The VMs have IP addresses on their own subnet which I have to route to myself. So the host has it's IP and gateway, and an alias which is used as a gateway by the VMs. The host configuration:               root@greece:~# ifconfig     eth0      Link encap:Ethernet  HWaddr 0c:c4:7a:02:5d:36               inet addr:192.99.46.35  Bcast:192.99.46.255  Mask:255.255.255.0               inet6 addr: 2607:5300:60:5123::/64 Scope:Global               inet6 addr: fe80::ec4:7aff:fe02:5d36/64 Scope:Link               UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1               RX packets:31246 errors:0 dropped:35 overruns:0 frame:0               TX packets:5818 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:1000               RX bytes:30002593 (28.6 MiB)  TX bytes:3268821 (3.1 MiB)               Memory:fb920000-fb940000          eth0:0    Link encap:Ethernet  HWaddr 0c:c4:7a:02:5d:36                 inet addr:198.50.241.112  Bcast:198.50.241.255  Mask:255.255.255.0               UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1               Memory:fb920000-fb940000           lo        Link encap:Local Loopback                 inet addr:127.0.0.1  Mask:255.0.0.0               inet6 addr: ::1/128 Scope:Host               UP LOOPBACK RUNNING  MTU:16436  Metric:1               RX packets:2191 errors:0 dropped:0 overruns:0 frame:0               TX packets:2191 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:0                RX bytes:2781224 (2.6 MiB)  TX bytes:2781224 (2.6 MiB)          root@greece:~# route     Kernel IP routing table     Destination     Gateway         Genmask         Flags Metric Ref    Use Iface     default         192.99.46.254   0.0.0.0         UG    0      0        0 eth0     192.99.46.0     *               255.255.255.0   U     0      0        0 eth0     198.50.241.0    *               255.255.255.0   U     0      0        0 eth0          root@greece:~# iptables -nvL     Chain INPUT (policy DROP 0 packets, 0 bytes)      pkts bytes target     prot opt in     out     source               destination               1088  987K ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0            ctstate RELATED,ESTABLISHED         1    84 ACCEPT     all  --  *      *       198.50.241.0/24      0.0.0.0/0                    1    60 ACCEPT     all  --  *      *       0.0.0.0/0            198.50.241.0/24              1    72 ACCEPT     all  --  lo     *       0.0.0.0/0            0.0.0.0/0                    0     0 DROP       all  --  *      *       0.0.0.0/0            0.0.0.0/0            ctstate INVALID         0     0 ACCEPT     icmp --  *      *       0.0.0.0/0            0.0.0.0/0            icmptype 8 ctstate NEW        40 13120 UDP        udp  --  *      *       0.0.0.0/0            0.0.0.0/0            ctstate NEW         0     0 TCP        tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            tcpflags: 0x17/0x02 ctstate NEW        40 13120 REJECT     udp  --  *      *       0.0.0.0/0            0.0.0.0/0            reject-with icmp-port-unreachable         0     0 REJECT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            reject-with tcp-reset         0     0 REJECT     all  --  *      *       0.0.0.0/0            0.0.0.0/0            reject-with icmp-proto-unreachable          Chain FORWARD (policy ACCEPT 109 packets, 7776 bytes)      pkts bytes target     prot opt in     out     source               destination          Chain OUTPUT (policy ACCEPT 854 packets, 1879K bytes)      pkts bytes target     prot opt in     out     source               destination          Chain TCP (1 references)      pkts bytes target     prot opt in     out     source               destination         0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            tcp dpt:22          Chain UDP (1 references)      pkts bytes target     prot opt in     out     source               destination     root@greece:~# sysctl net.ipv4.ip_forward     net.ipv4.ip_forward = 1      This configuration should work. I can reach the host's main IP (192.99.46.35) from the VMs. I get an interesting response when I try to ping the hosts gateway (192.99.46.254).               root@minecraft:~# ping -c 2 192.99.46.254     PING 192.99.46.254 (192.99.46.254) 56(84) bytes of data.     From 198.50.241.112: icmp_seq=1 Redirect Host(New nexthop: 192.99.46.254)     64 bytes from 192.99.46.254: icmp_req=1 ttl=254 time=47.1 ms          --- 192.99.46.254 ping statistics ---     2 packets transmitted, 1 received, 50% packet loss, time 1002ms     rtt min/avg/max/mdev = 47.134/47.134/47.134/0.000 ms     root@minecraft:~# ping -c 2 192.99.46.254     PING 192.99.46.254 (192.99.46.254) 56(84) bytes of data.     From 198.50.241.115 icmp_seq=1 Destination Host Unreachable     From 198.50.241.115 icmp_seq=2 Destination Host Unreachable          --- 192.99.46.254 ping statistics ---     2 packets transmitted, 0 received, +2 errors, 100% packet loss, time 1011ms     pipe 2      It responds to redirect the host and then after than the host in unreachable. It should work as far as I know. The configuration has not changed. The guest VM has a very simple configuration...               root@minecraft:~# ifconfig     eth0      Link encap:Ethernet  HWaddr 08:00:27:8e:9b:2b                 inet addr:198.50.241.115  Bcast:198.50.241.255  Mask:255.255.255.0               inet6 addr: fe80::a00:27ff:fe8e:9b2b/64 Scope:Link               UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1               RX packets:750 errors:0 dropped:0 overruns:0 frame:0               TX packets:336 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:1000                RX bytes:79663 (77.7 KiB)  TX bytes:30405 (29.6 KiB)          lo        Link encap:Local Loopback                 inet addr:127.0.0.1  Mask:255.0.0.0               inet6 addr: ::1/128 Scope:Host               UP LOOPBACK RUNNING  MTU:16436  Metric:1               RX packets:48 errors:0 dropped:0 overruns:0 frame:0               TX packets:48 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:0                RX bytes:4405 (4.3 KiB)  TX bytes:4405 (4.3 KiB)          root@minecraft:~# iptables -nvL     Chain INPUT (policy ACCEPT 0 packets, 0 bytes)      pkts bytes target     prot opt in     out     source               destination                   Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)      pkts bytes target     prot opt in     out     source               destination                   Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)      pkts bytes target     prot opt in     out     source               destination          # route     Kernel IP routing table     Destination     Gateway         Genmask         Flags Metric Ref    Use Iface     default         198.50.241.112  0.0.0.0         UG    0      0        0 eth0     localnet        *               255.255.255.0   U     0      0        0 eth0      Note: flushing the IP tables and setting the input policy to accept does not change anything. This is not a NAT configuration, the guests have proper internet addresses.


title: Bluetooth not working in fresh Mint Maya install

text: I have a fresh Mint Maya install (MATE WM). Out of the box, the bluetooth applet appeared on the taskbar, but it wouldn't launch. After an upgrade from apt, it doesn't even appear on the taskbar anymore. Trying to run the appropriate programs directly fails like this:               $ mate-bluetooth-     mate-bluetooth-applet      mate-bluetooth-sendto     mate-bluetooth-properties  mate-bluetooth-wizard     $ mate-bluetooth-applet           ** (mate-bluetooth-applet:12517): WARNING **: Applet     is already running, exiting     $ mate-bluetooth-properties           (mate-bluetooth-properties:12521): Unique-DBus-WARNING     **: Error while     sending message: Did not receive a     reply. Possible causes include: the rem ote application     did not send a reply, the message bus security policy     blocked the reply, the reply timeout expired, or the     network connection was broken.     $ mate-bluetooth-wizard           (mate-bluetooth-wizard:12602): Unique-DBus-WARNING     **: Error while sending message: Did not receive a     reply. Possible causes include: the remote application     did not send a reply, the message bus security policy     blocked the reply, the reply timeout expired, or the     network connection was broken.


title: Is there a better way than cp to copy millions of files while preserving hard links?

text: So in this story on the GNU coreutils ML, someone used cp to copy 430 million files and needed to preserve hard links, and _just barely_ got it to finish after 10 days. The big problem was that, in order to preserve hard links, cp has to keep a hashtable of already copied files, which took up 17GB of memory towards the end and had the system thrashing on swap. Is there some utility that would have handled the task better?


title: Can I use Unix to load-balance two Linux servers?

text: I'm trying to work out a solution in my head where two backend linux-servers run HTTP, SMTP, XMPP mirrored and should load balance connections between them. My current solution is an OpenBSD box infront, that can of course be extended with carp to add more in the future to avoid single point of failure. Using PF I could have a pool of servers to send traffic to, using random or round-robin methods. And using relayd I can remove non-functioning pool-servers from it. But I would value the opinions of the community on this matter, so please tell me your best Unix load balancing solution for this type of environment. One goal would be that a single server should be allowed to fail with minimal service interruption.


title: Print UTF-8 file with command line tools

text: I want to print a file using a command like `cat filename > /dev/lp0` where the file contains characters like `ùàç` encoded in UTF-8. Is this is possible or do I need to use CUPS? I'm using an embedded Linux with a Debian file system and 3.10 kernel version.


title: How can I deny internet access to all processes except the chosen ones?

text: Sometimes I am forced to use really narrow Internet bandwidth of 56kbps. On my Ubuntu desktop I have too many programs, that frequently check something on the net - and hunting and disabling them one-by-one is really troublesome. I'd like to have some tool, that would deny internet access (by whatever means) to every process except the e.g. the mail client. Is it possible at all? If so, how? I imagine, that one way to accomplish it is to open another network device (like `/dev/tap1`) and set it to route into the `/dev/wlan0` (my usual internet device) and guard everything with custom `iptables` rules, that can be switched on and off. But I am no expert at iptables, so that sort solution, unless someone gives me specific instructions, is useless.


title: Dual Boot with Grub: can't boot Arch Linux

text: ### My history I got a PC with Intel 64 Bit Processor. There I have installed Ubuntu 14.04 LTS at `/dev/sdb1` and Arch Linux at `/dev/sda1`. Both use swap on `/dev/sdb2`. I tried (with success) to install Arch Linux onto a SD-Card (`/dev/sdc`) for my Raspberry Pi. There I tried to install `vim` to the SD-Card using `pacstrap`. This produced a few errors. Then I unplugged my SD-Card reader. After rebooting my PC I saw a `GRUB_RESCUE>` prompt, and the line:               error:no such device:5a28b060-333c-479a-b5ed-58a7b9d8ae77.      **NOTE:** This is the UUID of my Ubuntu partition (`/dev/sdb1`) ### My first try Then I used my _amd64 boot repair disc_ and installed GRUB onto `/dev/sdb`. Then I had to disable `/dev/sda` in the BIOS and Ubuntu is booting nicely. **NOTE:** Arch wasn't showing up at this moment. Then I ran `sudo update-grub` and rebooted. Then Arch Linux was shown up but if I selected: " _Arch on /dev/sda1_ " my sata disk or something like that produced a ugly sound and my PC rebooted. The output was:               :~$ sudo update-grub     Grub-Konfigurationsdatei wird generiert …              #generating grub.cfg     Linux-Abbild gefunden: /boot/vmlinuz-3.13.0-35-generic     #Linux-image found     initrd-Abbild gefunden: /boot/initrd.img-3.13.0-35-generic     Linux-Abbild gefunden: /boot/vmlinuz-3.13.0-34-generic     initrd-Abbild gefunden: /boot/initrd.img-3.13.0-34-generic     Linux-Abbild gefunden: /boot/vmlinuz-3.13.0-33-generic     initrd-Abbild gefunden: /boot/initrd.img-3.13.0-33-generic     Linux-Abbild gefunden: /boot/vmlinuz-3.13.0-32-generic     initrd-Abbild gefunden: /boot/initrd.img-3.13.0-32-generic     Found memtest86+ image: /boot/memtest86+.elf     Found memtest86+ image: /boot/memtest86+.bin     Arch auf /dev/sda1 gefunden             #found Arch on /dev/sda1     erledigt                          #done       Interestingly GRUB says that it only found Arch on `/dev/sda1`. ### My second try Then I tried to install GRUB onto `/dev/sda` and activated `sda` in the BIOS. Then my machine produced again this ugly sound and I had to start again with the _boot repair disc_. ### My third try Is this here. I checked the `/boot` folder of Arch and of Ubuntu, the differences are:   * Arch has got two `initramfs.img` (one is fallback) images   * Ubuntu has got a few `initrd.img` images(different versions)   * Ubuntu has got a few `System.map` files(see above)   * Ubuntu has got a few config files(again for the different versions)   * Ubuntu has got a few 'abi' files(what's that?) And the filesystem of my Arch-partition is not damaged. By the way I don't want to re-install Arch because my installation is at a point where it would be really a _lot_ work to rebuild the system. Could it be that my MBR of `/dev/sda` are damaged? Now I want to be able again to start both Operating Systems properly, but I'm at a loss on how to resolve my issue.


title: Apc is not working in php 5.5

text: I install APC in ubuntu server where php version is 5.5.9. When I see apc. php it is enabled but it not properly work. In php info               APC support     Emulated       2nd one apcu is               Version     4.0.2     APCu Debugging  Disabled     MMAP Support    Enabled     MMAP File Mask  no value     Serialization Support   php, eval     Revision    $Revision: 328290 $      Please help


title: How well do Chromebooks support other Linux distributions?

text: As many manufacturers of Notebooks do not offer any Notebooks without Windows preinstalled anymore, the next best thing would be a Chromebook.   I'd like to know how well do/will other Linux Distributions like Ubuntu and Fedora work on these new Chromebooks? I talk about all kind of drivers, battery lifespan and so on. _Also, is it right to assume that since Chrome OS is a Linux flavor, drivers **will** be released to the Open Source Community?_


title: rsync gives "chown <...> failed: Invalid argument (22)" with nfs share

text: I'm trying to back up my entire system to an external disk using rsync, via a shell script which is run as root:               #!/bin/bash     rsync -vSHPhhaX --numeric-ids --delete --exclude-from=/home/rena/.scripts/exclude-list / /home/rena/video/.backup/>/home/rena/video/.backup.log      This script is running on the machine "akira". Originally, /home/rena/video was a USB hard disk attached directly to akira, and the script worked fine. Recently I moved the disk; now it's mounted at the same path on another machine "yuki", and shared via NFS. So akira:/home/rena/video still refers to the same USB hard disk, only now it's attached to yuki and shared via nfs, instead of attached to akira directly. The disk is using ext3 and encrypted with Truecrypt. yuki's /etc/exports is:               /home/rena  akira(rw,subtree_check,nohide,no_root_squash) rei(rw,subtree_check,nohide,no_root_squash)     /home/rena/video    akira(rw,subtree_check,nohide,no_root_squash) rei(rw,subtree_check,nohide,no_root_squash)      Now rsync gives an error for every file:               rsync: chown "/home/rena/video/.backup/boot/System.map-2.6.38-8-generic" failed: Invalid argument (22)      nfs seems to be "squashing" even though it's told not to?               rena@akira $ stat /home/rena/video/.backup/boot/abi-2.6.38-10-generic       File: `/home/rena/video/.backup/boot/abi-2.6.38-10-generic'       Size: 730457          Blocks: 1440       IO Block: 65536  regular file     Device: 19h/25d Inode: 38822526    Links: 1     Access: (0644/-rw-r--r--)  Uid: (65534/  nobody)   Gid: (65534/ nogroup)     Access: 2011-10-19 22:17:12.000000000 -0600     Modify: 2011-06-28 13:19:43.000000000 -0600     Change: 2011-10-19 22:17:12.000000000 -0600          rena@yuki $ stat /home/rena/video/.backup/boot/abi-2.6.38-10-generic       File: `/home/rena/video/.backup/boot/abi-2.6.38-10-generic'       Size: 730457      Blocks: 1440       IO Block: 4096   regular file     Device: fc04h/64516d    Inode: 38822526    Links: 1     Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)     Access: 2011-10-19 22:17:12.000000000 -0600     Modify: 2011-06-28 13:19:43.000000000 -0600     Change: 2011-10-19 22:17:12.000000000 -0600      from akira, the UID and GID appear different; maybe the reason for rsync failing? [edit] In fact it looks like from akira, _every_ file on the share has UID and GID 65534/nobody.


title: Can not mount internal driver in Archbang 2014

text: I have just installed archbang 2014 on my laptop Asus K53SV. I followed the instruction on Archbang wiki. I have already installed `ntfs-3g`, but I can not access to the internal (ntfs-formatted) devices. The computer said that : **udevil: denied 88: device /dev/sda5 is an internal device and you're not root** I have already install `udevil` also. What is my problem? I heard that may be the etc/fstab is wrong, and here is mine:               #     # /etc/fstab: static file system information     #     # <file system> <dir>   <type>  <options>       <dump>  <pass>     UUID=9120f084-24b3-4047-b082-58a720a73433 / ext4 defaults 0 1      Here is the result after running `lsblk -f`               NAME   FSTYPE LABEL           UUID                                 MOUNTPOINT     sda                                                                     ├─sda1 ntfs   System Reserved 8E34628434626F61                          ├─sda2 ntfs                   16506B15506AFB3F                          ├─sda3 ext4                   9120f084-24b3-4047-b082-58a720a73433 /     ├─sda4                                                                  ├─sda5 ntfs   D               166016C36016A98F                          └─sda6 ntfs   E               3A07C62FDB62B589                          sr0               Please help me. Thanks.


title: VirtualBox appliance import locks up system

text: I have a Windows Vista x64 appliance that I am trying to import into the Open Source Edition of VirtualBox on Linux Mint 11 x86-64. The **ovf** file is 21.3 GB in size. The problem I am having is that every time I attempt to import said appliance, Virtual Box slowly begins to consume all 8 GB of RAM that I have in the system; at which point, the OS locks up. Would limiting the amount of memory the VirtualBox process can _use_ be the best solution?


title: On Gentoo, how do I rebuild all packages depended on some other package?

text: I made mistake and changed perl non-threaded version to threaded by unmerge first, change `USE` flags to include ithreads and emerge perl again. Now most packages depending on perl are broken. How do I rebuild them?


title: convert a hex string to binary and send with netcat

text: I have a binary file that I can send with `netcat`:               $ nc -l localhost 8181 < my.dat      The file contains this:               $ xxd my.dat     0000000: 0006 3030 3030 4e43                      ..0000NC      What I really want to do is send the hex string directly. I've tried this:               $ echo '0006303030304e43' | nc -l localhost 8181      However, the above command just sends the ascii string directly to `nc`.


title: virt-install complains "error: no such option: --network-bridge:br0"

text: I was following the directions here to set up a VM in CentOS 6.4 i386/686. But I'm getting this error:               $ sudo virt-install --network-bridge:br0 --name vm1 --ram=1024 --vcpus=1 --disk path=/var/lib/libvirt/images/vm1.img,size=10 --cdrom ~/winxp.iso     Usage: virt-install --name NAME --ram RAM STORAGE INSTALL [options]          virt-install: error: no such option: --network-bridge:br0      Sure enough, `virt-install --help` doesn't list that as an option. But it also doesn't list `\--cdrom`, `\--disk`... Does it mean I didn't set up `br0` right? (I followed the guide pretty closely. I wasn't sure how to verify that what it's looking for is present.) I ought to specify, I have no GUI installed--used the 'minimal' ISO. **UPDATE**               $ sudo -i brctl show     bridge name     bridge id               STP enabled     interfaces     br0             8000.0040caab50b8       no              eth0     virbr0          8000.525400dfd8ac       yes             virbr0-nic      Maybe I don't understand--I thought a VM needed an OS to be created? Or I guess you create the VM, and it's pretending to be bare metal, and then you can go into the VM and tell it to use a CD ISO as the CD drive, and install the OS from there? So at this point with your modified XML file and restarted libvirtd, I have KVM running and vm1 running on it, ready to have an OS installed? The thing is, virt-install still gives this error. IMO it for some reason doesn't have the switch named --network-bridge built into it, but I have no idea why that would be. Wrong version? Compiled without an option? I forgot to install a dependency of some kind? These all seem improbable to me, I thought network bridging is pretty standard for a VM, hence my posting a question here in the first place. :) Sorry if I'm babbling but I'm really just stuck on the virt-install command step.


title: Yum Returns Errors when using

text: When I try to use Yum (e.g. `# yum update`) I get an error and it prevents me from using Yum. Any help on this would be really cool! This is the error that I get when I try to run a Yum command:               # yum update     Setting up Update Process     Setting up repositories     not using ftp, http[s], or file for repos, skipping - 4 is not a valid release or hasnt been released yet     Cannot find a valid baseurl for repo: update     Error: Cannot find a valid baseurl for repo: update      Here is the content of the `CentOS-Base.repo` file:               [base]     name=CentOS-$releasever - Base     mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os     #baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/     gpgcheck=1     gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4     protect=1          #released updates      [update]     name=CentOS-$releasever - Updates     mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates     #baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/     gpgcheck=1     gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4     protect=1           #packages used/produced in the build but not released     [addons]     name=CentOS-$releasever - Addons     mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=addons     #baseurl=http://mirror.centos.org/centos/$releasever/addons/$basearch/     gpgcheck=1     gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4     protect=0           #additional packages that may be useful     [extras]     name=CentOS-$releasever - Extras     mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras     #baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/     gpgcheck=1     gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4     protect=0           #additional packages that extend functionality of existing packages     [centosplus]     name=CentOS-$releasever - Plus     mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus     #baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/     gpgcheck=1     enabled=0     gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4     protect=0           #contrib - packages by Centos Users     [contrib]     name=CentOS-$releasever - Contrib     mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib     #baseurl=http://mirror.centos.org/centos/$releasever/contrib/$basearch/     gpgcheck=1     enabled=0     gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4     protect=0      Thanks in Advance! Max Kulik


title: Is there any guarantee that /usr/bin/env will exist?

text: Often I will see scripts begin with a shebang line that uses `#!/usr/bin/env interpreter_name` for whatever interpreter, with the rationale that different systems might have the interpreter that they need in order to run installed in different places. For instance, if I assume `python` is installed as `/usr/bin/python` then some user who decided to install it as `/opt/python` for some reason won't be able to use it as easily. But the obvious question is, is there any guarantee that `env` will be installed at `/usr/bin/env` (or for that matter any particular place), or is this just a case of "moving the problem" so to speak? This slightly related question has a comment that says it's a bad idea and it's preferable to install it with the actual path of the interpreter and cites the single unix specification but does not really address this question.


title: On Gentoo how do I find list of packages installed after some specific date?

text: I have Gentoo VM that I use to test different puppet recipes and I frequently need to remove packages to bring it to clean initial state. While I could do this by hand when there are only few packages installed (and remove dependencies with `emerge -av --depclean`) but there are some recipes involving installation of few dozen of perl modules which I need to clean after testing. I think about packing them into single virtual ebuild but I already have test system dirty with many installed packages and I want to avoid reviewing them one by one. So question is _how do I find list of packages installed after some specific date_?


title: Ignore escape characters when printing string in shell script

text: I just wrote a simple shell script to save a LaTeX expression as a PNG file. It works fine, except for the LaTeX-syntax for "next row", i.e. the double backslash \\. When for instance my input expression is like this:               \left( \begin{array}{cc}1 & 2\\ 3 & 4\end{array} \right)      The double backslash is reduced to a single one. I know I can add more backslashes in my expression, but I want those expressions to be genuine LaTeX, not some weird LaTeX-bash combination. My script:               #!/bin/bash          if [ $# -ne 2 ]; then         echo -e "Er moeten twee argumenten worden opgegeven:\n(1) LaTeX code\n(2) Bestandsnaam zonder extensie"     else         SaveDir="/home/pieter"         echo "\documentclass{article}\usepackage[utf8x]{inputenc}\pagestyle{empty}\begin{document}\[ $1 \]\end{document}" > /tmp/$2.tex         latex -output-directory /tmp -interaction=batchmode $2.tex         dvips -o /tmp/$2.ps -E /tmp/$2.dvi         convert -units PixelsPerInch -density 200 /tmp/$2.ps -trim $SaveDir/$2.png     fi      So, how can I ignore the escape characters and literally print my LaTeX expression? Preferably without using sed.


title: hibernate / suspend problems

text: ### Problem The `Fn`-`F4` function key combination does not result in hibernating, instead it resets the internet connection instead ### Symptoms `pm-hibernate` and `pm-suspend` just reset the connection. `hibernate` works, as does `s2both`. ### Setup Lenovo X230, updated Debian testing, 3.14 kernel, i3 wm, lightdm, xfce4-power- manager. On Lenovos, `Fn`-`F4` is a special function key, which is supposed to hibernate the machine (moon symbol). Since `pm-hibernate` is not working, the idea was to change the handler to `s2both`. I cannot find the script responsible for handling the key press though. Other system keys work as expected (volume, mute, etc). Things I've tried:   1. Catching `XF86Sleep` or `XF86WakeUp` in `.i3/config` (my window manager config file). This file is handling some of the other special buttons like `XF86AudioRaiseVolume`. Variations on`bindsym XF86Sleep exec "hibernate"`. No effect.   2. Switching out the backend for pm by adding `SLEEP_MODULE=uswsusp` in `/etc/pm/config.d/module`. No effect.   3. Modyfying `etc/acpi/sleep_suspend.sh` to use `hibernate` or `s2both`. No effect.   4. Poking around `xfce4-power-manager` setting GUI. Nothing here. ### Questions   * Can someone please explain who is handling the power options here? ACPI? xfce4-power-manager?   * What is the relationship between these?   * What happens when I press `Fn`-`F4`?   * Who is handling the key press and how do I change / fix it?   * What is the best practice for handling suspends / hibernates gracefully?


title: On Gentoo is there a way to find a list of installed packages which doesn't have other packages depended on them?

text: On Gentoo, is there a way to find a list of installed packages which doesn't have other packages depended on them (so called leaf packages)? Or, is there analog of `pkg-orphan` FreeBSD utility?


title: Shell: How to read the bytes of a binary file and print as hexadecimal?

text: In shell, how can I read the bytes of a binary file I have, and print the output as hexadecimal numbers?


title: how to avoid ssh asking permission?

text: We are attempting to speed up the installation of oracle nodes for RAC installation. this requires that we get ssh installed and configured so that it doesn't prompt for a password. The problem is: On first usage, we are prompted for               RSA key fingerprint is 96:a9:23:5c:cc:d1:0a:d4:70:22:93:e9:9e:1e:74:2f.     Are you sure you want to continue connecting (yes/no)? yes      Is there a way to avoid that or are we doomed to connect at least once on every server from every server manually?


title: Automated SFTP upload with curl

text: I want a file to be uploaded daily to remote server using automated ftp command. Can someone please help me on this below command to check whether it's right or wrong?               curl -Tu username:password /path/to/dir/*(om[1]) sftp://sftp.example.com/remote/dir      where   * `username:password` is my own username and password.   * `/path/to/dir/*(om[1])`: to get the latest(updated) file from my local dir   * `sftp://sftp.example.com/remote/dir`: secure file transfer


title: rsync error: Time value of file truncated on receiver

text: I run the following rsync command to back up my data. I am on Ubuntu 12.04.               rsync -rt --delete --links --exclude-from '/home/john/rsync-exclude.txt' /media/data/ server:/backup/data      The data partition is NTFS formatted and mounted via `/etc/fstab` as follows.               UUID=371EB137049A5349 /media/data ntfs defaults,umask=007,uid=1000,gid=1000 0 0      The target disc is a RAID formatted with ext4. Some of the files, however, seem to have the wrong time stamp which results in the following error message.               Time value of /media/data/20090513/090513_185507.jpg truncated on receiver.     Time value of /media/data/20090513/090513_194115.jpg truncated on receiver.     rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1070) [sender=3.0.9]      Here is what the files look like on the source disc.               -rwxrwx--- 2 john 2.0M May 13  2009 090513_185357.jpg     -rwxrwx--- 2 john 1.5M May 13  2009 090513_185458.jpg     -rwxrwx--- 2 john 1.6M Jul 29  28617 090513_185507.jpg <---     -rwxrwx--- 2 john 1.8M May 13  2009 090513_185520.jpg     -rwxrwx--- 2 john 2.4M May 13  2009 090513_194047.jpg     -rwxrwx--- 2 john 2.2M May 13  2009 090513_194101.jpg     -rwxrwx--- 2 john 2.1M Jul 29  28617 090513_194115.jpg <---     -rwxrwx--- 2 john 2.4M May 13  2009 090513_194135.jpg      This is what the file look like on the target disc.               -rwxr-x---    1 root     root       1863446 May 13  2009 090513_185357.jpg     -rwxr-x---    1 root     root       1863446 May 13  2009 090513_185458.jpg     -rwxr-x---    1 root     root       1573733 Aug  8 04:18 090513_185507.jpg <---     -rwxr-x---    1 root     root       1863446 May 13  2009 090513_185520.jpg     -rwxr-x---    1 root     root       2504805 May 13  2009 090513_194047.jpg     -rwxr-x---    1 root     root       2297826 May 13  2009 090513_194101.jpg     -rwxr-x---    1 root     root       2147897 Aug  8 04:18 090513_194115.jpg <---     -rwxr-x---    1 root     root       2455909 May 13  2009 090513_194135.jpg      Should I try to fix the time stamp of the files or should I add some option to rsync? Whatever you recommend, please give reasons and provide the relevant commands to do so.


title: Why does my Debian VMWare virtual machine lose all network connections ~15 minutes after boot?

text: I’m having a strange networking problem with a Debian (6) VMWare virtual machine on my Mac. Around 15 minutes after starting it up, I can no longer SSH into, view websites served from, or ping the VM. I usually run the VM in headless mode, using `vmrun -T fusion start VIRTUALMACHINEPATH nogui`, but the problem occurs when I start the virtual machine via VMWare.app too. When I use `ifconfig` to check the machine’s IP address once the network connections have failed (which I do via the GUI — launching VMWare.app after the server is inaccessible in headless mode gives me a GUI access to the server), the following line is missing:                inet addr:192.168.231.137  Bcast:192.168.231.255  Mask:255.255.255.0      (This line is present when I boot up; it disappears after the network connections go down.) This started happening yesterday, seemingly for no reason — the VM’s been running fine for a couple of weeks. I installed rsync on the VM yesterday, and was writing some Python code that used `subprocess` to start Xvfb and Selenium Server. I don’t know if that code somehow managed to permanently bork networking on the VM. I’ve tried copying the .vdmx files and opening them in a VirtualBox virtual machine. The network issue doesn’t seem to happen there (i.e. the `inet addr` line in `ifconfig` stays present for over an hour); however, VirtualBox VMs don’t by default make the virtual machine accessible on the network, whereas VMWare seems to do so. I haven’t figured out how to turn on NAT port forwarding for incoming connections to the VirtualBox VM in the same way that VMWare is set up. (Both my VMWare and VitualBox virtual machines use NAT for networking.) I’m a total networking idiot, so I don’t know if this is a VMWare issue, something I’ve managed to do in Linux, or some sort of random external attack — hence the cross-posting.


title: Trouble in script with spaces in filename

text: I've got a script that scp's a file from remote host back to local. Sometimes the file names contain spaces. scp does not like spaces in its file names. For some reason my attempts at handling the spaces have not resulted in the correct scp path. Code:               PATH=/var/root/Documents/MyFile OG-v1.2.3.pkg     scp $PATH Me@10.1.10.33:/Users/Me/Desktop      Results in               Cannot find directory: var/root/Documents/MyFile     Cannot find directory: OG-v1.2.3.pkg      Enclosing PATH in quotes `"$PATH"` gives the same error. Swapping the spaces for escaped spaces also is not working, although as far as I can tell it should:               ESC_PATH=${PATH/' '/'\ '}      although printing the escaped path shows that the edit worked:               echo $ESC_PATH     > /var/root/Documents/MyFile\ OG-v1.2.3.pkg


title: How to export a private PGP email key

text: I have made a keypair for my email address using `gnupg`. I thought that I should probably keep a backup of it so that if I lose my desktop computer I can continue using the same key. Is this the correct thinking? How can I export my _private_ key / the whole pair?


title: zsh !! and !$ auto execute as it does in bash

text: I recently made the switch from bash to zsh. I discovered two minuscule issues and differences between zsh and bash. I was slightly disappointed when my favorite two shortcuts `!!` & `!$` don't behave as they do in bash. When I try to the following with the argument shortcuts (sorry I don't know what they're formally called) they would automatically execute like the following in bash:               $ touch foo     $ vim !$     <file opens immediately>      While in zsh they become translated then executed (I have to hit enter one extra time):               $ touch foo     $ vim !$     $ vim foo      Is there a way to have `!$` & `!!`, in zsh, behave the same way as it does in bash?


title: Unblanking a Linux Terminal Display

text: I am running an Ubuntu Server that boots to the console. After a long wile, the screen goes blank and I cannot type or unblank the screen. Even the caps lock / num lock do not change states. I am however, able to SSH into the computer. Is there a way I can unblank the tty1 over SSH? Is it possible to do this from the keyboard + not logged in + blank screen?


title: Should I care for applications that increase the system Load in order to prevent overheating?

text: I found that my "PCI Adapter" overheats when load is above 4.0 (having 4 cores). It does NOT overheat when the load is below 4.0 (but I had an overclocked memory that was causing trouble as I explain at the end), so my focus is on lowering the system load. What overheats is just the `k10temp- pci-00c3 PCI Adapter` (according to **sensors** ). **The mistake:**   I am trying to track applications that compose that value, and how much each did. From this question, I found `atop`, but reading its output, it is not clear what applications composed the system load... It is like a "simple" column showing _SYSLOAD_ is missing. It seems I could use all that displayed information to calculate something that could show such column, but I just don't know how. The explanations I found about system load seems too generic (I can be wrong..), so I couldn't understand them enough to produce an algorithm; I think I should mix some data like cpu usage, io usage, mem usage and so get the sysload even if it is somewhat fuzzily guessed... **Precise info on how system Load works** :   on this question there is a reference to a pdf explaining it. Load seems not exactly related to specific applications... **Still need a workaround** :   Anyway I still would like to know how possible it is to make an application approach about system load, may be there is some way to prioritize the whole system utilization to some specific application, while all the others clogging it, even when they are NOT using much cpu (less than 3%), calm down? **Tests on-going** :   I set all processes to `nice -n 19`, but the one window/process I am actively using; I saw improvement on the temperature graph with psensor (the graph is a lot less fuzzy); the temperature is holding longer, below the limit, now; all processes seems to be behaving as expected; the system load is still high but I saw it once go til 6.0 and the temperature was still fine; no sudden shutdowns since.. need more test tho... **Finally the culprit was found** :   My memory was supposed to accept 2000MHz. Long ago I set it to work at 1600MHz, because the machine would not boot otherwise. Now I set it to automatic, what made it work at 1333MHz. The temperature _k10temp-pci-00c3_ that was overheating (reaching above 80c) now is consistent around 60c when I run heavy applications! Also the load average is around 3.5 to 4.0 without causing any hardware problems! The _nice 19_ on processes helped postpone the overheating indeed, but wasnt able to totally prevent it!


title: Why does my X11 forwarding attempt fail with "connect /tmp/.X11-unix/X0: No such file or directory"?

text: On my local machine, I run:               ssh -X me@remotemachine.com      (For completeness, I have also tested all of the following using -Y with identical results). As expected, this accesses remotemachine.com fine, and all appears well. If I then attempt to run xcalc however, I get:                connect /tmp/.X11-unix/X0: No such file or directory      Error: Can't open display: localhost:10.0      But,               $ ls -la /tmp/.X11-unix/     total 36     drwxrwxrwt 2 root root  4096 2012-11-23 09:29 .     drwxrwxrwt 8 root root 32768 2012-11-29 08:22 ..     srwxrwxrwx 1 root root     0 2012-11-23 09:29 X0      So not only does /tmp/.X11-unix/X0 exist, it has universal r/w/x permissions! I've previously used x-forwarding without issue, though not in some time... uname -a on the server for reference:               Linux machinename 2.6.32-25-generic #45-Ubuntu SMP Sat Oct 16 19:52:42 UTC 2010 x86_64 GNU/Linux      Been searching around on the web for a couple hours now without success. Other mentions of the same problem, but no solutions.


title: What is a "non-option argument"?

text: I am trying to understand `info who` but completly fail at the term » _non- option argument_ «. Can someone please explain this term to me in simple words or an example? **UPDATE** : from ' info who' : > If given **no non-option arguments** , `who' prints the following > information for each user currently logged on: login name, terminal line, > login time, and remote hostname or X display. > > If given **one non-option argument** , `who' uses that instead of a default > system-maintained file (often`/var/run/utmp' or `/etc/utmp') as the name of > the file containing the record of users logged on. `/var/log/wtmp' is > commonly given as an argument to `who' to look at who has previously logged > on. > > If given **two non-option arguments** , `who' prints only the entry for the > user running it (determined from its standard input), preceded by the > hostname. Traditionally, the two arguments given are`am i', as in `who am > i'. I [thought to] know the difference between an argument and an option, but this [again] nixes a lot.


title: Unable to mount raid on my NAS, trying to rescue the data, how should I proceed?

text: A short backstory: something happened on my Synology NAS, apparently a buggy mailserver program that came with an update stopped the device from seeing the 2x3TB drives I have. After a lot of searching and a trying a lot of different solutions I eventually got the drives to show up again but they would not mount. After struggling, I figured that, because it was set up as a mirror, I could format one drive, mount it and perform the recovery on the other. EDIT: I had it wrong and was trying to mount the wrong disk (not used to messing around with raid), however, I'm still unable to mount the correct disk, `sda`               $ file -s /dev/sda1     /dev/sda1: data               $ mount -t ext4 /dev/sda1 /mnt                    mount: mounting /dev/sda1 on /mnt failed: Invalid argument **Further Info**               $ cat /proc/mounts     rootfs / rootfs rw 0 0     /dev/root / ext4 rw,relatime,barrier=0,journal_checksum,data=ordered 0 0     /proc /proc proc rw,relatime 0 0     /tmp /tmp tmpfs rw,relatime 0 0     none /dev/pts devpts rw,relatime,gid=4,mode=620 0 0     /sys /sys sysfs rw,relatime 0 0     /proc/bus/usb /proc/bus/usb usbfs rw,relatime 0 0     /dev/vg1000/lv /volume1 ext4 rw,relatime,synoacl,barrier=0,journal_checksum,data=writeback,jqfmt=vfsv0,usrjquota=aquota.user,grpjquota=aquota.group 0 0     /dev/vg1000/lv /opt ext4 rw,relatime,synoacl,barrier=0,journal_checksum,data=writeback,jqfmt=vfsv0,usrjquota=aquota.user,grpjquota=aquota.group 0 0


title: Different colour for the KiB range in `ls -l`

text: Is there any sane way to highlight the 4th, 5th, and 6th columns from the right of the file size in `ls -l`? My intention is to make it easy to read a file size be it in bytes, KiBs, or MiBs. I do know about the `-h` flag, but I find that having to interpret the letters at the end is more cumbersome than just looking and seeing the length of the number (magnitude). This is the same reason why race cars use analogue dials instead of digital. My target shell is Bash. Thanks. **EDIT:** I am looking to highlight the thousands, ten thousands, and one hundred thousands places of the size column. Like this: 123 **456** 789


title: How to convert a color pdf to black-white?

text: I'd like to transform a pdf with some coloured text and images in another pdf with only black&white, in order to reduce its dimensions. Moreover, I would like to keep the text as text, without transforming the pages elements in pictures. I tried the following command:               convert -density 150 -threshold 50% input.pdf output.pdf      found in another question, a link, but it does what I don't want: the text in the output is transformed in a poor image and is no longer selectable. I tried with Ghostscript:               gs      -sOutputFile=output.pdf \             -q -dNOPAUSE -dBATCH -dSAFER \             -sDEVICE=pdfwrite \             -dCompatibilityLevel=1.3 \             -dPDFSETTINGS=/screen \             -dEmbedAllFonts=true \             -dSubsetFonts=true \             -sColorConversionStrategy=/Mono \             -sColorConversionStrategyForImages=/Mono \             -sProcessColorModel=/DeviceGray \             $1      but it gives me the following error message:               ./script.sh: 19: ./script.sh: output.pdf: not found      Is there any other way to create the file?


title: will tail with piping read whole file?

text: I want to read a big log file with 10000 lines everytime. and I use this command: `tail -c +offset somefile | head -n 10000` my question is, with the piping of head, will tail read the whole file? updated: I know that `tail` will read from the offset pos. what I want to know is that: if the file has 20000 lines left from the offset, and the head will just print first 10000, will the tail read the left 20000 lines? or just read the first 10000 lines?


title: ffmpeg not found

text: As I had to install my system from scratch I decided to play it safe this time around and follow the documentation for compiling ffmpeg on Centos via the ffmpeg.org site. I followed every command line by line without any errors until the very final one which was to do with the bash_profile. If I look for ffmpeg on my system it just keeps saying command not found? I don't understand why the documentation installs everything in `~/` when I thought it needs to be in `/usr/bin`. I don't understand why the documentation doesn't include ldconfig command or any kind of instructions on setting the path and executing the software. update: I decided to undo what I had done because couldn't work out file paths and instead I downloaded and installed ffmpeg with rpmforge and yum and finally it is all working. I literally began learning terminal last year and it has been a very steep learning curve for me so what may seem very obvious to some eg file paths for setting up ffmpeg is not for me. Hence my great confusion.


title: Dell D610 6.5 CentOS Installation - Undetected Network Adapters

text: I've spent the better part of the day attempting to install CentOS 6.5 on an older Dell D610 laptop, using everything from a Minimal Install to the Full DVD. After multiple attempts I was able to finally install the OS, but find both the ethernet and wifi adapter remain undetected. Labels on this laptop are unreadable and I cannot determine what adapters are in fact installed. Is there any easy solution to resolving this problem, or am I better served re-installing another distro?


title: Who is behind LXLE?

text: Canonical is behind Ubuntu, and RedHat is behind RHEL/Fedora, but who funds and who manages LXLE? The website says, "User contributions through donations and store purchases help cover the administrative and hosting cost of the distribution". But, there must some company collecting and dispersing those funds. For those who aren't aware, LXLE is a "respin" of LUbuntu, and stands for "Lubuntu Extra Life Extension. This question isn't intended to be nosy. It looks like a distribution I would like to try, and I am just trying to do "due diligence" before installing software on my computer.


title: Ulimits and pam modules

text: Can you explain me the relation of ulimit setting on a proccess and line `session required pam_limits.so` in pam module. In wich modules i really require this line? I have this line in `pam.d/su` `pam.d/sudo` Do I require it in `common- session` as suggested this post for example: http://askubuntu.com/questions/162229/how-do-i-increase-the-open-files-limit- for-a-non-root-user. And why do I require it if i do ? ) And one more question: if i have               root            soft    nofile  8192     root            hard    nofile  8192      in `/etc/security/limits.conf` it automatically forbids setting all nofile ulimits for other users that wants more open files than `8192` and are allowed to do this by file in `/etc/security/limits.d/` directory ? Why does this happen ? If i don't have directives in `/etc/security/limits.conf` and spawn a program in a shell that drop's it's privileges everything is right: process has `nofile 65535` files open. But if i add               root            soft    nofile  8192     root            hard    nofile  8192      why the process can't grab it's own limits? I know that the process should inherits all limits from parent, but why in this case it is possible for a process to get higher privileges, than defaults of `root` when no `root` has no explicitly limited in `/etc/security/limits.conf` ?


title: apt-get prompts for CDs when installing packages, how do I make it stop?

text: I used ubuntu linux before, and I installed debian OS on my labtop using DVDs that I burned. But when I'm trying to use apt-get to install software, the system always asks me to insert disk to proceed. I wonder if there is a way to change the repository configuration so that I can retrieve installation files online instead of using disks.