title: Xfce and Xscreensaver doesn't seem to consider keyboard activity "activity" - how change?

text: After I upgraded from Debian Squeeze to Wheezy, the combination of Xfce and Xscreensaver doesn't seem to consider keyboard activity to be user activity. Since I sometimes use only the keyboard for long periods of time, this means that eventually the screensaver activates because of a lack of mouse input. This is somewhat of an annoyance, but another key press (or a bump on the mouse) will cause the screensaver to go away and wait another period of time before kicking in again. **How do I make the system consider keyboard input to be activity?** I looked at the screensaver preferences but couldn't find anything relevant. **Alternatively,** how do I switch to a screensaver subsystem which does accept keyboard input as user activity? (All I want is a blank screen screensaver and monitor DPMI suspend and power-off after a configurable delay in X.) In case it matters, I'm using a USB keyboard hooked directly to the PC (no USB hub in between). The mouse is also USB.


title: How to build Shallot

text: I am trying to build Shallot. I run x64 Debian Sqeeze. It runs into compile problems I don't understand...               john@hayek:~/build/katmagic-Shallot-831de01$ make     cc  -O3 -I/usr/include -I/usr/local/include -L/usr/lib -L/usr/local/lib  -Wall -o src/math.o -c src/math.c     In file included from src/math.c:3:     src/math.h:23:24: error: openssl/bn.h: No such file or directory     src/math.h:24:25: error: openssl/rsa.h: No such file or directory     src/math.h:25:25: error: openssl/sha.h: No such file or directory     In file included from src/math.c:3:     src/math.h:28: error: expected ‘)’ before ‘*’ token     src/math.h:29: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token     src/math.h:31: error: expected ‘)’ before ‘*’ token     src/math.c:14: error: expected ‘)’ before ‘*’ token     src/math.c:24: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token     src/math.c:56: error: expected ‘)’ before ‘*’ token     make: *** [src/math.o] Error 1


title: Upgraded to Gnome 3.4 on Debian, can't login to my main user?

text: I get into this endless login-cycle if I attempt logging with my main user - I tried Gnome Classic and regular Gnome, but after I login it sends me back to the login. The only way I can login is through another user. This means that there's some hidden setting file in the home directory that messes things up. How can I debug this further?


title: A way for saving running state of a program

text: I have a program that will perform a lengthy calculation which may take several days to be completed. Is there a way to save the program's running state; so I will be able to turn off the computer and run the program from a saved state. Or if the program crashed for any reason I can restart it from a saved state (and not from the outset)?


title: Find all lines between a line matching a pattern and a line matching another pattern

text: i want to start grepping from the lines that has "CK" at the end of line and stop grepping when the line has "D" at the end. I tried `grep "$CK" "$D" file..txt` , but it didnt work. Input:               kkkkkkkkkkk        jjjjjjjjjjjjjjjjjj       gggggggggggg/CK       JHGHHHHHHHH        HJKHKKLKLLL        JNBHBHJKJJLKKL       JLKKKLLKJLKJ/D       GGGGGGGGGGGGGG       GGGGGGGGGGGGGG      The desired output               gggggggggggg/CK       JHGHHHHHHHH        HJKHKKLKLLL        JNBHBHJKJJLKKL       JLKKKLLKJLKJ/D


title: Why do package names contain version numbers?

text: While working with Ubuntu and other Debian-based distros, I've noticed that packages in the software repos often contain the major version number. For example,   * Apache: `apache2`   * Tomcat: `tomcat7`   * PHP: `php5`   * Wine: `wine1.4`   * MySQL: `mysql-server-5.5` I notice however that there's no `apache1` package available, and similar for the rest. If the name of the package changes with updates to the software, doesn't that get in the way of one of the major goals of package management (easy upgrades)? If Apache 3 comes out tomorrow, am I going to have to install the `apache3` package manually if I want to upgrade?`


title: Is there an operator like && that ignores return status?

text: I've discovered the following useful trick for long-running tasks on the command line:               do_some_task && make_a_noise      For instance, on OSX:               do_some_task && say 'done'      However, `&&` means "run the next command if the previous one returned 0 for success". If the first command fails, the second doesn't execute. Is there a similar operator that means "do this regardless of the previous command's return status"?


title: Configure localtime. dpkg-reconfigure tzdata

text: I'm using this to configure localtime:               dpkg-reconfigure tzdata       It is ncurses interface. I'm looking for the way to programming this. Is there true way without user ncurses interface? How to change localtime by one shell command?


title: Is there a way to permanently exclude the kernel from updates?

text: I'm using Fedora and wonder if there is some way I can exclude kernel updates when I run `yum update`, until I specifically want to update the kernel. The reason why I am concerned about this is because sometimes it requires a lot of extra research finding patches for some programs and extra time spent recompiling them to work on the new kernel. I am thinking VMWare specifically as one example. I wonder if there is some way for `yum update` to NOT update the kernel and only notify me that a new one is available when it goes through its routine so that I can decide to put it off until a more convenient time. Or is this thinking likely to cause other issues?


title: Remove Linux Mint and restore windows's bootloader

text: I have an old laptop that is setup with dual boot, running Windows Vista and Linux Mint 12. I want to remove the Mint and reclaim the space to Windows. This is a simple task but I've been on it for the whole day and I'm no closer to a solution. I know removing Linux Mint on a dual-boot machine and restoring the windows's bootloader is a simple task of popping in the windows disk and hitting on repair. I've done this before on my old laptop, quite a few times. But that was quite a long time ago. Today, the laptop's CD/DVD drive is not reliable. It almost never works these days. And its also unable to boot from USB, which it used to do in the past. Without a functioning CD/DVD drive and no ability to boot from USB, is this even possible? If there is a way to restore the windows bootloader right from within the currently working Vista OS, that would be perfect. I have the Vista Business disk and I can get files from it by reading it on a different machine and transferring via a usb drive. So, do you guys have any ideas on how I can fix this. The laptop is, as of now, working perfectly fine, booting with grub. But this grub will be gone if I remove the Linux Mint partition.


title: Why does my desktop lock up when I copy lots of files to a USB drive?

text: My desktop is usually very responsive, even under heavy load. But when I copy files to a USB drive, it always locks up after some time. By "lock up", I mean:   * Moving focus from one window to another can take 10-20s   * Switching desktops can take 10-20s   * Videos don't update anymore (in YouTube, the audio continues to play, only the video freezes) The system load isn't exceptionally high when this happens. Sometimes, I see a lot of white on xosview indicating that the kernel is busy somewhere. At first glance, it looks as if copying files to the USB drive would interfere somehow with compiz but I can't imagine what the connection could be. Here is the output of `htop`: ![Output of htop shortly after the hang](http://i.stack.imgur.com/76ZSR.png) Here is the output of `iostat -c -z -t -x -d 1` during a 2 minute hang:               19.07.2012 20:38:22     avg-cpu:  %user   %nice %system %iowait  %steal   %idle                1,27    0,00    0,38   37,52    0,00   60,84          Device:         rrqm/s   wrqm/s     r/s     w/s    rkB/s    wkB/s avgrq-sz avgqu-sz   await r_await w_await  svctm  %util     sdg               0,00     2,00    0,00  216,00     0,00 109248,00  1011,56   247,75  677,69    0,00  677,69   4,63 100,00      As you can see, only the external harddisk is active. Here is the complete log: http://pastebin.com/YNWTAkh4 The hang started at 20:38:01 and ended at 20:40:19. Software information:   * openSUSE 12.1   * KDE 4.7.x   * Filesystems: reiserfs and btrfs on my internal harddisk, btrfs on the USB drive


title: Does inotify fire a notification when a write is started or when it is completed?

text: Imagine two processes, a reader and a writer, communicating via a regular file on an ext3 fs. Reader has an inotify `IN_MODIFY` watch on the file. Writer writes 1000 bytes to the file, in a single `write()` call. Reader gets the inotify event, and calls `fstat` on the file. What does Reader see?   1. Is there any guarantee that Reader will get back at least 1000 for `st_size` on the file? From my experiments, it seems not.   2. Is there any guarantee that Reader can actually `read()` 1000 bytes? This is happening on a seriously I/O bound box. For example, `sar` shows an await times of about 1 second. In my case the Reader is actually waiting 10 seconds AFTER getting the inotify event before calling `stat`, and getting too-small results. What I had hoped was that the inotify event would not be delivered until the file was ready. What I suspect is actually happening is that the inotify event fires DURING the `write()` call in the Writer, and the data is actually available to other processes on the system whenever it happens to be ready. In this case, 10s is not enough time. I guess I am just looking for confirmation that the kernel actually implements inotify the way I am guessing. Also, if there are any options, possibly, to alter this behavior? Finally- what is the point of inotify, given this behavior? You're reduced to polling the file/directory anyway, after you get the event, until the data is actually available. Might as well be doing that all along, and forget about inotify. _**_*** _**EDIT **_** _*_ *** Okay, as often happens, the behavior I am seeing actually makes sense, now that I understand what I am really doing. ^_^ I am actually responding to an IN_CREATE event on the directory the file lives in. So I am actually stat()'ing the file in response to the creation of the file, not necessarily the IN_MODIFY event, which may be arriving later. I am going to change my code so that, once I get the IN_CREATE event, I will subscribe to IN_MODIFY on the file itself, and I won't actually attempt to read the file until I get the IN_MODIFY event. I realize that there is a small window there in which I may miss a write to the file, but this is acceptable for my application, because in the worst case, the file will be closed after a maximum number of seconds.


title: How to configure ADSL connection using bash?

text: I know it's possible to configure the modem to automatically connect the internet using a browser, but I want to do it using bash. I would like the network to automatically connect when the system boots. I have a ADSL2 router/modem and I'm using the Debian 6 Squeeze.


title: Linux kernel compiling commands

text: I'm trying to make a mini operating system (using the linux kernel). I'm planning on it being for x86 and I'm trying to make it so that it not only runs on qemu but also on a real device. What are the exact commands that I would need to put into terminal to do this?


title: What is a spinlock in Linux?

text: I would like to know about spinlocks in detail?   Could someone explain that to me?


title: Where to find a PKG or RPM of fsarchiver?

text: I want to download the latest version of fsarchiver (I need a PKG file or RPM). Where can I find that?


title: Graphics card recommendation, Dell PowerEdge R210 & CentOS 6.5

text: I have server with displays and a keyboard-mouse for displaying network map status and for use as a shell and virtual console in my server room. Need a recent video card that is > $100 that can support the hardware requirements. I do not need to do any heavy rendering, but multiple open windows and graphics on Gnome2x desktop. I am required to use CentOS 6.5. =-/ My hardware: Dell PowerEdge R210 - Intel Core (i3 or i5, family6 model 37 stepping 2) 1.2GHz - 4GB DDR3 ram - 1 available PCIx slot (full size/height, it is on a riser/right-angle card) 2x Apple Cinema HD 30" (M9179LL/A) I have tried an ATI HD3450 and several similar older cards. Double screwed with older ATI; the chipsets are unsupported by current drivers (proprietary and ElRepo), and the legacy drivers do not support current Xorg packages (so I have to downgrade etc. ad naseum). I have also tried a Geforce 7300 GT that I cannibalized from an old Mac Pro. Nouveau driver does not like/recognize the card, NVidia driver install script says the adapter is not initialized (bad card? incompatible with Dell hw?) I'm done with old used hardware. Any suggestions on a decent, inexpensive, _currently supported_ video adapter that will drive these two displays at native 2560x1600 resolution?


title: How to see disk details like manufacturer in Linux

text: With `sfdisk -s` I can see the disk capacity as follows:               $ sfdisk -s     /dev/cciss/c0d0: 143338560     total: 143338560 blocks      How do I see disk details like disk manufacturer? I tried `hdparm`, but got an error:               $ hdparm -i  /dev/cciss/c0d0     /dev/cciss/c0d0:     HDIO_GET_IDENTITY failed: Inappropriate ioctl for device


title: Common code for kernel and userspace

text: I'm working on a linux project. I want to have some code (to be specific, a struct) and a header file (my own implementation) common to both the kernel and the userspace. Can someone tell me how to implement this ?


title: Join multiple files in a directory column wise

text: I would like to join about 100 files in the same directory column-wise. I have tried                 paste file1 file2 | column -s $'\t' -t      This works fine for 2 files. But when I try to do it for 100 files, I get an error saying                column: line too long      Could someone please help where I am going wrong?


title: Mounting NTFS Drives in Linux Mint

text: ![enter image description here](http://i.stack.imgur.com/LHzvx.png) My laptop is an Aspire E1 -431. When I installed Linux Mint 15 and 17, I found that the NTFS drives cannot be mounted:               Error mounting /dev/sda3 at /media/kutti/BE6C20D66C208B6B: Command-line `mount -t "ntfs" -o "uhelper=udisks2,nodev,nosuid,uid=1000,gid=1000,dmask=0077,fmask=0177" "/dev/sda3" "/media/kutti/BE6C20D66C208B6B"' exited with non-zero exit status 14: The disk contains an unclean file system (0, 0).     Metadata kept in Windows cache, refused to mount.     Failed to mount '/dev/sda3': Operation not permitted     The NTFS partition is in an unsafe state. Please resume and shutdown     Windows fully (no hibernation or fast restarting), or mount the volume     read-only with the 'ro' mount option.      Here i have enclosed my terminal working: ![](http://i.stack.imgur.com/abZRA.png) After editing `/etc/fstab` and entering the command, `sudo mount -a`, I get the following message:               [mntent]: line 13 in /etc/fstab is bad     [mntent]: line 14 in /etc/fstab is bad


title: rsync --delete deleted most files in the destination directory, why?

text: I got my config files in `/etc` folder all messed up because I did not take care of shell expansion while doing rsync:               rsync --progress --delete -avhHe ssh /etc/logrotate.d/{httpd,mariadb,php-fpm,ppp,wpa_supplicant,yum} root@my.ipaddress:/etc      I think the problem is that the '.' following logrotate got expanded and subsequently some folders such as `/etc/httpd` got deleted. I want to learn from this mistake by doing it correctly. How do I prevent shell expansion when rsync multiple files with ssh?


title: pm-suspend fails to wake up

text: I use `pm-suspend` on Debian 7.5. Most of the time everything works perfect, but sometimes it fails to wake up. The fans spin up, even the hard disk shows activity, but there is only a blank screen. After some time, I can see a strange mouse pointer on the screen, which looks like this: ![mouse poiinter](http://i.stack.imgur.com/GGF9H.jpg) When this happens, I can't change to another console or do anything. Only shutting down power and rebooting helps. The log (`/var/log/pm-suspend`) indicates a successful wakeup. I think this is not an X server error since I cannot even use my keyboard to change to a tty. Anyway, I use `xorg 7.7`. **EDIT** - hardware:   * AMD FX-8120 CPU   * Sapphire Radeon HD 6850 VGA, 1st screen connected via HDMI, 2nd via DVI   * ASUS M5A97 PRO motherboard with UEFI firmware (up to date, but the latest update is from October, 2012)


title: Raspeberry pi OTG power and usb pen drive

text: I know The OTG port is used to power the pi. So, how could I use a usb drive on that OTG port ? Could i plug a powered hub and the drive on the hub ? Moreover, is there any other way to power the pi while leaving the otg port to be used as a normal host usb port ?


title: conky: proper column alignment

text: Say I want something like the following in my `.conkyrc`               NAME                PID       CPU%      MEM%     ${top name 1} ${top pid 1}   ${top cpu 1}    ${top mem 1}     ${top name 2} ${top pid 2}   ${top cpu 2}    ${top mem 2}     ${top name 3} ${top pid 3}   ${top cpu 3}    ${top mem 3}     ${top name 4} ${top pid 4}   ${top cpu 4}    ${top mem 4}      Do I have to align the columns manually by adding space, or is there a way to tell conky to align things in columns. With fewer columns, I could just use `$alignc` and `$alignr` but I can't do that here...


title: Segmentation fault when trying to run glxgears via virtualGL

text: (Follow-up on How to efficiently use 3D via a remote connection?) I installed the amd64 package on the server and the i386 one on the client. Following the user's guide I run this on the client:               me@client> /opt/VirtualGL/bin/vglconnect me@server     me@server> /opt/VirtualGL/bin/vglrun glxgears      This causes a segfault, using `vglconnect -s` for a ssh tunnel doesn't work either. I also tried the TurboVNC method, where starting `vglrun glxgears` works, but I'd prefer transmitting only the application window using the jpeg compression. Is the problem 32 <-> 64 bit? Or how can I fix things?


title: What's the difference between fork() and vfork()?

text: I would like to understand in detail the difference between fork() and vfork(). I was not able to digest the man page completely. I would also like to clarify one of my colleagues comment " **In current Linux, there is no vfork(), even if you call it, it will internally call fork()**."


title: How is paging managed in the absence of swapping?

text: How is paging managed in the absence of swapping. If that is the case, how will a page fault be managed? What I meant is, if there is no availability for swapping, then how is Paging managed. I know that there will be two list of pages - free_pages list and allocated_pages list. When the pages in the free_pages list becomes low, it will move the LRU pages from the allocated_pages list to the swap partition. I just want to know what will happen if there is no swap partition.


title: How to modify a PKGBUILD which uses git sources to pull only a shallow clone?

text: The other day I tried installing `opencv-git` from the _AUR_ with `makepkg` on Arch Linux. Of course it pulls from the _git_ repository as the name indicates. This pulls 1Gb. I am reading about making a _shallow clone_ with `git`. When I look at the `PKGBUILD` file, using `grep git PKGBUILD`, I see:               pkgname="opencv-git"     makedepends=('git' 'cmake' 'python2-numpy' 'mesa' 'eigen2')     provides=("${pkgname%-git}")     conflicts=("${pkgname%-git}")     source=("${pkgname%-git}::git+http://github.com/Itseez/opencv.git"         cd "${srcdir}/${pkgname%-git}"         git describe --long | sed -r 's/([^-]*-g)/r\1/;s/-/./g'         cd "${srcdir}/${pkgname%-git}"         cd "${srcdir}/${pkgname%-git}"         cd "${srcdir}/${pkgname%-git}"         install -Dm644 "LICENSE" "${pkgdir}/usr/share/licenses/${pkgname%-git}/LICENSE"      Is there a way to modify the recipe or the `makepkg` command to pull only a shallow clone (the latest version of the source is what I want) and not the full repository to save space and bandwidth? Reading `man 5 PKGBUILD` doesn't provide the insight I'm looking for. Also looked quickly through the `makepkg` and `pacman` manpages - can't seem to find how to do that.


title: 32 bit appplication on 64 bit linux not working

text: I'm running linux mint LMDE 64 bit version, I have to install this i386 software to use my modem. So I did it with --force-architecture mode, installation completed with errors. Here is the log               dpkg: warning: overriding problem because --force enabled:      package architecture (i386) does not match system (amd64)     Selecting previously unselected package crossplatformui.     (Reading database ... 175681 files and directories currently installed.)     Unpacking crossplatformui (from CrossPlatformUI-V1.0.27-BSNL-i386-ubuntu.deb) ...     Setting up crossplatformui (1.0.27) ...     Stopping ACPI services....     Starting ACPI services....     package libqtgui4 exist     QT_VERSION = 4     make -C /lib/modules/3.2.0-2-amd64/build M=/usr/local/bin/ztemtApp/zteusbserial/below2.6.27 modules     make[1]: Entering directory `/usr/src/linux-headers-3.2.0-2-amd64'       CC [M]  /usr/local/bin/ztemtApp/zteusbserial/below2.6.27/usb-serial.o     /usr/local/bin/ztemtApp/zteusbserial/below2.6.27/usb-serial.c:34:28: fatal error: linux/smp_lock.h: No such file or directory     compilation terminated.     make[4]: *** [/usr/local/bin/ztemtApp/zteusbserial/below2.6.27/usb-serial.o] Error 1     make[3]: *** [_module_/usr/local/bin/ztemtApp/zteusbserial/below2.6.27] Error 2     make[2]: *** [sub-make] Error 2     make[1]: *** [all] Error 2     make[1]: Leaving directory `/usr/src/linux-headers-3.2.0-2-amd64'     make: *** [modules] Error 2     dpkg: error processing crossplatformui (--install):      subprocess installed post-installation script returned error exit status 2     Processing triggers for desktop-file-utils ...     Processing triggers for gnome-menus ...     Errors were encountered while processing:      crossplatformui      Now if I start the app it says               phanindra@phanindra:~$ ztemtapp      /usr/bin/ztemtapp: 4: exec: /usr/local/bin/ztemtApp/bin/App: not found      How to fix this? Update: I have installed `ia32-libs` now and now it says               phanindra@phanindra:~$ ztemtapp      /usr/local/bin/ztemtApp/bin/App: error while loading shared libraries: libQtGui.so.4: wrong ELF class: ELFCLASS64      whn I started the app


title: linux VM ware + ifconfig

text: I have linux machine red-hat 6.3 VM machine when I run the command ifconfig -a I see also the interfaces - **virbr0** and **virbr0-nic** what I want to get is only the interfaces eth0 and lo without **virbr0** and **virbr0-nic** please advice how to delete thise interface ? ( so when I will type ifconfig -a , then I will not see them )                     ifconfig -a|more           eth0      Link encap:Ethernet  HWaddr 00:50:56:BA:06:6B             inet addr:198.202.183.105  Bcast:198.202.183.127  Mask:255.255.255.128           inet6 addr: fe80::250:56ff:feba:66b/64 Scope:Link           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1           RX packets:2694 errors:0 dropped:0 overruns:0 frame:0           TX packets:44 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:1000            RX bytes:258427 (252.3 KiB)  TX bytes:6230 (6.0 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:12 errors:0 dropped:0 overruns:0 frame:0           TX packets:12 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:0            RX bytes:720 (720.0 b)  TX bytes:720 (720.0 b)      .                      virbr0    Link encap:Ethernet  HWaddr 52:54:00:CE:AA:24             inet addr:192.168.122.1  Bcast:192.168.122.255  Mask:255.255.255.0           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1           RX packets:0 errors:0 dropped:0 overruns:0 frame:0           TX packets:32 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:0            RX bytes:0 (0.0 b)  TX bytes:4613 (4.5 KiB)      .                     virbr0-nic Link encap:Ethernet  HWaddr 52:54:00:CE:AA:24             BROADCAST MULTICAST  MTU:1500  Metric:1           RX packets:0 errors:0 dropped:0 overruns:0 frame:0           TX packets:0 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:500            RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)


title: sed substitution matches too many inputs

text: This is my command:               echo "Test" | sed -f <(sed -e 's/.*/s,&,gI/' mydic)        The file `mydic` contains 2 columns delimited by commas (`,`)               a,AlphabetA       .       .        .         e,AlphabetE        .        .        s,AlphabetS       .        t,AlphabetT        test,testedd        .        .        zebra,zebraaaa      The expect result is `testedd`, but I get `AlphabetTAlphabetEAlphabetSAlphabetT`.


title: Multiplex bash function execution

text: I created a bash function to "automagically" connect on our switches and retrive their `startup-config` using the `expect` command. I have to use `expect` because this switch does not accept the `ssh user@host` fashion and ask me again for the User and Password tuple. This is the function that i created to manage those backups               main_pc3548(){             /usr/bin/env expect <<-END3548             spawn ssh -o StrictHostKeyChecking=no -o LogLevel=quiet $IP             expect "User Name:"             send "$USER\r"             expect "Password:"             send "$PASS\r"             expect "*# "             send "copy startup-config tftp://$SERVER/$SWNAME.cfg.bkp\r"             sleep 8             END3548     }      This block of code will separate my switch types, and call `main_pc3548()` when my switch list have this switch model:               egrep -v '(^#|^\s*$|^\s*\t*#)' $LISTA_SWITCHES | while read IP SWNAME SERVER TIPO     do             if [ "$TIPO" = core  ]; then                     main_pc6248             elif [ "$TIPO" = dep ]; then                     main_pc3548             else                     echo "$(date "+%d/%m/%Y-%T") - Switch $SWNOME Have a martian type of switch" >> $LOG_FILE             fi     done      The rest of the script reads a pretty lengthy file with information about the Switch IP, the TFTP ip address, the Switch name, and waiting 8 seconds each switch consumes a lot of time. **This sleep is needed** to avoid slow connections to break the tftp copy so, here it comes my question: Is there a easy way to "multithread" this function to gain performance?


title: Best way to encrypt my system on an ssd

text: I consider to buy an ssd for my laptop (something like Samsung 830 or 840) to make the system more responsive. I want my system (at least my home partition) to be encrypted. However I know about rumors that there may be problems with encryption on ssd's and although that statements about this change very fast with time. Especially I don't want to have a big performance drop (as said above, I want the ssd to make the system significantly more responsive) and I don't want to shorten the lifetime of my ssd. Having this in mind, what is the best way to encrypt the system on an ssd? You can assume that the ssd will be a samsung 830, 840 or 840 pro if this matters. **Edit** My CPU is a pretty old Core2 Duo P8700 with 2,53 GHz without AES-NI and I have only SATA II. So I want to add the question: Does it make sense at all to upgrade say to a Samsung 830 and use dm-crypt/luks or ecryptfs? Or does the CPU and SATA port slow down the SSD too much? I don't want to win any benchmark contest, just want to have an clear improvement in my system responsiveness. I am not sure if the following is a good indicator about how fast the system will be, so it would be great if someone could comment it: Currently I am using ecryptfs to encrypt my home partition. An `LC_ALL=C dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc` on my encrypted home partition gives:               1024+0 records in     1024+0 records out     1073741824 bytes (1.1 GB) copied, 56.4674 s, 19.0 MB/s      and the CPU is working between 40 and 60%. The same on an unencrypted partition gives               LC_ALL=C dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc     1024+0 records in     1024+0 records out     1073741824 bytes (1.1 GB) copied, 29.6554 s, 36.2 MB/s      and the CPU is working between 0 and 20%. My `/tmp` folder is mounted via `tempfs` i.e. it lies in RAM. Doing the same in `/tmp` gives:               1024+0 records in     1024+0 records out     1073741824 bytes (1.1 GB) copied, 0.941708 s, 1.1 GB/s      Then I created a new `ecryptfs` directory below `/tmp` and did it there again.               1024+0 records in     1024+0 records out     1073741824 bytes (1.1 GB) copied, 10.1884 s, 105 MB/s      and one core working at 100% the other at 20%. The creation of the ecryptfs dir was as follows: `sudo mount -t ecryptfs /tmp/encrypted/ /tmp/decrypted` As options I choosed the default ones (ubuntu-system): AES, 16 bit, no plaintext passthrough, no filename encryption. Considering this result I would expect that the writing rate will increase from 19.0 MB/s to 105 MB/s when replacing my old WD-scorpion black 7200 with a Samsung 830 SSD and using ecryptfs. Which seems to be a clear performance improvement. I guess that dm-crypt will even be a bit faster. Any suggestions to make more reliable tests which will predict if the SSD will bring a clear performance boost. **Edit 2** Here is a similar test in a German debian wiki using dm-crypt: http://wiki.debianforum.de/Benchmark_f%C3%BCr_Festplattenverschl%C3%BCsselung I did that and got ~95 MB/s.


title: Using Putty/plink to scp to a named pipe

text: I have a large tar.gz file that I need to transfer from Windows to a UNIX machine and unzip into a folder that my login user doesn't have write permissions on. Once the file is on the machine I can extract it into the correct folder by using another user, but this user can't log in directly. The problem is that the user that does the scp only has write permissions on its ~ and /tmp folders, neither of which is big enough to accept the file. Therefore, I would like to use a named pipe created in the /tmp directory that I can extract the .tar.gz from using the user with the correct privs. However, I am unsure how to cat the tar.gz to the named pipe using Putty. I have a feeling that plink is involved, but I can't quite work out the command.


title: PCLOS FM - Kate editor really old version but classic PCLOS has a more current one

text: I have moved from classic pclinuxos to full monty some weeks ago. With great surprise, I realised that Kate editor is on version 3.12.3 while on the classic Pclinuxos is on much later one. Anyone with similar experience or workaround to "force kate update"? It is a really useful tool for me and I consider compiling from source as my last choice in such cases. Is it safe to go to the repositories of the classic Pclos and download the rpm?


title: Adding Arch Linux's repository to Manjaro

text: Is it safe to use Archlinux's repository within Manjaro Linux installation? If it is, all I need to do is just add some line to /etc/pacman.d/mirrorlist, right?


title: blockdev --setro doesn't work (for me at least)

text: I'm sure I don't understood how blockdev works. I going to expose the case here and hope some of you can help me. The case: I have mounted a flash drive and it was mapped to `/dev/sdb1`. Then I type in a terminal (as root):               root# blockdev --setro /dev/sdb1     root# blockdev --report      the report was: ![enter image description here](http://i.stack.imgur.com/yRFap.png) as you can see, the report said that `/dev/sdb1` is set to read-only (ro). But I'm still able to create files and folders in the flash drive. What I'm missing? Thanks in advance.


title: How to password-less log on via ssh alias

text: Suppose I have access to `pc` via a `server`. I can directly log-on to `pc` by using How do I connect to a pc through another pc using ssh Such that my `.ssh/config` looks like:               Host short     Hostname pc     User me     ProxyCommand ssh me@server nc %h %p      The user and home-folder on `pc` and `server` are the same, but only `server` can be directly reached from the outside world. Now, if I `ssh short`, I have to type the same password twice. I am now looking for a way to login using the tunnel without typing my password even once. I've tried the `ssh-keygen` procedure, but that does not help me here. I also found this quite related question: Set up password-less SSH tunneling from home computer behind NAT to inside computer behind gateway, but I can't figure out how this would apply to my situation. The question basically comes down to: how can I setup passwordless login over a ssh alias?


title: Start rsyslog as unprivileged user

text: On Debian, rsyslog runs by default as root (due to POSIX compatibility). It can drop privileges after start, but a cleaner way would be to start as a non- privileged user. Could somebody please advise, what would be a clean way to set up rsyslog to run as non-privileged user? (which user?). While googling, I found start-stop-daemon, which apparently can make daemon start as non-root. is this the way to do it, or is there a better way?


title: Actkbd as service with systemd

text: A while ago I asked for how to stop a music player while the screen is locked. The answer was to use actkbd which works like a charm. Now I wanted to add actkbd as a service to systemd in order to start it automatically when booting. So as you can see the service is started correctly and it shows up in htop as well. Some output below:               [root@hostname init.d]# systemctl start actkbd.service     [root@hostname init.d]# systemctl status actkbd.service     actkbd.service - Actkbd: Daemon for X-independent shortcuts           Loaded: loaded (/etc/systemd/system/multi-user.target.wants/actkbd.service)           Active: active (running) since Tue, 10 Apr 2012 17:50:36 +0200; 2s ago          Process: 23526 ExecStart=/usr/local/sbin/actkbd -d /dev/input/event3 -D (code=exited, status=0/SUCCESS)         Main PID: 23527 (actkbd)           CGroup: name=systemd:/system/actkbd.service                   └ 23527 /usr/local/sbin/actkbd -d /dev/input/event3 -D     [root@hostname init.d]# systemctl stop actkbd.service     [root@hostname init.d]# ps -C actkbd       PID TTY          TIME CMD      I have the following `actkbd.service` file in `/etc/systemd/system/multi- user.target.wants/`               [Unit]     Description=Actkbd: Daemon for X-independent shortcuts          [Service]     Type=forking     ExecStart=/usr/local/sbin/actkbd -d /dev/input/event3 -D     ExecReload=/bin/kill -HUP $MAINPID     ExecStop=/bin/kill -15 $MAINPID     Restart=always     User=root      So the problem is that after starting the service with systemctl nothing happens if I press my usual shortcut for pausing Rhythmbox. If I instead just execute the command `/usr/local/sbin/actkbd -d /dev/input/event3 -D` via the a root terminal everything works fine. Why that? Sorry if it's something obvious, I'm new to the systemd business but I couldn't find anything that helped me. Cheers. EDIT: This is still not working. If somebody has some time I'd appreciate it if one could try and reproduce it. If that is possible then I will file a bug report.


title: How to count the number of a specific character in each line?

text: I was wondering how to count the number of a specific character in each line by some text processing utilities? For example, to count `"` in each line of the following text               "hello!"      Thank you!      The first line has two, and the second line has 0. Another example is to count `(` in each line.


title: Writing command synopsis in standard man format

text: I am writing a script and in the `usage()` function I want to specify the usage. My script uses either option1 or option2 or both. One of them is mandatory. Is there a standard way to write it up?


title: Solaris swap allocation with mlocked shared memory

text: I'm having a hard time understanding how Solaris 10 x86 swap allocations work in the presence of `mlock`ed share memory. I wrote a small program that:   * Gets a 1G SHM segment (`shmget`)   * Attaches it to the process (`shmat`)   * Locks a part of that (`mlock`, first round locks nothing, then 512M, then the whole thing)   * Write on the last, then the first, page of the SHM region   * Writes on the whole segment progressively   * Release the lock (if any)   * Detaches and cleans up. It prints out the values of `swap -s` in MB after each action. The output is as follows:   * Round 1, no `mlock`: (values on the right are relative to the first reading)               pid:    2221    mlock size:     0     header:      alloc  resvd   used   free [+/-  alloc  resvd   used   free]       init:        325    130    456   2873 [+/-      0      0      0      0]     shmget:        326   1154   1480   1849 [+/-      1   1024   1024  -1024]      shmat:        326   1154   1480   1849 [+/-      1   1024   1024  -1024]     touchE:        326   1154   1480   1849 [+/-      1   1024   1024  -1024]     touchS:        326   1154   1480   1849 [+/-      1   1024   1024  -1024]       set1:        582    898   1480   1848 [+/-    257    768   1024  -1025]       set2:        838    642   1480   1848 [+/-    513    512   1024  -1025]       set3:       1093    386   1480   1847 [+/-    768    256   1024  -1026]       set4:       1350    130   1480   1847 [+/-   1025      0   1024  -1026]        set:       1350    130   1480   1847 [+/-   1025      0   1024  -1026]      shmdt:       1350    130   1480   1847 [+/-   1025      0   1024  -1026]     shmctl:        326    130    456   2871 [+/-      1      0      0     -2]      Here, all good. `free` column was at most ~1G smaller than it was at startup.   * Round 2, `mlock` the first 512M of the shared segment:                pid:    2221    mlock size:     536870912      header:      alloc  resvd   used   free [+/-  alloc  resvd   used   free]        init:        326    130    456   2871 [+/-      0      0      0      0]      shmget:        326   1154   1480   1847 [+/-      0   1024   1024  -1024]       shmat:        326   1154   1480   1847 [+/-      0   1024   1024  -1024]       mlock:        838    642   1480   1334 [+/-    512    512   1024  -1537] <<<<      touchE:        838    642   1480   1334 [+/-    512    512   1024  -1537]      touchS:        838    642   1480   1334 [+/-    512    512   1024  -1537]        set1:        838    642   1480   1334 [+/-    512    512   1024  -1537]        set2:        838    642   1480   1334 [+/-    512    512   1024  -1537]        set3:       1094    386   1480   1334 [+/-    768    256   1024  -1537]        set4:       1350    130   1480   1334 [+/-   1024      0   1024  -1537]         set:       1350    130   1480   1334 [+/-   1024      0   1024  -1537] <<<<     munlock:       1350    130   1480   1846 [+/-   1024      0   1024  -1025]       shmdt:       1350    130   1480   1847 [+/-   1024      0   1024  -1024]      shmctl:        326    130    456   2871 [+/-      0      0      0      0]        * Round 3, `mlock` the whole segment:                pid:    2221    mlock size:     1073741824      header:      alloc  resvd   used   free [+/-  alloc  resvd   used   free]        init:        326    130    456   2871 [+/-      0      0      0      0]      shmget:        326   1154   1480   1847 [+/-      0   1024   1024  -1024]       shmat:        326   1154   1480   1847 [+/-      0   1024   1024  -1024]       mlock:       1350    130   1480    822 [+/-   1024      0   1024  -2049] <<<<      touchE:       1350    130   1480    822 [+/-   1024      0   1024  -2049]      touchS:       1350    130   1480    822 [+/-   1024      0   1024  -2049]        set1:       1350    130   1480    822 [+/-   1024      0   1024  -2049]        set2:       1350    130   1480    822 [+/-   1024      0   1024  -2049]        set3:       1350    130   1480    822 [+/-   1024      0   1024  -2049]        set4:       1350    130   1480    822 [+/-   1024      0   1024  -2049]         set:       1350    130   1480    822 [+/-   1024      0   1024  -2049] <<<<     munlock:       1350    130   1480   1846 [+/-   1024      0   1024  -1025]       shmdt:       1350    130   1480   1847 [+/-   1024      0   1024  -1024]      shmctl:        326    130    456   2871 [+/-      0      0      0      0]      In the last two rounds, the `free` column goes down an extra 512M or 1G right after the `mlock`, but before any page is actually touched. This "double accounting" disappears after the `munlock` call. Can anyone explain this behavior? Are `mlocked` pages reserved both in real RAM and in backing store or something like that?               SunOS myhost 5.10 Generic_142910-17 i86pc i386 i86pc


title: Why does VLC superimpose an additional “shadow” image?

text: ![enter image description here](http://i.stack.imgur.com/kw8d5.png) This "effect" has been regularly occuring on my Fedora 20 desktop the past few days. It seems strictly confined to VLC and does not affect any other video players I have installed. I have played with VLC settings (including resetting to the factory default settings) as well as reinstalling the entire package with no luck. The only thing that seems to fix this is a complete reboot of my system. Why does this occur and how can I fix this besides a reboot?


title: Private Debian repository to serve selected packages to selected machines

text: I have a private Debian repository setup with a few custom built packages (along with other official Debian packages). All my machines have this repository(only) configured in `/etc/apt/sources.list`. I want to know if there is a way to serve certain packages to certain machines. For example - machine1 should be able to connect to the repository but should be able to download package1 and package2 only. machine2 should not be able to upgrade package1 even if a new version is available in the repository. I know how to do the above on the client side - by running (or not running) the appropriate commands on machine1 and machine2. I want to automate this - I was planning to run a cronjob on those machines to do `apt-get update && apt- get upgrade` once every day but only the packages intended for them should be installed/upgraded. I have looked up online for weeks but couldn't find anything useful. Is this even doable?


title: Setting up a cronjob as a file

text: I want to create a cronjob at my Ubuntu server by adding/modifying a file in the `/etc/cron.d` folder, rather than using `crontab -e` as it's not too easy to automate. I've managed to make a file looking like this:               * * * * * username command >> logfile      I can tell that the file is there, I've chmoded it to `777` but it still isn't executed or appears when I do `crontab -l` as root. What am I doing wrong?


title: Equivalent of pvmove for BTRFS

text: Similar to the question I asked a while back. This one's a little easier? I can see there's volume management logic in BTRFS for removing/adding/rebalancing physical drives, but is there a tool to manually move extents/blocks off a particular physical device and onto another? Seems like it would be important for files that should be created quickly (like backup files) but can be moved to slower storage on the backend.


title: How to select, copy and paste some columns from different files and create one file from them?

text: I want to create and organize data in a file from a number of files by selecting parts of the columns of the given files. I have more than 10 file to copy the second, third and forth columns of each file and pasting them into a single file.


title: How to disable select-on-release right mouse button in Linux

text: We are having issues with mouse behavior in Linux. In Windows: In any application, to open a context menu and select an option:   1. right mouse button down + release   2. move the cursor to an option   3. left mouse button down + release In Linux, the same thing can be done in:   1. right mouse button down   2. move the cursor over to an option   3. release right mouse button. We are having problems in Eclipse, when accessed from a remote X server on Windows. The padding between the Eclipse menu items and the mouse cursor is too low (mouse cursor is inside the menu). Whenever we press the right mouse button down, mouse cursor is already moved over onto the immediate menu option, and when we release, selection event is triggered. How to disable this behavior?


title: wget hangs AFTER download complete, on exit_group

text: I am running CentOS release 6.3 (Final). This issue occurs for every VM on my server. When connected over SSH, wget hangs after download certain URLs. I am running the following command:               wget --no-http-keep-alive -O test http://downloads.sourceforge.net/project/nagiosplug/nagiosplug/1.4.16/nagios-plugins-1.4.16.tar.gz?r=http%3A%2F%2Fwww.nagios.org%2Fdownload%2Fplugins%2F      If I run `strace` on `wget` I get the following output at the end:               clock_gettime(CLOCK_MONOTONIC, {2670737, 421643851}) = 0     write(3, "\316\206\257'\323\4\241\262\322\"\326I\236\37\327\365\27295\310\t\210\"\212$\350[\214\346\177$\320"..., 745) = 745     write(2, ".", 1.)                        = 1     write(2, " ", 1 )                        = 1     write(2, " ", 1 )                        = 1     write(2, " ", 1 )                        = 1     write(2, " ", 1 )                        = 1     write(2, " ", 1 )                        = 1     write(2, " ", 1 )                        = 1     write(2, " ", 1 )                        = 1     write(2, " ", 1 )                        = 1     write(2, " ", 1 )                        = 1     write(2, " ", 1 )                        = 1     write(2, " ", 1 )                        = 1     write(2, " ", 1 )                        = 1     write(2, " ", 1 )                        = 1     write(2, "100%", 4100%)                     = 4     write(2, "  508K", 6  508K)                   = 6     write(2, "=4.3s", 5=4.3s)                    = 5     write(2, "\n\n", 2          )                     = 2     close(5)                                = 0     time(NULL)                              = 1365435671     stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=3424, ...}) = 0     time(NULL)                              = 1365435671     utime("test", [2013/04/08-12:41:11, 2012/06/27-14:39:15]) = 0     write(2, "2013-04-08 12:41:11 (478 KB/s) -"..., 692013-04-08 12:41:11 (478 KB/s) - “test” saved [2087089/2087089]          ) = 69     close(2)                                = 0     close(3)                                = 0     munmap(0xb77fb000, 4096)                = 0     exit_group(0)                           = ?      Best I can tell, the file has completely finished downloading. Sending a command interrupt kills `wget` and the file is intact. This is very inconvenient and is causing issues with automated scripts.


title: How to list ALL directories according to their size? [without including the parent directory]

text: I have a bunch of random folders, some of them are hidden (beginning with a period). I want to list all of them, sorted by their sizes. I have something on the lines of this in mind:               ls -d -1 -a */ | xargs du -s | sort      But the `ls ...` part of it doesn't show hidden files. I know some questions have been asked before on the same topic, but the answers never include a way to include hidden files. Or if it does, it uses the long format, hence making the output incompatible with the rest of the command.


title: What is the exact difference between a 'terminal', a 'shell', a 'tty' and a 'console'?

text: I think these terms almost refer to the same thing, when used loosely:   * terminal   * shell   * tty   * console What exactly does each of these terms refer to?


> **Possible Duplicate:**   >  What is the exact difference between a 'terminal', a 'shell', a 'tty' and a > 'console'? What is the difference between a terminal and a console in unix?


title: PseudoTerminal concept in Linux

text: > **Possible Duplicate:**   >  What is the exact difference between a ‘terminal’, a ‘shell’, a ‘tty’ and a > ‘console’? This question follows directly from another question of mine in this great forum. What exactly is the concept of a `Pseudo Terminal` in Linux speak? Can you please explain with an example. Is it a different concept from `Terminal emulators`?


title: Trying to understand how TTYs and PTYs work in CentOS 6.5?

text: I started to dig into the whole Linux `pty` and `tty` hell. I'm trying to understand how it works here in Linux so I was reading quite a lot of articles that covered this topic. So far I know: > TTYs are TERMINALS which are the last "secretary" to talk to kernel. PTS are > virtual terminals, that on the one end are connected to the TTY and on the > other end are connected to the terminal-emulator (the one that we can for > example open by clicking applications->system tools->terminal. or to ssh > session(?). So ssh uses another pts. That seems pretty clear to me because when I will do `w` in a shell on my system I get:               21:26:53 up 2 days, 11:35,  2 users,  load average: 0.11, 0.08, 0.08     USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU WHAT     kris     tty1     :0               Thu09    2days 52:28   0.05s pam: gdm-passwo     kris     pts/0    :0.0             21:18    0.00s  0.02s  0.01s w      The `tty1` is a terminal session, which was started when I logged into my machine, and the `pts/0` is a virtual terminal (instance of _App_ -> _System Tools_ -> _Terminal_ ). However, what is the `pty` then? If I will connect to my server through `ssh` then another `pts` will be spawned, but when will another `tty` be spawned, and whats the point of `pty`, from the `man pty` it seems to me like it is this:   1. Emulated terminal (gui terminal) talks to `pts`   2. This `pts` in turn talks to `pty` , which talks to `tty` That doesn't make sense. Please try to explain it using examples because it is very easy to fall off with all the differences between consoles, terminals, virtual terminals, emulated terminals, `pts`, `pty`, `tty`.


title: Difference between pts and tty

text: > **Possible Duplicate:**   >  What is the exact difference between a 'terminal', a 'shell', a 'tty' and a > 'console'? I always see pts and tty when I use the `who` command but I never understand how they are different? Can somebody please explain me this?


title: Recover files from corrupt DVD

text: I have a DVD+RW containing a lot of images and videos. Multiple DVD drives fail to read or mount it. I tried to follow this to try and recover the files using DVDisaster, and have created an iso file. But after that, I am lost. The instructions apply to a video DVD, not a data one, so the "split" command doesn't make sense. The iso file created by DVDisaster can't be mounted either in linux (with the "mount" command) or Windows (I understand it creates something like a "raw" image, though I'm not sure of the technicalities). Any idea what to do now? The error I get with mount is: > mount: wrong fs type, bad option, bad superblock on /dev/loop0, missing > codepage or helper program, or other error In some cases useful info is > found in syslog - try dmesg | tail or so


title: Do special characters in paths pose a problem when mounting network shares?

text: I am trying to create a permanant access point to a windows share from a CentOS 5.5 machine. I edited the `/etc/fstab` file to have the following entry:               //travellot/ArcGIS Setup's/9.3.1 Entire/ArcGIS_Server_ent_Unix /home/thomasm/shares/agslinux cifs username=thomasm,dom=cssl,password=*******     0 0      I have blocked out the password only for this Q and the parameters are separated by tabs. Anyway, this doesn't seem to work. The agslinux directory on the CentOS machine does not list the files in the windows share. I think it may be the underscores, apostrophes, spaces or periods that are causing the problem. Can someone confirm if this is the issue? If it is, is there any way to workaround this? Perhaps by encasing the windows share with double quotes or by using escaped characters?


title: RAMFS seems slower than expected — what is the bottleneck?

text: RAMFS doesn't uses swap (TMPFS does). So I mount the FS               cd /mnt/; mkdir SOMETHING; mount -t ramfs -o size=1500m ramfs /mnt/SOMETHING; cd /mnt/SOMETHING      I generate a testfile:               dd if=/dev/zero of=testfile_500MB bs=524288000 count=1      I cp the test file (from memory to memory)               time cp testfile_500MB testfile_500MB_cptestfile          real    0m0.599s     user    0m0.008s     sys     0m0.592s      I have one DDR2-1066 module in my PC. What is the bottleneck? According to this wikipedia article: http://en.wikipedia.org/wiki/List_of_device_bandwidths it would need to do more then 10 GByte/sec! It's waay not more 10 GByte/sec 500 MByte in 0.599 sec = 835 MByte/sec. It's slow. Is the CPU the bottleneck? OR what? :O (E7300 @ 2.66GHz) UPDATE: is measuring a "cp" with "time" a good thing?


title: Why isn't the -rt (RT-Preempt) kernel patch included by default in the mainline kernel?

text: According to https://rt.wiki.kernel.org/index.php/RT_PREEMPT_HOWTO , the RT- Preempt patch converts Linux into a fully preemptible kernel. The magic is done by:   1. Making in-kernel locking-primitives (using spinlocks) preemptible though reimplementation with rtmutexes.   2. Critical sections protected by i.e. spinlock_t and rwlock_t are now preemptible. The creation of non-preemptible sections (in kernel) is still possible with raw_spinlock_t (same APIs like spinlock_t)   3. Implementing priority inheritance for in-kernel mutexes, spinlocks and rw_semaphores.   4. Converting interrupt handlers into preemptible kernel threads: The RT-Preempt patch treats soft interrupt handlers in kernel thread context, which is represented by a task_struct like a common userspace process. However it is also possible to register an IRQ in kernel context.   5. Converting the old Linux timer API into separate infrastructures for high resolution kernel timers plus one for timeouts, leading to userspace POSIX timers with high resolution.  Are there any drawbacks of being real-time instead of just multi-tasking?


title: What is the difference between '.' and 'source' in shells?

text: > **Possible Duplicate:**   >  running script with “. ” and with “source ” I have used both the dot command '.' and 'source' to reload a given rc file (typically to update my environment variables) but I am not sure if they are different and if one is preferred. What is the difference between the two ?


title: Compiling Netcat with DFLAGS

text: I've been trying to compile netcat so that I can use the `-e` option but I am not sure as to how or where to place the custom flags. So far I've done:               ./configure     Make      and then I edit the Makefile with:               DFLAGS = -DGAPING_SECURITY_HOLE -DTELNET      and then do `make install`. Is that the correct way to do this?


title: Configure third button of a 3M Ergonomic Mouse

text: I've just bought a 3M Ergonomic Mouse, model EM500GPL, and for pointer movement and left/right click it works fine. But I'd like to know if it's possible to configure the third button to behave the way the makers intended. Holding the third button down and then moving the mouse up should cause a scroll-up action in the target window; holding the third button down and then moving the mouse down should cause a scroll-down action. I'm using OpenSUSE 12.3 with KDE 4.10.5. I suspect the desired behaviour is not something that can be achieved easily, but I'd be very happy to be proved wrong.


title: How are "xterm" and "screen" related?

text: I am not quite sure if there is any subtle or wide differences between screen and xterm. I have used screen before and had it being described as kind of like a multiplexer and have tried xterm a few times. Can anyone explain the differences between the two as well as the pros and cons to them both?


title: PHP on centos 6 not working

text: I have installed PHP, MySQL, Apache on CentOS 6, now I have restarted the Apache and mysql, to test PHP i have created a `index.php` on `/var/www/html/test/` now once i go to `localhost/test/index.php` then it shows only PHP soruce code like this: ![enter image description here](http://i.stack.imgur.com/0VO5F.jpg)    From Gnouc comment, i understand that it is due to SELinux security layer.   To work with HTML directory i did this in my terminal, but still i have the same result:               [root@localhost www]# chcon -v --type=httpd_sys_content_t html     changing security context of `html`         Any idea? Thanks


title: How to make a system lock when the USB pendrive with authentication key is removed?

text: Say, I have USB drive authentication up and working. So far, so hoopy. But now I want to take the next step, which is locking the machine when I eject the medium. I know there is udev I can script, but it would be really silly if there's a solution out there which I fail to type the right keywords to find. So the objective is: lock the screen when the key medium is taken out. Optionally, offer to switch user. In case anyone cares, I use Debian Sid with WindowMaker, adding gnome- settings-daemon to the mix. I have GNOME programs and use them, just not using the DE itself. I hope there is DE/WM-agnostic solution. „There is no ready-made solution” counts as a valid answer, too.


title: How to recreate EFI boot partition?

text: I've installed Fedora on my machine with `/` partition, `swap` partition and `ESP` partition for EFI booting. Now, I was installing Elementary OS instead of Fedora.   1. I have formatted the `/` partition (/dev/sda3)   2. Formatted the swap partition (/dev/sda4)   3. But **did not** format the EFI boot partition (/dev/sda1) Now when i boot, i get my old grub menu that's was installed by Fedora. I can only boot into Elementary OS by:   1. Entering the boot menu.   2. Selecting boot from EFI file   3. Navigate through `/dev/sda1/`, to get the `elementary` directory that contains `grubx64.efi` file. Which is `/boot/efi/EFI/elementary/grubx64.efi`. How can i fix that ? I thought of formatting the boot partition `/dev/sda1/` with `fat16` or something then re-installing grub on it. My `/dev/sda1` now contains this :               root@rafael:/home/rafael# ls /boot/efi/     EFI  mach_kernel  System          root@rafael:/home/rafael# ls /boot/efi/EFI/     BOOT/       elementary/ fedora/               root@rafael:/home/rafael# ls /boot/efi/EFI/fedora/     BOOT.CSV  fonts  gcdx64.efi  grub.cfg  grubx64.efi  MokManager.efi  shim.efi  shim-fedora.efi          root@rafael:/home/rafael# ls /boot/efi/EFI/elementary/     grubx64.efi      Here's my `efibootmgr` output :               BootCurrent: 003D     Timeout: 0 seconds     BootOrder: 2001,2002,2003     Boot0000* Notebook Hard Drive     Boot0010* Internal CD/DVD ROM Drive     Boot0011* Internal CD/DVD ROM Drive (UEFI)     Boot0012* Fedora     Boot0013* Fedora     Boot0014* Fedora     Boot0015* Fedora     Boot0016* Fedora     Boot0017* Fedora     Boot0018* Fedora     Boot0019* Fedora     Boot001A* Fedora     Boot001B* Fedora     Boot001C* Fedora     Boot001D* Fedora     Boot001E* Fedora     Boot001F* elementary     Boot2001* USB Drive (UEFI)     Boot2002* Internal CD/DVD ROM Drive (UEFI)      Any help would be appreciated.


title: Is it bad to select remember me option in the browsers of a compromised machine?

text: I was reading an article on how to sniff network packets. (of course for knowledge purposes only). I came across these particular lines. > For instance, say I was sniffing traffic on the network, and you logged in > to Facebook and left the Remember Me On This Computer check box checked. > That signals Facebook to send you a session cookie that your browser stores. > I potentially could collect that cookie through packet sniffing, add it to > my browser and then have access to your Facebook account. So, assuming my Linux client is compromised and am unaware of it currently, does that mean if I have clicked on `remember me` on this machine to login to my accounts, my personal details are compromised? How can the compromised machine's cookie information can be used in any hacker's browser?


title: $ORIGIN directive in IPv6 zone files

text: I have often seen similar BIND zone files:               $ORIGIN 2.0.3.0.8.b.d.0.1.0.0.2.ip6.arpa.     $TTL 604800     @   IN  SOA ns1.example.org. hostmaster.example.org. (             1978022513  ; Serial             10800       ; Refresh             3600        ; Retry             2419200     ; Expire             604800 )    ; Default TTL                  NS   ns1.example.org.             NS   ns2.example.org.             TXT  "2001:db8:302::/48 Example IPv6 reverse"               $ORIGIN 0.0.0.0.2.0.3.0.8.b.d.0.1.0.0.2.ip6.arpa.     1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0 PTR host.example.net.      Why is there additional $ORIGIN directive? I mean this "$ORIGIN 0.0.0.0.2.0.3.0.8.b.d.0.1.0.0.2.ip6.arpa." one. Why isn't it simply:               $ORIGIN 2.0.3.0.8.b.d.0.1.0.0.2.ip6.arpa.     $TTL 604800     @   IN  SOA ns1.example.org. hostmaster.example.org. (             1978022513  ; Serial             10800       ; Refresh             3600        ; Retry             2419200     ; Expire             604800 )    ; Default TTL                  NS   ns1.example.org.             NS   ns2.example.org.             TXT  "2001:db8:302::/48 Example IPv6 reverse"          1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0 PTR host.example.net.


title: Root not affected by file permissions?

text: Why does this work as root?               # touch test1     # chmod 000 ./test1     # echo "test" > ./test1      I take it root is not affected by file permissions?


title: Unity: Stop Dock Repopulation at Restart

text: Unity is currently the default window manager on my system, a window manager that's available for many Linux distributions, meaning this question isn't Ubuntu-specific. I have disabled the dock's autohide using `debconf`, but apart from that I haven't altered any of the default settings. My usage pattern is centred around the Windows key; whenever I wish to start something, whether it be Firefox, GVim, or a terminal window, I just hit the windows key, start typing the name, and hit enter when Unity guesses what it is I want. This use means I have no need to keep anything in the launcher. Given that I only start applications using the keyboard, I only need the dock to show me currently running applications. Naturally, my response was to simply remove everything I could from the dock, meaning all that remains is running applications. It doesn't work though. If I remove all 'pinned' applications from the dock, the system repopulates it to the defaults on restart of Unity. I assume that Unity thinks everything being removed is either a user error or a clobbered configuration file somewhere, and as such 'repairs' it by restoring the pinned applications. How can I suppress this setting so I can have an empty dock?


title: MySQL Workbench Cannot start SSH tunnel manager

text: I don't know why this error is happening when I try to connect by MySQL Workbench. > Cannot start SSH tunnel manager. I'm using slackware 14.1 and installed all dependencies.    ![enter image description here](http://i.stack.imgur.com/7rhtr.png)


title: creating archive using tar including all 'dotfiles' but excluding all subdirectories and /wo directory structure

text: I want to backup all the 'dotfiles' (f.e. `.zshrc`) under my home directory with **tar** , but excluding the directory structure and all subdirectories. I've tried it several times with different commands, but the best i achieved was an archive which included the hidden directories under `$HOME` as well.               #!/bin/zsh     BACKUPFILE=dotfile_backup.tar.gz     tar --create --file=$HOME/$BACKUPFILE --auto-compress --no-recursion --exclude=. --exclude=.. --exclude=*/ --directory=$HOME .*      I also thought about using `find` and piping the result to tar, but with no luck. Does somebody know how to achieve this - seemingly easy - task? PS: Most of the time when I'm using tar to create an archive, i have to think about xkcd comic: ![xkcd 1168](http://i.stack.imgur.com/VFqK5.png) :)


title: Invalid version string 'GNU/Linux'" when creating bootable USB stick

text: When I tried to create a bootable USB stick using Startup Disk Creator, appear this massege below. Invalid version string 'GNU/Linux'" ![enter image description here](http://i.stack.imgur.com/vQzcU.jpg) How can I create a bootable USB stick on Ubuntu 14.04?


title: How to get the value from rows and columns from text file in bash?

text: I am working on a bash project. I need to get all the values (one at a time because I will be using them somewhere else) from a text file. The text file I will be getting is structured like this:               Report:     -----------     Name  Column1  Column2  Column3  Column4     row1  val1     val2     val3     val4          row2  val5     val6     val7     val8          row3  val9     val10    val11    val12        There are no fixed amount of rows and columns so I will need something general. How do I retrieve each val one by one in bash? Thanks.


title: How to force a particular version of Java?

text: I am on a RHEL 5.5 64 bit box. The systems engineer installed the 64-bit Java VM under `/usr/bin` ; however, I needed a 32 bit VM which he installed in `/opt/jdk1.6.0_35`. But now, everytime I do `java -version` it shows that I'm using the 64-bit VM. How do I force it to select the 32 bit VM? I changed the PATH to not include `/usr/bin`, but that's where most of the important programs like vi and nano are, and I cannot exclude that. Is there another variable I can add to force it to select the 32 bit VM by default?


title: Adding a character to every other text line

text: I have a huge (ca. 20G) text file which contains millions of passages (a.k.a. paragraphs) with headers. Headers and paragraphs are always one line each, e.g., > Sunshine   >  This is a sunny day.   >  Darkness   >  A cave is a dark place. What I try to come up with is a terminal command which goes through the text and adds a '>' in front of every header, i.e., every _odd-numbered line_ (lines 1, 3, 5, …), e.g., > >Sunshine   >  This is a sunny day.   >  >Darkness   >  A cave is a dark place. Any ideas? If this is relevant: the above text was just an example. Most of the headers are MD5s, followed by a DNA sequence ('paragraph'), e.g., > 0002ebd9ca12d6b69dfc3066356fc299   > > CATTAACCATTGGATACCTTCGGGTATATCCCATCCGTGTCTACATACTCTTGTTGCTTTGGCAGGCCGTGGTCACACACTGTGGGCTATGCCTGCATGTGCCTGCCAGAGGACCA … which I'm trying to convert to > >0002ebd9ca12d6b69dfc3066356fc299   > > CATTAACCATTGGATACCTTCGGGTATATCCCATCCGTGTCTACATACTCTTGTTGCTTTGGCAGGCCGTGGTCACACACTGTGGGCTATGCCTGCATGTGCCTGCCAGAGGACCA


title: Is there a selinux, httpd, or PHP configuration that prevents reading mounted drives?

text: I'm moving a virtualized centos web server over that has an all-to-small hard drive to a new machine and I hooked up a bigger drive for hosting videos and downloads and stuff. W When I try to run a readfile or filesize or anything from my PHP script, I get the stat failed error telling me I don't have rights to my file. Everything looks like it should work according to permissions (I can even chmod them 777 all and I get the same problem). When I put files in the /mnt folder, I can read them, but if I put them in the mounted /mnt/data folder. Other than file/directory level permissions, are there permissions that need to be granted to allow the apache user/group or the httpd service to be able to communicate with mounted drives. (If this is a security feature, I think it's a great idea, I just need to be able to subvert it in this case)


title: Finding parentheses with % in vim across lines

text: In the following text block, starting at 1 or 3, and pressing `%` in normal mode in `vim`, finds the pair of matching parentheses, and toggles between them if you press `%` again. Starting at 1 finds the closing `)` first. Starting at 3 finds the opening `(` first. This is all OK and useful.               Some lines 1 with (stuff 2 in     matching 3 parentheses)      However, starting at 2 and pressing `%` finds nothing. What's going on? _Update_ : other commands such as `vib` can find the `(...)` block from either 2 or 3 (but not 1) which is one way around the limitation, but still curious...


title: Yast is unable to access software repositories even though URLs are accessible in browser and system date is correct

text: I am using Yast on OpenSuse 12.1. When trying to install packages from the software repositories, I get an error that the repo cannot be accessed because the network is unreachable: > Download (curl) error for > 'http://download.opensuse.org/update/12.1/repodata/repomd.xml': Error code: > Connection failed Error message: Failed to connect to 2001:67c:2178:8::13: > Network is unreachable I tried accessing this URL in the browser, and it works fine. This question suggests that the system date may have reset itself, but that is not the case for me. While it's a duplicate _question_ , the accepted answer there is incorrect for me.


title: How to change the color of all highlights in a PDF file?

text: I want to change the color of every highlight in a PDF file (without having it do for every highlight manually). Preferably with a command line command. Here is an example PDF with a highlighted line.


title: Unable to mount external USB HDD because of GPT on debian

text: I have tried to mount an external USB 3.0 hdd on my debian virtual machine (I'm using VirtualBox). I have tried to mount it using `mount /dev/sdb1/ /media/vol1/` but I get the following error:               mount: can't find /dev/sdb1 in /etc/fstab of /etc/mtab      I have tried to use `fdisk -l`, the error I get is the following:                   WARNING: GPT (GUID Partition Table) detected on '/dev/sdb'! The util fdisk doesn't support GPT. Use GNU Parted.          Disk /dev/sdb: 1000.2 GB, 1000170586112 bytes     255 heads, 63 sectors/track, 121597 cylinders, total 1953458176 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x00000000             Device Boot      Start         End      Blocks   Id  System     /dev/sdb1               1  1953458175   976729087+  ee  GPT      This is the result of `parted -l`:               Model: WD My Passport 0748 (scsi)     Disk /dev/sdb: 1000GB     Sector size (logical/physical): 512B/512B     Partition Table: gpt          Number  Start   End     Size    File system  Name                   Flags      1      20,5kB  210MB   210MB   fat32        EFI System Partition   boot      2      210MB   1000GB  1000GB  hfsx         Apple_HFSX_Untitled_2      How can I mount the hdd and read its content?


title: Why does installing to /usr/bin automatically install to /usr/bin/X11?

text: I am using the command:               install ./prog /usr/bin      to copy the program to the `/usr/bin` directory. Doing this automatically installs the prog to `/usr/bin/X11`. Deleting from `/usr/bin` also automatically removes it from `/usr/bin/X11`. Does my Linux Mint automatically do this? What is the reason for this feature?


title: Upstart documentation for CentOS 6

text: I am currently migrating from CentOS 5.5 to 6.4. Having fun converting **/etc/inittab** stuff to upstart. Ran into a lot of little problems but am getting the hang of it now. The best documentation I've found is for Ubuntu: http://upstart.ubuntu.com/cookbook/#id416 It was helpful with various upstart issues I ran into. The only problem is that some of the ubuntu items do not work with CentOS (Can't get logger function to work but found a way around that with 'exec >/dev/kmsg 2>&1'). Is there any CentOS specific documentation out there to help with upstart scripts? CentOS needs the same document that Ubuntu has..Argg!! Since I'm new to upstart, I'm still not sure what the best practices are. The script below seems to work great too. Any comments on it are welcome..Thx!! Here is a script that launches TTYs for modem dialin service to the server. It can launch TTYs for modems connected by USB,Serial,Network modem bank (Digi Port Server). It uses a file maintained by an admin to specify which ttys to launch : **/etc/init/ssi-ttys.conf:**               start on stopped rc RUNLEVEL=[2345]          task     script       #--------------------------------------------------------------------       # The following exec will send the data to the kernels ring buffer.       # Once the syslog daemon starts, this data will be redirected to the       # system log file. So, the echo below will be written out to       # /var/log/messages. Helps out a ton when you need to debug these       # scripts.       #--------------------------------------------------------------------       exec >/dev/kmsg 2>&1       re="^#"       while read line       do         tty=         identifier=         # Proccess /etc/ssi-init-ttys.conf lines without comments         if [[ ! $line =~ $re ]]         then           set $line           tty=$1           identifier=$2           echo "Starting TTY ($tty) ($identifier) using ssi-tty.conf"           #-----------------------------------------------------------------           # Remember that Upstart runs every script section using /bin/sh -e.           # This means that if any simple command fails, the shell will exit.           # So, this is why || true is added to the start so if one of the           # TTYs is already running (Which would normally cause an exit,           # the loop will continue and start other TTYs without exiting.           # Add || true to any system command that might return a code other           # than 0.           #------------------------------------------------------------------           initctl start ssi-tty TTY=$tty IDENTIFIER=$identifier || true         fi       done </etc/ssi-init-ttys.conf     end script      **/etc/init/ssi-tty.conf:**               stop on runlevel [S016]          respawn     respawn limit 5 10     # There's an automatic limit set to this: if a process is respawned more     # than 5 times within 10 seconds, it will be stopped and not restarted.     # Check /var/log/messages and /var/log/mgetty.log.<tty> for error messages     instance $TTY     script       # Regex for serial and USB ttys       reg1="ttyUSB"       reg2="ttyS"       m_flg=""       # Check for USB or serial ttys which use the -D flag for mgetty        if [[ $TTY =~ $reg1 ]] || [[ $TTY =~ $reg2 ]]       then         # Use -D flag with mgetty for ttyUSB and ttyS ports         m_flg="-D"       fi       exec /sbin/mgetty $m_flg $TTY $IDENTIFIER     end script     usage 'ssi-tty TTY=ttyX IDENTIFIER=Z  - ttyX is the tty id and Z is the /etc/gettydefs identifier'      /etc/ssi-init-ttys.conf:               # Serial port TTY     ttyS0 9     # USB port tty     ttyUSB0 9     # Digi port tty     ttyA18 9      **Note:** 9 indicates the appropriate /etc/gettydefs identifier to use for the tty.


title: Can't resize lvm volume "lv_home is in use. e2fsck: Cannot continue, aborting"

text: I would like to shrink my logical volume for home directory, so that I can extend volume for root. **`df -h`**               /dev/mapper/vg_mitoscomp-lv_root   50G   33G   15G  70% /     /dev/mapper/vg_mitoscomp-lv_home   53G  180M   51G   1% /home      **`lsblk`**               ─sdc2                                                                      8:34   0 111.3G  0 part       ├─vg_mitoscomp-lv_root (dm-0)                                           253:0    0    50G  0 lvm  /       ├─vg_mitoscomp-lv_swap (dm-1)                                           253:1    0   7.6G  0 lvm  [SWAP]       └─vg_mitoscomp-lv_home (dm-2)                                           253:2    0  53.8G  0 lvm  /home      I can successfully unmount `/home`, but than I can't perform health check nor can I resize volume.               [root@MITOs-Comp ~]# e2fsck -f /dev/mapper/vg_mitoscomp-lv_home     e2fsck 1.41.12 (17-May-2010)     /dev/mapper/vg_mitoscomp-lv_home is in use.     e2fsck: Cannot continue, aborting.                    root@MITOs-Comp ~]# resize2fs /dev/mapper/vg_mitoscomp-lv_home 10G     resize2fs 1.41.12 (17-May-2010)     resize2fs: Device or resource busy while trying to open /dev/mapper/vg_mitoscomp-lv_home     Couldn't find valid filesystem superblock.


title: "Self-test Failed" in Disks

text: On Lubuntu when I open "Disks", it says "80 GB Hard disk" in red, followed by " **SELF-TEST FAILED** ". What's wrong? How do I fix it?


title: Automate DISA STIG controls for RHEL/CentOS?

text: I am deploying systems that must be configured using the Red Hat 6 (v1r2) Security Technical Implementation Guide(STIG) published by the Defense Information Systems Agency (DISA). Link to site. I've started developing a Kickstart file to automate many of these settings based on other KS files I've found via Google. Does anyone have any advice, additional tools, or other resources that will help? I do not _need_ to use Kickstart, it just seemed like the easiest way to get started. I'm looking for any resources: playbooks for Ansible, basic shell scripts, etc.


title: how to synchronize two directory?

text: I want to using crontab to synchronize two directory between my linux partion and windows partion like this:               24 9 * * * cp -r /home/fan/Data /media/T/Data      But it would create a directory named Data in the origin Data directory, instead of copy the missing file from the source directory. I can't find a proper option at the cp manual to perfectly solve this. How can i copy the missing file(they do exist at the destination directory) from the src to dir. And by the way, seems it need the T disk have been mounted to run the copy command, how to automatically mount the disk when i need to run the command(the mount command should run as root). And how can i get the error message if the command have an exception?


title: Ubuntu 12.04.1 LTS - /boot is using 98.4% of 193MB

text: I have a problem. I have noticed that my VPS is saying : > => /boot is using 98.4% of 193MB Looks like something went wrong, doesn't it? I have tried to run `dpkg -l | grep linux` to check what's there. Here is the output:               ii  libselinux1                        2.1.0-4.1ubuntu1             SELinux runt                                                                                ime shared libraries     ii  linux-firmware                     1.79.7                       Firmware for                                                                                Linux kernel drivers     iU  linux-generic-pae                  3.2.0.56.66                  Complete Gen                                                                                eric Linux kernel     ii  linux-headers-3.2.0-45             3.2.0-45.70                  Header files                                                                                related to Linux kernel version 3.2.0     ii  linux-headers-3.2.0-45-generic-pae 3.2.0-45.70                  Linux kernel                                                                                headers for version 3.2.0 on 32 bit x86 SMP     ii  linux-headers-3.2.0-48             3.2.0-48.74                  Header files                                                                                related to Linux kernel version 3.2.0     ii  linux-headers-3.2.0-48-generic-pae 3.2.0-48.74                  Linux kernel                                                                                headers for version 3.2.0 on 32 bit x86 SMP     ii  linux-headers-3.2.0-51             3.2.0-51.77                  Header files                                                                                related to Linux kernel version 3.2.0     ii  linux-headers-3.2.0-51-generic-pae 3.2.0-51.77                  Linux kernel                                                                                headers for version 3.2.0 on 32 bit x86 SMP     ii  linux-headers-3.2.0-52             3.2.0-52.78                  Header files                                                                                related to Linux kernel version 3.2.0     ii  linux-headers-3.2.0-52-generic-pae 3.2.0-52.78                  Linux kernel                                                                                headers for version 3.2.0 on 32 bit x86 SMP     ii  linux-headers-3.2.0-53             3.2.0-53.81                  Header files                                                                                related to Linux kernel version 3.2.0     ii  linux-headers-3.2.0-53-generic-pae 3.2.0-53.81                  Linux kernel                                                                                headers for version 3.2.0 on 32 bit x86 SMP     ii  linux-headers-3.2.0-54             3.2.0-54.82                  Header files                                                                                related to Linux kernel version 3.2.0     ii  linux-headers-3.2.0-54-generic-pae 3.2.0-54.82                  Linux kernel                                                                                headers for version 3.2.0 on 32 bit x86 SMP     ii  linux-headers-3.2.0-55             3.2.0-55.85                  Header files                                                                                related to Linux kernel version 3.2.0     ii  linux-headers-3.2.0-55-generic-pae 3.2.0-55.85                  Linux kernel                                                                                headers for version 3.2.0 on 32 bit x86 SMP     ii  linux-headers-3.2.0-56             3.2.0-56.86                  Header files                                                                                related to Linux kernel version 3.2.0     ii  linux-headers-3.2.0-56-generic-pae 3.2.0-56.86                  Linux kernel                                                                                headers for version 3.2.0 on 32 bit x86 SMP     ii  linux-headers-generic-pae          3.2.0.56.66                  Generic Linu                                                                                x kernel headers     ii  linux-image-3.2.0-29-generic-pae   3.2.0-29.46                  Linux kernel                                                                                image for version 3.2.0 on 32 bit x86 SMP     ii  linux-image-3.2.0-45-generic-pae   3.2.0-45.70                  Linux kernel                                                                                image for version 3.2.0 on 32 bit x86 SMP     ii  linux-image-3.2.0-48-generic-pae   3.2.0-48.74                  Linux kernel                                                                                image for version 3.2.0 on 32 bit x86 SMP     ii  linux-image-3.2.0-51-generic-pae   3.2.0-51.77                  Linux kernel                                                                                image for version 3.2.0 on 32 bit x86 SMP     ii  linux-image-3.2.0-52-generic-pae   3.2.0-52.78                  Linux kernel                                                                                image for version 3.2.0 on 32 bit x86 SMP     ii  linux-image-3.2.0-53-generic-pae   3.2.0-53.81                  Linux kernel                                                                                image for version 3.2.0 on 32 bit x86 SMP     ii  linux-image-3.2.0-54-generic-pae   3.2.0-54.82                  Linux kernel                                                                                image for version 3.2.0 on 32 bit x86 SMP     ii  linux-image-3.2.0-55-generic-pae   3.2.0-55.85                  Linux kernel                                                                                image for version 3.2.0 on 32 bit x86 SMP     iF  linux-image-3.2.0-56-generic-pae   3.2.0-56.86                  Linux kernel                                                                                image for version 3.2.0 on 32 bit x86 SMP     iU  linux-image-generic-pae            3.2.0.56.66                  Generic Linu                                                                                x kernel image     ii  util-linux                         2.20.1-1ubuntu3              Miscellaneou        What can I do to solve this problem? What may I safely remove?


title: What is the keyboard shortcut opposite to Ctrl+k?

text: `Ctrl` + `K` deletes rest of line in an UNIX command line. How do I delete all the text _before_ the cursor?


title: "mke2fs -r fs-revision-level" - how is this used?

text: `mke2fs -r` offers > Set the filesystem revision for the new filesystem. Note that 1.2 kernels > only support revision 0 filesystems. The default is to create revision 1 > filesystems. Trying to look up what was meant by that I found loads of screenshots etc. of `dumpe2fs`containing the line > Filesystem revision #: 1 (dynamic) ## Question: _What does that mean? What does the option actually do and what is meant with this output?_ Where is documented what a value of zero would mean, what _dynamic_ actually means; and is there a value of two also? I could live with » _keep untouched as you won't ever need to change it_ « - but as there is an option for that and no note about backward compatibility, this makes me wonder…


title: Append output to a file and redirect stderr to null

text: How can I append the result of a command to a file and redirect stderr to null?


title: How do I tell `ps` to use all available columns?

text: To specify columns, I can use `ps`'s `-o` option:               ps -o pid,cmd      How can I tell `ps` to output all of its available columns?


title: Running C Programs on Linux

text: I watched a video lecture today that introduced C and things like how to make a C program that will run in Linux. I followed the steps given and now I'm stuck with a bit of a problem. I created my C file (HelloWorld.c) and used the command `gcc -o HelloWorld HelloWorld.c` to compile the file, both of these steps were successful. Afterwards I checked to make sure that HelloWorld had been created by using the command `ls`, and it had been. However, when I use the command `HelloWorld`, which is supposed to run the program, I get an error that says `HelloWorld: command not found`. In the video lecture the professor did mention that this worked for 32-bit systems and I'm using a 64-bit system. Perhaps this could be the problem? EDIT: Also in the video lecture the professor mentioned that when I use the command `ls` I should see `HelloWorld*`. I see only HelloWorld (without the star).


title: Terminal command vs. GUI drag & drop when copying large no. of files: Any tangible benefit?

text: I'm finding myself in a terminal more and more often these days as I learn to do certain types of things quicker or more conveniently. However, when it comes to copying a large amount of data (i.e. hundreds of gigabytes) from one HDD to another, I always revert to the GUI (Nautilus or Finder in my case; the file systems are ext4 or HFS+). What I have in mind is the initial copying of data to a new larger HDD that's replacing an older one, or to an external back-up HDD. Are there any tangible benefits to be had using terminal commands in this setting? If so, what are they? **EDIT** Sometimes with these large GUI copies it'll get tripped up somewhere along the way due to a corrupt file or for some other reason. I guess I was wondering if terminal commands, rather than the GUI method, can avoid this problem. It's often quite difficult to determine where the GUI copy has got to, where to resume, and which files are causing the issues. To my eyes at least, these copies seem a little bit random as to where they start and end.


title: No window menus in freenx

text: I recently upgraded an openSUSE 11.3 install to 11.4 by downloading the DVD, burning it, & chosing the upgrade option upon booting to it. I used all the upgrade defaults. Upon coming back up, I added the FreeNX zypper repository & installed the latest FreeNX. Connecting via FreeNX works, but I'm not able to see any window menus on any of my applications. They get stuck to the top left corner of the screen &/or they don't have the window border surrounding the window (as in the top bar that contains the minimize/maximize buttons). I've verified it's not a user problem because I created a new user & logged in as the user for the first time & it still happened to that user too. *** EDIT *** Client is OS X 10.6.7 using NX Client by NoMachine, ver 3.4.0-8. I should also point out I have other servers running FreeNX that still work fine, none of which are openSUSE 11.4 however. I think it is an openSUSE 11.4 specific problem. *** EDIT 2 *** Desktop environment on openSUSE is Gnome (whatever the standard is for 11.4). Window manager is the default, so I guess Nautilus. I should point out that it works fine locally & with VNC, so it must be a FreeNX problem... *** EDIT 3 *** This is what I'm seeing: ![enter image description here](http://i.stack.imgur.com/s0GBF.png)


title: Where did Trampoline.S go?

text: Dear all, I was wondering where the trampoline code went. It is referenced here, and I could find some code in an earlier distro, but I can't find it in the 2.6.38 kernel. Can you explain to me the path of execution, if `trampoline.S` is not there anymore? Thanks.


title: Hiding data in filesystems

text: I want to hide some files such that not even 'ls -a' can find it. I'm not talking about adding '.' in front of the filename. I was thinking if I could create separate system calls for accessing those files The actual need is to hide some log files from the user. I'm storing the MAC data of some files and don't want the user to see those log files. At present I know only one way to hide data,i.e, by adding '.' in front of filename. But the file can be seen by the user by the simple call ' ls -a'. So I want to know if there is any other way to hide those log data?


title: How to trick an init script into returning 0

text: I have a init script which is poorly designed because it does not conform to the Linux Standard Base Specifications The following should have an exit code of 0 if running, and 3 if not running               service foo status; echo $?       However because of the way the script is designed, it always returns a 0. I can not fix the script without a significant rewrite (because service foo restart is dependent on service foo status). How could you work around the issue so that `service foo status` returns a 0 if running, and a 3 if not running? What I have so far:               root@foo:/vagrant# service foo start     root@foo:/vagrant# /etc/init.d/foo status | /bin/grep "up and running"|wc -l     1     root@foo:/vagrant# /etc/init.d/foo status | /bin/grep "up and running"|wc -l;echo $?     0 # <looks good so far          root@foo:/vagrant# service foo stop     root@foo:/vagrant# /etc/init.d/foo status | /bin/grep "up and running"|wc -l     0     root@foo:/vagrant# /etc/init.d/foo status | /bin/grep "up and running"|wc -l;echo $?     0 # <I need this to be a 3, not a 0


title: Zsh possibly adding quotes to variable value (works in bash though)

text: I'm fairly new to zsh (shifted yesterday from bash) I had a bash function in bash like               vl() { cmd=`echo $1 | sed -r 's/(.+):([0-9]+).+/\1 +\2/g'`; vim $cmd }      This basically converts a argument like:               vl ./manifests/production/test.pp:387:foobar  # A output of $grep -iHn test       to               vim ./manifests/production/test.pp +387   #Aim is to open file at line-number 387      The same function in zsh doesn't work as expected. It opens a file named `./manifests/production/test.pp +387` in vim instead of opening a file named `./manifests/production/test.pp` with `+387` appended to it. Seems like, it's adding the quotes to `$cmd`. It would be great if someone explains what's happening here. Thanks


title: Where kernel configuration file is stored?

text: I currently run Angstrom Linux 2.6.32. I intend to upgrade linux kernel from 2.6.32 to 3.0.7. For this reason, I had to configure kernel 3.0.7 running `make menuconfig`. Now, I want to compare the new kernel configuration with the previous, but I can't find kernel 3.0.7 configuration file. Any ideas?


title: Install-on-Demand Wrapper Function for Executables

text: How do I make the following function work correctly               # Install git on demand     function git()     {         if ! type git &> /dev/null; then sudo $APT install git; fi         git $*;     }      by making `git $*` call `/usr/bin/git` instead of the function `git()`?


title: How to make a script run at boot time in Debian Wheezy?

text: I am writing a script to do some tasks at boot up time in my Debian Wheezy AWS EC2 AMI. Sources on the internet say that usual way to do this is to use `update-rc.d` to install the symlinks needed to set it up to run at boot time. However, when I try this, I get the error               $ update-rc.d     -bash: update-rc.d: command not found      This method has been working for me till Debian Squeeze. Has the standard way to do this changed in Debian 7.0? I am not able to find any documentation that explains how to do it in the official way.


title: Pamtester automate password testing

text: We have a system image which uses a default password for root. This _should_ be changed, though I have a feeling not all users do this. I know I can test login with pamtester:               # pamtester system-auth root authenticate     Password:      It asks for the password on the command line. I want to automate this. Can this be done?


title: Uninstalling LDAP on Fedora

text: I'm attempting to maintain a legacy collection of Fedora VMs, all configured to a old LDAP server. However, it's very touchy, and whenever the VM running the LDAP server is slow or unresponsive for any reason, everyone gets locked out of the entire system, since no one can login. As I no longer have the manpower to manage such a complicated setup, I want to completely remove LDAP as the single point of failure, and simply use SSH keys to login to the VMs, so if one VM is down it won't disable all the others. As I'm the only person who ever logs into these systems anyways, having LDAP is overkill. What's the easiest way do do this? I tried the obvious `yum remove openldap` but that attempted to uninstall nearly all packages, including yum. I currently can't login to any of them, so I have to boot each VM in single user mode and start its network interface.


title: Are the crontabs of users linked?

text: Our Linux server has a community user that has a crontab for itself. The admins don't want me to schedule my scripts on their crontab because they don't want to take responsibility for my programming. Different department, Fair enough. I suggested that I use my own users crontab to schedule my programming and now the aren't certain that if my crontab failed, theirs wouldn't too. Please tell me they aren't linked. Isn't that one of the purposes for having the ability to make multiple crontabs?


title: What do the kernel parameters acpi_osi=linux and acpi_backlight=vendor do?

text: I had troubles with the screen brightness control in my laptop and I fixed it by adding the `acpi_osi=linux` and `acpi_backlight=vendor`parameters to the file`grub.cfg`. I'd like to know what these parameters mean and why they work.


title: How does Linux manage fonts?

text: When I used Windows (a very very long time ago!), and Mac OS X, there was always a central "repository" of fonts shared and accessed by the OS and all programs (the font folder in Windows, and Font Book in Mac OS X). How are fonts managed in Linux? Is there also a central store for fonts that all programs (the shell with no X, with X, window managers, other GUI software) can use? Or are fonts managed separately? What can I do to efficiently and easily manage my fonts in Linux?


title: Network Filesystem + Local Access

text: I need to set up a network fs, so that I can mount a directory from `Box A` on to `Box B` and `Box C`. However, I need those files to not be transferred from `Box A` upon every access request; basically, I need the files cached locally, and only updated when "pushed" from `Box A`. Any suggestions?


title: I can't delete a file that I have write permissions for as a group member

text: $ touch testfile     $ chmod g+w testfile     $ sudo adduser user2 user1     $ stat -c'%a %A' testfile     664 -rw-rw-r--     $ su user2     Password:      $ groups     user2 user1     $ rm testfile      rm: cannot remove `testfile': Permission denied      What is missing?