title: Underscores in variable names and Emacs `f90-mode`

text: Editing Fortran in Emacs with `f90-mode`, I would like the “word commands” `M-b`, `M-f`, `M-d`, `M-DEL` and so on to act on “words” as separated by underscores. On the other hand, for the syntax highlighting, commands like `C-M-f`, and so on, the underscores obviously must not break apart identifiers. `subword-mode` partially does this: `M-f` and `M-d` act like I want, but `M-b` and `M-DEL` still treat the _whole_ identifier as one word. To illustrate: if point is after `some_thing`, `M-b` (`subword-backward`) will move it to `s`; after that, `M-f` (`subword-forward`) will move point to `_`. In `f90-mode`, `_` has syntax class `"w"` (word). If I change it to `"_"` (symbol) or `"."` (punctuation), I get the desired behavior, but then `some_thing` will also be two words to font lock and completion. E.g., `program my_prog; end` will be completed only to `end my`, and `write_me` would be incorrectly fontified (`write` as a keyword). How do I get both things at once? PS: This is GNU Emacs 24. * * * EDIT: Here is the complete code I ended up using, building on cadrians answer (thanks!)               (let ((adv (cons 'advice                      (lambda ()                        (let ((os (char-syntax ?_)))                          (modify-syntax-entry ?_ "_")                          ad-do-it                          (modify-syntax-entry ?_ (string os))))))           (fun '(subword-forward subword-kill subword-backward                  subword-backward-kill subword-downcase subword-upcase                  subword-transpose)))       (dolist (f fun)         (ad-add-advice f (list 'underscore-wrap nil t adv)                        'around 'last)         (ad-activate f)))      I added a `let` so as not to change the syntax permanently, and used `ad-add- advice` to be able to put it in a loop.


title: What are the .Trash-500 and .Trash-1000 directories?

text: I have a DNS-321 NAS drive which apparently runs Linux, so I logged in via ssh and I see `.Trash-500` and `.Trash-1000` directories. I realize that they're for trash, but why do I need two? Inside of them I see `expunged`, `files`, and `info` directories -- what are those for?


title: Zathura: how to print specified pages

text: I would like to print some pages from a large pdf file within Zathura (typically the current, or a range of pages). What is the syntax to do that? **Edit:** The solution was quite obvious... By the developer himself: > Select the page range in the printing dialog? So yes, there **is** a printing dialog, the classic Gtk+ printing dialog with the common options that allows me to do whatever I might want. I just need to type `:print`. I was actually expecting from Zathura to type arguments to select the printer and other stuffs. At least, next time someone wonders how to print with Zathura, he might find this post.


title: Starting a VNC session on a new X display

text: I'm currently using `x11vnc` to share my existing X session over VNC. What I'd like to do is to start a new X session/display which would work and act exactly like the existing one, except wouldn't be visible to someone sitting at my computer. (Problem right now is that people at the office can watch my unattended screen as I work, weird.) Is there a way that I can do something like this to achieve this:               ssh -L 5900:localhost:5900 otherhost "x11vnc -newdisplay -geometry 1920x1080 -localhost"      to tunnel back the port and connect in a more secure way?


title: How to get log from u-boot without com-port

text: U-boot is configured to print its logs into com-port by default. There is a device I can't receive this information (without uart/com). Can I configure u-boot to store its log strings into some place in memory (not to console) to sd-card?


title: Locale not being set on initial login on Raspbian/Debian

text: When I log in to my headless Raspbian box using putty/ssh, the locale is not being set correctly. However, if I `su` to another user, then `su` back, the locales are then set. This session shows the behaviour.               pi@raspberrypi(~)$ locale     LANG=     LANGUAGE=     LC_CTYPE="POSIX"       … more LC_* environment set to POSIX     LC_IDENTIFICATION="POSIX"     LC_ALL=     pi@raspberrypi(~)$ su XX     Password:     XX@raspberrypi /home/pi $ locale     LANG=en_GB.UTF-8     LANGUAGE=en_GB.UTF-8     LC_CTYPE="en_GB.UTF-8"       … more LC_* environment set to en_GB.UTF-8     LC_IDENTIFICATION="en_GB.UTF-8"     LC_ALL=en_GB.UTF-8     XX@raspberrypi /home/pi $ su pi     Password:     pi@raspberrypi(~)$ locale     LANG=en_GB.UTF-8     LANGUAGE=en_GB.UTF-8       … more LC_* environment set to en_GB.UTF-8     LC_IDENTIFICATION="en_GB.UTF-8"     LC_ALL=en_GB.UTF-8      **Note**   `locale charmap` returns `ANSI_X3.4-1968` before `su`'ing to another user then back.   After, `locale charmap` returns the intended `UTF-8` Also, putty translation is set to `UTF-8`


title: Print dialog crashes, any workaround?

text: At work, where there are dozens of printers on the network, I'm no longer able to open the print dialog (the Gnome/Gtk one opened by firefox, evince, gedit, etc.). This happened one day with no obvious reason (I don't recall of any update), so I suspect that the problem is due to a change in the network. If I open the dialog without being on the network, it works fine. Currently, I am using acroread to print my pdf files because its print dialog doesn't crash. The difference is that it does not try to retrieve the list of the network printers so I can use a manually set up printer. lp is also working great. I am looking for a workaround or a real fix. For instance, a way to make it avoid to retrieve the network printers would be fine.


title: Convert key=value blocks to CSV

text: I am trying to transpose a content of a file into another. I am new to shell scripting any help would be really appreciated Input file `Test.txt`:               HLRSN = 3     IMSI = 404212109727229     KIVALUE = A24AD11812232B47688ADBF15CE05CA9     K4SNO = 1     CARDTYPE = SIM     ALG = COMP128_3          HLRSN = 3     IMSI = 404212109727230     KIVALUE = A24AD11812232B47688ADBF15CE05CB8     K4SNO = 1     CARDTYPE = SIM     ALG = COMP128_3          HLRSN = 3     IMSI = 404212109727231     KIVALUE = A24AD11812232B47688ADBF15CE05CD6     K4SNO = 1     CARDTYPE = SIM     ALG = COMP128_3      Output needed in annother text file:               3,404212109727229,A24AD11812232B47688ADBF15CE05CA9,1,SIM,COMP128_3     3,404212109727230,A24AD11812232B47688ADBF15CE05CB8,1,SIM,COMP128_3     3,404212109727231,A24AD11812232B47688ADBF15CE05CD6,1,SIM,COMP128_3


title: How to count specific strings in file?

text: Using hash table to count specific strings, and out put a result with time it repeat. File A               AAA     BBB     CCC     DDD     BBB     DDD     AAA     CCC     BBB     AAA     BBB     CCC     BBB      Result               AAA 3     BBB 5     CCC 3     DDD 2


title: How to get correct scan codes for my laptop keyboard without pressing a key?

text: I have a problem with the keyboard of my laptop which doesn't work properly anymore. However I have full control of the laptop via ssh. The problem is that I use a self encrypting disk (Samsung 840 Pro). If I turn the laptop of I will perhaps not be able to login anymore because of the keyboard issue (which is probably a hardware issue). So I want to turn of the ata-password via ssh and hdparm before rebooting, then I can put the SSD into another PC and access it without problems. The problem with: `hdparm --security-disable password /dev/sda` however is that my laptop (Dell Latitude E6400, german keyboard) seems to translate the characters to scan codes, so I tried something like:               hdparm --security-disable $(printf 'password' | tr '1234567890qwertyuiopasdfghjklzxcvbnm' '\2-\13\20-\31\36-\46\54-\62') /dev/sda       as described here. But this doesn't work and I guess the reason for this is that I need the correct scan-code translation (the one above seems to be for a us keyboard). So how can I get the correct scan codes via ssh without typing the keys on my laptop? Are there any other suggestions how to disable the password via ssh.


title: Triggering a server to shutdown in receiving a signal via serial port (RS232)

text: I'm a fresh graduate (Electronics & Commn) and want to start my career in linux administration. I'm using a **Ubunutu 14.04 server machine** for R&D ( **with ups** ). Now my scenario is whenever main power supply goes off and ups gives backup, a message or signal has to be sent to the server machine and make it to shutdown. How to accomplish this task. Can anyone help me with this. (I'm ready to setup some embedded controller in ups if needs)


title: Type some text with xdotool independently of the keyboard layout

text: The command               xdotool type "hello"      can be used to type the word _hello_. But only if the keyboard layout is not English, otherwise it will type something else. How can I solve this problem so that `xdotool` will always type hello in any layout. I use the latest `xdotool` in Ubuntu 14.04 repo.


title: Problem executing command as differetn user with sudo -u

text: I have the following problem When I'm trying to execute `ls` as user `abc` with the following command I get an error:               xyz@host:~/temp$ sudo -u abc ls     [sudo] password for xyz:     Sorry, user xyz is not allowed to execute '/bin/ls' as abc on host.      But if I do `su abc` and then execute `ls` I have no problem Can anyone help?


title: Trouble Logging Kernel Panic for Debugging

text: I'm running Ubuntu 12.04 on AWS/EC2 and having a large number of hosts going belly up. I'm trying to enable kernel dumping, but when I simulate a kernel panic, there's no .crash file written anywhere on the file system. I followed the instructions here: https://wiki.ubuntu.com/Kernel/CrashdumpRecipe And things seem set up correctly:               # cat /proc/cmdline      root=LABEL=cloudimg-rootfs ro console=hvc0  crashkernel=384M-2G:64M,2G-:128M          # dmesg |grep crash     [    0.000000] Command line: root=LABEL=cloudimg-rootfs ro console=hvc0  crashkernel=384M-2G:64M,2G-:128M     [    0.000000] Reserving 64MB of memory at 832MB for crashkernel (System RAM: 1708MB)     [    0.000000] Kernel command line: root=LABEL=cloudimg-rootfs ro console=hvc0  crashkernel=384M-2G:64M,2G-:128M          # cat /sys/kernel/kexec_crash_loaded     1      But when I execute:               # echo c | sudo tee /proc/sysrq-trigger      The system reboots as expected, but no 'crash' file of any kind is generated. What might I be doing wrong?


title: Unable to install yum and mysql,ssh

text: When I go to install mysql on CentOS 6,I get the following error:               yum install mysql mysql-server     Loaded plugins: fastestmirror, refresh-packagekit, security     Loading mirror speeds from cached hostfile     Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=os error was     14: PYCURL ERROR 22 - "The requested URL returned error: 403"     Error: Cannot find a valid baseurl for repo: base      I think I do not have `Yum` installed. Please let me know the corresponding steps. I am also unable to install `SSH` on Ubuntu.


title: ld cannot find -lQt5Multimedia

text: I'm trying to build BBQScreen for Linux. During the make process, I get the following error:               g++ -m64 -o Linux/BBQScreenClient2 debug/main.o debug/mainwindow.o debug/screenform.o debug/QStreamDecoder.o debug/stdafx.o debug/ShrinkableQLabel.o debug/qrc_mainwindow.o debug/moc_screenform.o debug/moc_mainwindow.o debug/moc_QStreamDecoder.o debug/moc_ShrinkableQLabel.o   -L/usr/X11R6/lib64 -L/usr/local/lib -lavutil -lavcodec -lavformat -lswscale -lswresample -lz -lQt5OpenGL -L/usr/lib/x86_64-linux-gnu -lQt5Multimedia -lQt5Widgets -lQt5Network -lQt5Gui -lQt5Core -lGL -lpthread           /usr/bin/ld: cannot find -lQt5Multimedia     collect2: error: ld returned 1 exit status     make: *** [Linux/BBQScreenClient2] Error 1      But, `Qt5Multimedia` is installed:               $ sudo apt-get install libqt5multimedia5     Reading package lists... Done     Building dependency tree            Reading state information... Done     libqt5multimedia5 is already the newest version.     0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.      Any idea why this is occurring? EDIT: I also have `qtmultimedia5-dev` installed.


title: Why can't I modify OpenBSD securelevel?

text: I just installed an OpenBSD. I edited "vi /etc/rc.securelevel" and set the securelevel from 1 to 0. Saved the file, then rebooted. But after the reboot the sysctl states the securelevel is still 1. **Why?**


title: Display transfer speed when performing "cp" from the command line?

text: Is this possible?


title: How do I quickly move the cursor to the end in bash in vi mode?

text: When I'm in insert mode and I move left from the last cursor position (the empty spot to the right of the last character), then I can't go back to that position anymore. I have to type `Esc``$``a` (or replace `$` with `→` a bunch of times) to get there. It seems like a lot of extra keystrokes just to, say, go delete the last character (and still be in insert mode). Is there a better way or should I just use the default emacs mode (even though I don't know a single emacs command)?


title: Example for kernel timer Implementation in Linux

text: Could you please give any basic example of a kernel timer (start_ktimer) implementation in Linux?


title: Trying to set up a server/workstation SLED environment

text: I'm considering a number of desktop distros for use in our office. It seems like SLED matches what I want more than any other distro, especially home user focused distros. In an attempt to learn more about it, I made a SUSE Studio account and got to playing just to learn what I can. I have at least an above average amount of Linux experience. I run it on my home machines exclusively (running ArchLinux) and manage our Linux server at work just fine. My knowledge is a bit lacking in Linux server/workstation interactions, especially when it comes to SUSE (which I haven't used before). Now my goal here is threefold:   1. All workstations should be running an identical OS with identical software. This part seems easy. If I make a SUSE Studio appliance for all our machines and use that, mission accomplished.   2. I should be able to make system-level changes remotely to all our machines at once (as opposed to SSHing them one by one). I haven't played with it much but I've read that YaST is designed to do such things?   3. I want user information to be stored on our (non SUSE) server. This is where things get especially fuzzy for me. If each workstation's software is identical then in theory if the user's home folder is stored on the server, a user could log in from any machine on the network and have all their stuff right there. This also greatly simplifies the backup process since all user data is in one spot (/home on the server). I don't know if this is a bad idea or not but it seems really cool. In SUSE Studio I only saw options to manually add users so I don't know of SLED supports anything like this out of the box or not. I'd appreciate if somebody could clear up my confusions here and point me down the right path to have smooth server-workstation integration in our office.


title: How to have cron run a python script as root?

text: How can I get `cron` to run a python script as root? Here is my crontab file:               0 * * * * ./twitter/twitter.py      Am I doing something wrong?


title: Missing icons in Nautilus

text: I've installed Fedora 18 (x64) minimum and I installed Enlightenment with Nautilus. But I see that there are icons missing in Nautilus, I have selected the gnome icon theme so I must be missing some package(s). Does anyone know which ones? ### screenshot ![ss of missing icons](http://i.stack.imgur.com/AKwag.png)


title: Is there a way to maintain ssh-agent connectivity in different screens?

text: Whenever I use ssh-agent for passwordless logins it doesn't work across different logins and screen sessions, even if they are concurrent. I suspect it uses some shell variables that don't work across different sessions. Is there some way to configure it or get it to use some kind of variables that can be present on all sessions?


title: exchange two words using sed

text: I am trying to exchange two words in a line but it doesn't work. For example: "Today is my first day of university" should be "my is Today first day of university" This is what I tried:               sed 's/\([a-zA-z0-9]\)\([a-zA-z0-9]\)\([a-zA-z0-9]\)/\3\2\1/' filename.txt      What am I doing wrong?


title: Null byte files in duplicity backup

text: When duplicty encounters 0-byte-files it gives an IO-error:   `Error [Errno 5] Input/output error` ... `getting delta for` ... The files are usually some wired stuff like               /home/user/.libreoffice/3/user/fR6Qeq     /home/user/.config/dconf/user.Z18ABW     /home/user/.mozilla/firefox/profile/sessionstore-8.js      I feel that this slows down the backup process significantly. So what's the best way to deal with that problem?


title: Location of colorscheme-files in Kate

text: In **Kate** one can export file `Fortran.katehlcolor` which store the information about color in syntax-highlighting. The syntax-highlighting files itself are located in `~/.kde/share/apps/katepart/syntax` which can be backuped easily. Is there an analog directory for the `colorscheme`-files which already exists before exporting all `.katehlcolor`-files by hand?


title: using _< instead of < for stdin using bash

text: What is the difference between using `_<` and `<` for stdin when using process substitution. This is done using bash. Example:               read bytes _< <(du -bcm random_iso.iso | tail -1); echo $bytes


title: Partitioning. Arch vs Ubuntu manuals

text: I got a little confused after I had read advices on https://wiki.archlinux.org/index.php/Partitioning and on https://help.ubuntu.com/12.04/installation-guide/powerpc/directory-tree.html. Why is there such a big difference between the sizes of the partitions? E.g., about / partition. **Ubuntu.** > Typically 150–250MB is needed for the root partition. **Arch.** > 15-20 GB should be sufficient for most users with modern hard disks.


title: Block Devices & Partitions

text: I partitioned a microSD card (`mmcblk1`) into two partitions `mmcblk1p1` and `mmcblk1p2`. If use a dedicated card reader I am able to see the entire SD card and its partitions using various disk management tools on my PC. I am able to mount both partitions on my Android phone. However when I put my phone into USB Mass Storage mode, only `mmcblk1p1` appears as a drive letter on my computer. `mmcblk1p2` remains mounted and usable on the phone.   1. Isn't the partition table (GPT or MBR) stored outside of `mmcblk1p1` and thus not accessible to the computer?   2. Assuming (1) how does the computer clearly show a disk with only 1 partition in various disk management tools as if it was a physical disk? Is the phone's Mass Storage mode performing some kind of abstraction?   3. What exactly would happen if I partitioned this disk on the computer? Would the phone then see a new `mmcblk1p3`. How would it even be possible without access to the real partition table?


title: CTRL meta key 'sticky' in GUIs over X11 forwarding from CentOS to fedora

text: Despite numerous problems, I managed to get X11 forwarding working from a SSH server running on a CentOS host to a Fedora client (changing various settings and finally fixing it by installing a package for authentication). The program in question is Geany. It acts as though the CTRL meta key was always pressed, not allowing me to enter characters normally.   * What can I do about this?   * What information should I provide? Here is exactly what I mean:               ssh -XY4 -i ... user@host     geany      Within Geany every keystroke is processed as if with the CTRL modifier.


title: Run "logout script" for non-login shells

text: I have a `.bash_logout` script that I've put in the home directories of the _vagrant_ and _root_ users of a VM (created, as you have already guessed, with Vagrant) that I'm using for development. The script copies all my important dot files into a directory that is shared between the host OS and the guest OS, so that I can easily check them into my Git repo, track changes, and more easily carry over improvements I've made in the configuration of one VM to another. The problem I'm running into (which you have also probably guessed) is that the the script never runs for the _root_ user, since I `su` to _root_ rather than log in as _root_. Is there anyway to make a script run every time you `exit` a shell you entered by `su`ing to another user? Not technically a logout script, I suppose, but pretty nearly the same thing in spirit.


title: cannot mount .img file - "not a directory" error

text: I try to execute the following command on an ubuntu 12.04 system:               sudo mount minix203.img -o loop -t minix /mnt/myminix/      in order to mount an .img file with minix partition; and get the following error instead:               mount: Not a directory      what is wrong with my command?


title: How does Linux, the kernel, mount filesystems? What actually does this?

text: My question concerns the Linux source, and if it actually contains the code necessary, natively to mount, parse, and use a filesystem, or if that's added to the source. If the Linux source contains code to parse and access/organize files through a file system and such, is it safe to say that the filesystem is controlled by a device driver coded in to Linux, or is this procedure differ based on things like distro, releases, etc. How does Linux access files using a filesystem on other storage devices, i.e., how do userspace programs access proc, ext3, ext4, etc., and are ext3, ext4 considered "device drivers", since they operate directly with hardware, or do I have it wrong?


title: Ctrl+C does not work in gnome-terminal

text: On my Linux host, `Ctrl`+`C` does not seem to work and I do not know how to proceed to make it work. I am using Ubuntu 10.04 with bash 4.1.5(1), and working in Gnome-terminal. When I pressed `Ctrl`+`C` while this script was running, it did not cause it to quit.               #!/bin/bash     for i in `seq 500`     do             ps -e > /dev/null             echo $i     done


title: Searching the scrollback buffer

text: Is there any way to search the scrollback buffer in Terminator? I'd like to be able to search in the logs that are displayed when something is run from the terminal.


title: Querying the current time of a city from terminal

text: I have friends all over the globe and before calling them I need to know their current time. Is there an application in Linux where one can query a city (if exists) in terminal (something like this): `time miami` P.S: Yes I know that I can query it from Google but I prefer using the terminal


title: install using YUM without root permissions

text: So I don't have root permissions but I've been installing packages to a local directory on my(CentOS) system and it works fine. But I was wondering if I can do the same using yum. The reason I want to use yum is because I don't want to worry about dependencies and want yum to take care of that for me. Is there a way to do this? Thanks.


title: How do you bypass or skip the intro message when starting screen?

text: When I start `screen`, I get a message giving the version, copyright, and bug- reporting email address. I don't want to see this every time I start `screen`. Searching the man page didn't seem to result in a solution, and I am hoping that the experts here know a way to bypass this info page.


title: Low graphical mode, system hangout, no boot, no live CD boot

text: I have a Linux Mint 11 instalation (until some months ago I had Ubuntu 11.04) and since yesterday I have different problems. Let's explaine in steps:   * I had updated my system (I can't say what files were installed)   * restarted and the system entered in "low graphic mode" but no options from menu are working. I have made a video (bad quality but to get the idea) here.   * I have made Bootable USB stick with different distributions like Puppy, DSL, Fedora, Ubuntu also tried with Live CD (Ubuntu) but I get errors and the system remains in "standby". Here I have made pictures of the errors: Linux Mint editing the grub Fedora live USB Ubuntu Live CD   * conclusion until now is that I can't manage to boot with LiveCD or USB stick although with Puppy Linux it worked but I couldn't mount the ext4 drives but the ntfs drives were mounted corectly.   * the tty doesn't work that means that I can't write something like: sudo dpkg-reconfigure xserver-xorg   * I have dual boot with WinXP. Entered here and installed Ext2explore and Ext2fsd at least to back up my files from /home. When entering on /root partition with Ext2fsd is asking me if I want to format it. I didn't continued but as final resort can I format the /root and try again to install from scratch a new distribution? My /home partition will remain untouched hopefully. Someone knows a reason why I can't boot or why even the Live CD gives errors? I have used more than one live cd and more than one bootable usb stick. I don't see on my system file /etc/X11/xorg.conf but is xorg.conf.failsafe. Here you have an archive where I managed to save xorg.0.log and other files: link. If you can please tell me what other files are relevant to save to place here maybe it's shows clues why this is happening... Thanks and sorry for the mistakes in writting this topic...


title: iPhone type login screen?

text: The person that introduced me to Fedora had somehow made his login screen so that instead of typing in a password he used the "connect the dots" password that's popular on phones. Eg ![Example of what I'm talking about](http://i.stack.imgur.com/K5pdH.png) On my touchscreen/stylus laptop, I'm interested in doing this as well. However I can't seem to find the plugin he was using, and I don't have contact with him anymore. Various searches for "Fedora connect the dots login" and "Fedora iPhone login" have unsurprisingly not yielded anything. Does anyone happen to know the name of the plugin he was using that provides functionality like this in Fedora 15?


title: How to check for hardware errors with software methods?

text: How can I check for bad blocks, bad memory, etc. using only software solutions? I'm using Ubuntu 11.04.


title: CentOS - Check partition information from command line

text: What is the command to check partition information on a CentOS 5.5 release? Specifically, I'm looking to see if the partitions were set as LVMs.


title: Toggle/macro/xargs-like thing for shell variables

text: So I'm stuck doing a lot of cross-compiling and am typing stuff like this a lot               FOO=bar command --some-args     BAZ=qxt other-command --other-args      But obviously the real shell variables are long and cumbrous to type. Bash is not a dynamic language, so backticks won't work (it tries to run the command FOO=bar). xargs is wrong though something like it that works before command evaluation would be good. Setting the shell variables I want as env variables hits the same problem as backticks if I just put them before the command; changing envs explicitly every time leaves me with the same cumbrous typing problem as shell variables, with the added fun of polluting my later environment. Is there something like pushenv and popenv? Is there any way I can store and retrieve through a short handle all the shell variables I might need, so I can do something like               shellvars1 command --some-args     shellvars2 other-command --other-args      The different combinations of shell variables is large but finite, so if there's a way of offloading that to a helper script I can type them all there once, I just can't figure out a way to do that. Bonus points: does bash have something like tcsh's ability to do               !24:s/FOO/BAZ/      ? That could also help (though not as much). I mostly want to remove opportunities for my preternatural skill at typos to show itself.


title: How to split such a string into array in bash

text: I have problem with output of a program. I need to launch a command in bash and take its ouput (string) and split it to add new lines in certain places. The string looks like this: > battery.charge: 90 battery.charge.low: 30 battery.runtime: 3690 > battery.voltage: 230.0 device.mfr: MGE UPS SYSTEMS device.model: Pulsar > Evolution 500 basically it's xxx.yy.zz: value, but value may contain spaces. Here's the output I'd like to get               battery.charge: 90     battery.charge.low: 30     battery.runtime: 3690     battery.voltage: 230.0     device.mfr: MGE UPS SYSTEMS     device.model: Pulsar Evolution 500       I have an idea to search for first dot and then look back from that position for space to put a new line there, but I'm not sure how to achieve it in Bash. I'm still beginner. Please, help me with it.


title: How to add a function to .bash_profile/.profile/bashrc in shell?

text: I have a function which converts epoch time to date. Here is the definition               date1(){       date -d @$1     }      I'd like to be able to write:               $ data1 xxxyyy      And I want the corresponding date. I understand I have to add it in either `.bash_profile`, `.profile`, or `.bashrc` and then source it:               $ source file      But, I'm not sure which file to put it in. Currently, I have it in `.profile`. But to run it, I have to do `source .profile` every time. Ideally, it should make it available, when the computer starts up like the environment variable.


title: Gentoo framebuffer dual monitors

text: I have Gentoo and great frame buffer with smaller fonts and great resolution, also I have two monitors. On both monitors I have same frame buffer. Is it possible to have multiple different frame buffers on two monitors?


title: How to write bash script that deletes the oldest file in a directory if there are greater than N files in the directory?

text: Wondering how would one go about writing a script that: Counts the number of files in a directory. If that number is greater than a specified number N, delete the oldest file in the directory. For bonus feelings of good will: Only included .zip files in the count/delete.


title: Send DXY-GL command to printer

text: How to send DXY-GL commands to a plotter? My plotter can draw only lines. Can I send text commands via stty to the printer port?


title: Verbose DNS query to see DNS query order?

text: I typically determine the IP of a host by doing: `$ host -t A example.com`. Is there a more verbose version of this that tells me whats happening in the background, specifically the order of what is queried (/etc/hosts 1st, dns server 2nd)? As many people can attest to, OS X Lion resolves local `/etc/hosts` entries painfully slow, and I'd like to see what bottlenecks are causing this. Seems like in theory, `/etc/hosts` should be queried first and name resolution should happen instantaneously for manually entered hosts.


title: How To See Which Ports Are Open On A Particular Firewall

text: Using the terminal I was wondering if it would be possible to see a list of all the active firewalls on a particular system that I have shelled into. I want to be able to see which ports are active pertaining to each firewall, so that I can change the restrictions.


title: WiFi USB stick not recognised by BeagleBone Black

text: I'm trying to set up a TP-LINK TL-WL725N v2 WiFi USB stick on my BeagleBone Black. However, it doesn't even appear to be recognised, i.e. it doesn't show up in the output of `lsusb`:               $ lsusb       Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub       Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub      Neither `dmesg` nor the syslog contain any new messages when the stick is plugged in or unplugged. Oddly enough, the stick even **seems to break the USB port for the rest of the session:** after plugging and unplugging the WiFi stick, a memory stick that previously worked fine was no longer recognised until I rebooted the BeagleBone. The same WiFi stick **works flawlessly on a laptop running Ubuntu 12.04.3 with a 3.11.0 kernel** and a Raspberry Pi running Raspbian with a 3.10.24 kernel.   Relevant `lsusb` line:               Bus 001 Device 006: ID 0bda:8179 Realtek Semiconductor Corp.      However, the Raspberry reboots whenever I plug in the stick, so it might be drawing too much current. I'm not quite sure how to proceed:   does this indicate a hardware failure (presumably of the WiFi stick)? Or is there anything else I could try to at least get the stick recognised on the BeagleBone?   (I'm aware that I will have to compile the necessary kernel module myself, just like on the Raspberry Pi, but that's no use if the stick isn't even recognised...) * * * **Edit** I've checked the supply voltage on the USB port and it is actually switched off the moment I connect the WiFi stick. I tried forcing it back on by pulling the !EN pin on the TPS2051 switch IC low, but that didn't help (i.e. the voltage came back on, but the system didn't seem to poll the bus anymore). I've googled for the `USB1_DRVVBUS` output on the processor that drives the input of the switch IC and it seems that the supply for the USB host port is automatically disabled when an over-current condition is detected. That explains why the stick crahes the Raspberry Pi and fails to work on the BeagleBone, but leaves me to wonder if it might be broken, since several Raspberry users have reported that it worked for them without a powered hub. * * * **Second Edit** I perused the schematic some more and bypassed the switch IC and current sensing resistor, but even then the the USB host section is disabled as soon as the WiFi stick is connected.


title: How can I format a thumb drive so that I delete all existing files?

text: I have a usb thumb drive that I want to reuse. How can I format it?


title: How to copy or move files without being asked to overwrite?

text: What I've tried:               root@host [/home1]# cp -f hello /home3     cp: omitting directory `hello'     root@host [/home1]# cp -rf hello /home3     cp: overwrite `/home3/hello/.buildpath'? y     cp: overwrite `/home3/hello/.bash_logout'? y     cp: overwrite `/home3/hello/.project'? ^C      They always ask me whether I want to overwrite. Using mv doesn't work either. So what should I do? Other things I tried:               root@host [/home1]# cp -rf hello /home3     cp: overwrite `/home3/hello/.buildpath'? y     cp: overwrite `/home3/hello/.bash_logout'? y     cp: overwrite `/home3/hello/.project'? ^C     root@host [/home1]# cp -force hello /home3     cp: invalid option -- 'o'     Try `cp --help' for more information.     root@host [/home1]# cp --remove-destination hello /home4     cp: omitting directory `hello'     root@host [/home1]# cp --remove-destination hello /home3     cp: omitting directory `hello'     root@host [/home1]# cp --remove-destination -r hello /home3     cp: overwrite `/home3/hello/.buildpath'? ^C     root@host [/home1]#


title: What is the extended version of the "sl" command?

text: Recently I've been discussing Unix humor with a friend and we got to the topic of the `sl` command. I got the sources, compiled, installed on our development machine, and... got rather disappointed. The "official version" shows just the engine, with option to expand it to two cars. I remember a version from a machine I had a couple years ago, that had a road crossing with barriers, a very long train, and dozens of options. Where can I find that extended version?


title: Doing simple math on the command line using bash functions: $1 divided by $2 (using bc perhaps)

text: Sometimes I need to divide one number by another. It would be great if I could just define a bash function for this. So far, I am forced to use expressions like               echo 'scale=25;65320/670' | bc      but it would be great if I could define a .bashrc function that looked like               divide () {       bc -d $1 / $2     }


title: Distribution with Hadoop installed

text: Is there any Gnu/Linux distribution that provides by default an Hadoop installation?


title: Universal package manager for install/uninstall?

text: All I truly want a package manager for is to install an app in a location of my choice, make symlinks if I want them, and remove everything when I'm done with the app. Keeping track of all the user-modifiable files for each app and saving those when I "remove" would be nice too. Yet there are 5-10 different package managers each with their own "ecosystem" of apps, and there are also a lot of apps I come across while browsing the web that say "here, download this .tgz!"; sure I'll click, but now I have a .tgz! Does anything sort of like a "universal" package manager exist? Something with few features, just install and uninstall would be perfect as long as it will install/uninstall whatever I throw at it: .deb, .rpm, .tgz, .gem, etc. All I want is install/uninstall through a single interface, a la App Store!


title: Grep pattern in ksh

text: a small question regarding grep. I'm doing :               find . -type d      And I have three directories :               ./backup-2013-11-27     ./backup-2013-11-26     ./backup-2013-11-28      If I only want to retrieve the one from 11/26, I do :               find . -type d | grep "2013.*11.*26"      and it works. However, I can't understand why :               find . -type d | grep "2013*11*26"      doesn't work ...   Indeed, I'm not using regexp here, I'm using pattern, so `*` should be used as wild card, or not?


title: Meaning of ":-" in bash

text: I have a bash code `export TM_SCALAC=${TM_SCALAC:-scalac}`. I'm not sure the meaning of ":-" inside the `${}`. How do I interpret this line of bash code?


title: What is the difference between filename=${1:-/etc/hosts} and filename=/etc/hosts?

text: What is the difference between `filename=${1:-/etc/hosts}` and `filename=/etc/hosts`? For example:               filename=/etc/hosts          if [ -r "$filename" ] && [ -s "$filename" ]; then         md5sum $filename     else         echo "$filename cannot be processed"     fi      and               filename=${1:-/etc/hosts}          if [ -r "$filename" ] && [ -s "$filename" ]; then         md5sum $filename     else         echo "$filename cannot be processed"     fi


title: Hosting on freeBSD

text: I already installed FreeBSD 10, Apache 2.4 and PHP 5.5. I also just bought a domain from _GoDaddy_ , and I would like to setup a web-hosting in my server, in order to make my website to be reachable from any web browser. So should be my configuration?   1. I assigned my server (running FreeBSD 10) the static IP address 192.168.1.130   2. My domain.com has x1.x1.x1.x1   3. My internet service provider is (ISP) is x2.x2.x2.x2 Questions:   * From these 3 IP addresses above, which one should my `httpd.conf` in _Apache 2.4_ have to be listen to?    * In my DNS “A” record at _GoDaddy_ , which IP address should my domain point to?   * Do I need to make any changes in my `/etc/hosts` file? **Note** : I use x1.x1.x1.x1 and x2.x2.x2.x2 as examples.


title: dracut and separate /usr?

text: I would like to use _systemd_ on my Gentoo box. Unfortunately, I have `/usr` on a separate partition and Gentoo puts `libdbus` into `/usr/lib`, leading to a segfault on boot, since systemd relies on dbus. Hence I would like to generate an initramfs using _dracut_ that mounts `/usr` for me. This partition is on an md raid. I think that I have setup dracut correctly to include mdadm, but somehow it does not mount `/usr` I think that it is configured to only mount the root partition by default, even if it detects other partitions. How can I tell _dracut_ to mount `/usr` also before switching to the real init?


title: How to add a feature to Vim if it's not compiled with that feature?

text: I am trying to use clewn (full gdb support in the vim editor), but the vim I have on my box doesn't have the `netbeans_intg` feature enabled. Is it possible to enable it without recompiling vim? I am using Cygwin. **EDIT** : I did fix it by recompiling vim, but I was wondering if there were an easier way.


title: Convert a folder of images into a multi-page pdf file usind command line tools?

text: I have a folder with 100 jpg images. I want to convert these images into a multi-page pdf file, with all the images (cropped to A4 size). They are already in the correct rotation. Which tools should I use?


title: How to clear environment variables in launchd?

text: Currently, I have this bash script:               #!/bin/bash     function clear_secrets {       export bob=""       export john=""     }     clear_secrets      And I want this bash script to run every 1 minute through launchd. However, when I set those environment variables in a bash session, they are not being cleared out after a minute. I'm assuming it's because launchd runs the script in a different session. Is there a way to have launchd affect all bash sessions? To clarify, I want to clear some environment variables every minute in all current bash sessions. I tried this using a bash script and having launchd sourcing that bash script every minute. What can I do to achieve this?


title: For loop for renaming files with prompt for each filename

text: I have to convert multiple video files in a folder. I have to rename each one of them but I need the script to prompt me to write a custom name for each filename. Here is what I've got so far:   1. First I need to remove the filename spaces which my script does with that command:              for f in *' '*; do mv "$f" "`echo $f | sed -e 's/ /_/g'`"; done        2. I remove the extension of the files because I don't need it for the conversion. I use this command:              for x in *; do mv $x $(echo ${x%*.*}); done      After that I need a for loop to rename each file in the pattern:               for i in * ; do mv $i $customname; done      The problem is that I need in that phase the script to prompt me what name to add in the variable `$customname` for each file. Something like this:               Rename file1 to:     .......          Rename file2 to:     .......


title: hiding a php file/folder with php file from ftp user

text: Is it possible to hide the php files or hide a folder with php files from FTP user accessing? But the files can be executed on a webserver?


title: Setting LS_COLORS and in a GNU Screen

text: Is there a way to set a GNU Screen LS_COLORS to that of the default non-screen terminal window? Is there `.screenrc` or `.screen_profile`, I don't understand what happens when a GNU Screen is initialized?


title: Can I use pxelinux to boot from an ISOs over the network?

text: I have a server which hosts mirrors for FreeBSD, CentOS and Scientific Linux. It includes .iso files. Is it possible to use pxelinux to boot this ISO over the network? Must I use gPXE or iPXE instead? I have seen some indication that this is possible, but I'm not sure that I trust that forum post, as I have not gotten this to work. I have the following configuration:               LABEL freebsd-install-net       MENU LABEL Netboot FreeBSD-8.2-RELEASE-amd64-disc1.iso       KERNEL memdisk       APPEND iso raw initrd=http://192.168.1.100/freebsd82-disc1.iso      But pxelinux tells me the following:               Loading memdisk....     Could not find ramdisk image: http://192.168.1.100/freebsd82-disc1.iso


title: Make sure X server isn't already running?

text: Suddenly out of the blue I was able to start the X server but with many warnings on CentOS and then I tried to make sure it was shut down by going into /usr/bin and `gdm stop` but there is an error log which states:               [2148293.861] _XSERVTransSocketINETCreateListener: ...SocketCreateListener() failed     [2148293.861] _XSERVTransMakeAllCOTSServerListeners: server already running     [2148293.861]     Fatal server error:     [2148293.862] Cannot establish any listening sockets - Make sure an X server isn't already running     [2148293.862] (EE)     Please consult the CentOS support              at http://wiki.centos.org/Documentation      for help.     [2148293.862] (EE) Please also check the log file at "/var/log/Xorg.0.log" for additional information.     [2148293.862] (EE)     [2148293.862] Server terminated with error (1). Closing log file.      With `gdm stop` I get:               ** (gdm-binary:25390): WARNING **: Couldn't connect to system bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or director


title: tmux on startup and ssh-agent forwarding issue

text: I've added the following lines (taken from here) to my .bashrc to automatically start a tmux session on login:               if [ "$PS1" != "" -a "${STARTED_TMUX:-x}" = x -a "${SSH_TTY:-x}" != x ]     then             STARTED_TMUX=1; export STARTED_TMUX             sleep 1             ( (tmux has-session -t remote && tmux attach-session -t remote) || (tmux new-session -s remote) ) && exit 0             echo "tmux failed to start"     fi      However, this seems to breaks ssh agent forwarding on subsequent logins. Is there a way around this?


title: how to clean free row/column spaces after the row of your data

text: I have a problem in cleaning my file where there are unnecessary free spaces below my last data row. This is created when I am copying and pasting my data from excel to text. I want my text file to fit my data only. This will reduce the computational time when I am running my model. I just came to know the size of my file is big due to the unwanted free space below my last data row. I want you help me how clean up the unwanted rows.


title: Is there anything in unix crontab to determine this should be executed in PST/CST standard time?

text: There is this thing in QuartzScheduler where we can say execute this in CST/BST/ or whatever timezone. This is also good when you want to execute some jobs in certain timezones and certain jobs in some other timezones. Is there something like that in crontab where we can specify the timezone, because I have been seeing people going crazy numerous times when there is a timezone change and they have to go through the list of jobs in crontab where they have to change timings. `I am looking for something where we can execute certain jobs in certain timezones and certain other jobs in some other timezones.`


title: Create new linux account as a user without root access

text: Is it possible to create a non-root Linux user account without being logged in as a root user and without using `sudo`?


title: Protect application files in from access by the same user

text: I want to know if it's possible for an application to create files accessible only from the application itself. Problem is that I don't have root access. For example, if I run the application as UserA I want to ensure that any other application run by UserA cannot access the files.


title: Terminal won't go back to prompt after launching app

text: I'm running elementary OS Luna (based on Ubuntu 12.04) on which I've installed `Okular` as I consider it to be the best PDF reader even if it's meant primarily for KDE. The issue is this, I need to use the terminal to tell `Okular` to open a file and then I want it to go back to the prompt. I've tried the standard:               okular file.pdf &      but it doesn't work. The terminal is only released after I close `Okular` and as I understand it, the `&` command should do that automatically. What am I doing wrong? * * * **Add** This is what I get in the terminal after issuing the above command:               okular(13592)/kdecore (KConfigSkeleton) KCoreConfigSkeleton::writeConfig:     okular(13592)/kdecore (KConfigSkeleton) KCoreConfigSkeleton::writeConfig:     okular(13592)/kdecore (KConfigSkeleton) KCoreConfigSkeleton::writeConfig:     okular(13592)/kdecore (KConfigSkeleton) KCoreConfigSkeleton::writeConfig:     okular(13592)/kdecore (KConfigSkeleton) KCoreConfigSkeleton::writeConfig:     This backend is only for XRandR 1.1, your version is:  1 . 3


title: Can it harm if I shutdown without closing applications?

text: Can it hurt if I shut down my machine without closing all programs? I normally close all of them by hand, but have heard from others that this is really not necessary anymore (i.e. Linux will take care of proper closing of programs before shutting down the computer). I normally run applications like Thunderbird, VIM (with no unsaved files opened), and browser windows when I shut down my pc. And I would make sure not to be writing anything to USB when shutting down. Running Arch Linux and shutting down using ConsoleKit.


title: How do you make DISPLAY variable undefined?

text: I am using Ubuntu, but I think this applies to all Linux. What's the command to set DISPLAY to be undefined in the shell?


title: Preventing access to TTY when X is killed

text: Assume I start an X server manually from a virtual console `/dev/tty1` with `xinit` or `startx`, with the line `id:3:initdefault:` set in `/etc/inittab`. The X server gets run and put on another virtual console, normally being `/dev/tty7`. After some time I decide to lock the screen with `xscreensaver --lock` and leave my computer. To unlock the screen one would have to know my user's password. If someone now decides to kill the running X server, he or she would be returned to the shell running at `/dev/tty1` and pretty much have access to my computer. Typically, the X server can be killed with `Ctrl+Alt+Backspace` or switching to the initial console and `SIGTERM` the running process with `^C`. This is trivial to do - which means there must be trivial ways to prevent it from happening. I'm using `vlock` to lock my virtual console `/dev/tty1` to prevent this:               $ xinit && vlock || vlock      When the X server now returns, gracefully `&&` or not `||`, the console will be locked. This may not be the optimal solution. I've read this thread and this wiki article, explaining different solutions. What other methods are there to prevent this kind of access to virtual consoles from X sessions? Is the above method safe enough? How do you prevent this on your system? I'm not going to use a display manager.


title: Prevent specific USB device from automounting

text: I have a SD card which is always inserted in my SD-card slot. However, I do not often use it (but do not want to take it out). Currently, it's being auto- mounted every time I start my computer. I feel this might over time wear out the SD card unnecessarily. So my question is: how to prevent this particular SD card from being mounted automatically? Whenever I need it, I'll mount it manually. I've found this article: http://www.tuxradar.com/answers/706 Which explains exactly what to do using HAL, but given that HAL is deprecated I'm looking for a way of doing this using udev. Using Arch Linux.


title: How do I proceed further when my reports of a improper functioning of a gnome component has not met with answers on the respective mailing list

text: I am unable to connect to internet using my modem. I followed instructions to seek help at http://live.gnome.org/NetworkManager/Debugging and posted on http://mail.gnome.org/archives/networkmanager-list/2011-October/msg00194.html. There was an initial response from the mailing list, but now its silent. What should I do in this situation? Do I go ahead and just file a bug at bugzilla.gnome.org? Though I am competent enough to help somebody fixing bugs by providing required more information, I am not competent enough to try and help fixing the bug myself.


title: Cron allowed special character "L" for "Last day of the month" on Debian

text: I'd like to know if `L` is one of the allowed special characters on Debian's cron implementation? I'm trying to set up a cron to run on the last day of every month. From the cron entry on wikipedia: > 'L' stands for "last". When used in the day-of-week field, it allows you to > specify constructs such as "the last Friday" ("5L") of a given month. In the > day-of-month field, it specifies the last day of the month. > > Note: L is a non-standard character and exists only in some cron > implementations (Quartz java scheduler) If not, how would you go about setting a cron to run on the last day of every month? Would you recommend 3 different entries like this solution on stackoverflow?


title: how to select part of the row and pasting to form other file?

text: I want you help me how to organize my data by cutting in the following way. I have the input data as below. **input.file:**               1   2   1   0.6007  0.1 0.3 0.2 0.7 0.7 0   2   0.3073  0.1 0.1 0.2 0.4 0.7 0.5     2   2   1   0.4022  0.1 0.3 0.2 0.7 0.7 0   2   0.5085  0.1 0.1 0.2 0.4 0.7 0.5     3   2   1   0.0029  0.1 0.3 0.2 0.7 0.7 0   2   0.9078  0.1 0.1 0.2 0.4 0.7 0.5     4   2   1   0.0692  0.1 0.3 0.2 0.7 0.7 0   2   0.8805  0.1 0.1 0.2 0.4 0.7 0.5      My desired output file would look like this: **out.file:**               1   2                                            0.6007  1   0.1 0.3 0.2 0.7 0.7 0             0.3073  2   0.1 0.1 0.2 0.4 0.7 0.5     2   2                                            0.4022  1   0.1 0.3 0.2 0.7 0.7 0             0.5085  2   0.1 0.1 0.2 0.4 0.7 0.5     3   2                                            0.0029  1   0.1 0.3 0.2 0.7 0.7 0             0.9078  2   0.1 0.1 0.2 0.4 0.7 0.5     4   2                                            0.0692  1   0.1 0.3 0.2 0.7 0.7 0             0.8805  2   0.1 0.1 0.2 0.4 0.7 0.5


title: Boot my kernel in a Virtual Machine?

text: I'm learning now how to compile and boot linux kernels. Is there a way to boot kernels in a virtual machine, rather than messing my system? I use VMWare Workstation on Windows 8. Can I use that to boot my linux kernel?


title: How do you use minicom with stdin and stdout?

text: I need to communicate with Python over a USB to RS-232 converter, to a device. The application `minicom` connects seamlessly, so if I could run that in non- interactive mode, everything would would be great. Reading the documentation there are some interesting options, but I'm not fully understanding any one of them:                -t   Terminal type. With this flag, you can override the environment            TERM variable.            -S   script.   Run  the named script at startup.      How do I pipe data between my application and `minicom`? Should I use something else?


title: Some keys keep getting randomnly ignored when typing on my laptop keyboard

text: Currently, I have Arch Linux 64-bit installed on the Razer Blade Pro laptop. The only problem I have is that some keystrokes get randomly ignored when typing at normal-fast speed (above 5 keys/sec becomes a problem). This does not occur when typing slow, and never occurs in windows. Is this a problem with the hid-usb controller and Razer laptop antighosting keyboard? We tried solving the problem by following some directions from a forum which mentioned recompiling the kernel with a modified "drivers/hid/usbhid/hid- core.c" file, hardcoding "interval = 1; at line 1134". But we did not reach a solution. My internal devices are:               [cristobal@orion ~]$ lsusb -vv -d 1532:          Bus 001 Device 003: ID 1532:0116 Razer USA, Ltd      Couldn't open device, some information will be missing     Device Descriptor:            bLength                18       bDescriptorType         1       bcdUSB               2.00       bDeviceClass            0 (Defined at Interface level)       bDeviceSubClass         0        bDeviceProtocol         0        bMaxPacketSize0        64       idVendor           0x1532 Razer USA, Ltd       idProduct          0x0116        bcdDevice            1.00       iManufacturer           1        iProduct                2        iSerial                 0        bNumConfigurations      1       Configuration Descriptor:         bLength                 9         bDescriptorType         2         wTotalLength          123         bNumInterfaces          4         bConfigurationValue     1         iConfiguration          0          bmAttributes         0xa0           (Bus Powered)           Remote Wakeup         MaxPower              500mA         Interface Descriptor:           bLength                 9           bDescriptorType         4           bInterfaceNumber        0           bAlternateSetting       0           bNumEndpoints           1           bInterfaceClass         3 Human Interface Device           bInterfaceSubClass      1 Boot Interface Subclass           bInterfaceProtocol      2 Mouse           iInterface              0              HID Device Descriptor:               bLength                 9               bDescriptorType        33               bcdHID               1.11               bCountryCode            0 Not supported               bNumDescriptors         1               bDescriptorType        34 Report               wDescriptorLength      75              Report Descriptors:                 ** UNAVAILABLE **           Endpoint Descriptor:             bLength                 7             bDescriptorType         5             bEndpointAddress     0x81  EP 1 IN             bmAttributes            3               Transfer Type            Interrupt               Synch Type               None               Usage Type               Data             wMaxPacketSize     0x0008  1x 8 bytes             bInterval               8         Interface Descriptor:           bLength                 9           bDescriptorType         4           bInterfaceNumber        0           bAlternateSetting       1           bNumEndpoints           1           bInterfaceClass         0 (Defined at Interface level)           bInterfaceSubClass      0            bInterfaceProtocol      0            iInterface              0            Endpoint Descriptor:             bLength                 7             bDescriptorType         5             bEndpointAddress     0x81  EP 1 IN             bmAttributes            3               Transfer Type            Interrupt               Synch Type               None               Usage Type               Data             wMaxPacketSize     0x0040  1x 64 bytes             bInterval               8         Interface Descriptor:           bLength                 9           bDescriptorType         4           bInterfaceNumber        1           bAlternateSetting       0           bNumEndpoints           1           bInterfaceClass         3 Human Interface Device           bInterfaceSubClass      0 No Subclass           bInterfaceProtocol      1 Keyboard           iInterface              0              HID Device Descriptor:               bLength                 9               bDescriptorType        33               bcdHID               1.11               bCountryCode            0 Not supported               bNumDescriptors         1               bDescriptorType        34 Report               wDescriptorLength     159              Report Descriptors:                 ** UNAVAILABLE **           Endpoint Descriptor:             bLength                 7             bDescriptorType         5             bEndpointAddress     0x82  EP 2 IN             bmAttributes            3               Transfer Type            Interrupt               Synch Type               None               Usage Type               Data             wMaxPacketSize     0x0010  1x 16 bytes             bInterval               8         Interface Descriptor:           bLength                 9           bDescriptorType         4           bInterfaceNumber        2           bAlternateSetting       0           bNumEndpoints           1           bInterfaceClass         3 Human Interface Device           bInterfaceSubClass      1 Boot Interface Subclass           bInterfaceProtocol      1 Keyboard           iInterface              0              HID Device Descriptor:               bLength                 9               bDescriptorType        33               bcdHID               1.11               bCountryCode            0 Not supported               bNumDescriptors         1               bDescriptorType        34 Report               wDescriptorLength      71              Report Descriptors:                 ** UNAVAILABLE **           Endpoint Descriptor:             bLength                 7             bDescriptorType         5             bEndpointAddress     0x83  EP 3 IN             bmAttributes            3               Transfer Type            Interrupt               Synch Type               None               Usage Type               Data             wMaxPacketSize     0x0008  1x 8 bytes             bInterval               8         Interface Descriptor:           bLength                 9           bDescriptorType         4           bInterfaceNumber        3           bAlternateSetting       0           bNumEndpoints           2           bInterfaceClass       255 Vendor Specific Class           bInterfaceSubClass    240            bInterfaceProtocol      0            iInterface              0            Endpoint Descriptor:             bLength                 7             bDescriptorType         5             bEndpointAddress     0x01  EP 1 OUT             bmAttributes            2               Transfer Type            Bulk               Synch Type               None               Usage Type               Data             wMaxPacketSize     0x0200  1x 512 bytes             bInterval               0           Endpoint Descriptor:             bLength                 7             bDescriptorType         5             bEndpointAddress     0x02  EP 2 OUT             bmAttributes            2               Transfer Type            Bulk               Synch Type               None               Usage Type               Data             wMaxPacketSize     0x0200  1x 512 bytes             bInterval               0      What could be the cause of this problem? Directions on where to start looking would be appreciated.


title: Routing using second interface

text: I've got a machine I control running Ubuntu 12.10. I'm on a network that will only allow me to have one device connected. I've also got a USB ethernet adapter. I'd like to create a private network hung off that for eg my Raspberry Pi so I can SSH it and it can access the internet. Can someone please explain the concepts of what I need to do in order to achieve this without mucking up my main network connection? Not knowing exactly what it is I need to do in the vast field of linux routing has made googling somewhat futile.


title: Find directories and files with permissions other than 775 / 664

text: I am moving a website from one server to another and Git does not store metadata such as file permissions. I need to find the directories and files that are not 775 / 664 respectively. Right now, I'm using this cobbled-together contraption:               $ find . -type d -exec ls -la {} \; | grep ^d | grep -v ^drwxrwxr-x     $ find . -type f -exec ls -la {} \; | grep -v ^d | grep -v ^-rw-rw-r-- | grep -v '.git'      Though this works, I feel it is rather hacky. Is there a better way to do this, perhaps a canonical way, or should I just be hacky? This is running on a recent Ubuntu version with GNU tools under Bash.


title: How to write isolinux to an ext4 filesystem

text: How would I write isolinux to an ext4 filesystem on an 1 GB SD card so that it would boot at startup?


title: Uninstall a python software properly

text: I installed a little python software (pycarddav) before to notice there is a packaged version for Debian sid... Now, I would like to uninstall properly this software and then, install the packaged version with apt. Here is what I did to install pycarddav (following its doc):   1. Download pycarddav and extract it   2. Go to the folder and launch `python setup.py install` which contain:               #!/usr/bin/env python2          import os     import string     import subprocess     import sys     import warnings          #from distutils.core import setup     from setuptools import setup          MAJOR = 0     MINOR = 7     PATCH = 0          RELEASE = True          VERSION = "{0}.{1}.{2}".format(MAJOR, MINOR, PATCH)          if not RELEASE:         try:             try:                 pipe = subprocess.Popen(["git", "describe", "--dirty", "--tags"],                                         stdout=subprocess.PIPE)             except EnvironmentError:                 warnings.warn("WARNING: git not installed or failed to run")                  revision = pipe.communicate()[0].strip().lstrip('v')             if pipe.returncode != 0:                 warnings.warn("WARNING: couldn't get git revision")                  if revision != VERSION:                 revision = revision.lstrip(string.digits + '.')                 VERSION += '.dev' + revision         except:             VERSION += '.dev'             warnings.warn("WARNING: git not installed or failed to run")               def write_version():         """writes the pycarddav/version.py file"""         template = """\     __version__ = '{0}'     """         filename = os.path.join(             os.path.dirname(__file__), 'pycarddav', 'version.py')         with open(filename, 'w') as versionfile:             versionfile.write(template.format(VERSION))             print("wrote pycarddav/version.py with version={0}".format(VERSION))          write_version()               requirements = [         'lxml',         'vobject',         'requests',         'urwid',         'pyxdg'     ]     if sys.version_info[:2] in ((2, 6),):         # there is no argparse in python2.6         requirements.append('argparse')          setup(         name='pyCardDAV',         version=VERSION,         description='A CardDAV based address book tool',         long_description=open('README.rst').read(),         author='Christian Geier',         author_email='pycarddav@lostpackets.de',         url='http://lostpackets.de/pycarddav/',         license='Expat/MIT',         packages=['pycarddav', 'pycarddav.controllers'],         scripts=['bin/pycardsyncer', 'bin/pc_query', 'bin/pycard-import'],         requires=requirements,         install_requires=requirements,         classifiers=[             "Development Status :: 4 - Beta",             "License :: OSI Approved :: MIT License",             "Environment :: Console :: Curses",             "Intended Audience :: End Users/Desktop",             "Operating System :: POSIX",             "Programming Language :: Python :: 2 :: Only",             "Topic :: Utilities",             "Topic :: Communications :: Email :: Address Book"         ],     )      How can I remove it properly? Can I use `pip uninstall pycarddav` even if I didn't use pip for the installation?


title: How to fix Java applications mouse pointer offset in Awesome WM?

text: How to reproduce in Awesome WM v3.5.2 through 3.5.5 (so far):   1. Install OpenJDK or Oracle **Java 7**. This bug has been observed with both.   2. Start a new Awesome WM session with the **default configuration**.   3. Start either **jEdit** or **PyCharm**. This bug has been observed with both.      * Move the mouse pointer around, and observe how it changes based on whether you are hovering over code, project files or menus. This should work normally.     * Click and release on the _File_ menu, enter one of the sub-menu, and observe how the item directly under the mouse pointer is focused all the time.   4. Press `Mod4`+`Space` repeatedly until the **floating layout** is activated (the application will be almost full screen) _or_ open another application in the same tag. At this point, I would expect the mouse to behave like it does with "normal" applications. Instead I observe the following:   * When clicking and navigating menus with the mouse, the mouse pointer and the focused menu item will be **vertically offset** from each other, seemingly at the same amount of pixels as the height of the status bar.   * When hovering over miscellaneous items as before, the **cursor icon** will be set as if the mouse pointer was higher up on the screen. For example, hovering over the top line of text you will not see a text cursor. It's as if something doesn't detect that the window coordinates have changed. A similar but much more annoying bug happens when you **open another application in the same tag** - the mouse behaviour is **as if the window hadn't moved at all.** When you **toggle another tag which already has an application open** - the "virtual mouse desktop" is moved to the **top left of the primary screen**. Since these bugs have been observed in both OpenJDK and Oracle Java, with different Java applications, it seems very likely that the bug is in Awesome WM. Related question, article. I tried the `_JAVA_AWT_WM_NONREPARENTING` and `wmname` fixes, but no go.


title: communication between multiple processes

text: I have a bash script, which runs manager() function as a separate process for x-times. How is it possible to forward messages to all manager() processes from within the script? I've read about anonymous pipes but I have no idea how to share the messages with it.. I tried doing it with named pipes, but it appears that I would have to create a separate named pipe for each process? What is the most elegant way to do this? Here's my code so far:               #!/bin/bash          manager () {         while :         do             echo "read what has been passed to \$line"         done     }          x=1     while [ $x -le 5 ]     do       manager x &       x=$(( $x + 1 ))     done               while :     do     while read line     do       echo "What has been passed through the pipe is ${line}"       # should pass $line to every manager process          done < $1     done          exit 0


title: Help Deciphering Disk Usage. Where Did the Space Go?

text: # The System   * An instance running on _Amazon EC2_   * It is an _m1.large_ EC2 instance   * The instance is running _Ubuntu Server 12.04 LTS_ # Here's What Happens... To begin, let's execute the following:               root@host:~# df -h     Filesystem      Size  Used Avail Use% Mounted on     /dev/xvda1      9.9G  6.6G  2.8G  71% /     udev            3.7G  8.0K  3.7G   1% /dev     tmpfs           746M  184K  745M   1% /run     none            5.0M     0  5.0M   0% /run/lock     none            3.7G     0  3.7G   0% /run/shm     /dev/xvdb       414G  199M  393G   1% /mnt      The output above tells us that 199 MB or 1% of `/dev/xvdb` (our ephemeral storage) is in use. However, the output of `ls` tells us the device is pretty much empty.               root@host:~# ls -lah /mnt     total 24K     drwxr-xr-x  3 root root 4.0K Nov 11 11:27 .     drwxr-xr-x 23 root root 4.0K May  1 15:57 ..     drwx------  2 root root  16K Nov 11 11:27 lost+found      What is consuming all the space? # Edit: Additional Information... As advised in the comments below, here is the output of `du -sch /mnt`:               root@host:~# du -sch /mnt     20K     /mnt     20K     total      ... and here is the output of `mount`:               root@host:~# mount     /dev/xvda1 on / type ext4 (rw)     proc on /proc type proc (rw,noexec,nosuid,nodev)     sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)     none on /sys/fs/fuse/connections type fusectl (rw)     none on /sys/kernel/debug type debugfs (rw)     none on /sys/kernel/security type securityfs (rw)     udev on /dev type devtmpfs (rw,mode=0755)     devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)     tmpfs on /run type tmpfs (rw,noexec,nosuid,size=10%,mode=0755)     none on /run/lock type tmpfs (rw,noexec,nosuid,nodev,size=5242880)     none on /run/shm type tmpfs (rw,nosuid,nodev)     /dev/xvdb on /mnt type ext3 (rw)


title: What are the legitimate uses of the `touch` command?

text: What's the point of the `touch` command? I know I can create empty files with it, but so is also the case with `echo -n`. Otherwise, why would someone need to change the timestamps of a file? Unless to create the false impression about the age of a file, I don't see any other use, and this one is not a legitimate one (from my point of view).


title: Solaris 11 and syslog over TLS

text: Does Oracle support support remote syslog over TLS/SSL on Solaris **11**? I found it can be done with rsyslog, but is rsyslog default on Solaris 11 **and** if rsyslog is not default, does Oracle support a system with rsyslog (version?) rather than the default Solaris syslog? Anyone experience with this?


title: ideal live cd distro to build LFS 7.5

text: I was thinking of building my first LFS system but I can't seem to figure out which live cd distro to use. Because most distros are either out of date or are too fresh. However I did try out a few distros of which are   * fedora20   * archlinux   * linuxmint   * ubuntu 12.10 and 14.04   * lubuntu 14.04   * minisuse   * gentoo but most of them don't seem to meet the host system requirements as stated here. could anyone please suggest me a distro?


title: How to see what processes WERE running?

text: Is there a chance to get the processes that **RAN** before my system crash? **EDIT** What I really want is to see the past processes. My system crashed & I want to know if a specific process was the main reason. I search into all /var/log logs, but nothing, the only suspect in this were some apache logs, where I found some kind of scans... So now I want to check out for all processes running at that time.


title: How to see Current users on the system

text: I need a script to identify only and only users ( current users ) on the system and what actions they are performing. I use w , but don't show user's actions that are currently performing ... and PS shows me also the machine... I need something that only shows users with their current job!! Will you help me, please?


title: LXDE: change battery icon in the taskbar

text: I have installed `LXDE` on `Debian` (LXDE metapackage). I have also installed some additional themes and icons, but when I chage the icons, the battery icon in the task bar stays the same (basically just an ugly green rectange, that does not look anything like a battery) I am wondering, is there some special icon set for task bar icons ? I just want any reasonable battery icon.


title: Why is this python error message generated whenever I type a nonsense command?

text: Whenever I type any "nonsense" command, this python error message is generated. Normal commands work fine. Any idea how to debug this?               $ somenonexistingcommand     Traceback (most recent call last):       File "/usr/local/lib/python2.7/site.py", line 553, in <module>         main()       File "/usr/local/lib/python2.7/site.py", line 535, in main         known_paths = addusersitepackages(known_paths)       File "/usr/local/lib/python2.7/site.py", line 268, in addusersitepackages         user_site = getusersitepackages()       File "/usr/local/lib/python2.7/site.py", line 243, in getusersitepackages         user_base = getuserbase() # this will also set USER_BASE       File "/usr/local/lib/python2.7/site.py", line 233, in getuserbase         USER_BASE = get_config_var('userbase')       File "/usr/local/lib/python2.7/sysconfig.py", line 535, in get_config_var         return get_config_vars().get(name)       File "/usr/local/lib/python2.7/sysconfig.py", line 434, in get_config_vars         _init_posix(_CONFIG_VARS)       File "/usr/local/lib/python2.7/sysconfig.py", line 298, in _init_posix         raise IOError(msg)     IOError: invalid Python installation: unable to open /usr/include/python2.7/pyconfig.h (No such file or directory)     $ echo this works fine, however     this works fine, however     $      **EDIT** - after fixing my /usr/bin/python, I now get this different python error message:               $ yetanothernonexistingcommand     Traceback (most recent call last):       File "/usr/lib/command-not-found", line 10, in <module>         import CommandNotFound     ImportError: No module named CommandNotFound      Somehow, python is being run whenever I mistype a command.


title: How to add a dot to particular lines in LaTeX-document?

text: I have a LaTeX-document where I have lines of the form               \section*{3.1}     \addcontentsline{toc}{section}{3.1}      or in general               \section*{x.y}     \addcontentsline{toc}{section}{x.y}      for x between 1 and 31 and y between 1 and 12 inclusively, (dates). I would like to change those lines to the form               \section*{x.y.}     \addcontentsline{toc}{section}{x.y.}      Is there some easy script to do that?


title: Why isn't cron running automatically?

text: OS : Ubuntu 12.04 Now I want to use Backup and Whenever gem to automatic backup my database. When I connect the server by ssh as an added user to run **backup perform -t my_backup** ,it works well.But the cron file:               0 22 * * * /bin/bash -l -c 'backup perform -t my_backup'      can't run at 22:00. When I use **cat /etc/crontab** check the cron's config file,it is:               SHELL=/bin/sh     PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin          # m h dom mon dow user  command     17 *    * * *   root    cd / && run-parts --report /etc/cron.hourly     25 6    * * *   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )     47 6    * * 7   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )     52 6    1 * *   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )     #      The **/bin/bash** and **/bin/sh** are different.What's the reason?How to do?


title: How can I have `date` output the time from a different timezone?

text: I have a server running with the timezone set to `UTC`. It seemed like that was generally a good practice (please correct me if I'm wrong). Anyhow, one of the servers I connect to, in order to `scp` files, is running on `EDT` and stores files that I need to copy in the format `/path/to/filename/data20120913` I looked at trying to `rsync` files using something like find's `-mtime -1` flag for files modified in the last day, but I didn't have any luck. I don't mind just using `scp` to copy the current day's file, but as of right now there is a 4-hour window where running `date +%Y%m%d` will give a different day on each server and that bugs me a little. Looking through `man date` I see that I can have the time output as `UTC`, but I don't see a way to have it output as another timezone like `EDT` I suppose I could also use something like the `GNU` date extension `date -d 20100909 +%s` to get the date in seconds from the epoch, apply a manual `4 * 60 * 60` second calculation, and see about rendering that as a date - but then when daylight time kicks in it will still be an hour off. Is there a simpler way to output the date in a `YYYYMMDD` format for `EDT` on a server that is set to `UTC` ?


title: Is there a practical use for the GNU factor command?

text: Looking through the GNU Coreutils, I spotted the `factor` command, that I had never noticed before. Reading the man page: > Print the prime factors of each specified integer NUMBER. If none are > specified on the command line, read them from standard input. Is there a practical use for `factor`, or is it just a demonstration / toy package?


title: Ubuntu 10.04 LAMP Virtual Host seems to ignore active sites

text: **I was going to delete this question, but I couldn't because it has been answered. I am abandoning this question because I am going to replace my desktop install with a server install. We'll see if that fixes it.** I installed LAMP with apache2 on my Ubuntu 10.04 system. It works and serves files from /var/www. I followed the instruction found [here][1]. The new site username is selah and the domain name is selahsanctuary.org. Here's my file, /etc/apache2/sites-enabled/selah               <VirtualHost *:80>         ServerAdmin webmaster@localhost             ServerName selahsanctuary.org             DocumentRoot /home/selah/public_html/         <Directory />             Options FollowSymLinks             AllowOverride None         </Directory>         <Directory /home/selah/public_html/>             Options Indexes FollowSymLinks MultiViews             AllowOverride None             Order allow,deny             allow from all         </Directory>              ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/         <Directory "/usr/lib/cgi-bin">             AllowOverride None             Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch             Order allow,deny             Allow from all         </Directory>              ErrorLog /var/log/apache2/error.log              # Possible values include: debug, info, notice, warn, error, crit,         # alert, emerg.         LogLevel warn              CustomLog /var/log/apache2/access.log combined              Alias /doc/ "/usr/share/doc/"         <Directory "/usr/share/doc/">             Options Indexes MultiViews FollowSymLinks             AllowOverride None             Order deny,allow             Deny from all             Allow from 127.0.0.0/255.0.0.0 ::1/128         </Directory>          </VirtualHost>      I verified that /home/selah/public_html/index.html exists. If I visit http://selahsanctuary.com, I get the file served from /var/www. I found a suggestion that I add /etc/apache2/conf.d/virtual.conf with this line: `NameVirtualHost *` but that caused an error so I removed it. Then I found a suggestion to add a line in /etc/host like `127.0.0.1 selahsanctuary.org`. I did and restarted apache2. No help. So finally, I ask, what should I try next? Do I have a typo somewhere? I tried to simplify and found another sample of a site-available file like this:               <VirtualHost selahsanctuary.org>     ServerAdmin webmaster@localhost     #We want to be able to access the web site using www.selahsanctuary.org or selahsanctuary.org     ServerAlias www.selahsanctuary.org     DocumentRoot /home/selah/public_html          #we want specific log file for this server     CustomLog /home/selah/selah-access.log combined     </VirtualHost>      and I edited my /etc/hosts file so there is now a line like this: `127.0.0.1 localhost www.selahsanctuary.org selahsanctuary.org` but it still serves the file from /var/www (I did remember to a2ensite selah and /etc/init.d/apache2 reload)


title: How do I recover/kill an SSH session after losing connection?

text: I lost my connection while I was logged via SSH into my university server. Classic. Now I can't log in since the session appears to be still running and I get the error "Too many logins for 'myuser'". (Only 1 login for each user is allowed) Is there a way to recover the session _not_ having another access to the server (I can't reach any sysadmin until monday) - or the only way is just to wait for the session to time out? Typically how long should I wait? More than an hour has already passed.


title: Gedit opening an "Unsaved document" on opening files with mouse

text: When I open files by double-clicking a file with mouse I always get one additional "Unsaved Document X".. which is very annoying, because I have to close tham all, and click "Close without save" every time... This happens in dolphin, nautilus and krusader (those are the ones where I tried it, so I gues it's not because of a file manager). When I try opening a file from terminal using "gedit filename" the problem is not there. It also does not happen if I open files from within gedit. Any hints on how to fix this? This started happening I think somewhere around the time when gnome3 came into Arch official repos. (I use up-to-date Arch and KDE4.6)


title: Delete files that exist in the source with rsync

text: I have a folder on server "A" called `./delete`. I want to delete everything in the folder `./stuff` on server "B" that exists in the `./delete` folder on server "A". Its like the reverse of rsync. instead of transferring files from `a:/delete` to `b:/stuff` I want to just delete all the files that are in both places on server "B". like a `\--delete-on-destination` flag or something.


title: Looking for a GUI application to enter linux commands

text: I am looking for a GUI console where I can enter Linux commands in an entry widget and the result will be output in a text area widget. Is there is such software available? Something like this: ![enter image description here](http://i.stack.imgur.com/IQ980.png) In console programs like `gnome-terminal` or `xterm`, the screen keeps scrolling with every new command, and I find this annoying specially when the result has a few dozen lines. I would like to visualize the command and the result at the same time, alike a browser entering a web address in the address bar and obtaining the website as a result. I am wondering is there is an implementation of such a software in a language like Python, Tcl, Ruby or even Java.


title: Executing a shell command from PHP with shell_exec

text: Included in my thesis is to create an administration interface, in which an administrator can approve users whom have asked for access to use OpenNebula. Upon approval the users should be added to OpenNebula (i.e. it corresponds to the command `oneadmin createuser username password`). (More information of the interface (section 4.2).) I am trying to perform this with an execution of a shell command in a PHP file. Why doesn't this work (below is just a specific example - not the general code that I am using)?               $execQuery = "/bin/su oneadmin postgres -c '/usr/bin/oneuser create test10 test10'";     shell_exec ($execQuery); //execute query in shell.      Nor does this work (even though I am logged in as oneadmin, when the script is executed by PHP):               shell_exec ("/usr/bin/oneuser create test10 test10");      It works when I type that command in the shell. I have tried to execute other shell commands through php and those work fine, so I wonder where the problem lies. I have given the file `/usr/bin/oneuser` `rwx` rights for all users.


title: Traffic counter on openwrt?

text: Are there any (not a resource hog) solutions to have statistics about the traffic on an OpenWrt router? :O e.g.: traffic per IP address, monthly statistics, etc. :O


title: Java is constantly generating an error log in my home directory?

text: I have started to notice that whenever I use a Java-based application on Fedora 20, whether it's a game or Eclipse or something else, it will always generate an error log of some sort in home directory. This is an annoying place for logs to be saved in the first place, but I obviously would like to fix whatever error it is referencing. But I am not quite sure what it is saying or how I would go about fixing this. The name of the error logs are always `abrt_checker_####.log`, the #### being a series of random numbers. Below is an example of what one of these error logs look like. So, my question is, **what does this error mean and how I can I fix it?**               Uncaught java.lang.ClassNotFoundException exception in thread "main" in a method java.lang.ClassLoader.loadClass() with signature (Ljava/lang/String;Z)Ljava/lang/Class;     Exception in thread "main" java.lang.ClassNotFoundException: .usr.lib64.eclipse..plugins.org.eclipse.equinox.launcher_1.3.0.v20131104-1241.jar     at java.net.URLClassLoader$1.run(URLClassLoader.java:366) [jar:file:/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.60-2.4.3.0.fc20.x86_64/jre/lib/rt.jar!/java/net/URLClassLoader$1.class]     at java.net.URLClassLoader$1.run(URLClassLoader.java:355) [jar:file:/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.60-2.4.3.0.fc20.x86_64/jre/lib/rt.jar!/java/net/URLClassLoader$1.class]     at java.security.AccessController.doPrivileged(Native Method) [jar:file:/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.60-2.4.3.0.fc20.x86_64/jre/lib/rt.jar!/java/security/AccessController.class]     at java.net.URLClassLoader.findClass(URLClassLoader.java:354) [jar:file:/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.60-2.4.3.0.fc20.x86_64/jre/lib/rt.jar!/java/net/URLClassLoader.class]     at java.lang.ClassLoader.loadClass(ClassLoader.java:425) [jar:file:/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.60-2.4.3.0.fc20.x86_64/jre/lib/rt.jar!/java/lang/ClassLoader.class]     at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) [jar:file:/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.60-2.4.3.0.fc20.x86_64/jre/lib/rt.jar!/sun/misc/Launcher$AppClassLoader.class]     at java.lang.ClassLoader.loadClass(ClassLoader.java:358) [jar:file:/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.60-2.4.3.0.fc20.x86_64/jre/lib/rt.jar!/java/lang/ClassLoader.class]


title: Are short-lived files flushed to disk?

text: My program creates many small short-lived files. They are typically deleted within a second after creation. The files are in an ext4 file system backed by a real hard disk. I know that Linux periodically flushes (`pdflush`) dirty pages to disk. Since my files are short-lived, most likely they are not cached by `pdflush`. My question is, does my program cause a lot of disk writes? My concern is my hard disk's life. Since the files are small, let's assume the sum of their size is smaller than `dirty_bytes` and `dirty_background_bytes`. Ext4 has default journal turned on, i.e. metadata journal. I also want to know whether the metadata or the data is written to disk.


title: OpenSolaris vs. Debian for Xen Hypervisor VM server

text: all. I've just purchased a computer that I'd like to repurpose as a lab server. It's a six-core AMD processor with 8 gigs of ram (16 gig max) and a terabyte hard drive. My idea is to hose Windows, install a unix-based system on it, and use it to host a lot of virtual guests. I've been looking at my virtualization options, and I've decided to go with Xen - I've never used it before, but it looks like it has good support and I've heard good things about it. (My only experience with virtual hosts has been with VMware on Debian.) Debian would be my first choice as an OS because I'm familiar with it's setup and package management tools, and I know that Xen is supported on Debian. However, OpenSolaris has ZFS, which is pretty compelling. Has anyone had any experience doing something like this? I'm torn between going with what I know (Debian) or trying my hand with OpenSolaris just for the ZFS filesystem (which is, from what I understand, VERY awesome). Does Xen even run on OpenSolaris? All of my searches have turned up information about OpenSolaris as a virtual guest, not a virtual host. Discussion and experiences are welcome. If this is a bad question, or if I need to give more details, please let me know. Thanks! Edit: Virtualization options are welcome, as well. Xen looks interesting, but I am by no means tied to it. Since this will be a personal lab server, I'm willing to try different methods.


title: Default to "Execute" when double-clicking on a shell script in PCManFM

text: Is it possible to get an executable to execute by default? What I mean is this. I have an `.sh` file, which if I click on twice, it will show me this: ![enter image description here](http://i.stack.imgur.com/XeqQw.png) If I then click `Execute`, it does the right thing. Is it possible to get it to `Execute` without being shown the `Execute File` dialog box? So simply by double clicking the `.sh` file, it should do its thing without showing me the `Execute File` dialog box. I am using Lubuntu/PCManFM if that info is needed.


title: How to persist a file in /usr/local in embedded FreeNAS

text: I have embedded FreeNAS, version 8.2 beta. Now I would like to install openvpn, of course persisting between updates. I have managed to get the program itself persist by using               mount -wu /     pkg_add -r openvpn     mount -ro /      Also I got the the `openvpn_enable="YES"` line to persist by editing `/conf/base/etc/rc.conf` My problem is to persist the `/usr/local/etc/openvpn` folder with therein my `openvpn.conf` configuration and key files. How can I persist those?


title: How to restart polkitd?

text: My desktop PC is also used as a NIS/NFS server for a small workgroup. It runs for months without reboot. Recently I observed that when I log into a desktop session the computer becomes less responsive for several minutes. A `polkitd` process in a `D` state generates a lot of disk I/O activity. Its VmSize is over 600MB and its VmRSS is over 400MB. The machine is still on OpenSUSE 11.3 with polkit 0.96. I plan to upgrade in the summer. There are several reports of memory leaks in polkitd that were fixed in 0.98 (freedesktop.org, opensuse.org). While upgrading will probably solve the problem it would take about a day and I am looking for a quick fix. There is no polkitd script in /etc/init.d and the parent for the polkitd process is `init` itself.                   PID  PPID USER     CMD           ....       22362     1 root     /usr/lib/polkit-1/polkitd      **Question:** How do I restart polkitd without rebooting the system? Can I do it from within a desktop session or should I log off the desktop session and log on to the text console?


title: Pretty print mails from mutt?

text: I know that I can configure a print command in Mutt via `.muttrc`, e.g.:               set print=ask-yes     set print_command="..."      But what print command should I use for _pretty_ printing? Well, `a2ps` output seems a little bit spartan, even with the `-=mail` shortcut. It does not support UTF8. There is `paps` which is described as 'UTF-8 to PostScript converter using Pango' and currently does not include support for margins, or Email layout or something like that. `mp`: nice default header. Again no UTF8 support. Default margins are ridiculously small - if you specify wider margins the body text is printed behind the footer. `enscript`: `-G` for fancy page headers is indeed fancy. No UTF8 support. What do you use in the 21st century to print your mails from Mutt? (It should support UTF8, DIN A4 output as PS and/or PDF)


title: How to install Rekonq 1.0 on Fedora 17?

text: I would like to install Rekonq 1.0 on Fedora 17, using KDE 4.8.5. At the moment, this version of Rekonq isn't available in the repositories, I have version 0.9.2. Anyone knows how can I update my app?


title: What's wrong with this csh file?

text: I don't have any experience writing .sh files. I want to run the pvm2raw utility of this app from the Volume Library. I get the following error when running build.sh in Ubuntu 10.10. ![enter image description here](http://i.stack.imgur.com/QmZ0u.png) build.sh is as follows:               # make command     set mmfile=V3Makefile     set make="make -f $mmfile"          set rule=$1     if ($rule == "") set rule="all" // line 16          if ($rule == "deps") then        if ($HOSTTYPE == "iris4d") $make MAKEDEPEND="CC -M" OPTS="-DHAVE_CONFIG_H -DVIEWER_HAVE_DCMTK" TARGET=IRIX depend        if ($HOSTTYPE == "i386") $make MAKEDEPEND="c++ -M -I/usr/X11R6/include" OPTS="-DHAVE_CONFIG_H -DVIEWER_HAVE_DCMTK" TARGET=LINUX depend      What's wrong there? Edit: I followed jw013's advice and installed csh. Now I get the following error: ![enter image description here](http://i.stack.imgur.com/wMIMY.png) How can I solve this Undefined variable problem?


title: How to use /dev/fb0 as a console from userspace, or output text to it

text: So I have a Palm Pre (original P100EWW) model that I enabled developer mode on, and installed a Debian Squeeze chroot. Works great. I have plans to use this for ANYTHING (bittorrent peer, web server) but a phone. I noticed if I do a `cat /dev/urandom > /dev/fb0` it actually writes random pixels to the screen until a `No space left on device` error is generated. Awesome, now I can use the display. So what kind of utilites are there that will either A) let me use /dev/fb0 as a console I can output text to or B) render text on /dev/fb0 from the command line. I don't know about recompiling the kernel for this yet (I'd love to eventually strip WebOS off entirely and turn this into a minimal ARM server) so userspace tools if they exist is what I'm asking about. Also would prefer to render directly to /dev/fb0 and not use X.


title: Specifying outgoing interface for SSH tunnel

text: I have a machine with two public IP addresses on two interfaces. This machine is running `sshd`. Is there a way to specify, when creating a tunnel with a SOCKS interface (i.e. `-D`), which interface to use for outgoing connections?


title: How does umask affect ACLs?

text: Can someone explain to me how `umask` affects the default mask of newly created files if ACLs are activated? Is there some documentation about this? Example:               $ mkdir test_dir && cd test_dir     $ setfacl -m d:someuser:rwx -m u:someuser:rwx .  # give access to some user     $ getfacl .     # file: .     # owner: myUsername     # group: myGroup     user::rwx     user:someuser:rwx     group::---     mask::rwx     other::---     default:user::rwx     default:user:someuser:rwx     default:group::---     default:mask::rwx     default:other::---     $ umask # show my umask     077     $ echo "main(){}" > x.c # minimal C program     $ make x # build it     cc     x.c   -o x     $ getfacl x     # file: x     # owner: myUsername     # group: myGroup     user::rwx     user:someuser:rwx           #effective:rw-     group::---     mask::rw-     other::---      I would expect `mask:rwx`. Actually after setting `umask` to e.g. `027` I get the expected behavior.


title: Is there parallel wget? Something like fping but only for downloading?

text: I've found only puf (Parallel URL fetcher) but could to get it work with reading urls from file and something like                puf < urls.txt      does not work either. The operating system installed on the server is ubuntu.


title: Dynamically changing the proxy server for all outgoing traffic

text: I have three proxy servers in my college, all of them are connected to three different service providers. At different instant of time, different proxies give different speed (depending the number of users using that proxy at that instant of time). I feel that changing the proxy server configuration in browser(or at any other network appl.) at different instant of time are very time-consuming. I want to write one script which can change the proxy server used by all of my network applications at different instant of time dynamically by doing some kind of test. I am not able to start with it. Can somebody please give me some idea so that I can implement it.


title: Where are temporary files used for installation stored?

text: Where are installation temporary files stored by pacman in Arch Linux?