title: Vim interface on web browser input fields?

text: I am looking for a browser plugin which inputs textin of input boxes with the same keyboard interface of the Vim text editor. I have adopted Vimium which makes general navigation much more effective, however I often find my self wish I had the Vim interface while I have selected an input field (like while I'm creating this post). I would very much like to be able to navigate the text in the same way I edit file with the vim text editor and I am curious if such a plugin exists?


title: In which log should I check for udev errors?

text: I've written a `udev` rule which is run each time my device is mounted/dismounted. However, in which Linux (Debian) error log should I check when debugging such rules?


title: Weird ports open from Deluge Daemon

text: Hi I recently installed deluge on my home server, and configured all the settings to my needs, but when i run `netstat -tap | grep LISTEN` I see a few ports that I'm not familiar with.               tcp        0      0 *:2178                  *:*                     LISTEN     9847/python     tcp6       0      0 [::]:2178               [::]:*                  LISTEN     9847/python      I'm guessing it might be related to the webui stuff, but I never installed that nor have I seen a config containing these ports. Any ideas?


title: How can I print out all but the last n characters in bash?

text: I'm working with standard input (`cat`ing two files together) and want all but the last 10 characters of the result to be passed through the next command. All I can find through searching is using `sed`, `awk` or `tr` to remove the last n characters from each line, or `head`, `tail` or `rev` to remove n lines. What could I use to do this from standard output piped into a command (hopefully simply and with a single command)? Example:               Input:     SELECT 'A', 1, GETDATE() UNION ALL     SELECT 'B', 2, GETDATE() UNION ALL     ...     SELECT 'Z', 2, GETDATE() UNION ALL          Output:     SELECT 'A', 1, GETDATE() UNION ALL     SELECT 'B', 2, GETDATE() UNION ALL     ...     SELECT 'Z', 2, GETDATE()      For what it's worth, I'm using CygWin on Windows, so it needs to be with rather standard and old unix tools :(


title: Bash script returns "command not found" when outside the source folder

text: under my directory, `/home/lucas/bin` I have the following script `term_multiscreen`:               [lucas@lucas-ThinkPad-W520]~$ sudo cat bin/term_multiscreen                                   #!/bin/bash     # Initializes Nvidia Optimus for multi-screen functionality.          xorg_process=$(ps aux | grep 'Xorg' | grep -v grep | awk '{print $2}')     sudo kill -15 $xorg_process     sudo rmmod nvidia     sudo tee /proc/acpi/bbswitch <<<OFF     # xrandr --output VIRTUAL1 --off     [lucas@lucas-ThinkPad-W520]~$       When I `cd ~/bin`, it runs fine with `sudo term_multiscreen`. When I am outside that directory, it returns `command not found`. I also have `/home/lucas/bin` in my `$PATH`. What am I doing wrong? BTW here are my permissions:               [lucas@lucas-ThinkPad-W520]~$ ls -la bin/     total 44     drwxr-xr-x  2 lucas lucas 4096 May  6 15:43 .     drwxr-xr-x 71 lucas lucas 4096 May  6 15:43 ..     -rwx--x--x  1 root  root   137 Mar  2 03:26 init_multiscreen     -rw-r--r--  1 lucas lucas    0 Mar  2 03:24 init_optimus~     -rwx--x--x  1 root  root   260 Mar  2 05:54 term_multiscreen     [lucas@lucas-ThinkPad-W520]~$       BTW I am on Ubuntu 13.10


title: halt, poweroff, shutdown, reboot don't require root?

text: For some reason, I can run `halt`, `poweroff`, `shutdown`, and `reboot` as a regular user without root. How can I fix this? Is it something to do with user groups, or is it a seting somewhere?


title: Intentional kernel panic under Linux?

text: Is there any way to cause a kernel panic under Linux? I've heard of `echo c > /proc/sysrq-trigger` but it seems to just freeze, and I'm not sure it's a kernel panic. Is there any C program I can run as root to cause a kernel panic?


title: Is fedora 20 stable or not?

text: I am thinking of updating my fedora to fedora 20 and I was thinking whether it will be a good idea or not and if fedora is stable or not?


title: Regarding identical copies of gedit files

text: When ever I save a **gedit** file in a directory, two copies of it get saved with identical content. Ex: If the gedit file is named as `file_name` and saved in **Home** directory then when u `ls` the Home directory you get `file_name` and `file_name~` in the list. When the `file` command is run against them I get `ASCII text, with very long lines` for both of them when I view their contents using the `less` command they seem to largely contain identical content. The ~ file is a copy of the file when it was saved for the penultimate time. Can someone please help me in understanding as to why such a file (the file with a trailing ~ mark in its name ) is created?


title: alias for a command using !! to recall the last command

text: This is a follow-up question to > Execute a line of commands with one sudo If you want to redo the same command with **`sudo !!`** after doing a command like this:               echo "something">/path/file      You can use the global replace syntax to recall the command:               !!:gs/>/|sudo tee -a /      _Use a space after the **-a** parameter._ This is the equivalent to **sudo !!** but helps you bypass sudo restrictions for the < and >. Because sudo does not allow you to use [<, >]. How can I put this into an alias on my `.bashrc` so I can use it simple? I tried               alias redo='!!:gs/>/|sudo tee -a /'      But this doesn't work, I get the error:               $ echo "sdfdsf">/path/file     bash: /path/file: no permissions          $ redo     bash: /: Is a directory     tee: /: Is a directory


title: RPM fails to uninstall using sudo rpm -e

text: I have encountered a strange and annoying problem when trying to uninstall certain in-house generated rpm packages using `sudo`. When I do the following:               sudo rpm -e mypackage       rpm -qa | grep mypackage      I find that the package is still listed! This is despite `rpm -e` running without any obvious errors. This then prevents me from removing other packages which this package depends on. After some investigation I've discovered that the package includes a post uninstall script-let which seems to fail. The script-let simply tries to remove a directory, e.g.               rm -rf /some_directory      I then discovered that by bypassing this script the package will uninstall. So if I do:               sudo rpm -e --noscripts mypackage       rpm -qa | grep mypackage      then the package is no longer listed. Now my question is why should using `sudo` prevent such a simple script from running, and secondly why does the rpm command not report a problem? BTW, the following command sequence also works, so removing the directory is surely possible:               sudo rm -rf /some_directory       sudo rpm -e mypackage       rpm -qa | grep mypackage      Neither of these is really an acceptable solution as I need a reliable generic way of properly uninstalling rpm packages that are not under my control. It's also not possible for me to do this as root because I'm writing a script that other users must be able to run. Finally in desperation I tried the -H option of sudo, i.e.               sudo -H rpm -e mypackage      Now this also seems to work, but can anybody explain why setting `$HOME` to `/root` could make any difference? Due to strict processes in my work environment I cannot really submit this as a solution without a convincing argument, i.e. I must be able to explain why `-H` is needed and prove that my script is robust. Just saying `sudo -H` seems to work on my machine is not going to cut it with my boss unfortunately! I'm hoping that some expert on here can explain what is going on, and any help would be much appreciated!


title: How can I chainload GRUB from syslinux?

text: Due to the current state of my setup, I want to make Syslinux which is my main bootloader to chainload GRUB2. Google brings up plenty of info on how to chainload Syslinux from GRUB2, but nothing really useful for the reversed scenario, which is what I'm looking for.


title: Setting the column position in printf

text: How to fix the positions of output string in shell using `printf`? For example ,if I want to print text `TEXT-A` at position starting from third position from left and one more text `TEXT-B` at eleventh position from left,as shown below. ![enter image description here](http://i.stack.imgur.com/Qekb0.jpg)


title: Reusing older raid discs

text: I have a software RAID5 array (Linux md) on 4 disks; the OS is OpenSUSE 12.3. Recently I replaced a disc with a larger one (fail disc, remove it, add new disc). The capacity of the array has not yet increased as I didn't replace all discs. Now the new one seems to be bad and I want to replace it with the old one. Can I simply remove the new one (fail, remove) and replace it with the unchanged old one or should I format the old one before adding it to the array? The array has a bitmap. What would happen if I simply shut down the machine and replaced the discs without using `mdadm`?


title: How to run the terminal using keyboard shortcuts in Gnome 2?

text: I'm using Gnome 2. I use the terminal several times, and I lose a lot of time going in Applications / Utilities / Terminal to launch the terminal. I am wondering if I can launch the terminal using keyboard shortcuts. I would like to do something similar to `CTRL`+`T`.


title: Getting unexpected colorized output on several commands

text: I just added this to my `.bashrc` to get colorized output with `less`:               # Colorize less man pages.     export LESS_TERMCAP_md=$'\e[01;34m'     export LESS_TERMCAP_us=$'\e[01;33m'     export LESS_TERMCAP_so=$'\e[01;44;37m'     export LESS_TERMCAP_mb=$'\e[01;31m'     export LESS_TERMCAP_mr=$'\e[01;35m'     export LESS_TERMCAP_me=$'\e[00m'     export LESS_TERMCAP_ue=$'\e[00m'     export LESS_TERMCAP_se=$'\e[00m'      ... and now all of a sudden certain commands (seems to be related to displaying environment variables) produce color output that matches these new settings. Am I escaping wrong? Or is this intentional behavior? I tried a few other escape variations, but they didn't work with `less`. For example, here is a screenshot of an `env` command. ![env command](http://i.stack.imgur.com/gDsZO.png) `php -i` also has colorized output, but only on the environment variables section. ![php -i command](http://i.stack.imgur.com/WCkzO.png)


title: How to Extract Album Cover Image from MP3 file?

text: I have a bunch of MP3 files that have their album art included within the file itself. I am now looking for a way to extract them to store them separably, at best from command line. Is there a way to achieve this?


title: Finding the library versions a library was linked against

text: I have a library that was compiled on an unknown Ubuntu machine, And I'd like to determine what version of Ubuntu that machine had at the compile time. My idea was to try and find the versions of different libraries used (e.g. the kernel), knowing that these versions changed with different releases. Iv'e tried using `nm` and `ldd`, but I can't seem to find any relevant info. Any suggestions?


title: WeeChat decryption fails while reading from data socket

text: I'm using WeeChat for quite a while on different machines now. All instances are using the same settings over and over again. When I connect, everything is fine, like this output from WeeChat, just some certificate warnings, but I usually ignore them (as I'm connecting to my own server without any valid certs):               11:39:19     fnd  -- | irc: connecting to server ***.***.***/* (SSL)...     11:39:19     fnd  -- | gnutls: connected using 1024-bit Diffie-Hellman shared secret exchange     11:39:19     fnd =!= | gnutls: peer's certificate is NOT trusted     11:39:19     fnd =!= | gnutls: peer's certificate issuer is unknown     11:39:19     fnd  -- | gnutls: receiving 1 certificate     [...]     11:39:19     fnd =!= | gnutls: the hostname in the certificate does NOT match "***.***.***"     11:39:19     fnd  -- | irc: connected to ***.***.***/* (*.*.*.*)     11:39:19     fnd  -- | Welcome to the freenode Internet Relay Chat Network ***     [...]          Now, right after a successful connection, suddenly I get the following error disconnecting me from server:               [...]     11:39:19     fnd =!= | irc: reading data on socket: error -24 Decryption has failed.     11:39:19     fnd  -- | irc: disconnecting from server...     11:39:19     fnd  -- | irc: disconnected from server     11:39:19     fnd  -- | irc: reconnecting to server in 10 seconds          I'm using ArchLinux with WeeChat 0.4.1.               [user@machine ~]$ weechat-curses -v     0.4.1     [user@machine ~]$ uname -a     Linux machine 3.9.9-1-ARCH #1 SMP PREEMPT Wed Jul 3 22:45:16 CEST 2013 x86_64 GNU/Linux      SSL is on, SSL-Keysize is 1024 and SSL-Verify is off. The server which I'm connecting to is a bouncer (ZNC) instance. But the same WeeChat settings are working on other machines. How to solve this? What's the problem here?


title: How to make a multiple --scale dialog in yad or other alternative?

text: Is it possible to make a dialog with multiple --scale in yad, or other alternative easily, can you help me? I would like an interface multiple on/off. Example: ![enter image description here](http://i.stack.imgur.com/nxL20.png) **This is my script...**               #!/bin/sh     enable=0     disable=1          ret=$(yad --scale --value $disable --min-value $enable --max-value $disable --text "Enabla/disable sudo" --width=200 --height=100)          if [[ $ret -eq 0 ]]; then     echo 'enable'          elif [[ $ret -eq 1 ]]; then     echo 'disable'     fi      * * * This is a script writed in python,I try to learn python, I do not know how to transfer values to this script :(               #!/bin/python     from gi.repository import Gtk          class SwitcherWindow(Gtk.Window):              def __init__(self):             Gtk.Window.__init__(self, title="Switch Demo")             self.set_border_width(10)                  hbox = Gtk.Box(spacing=6)             self.add(hbox)                  switch = Gtk.Switch()             switch.connect("notify::active", self.on_switch_activated)             switch.set_active(False)             hbox.pack_start(switch, True, True, 0)                  switch = Gtk.Switch()             switch.connect("notify::active", self.on_switch_activated)             switch.set_active(True)             hbox.pack_start(switch, True, True, 0)              def on_switch_activated(self, switch, gparam):             if switch.get_active():                 state = "on"             else:                 state = "off"             print("Switch was turned", state)          win = SwitcherWindow()     win.connect("delete-event", Gtk.main_quit)     win.show_all()     Gtk.main()


title: setting a cronjob in IST time

text: I am trying to set a cronjob run in a different timezone. I've googled a lot and found editing `/etc/default/cron` is the way to go. But this file is deprecated and I see the following message, so I added `TZ=IST` in the file `/etc/init/cron.conf`. I'm not sure this will work, any tips on how to move forward please?               # This file has been deprecated. Please add custom options for cron to     # /etc/init/cron.conf and/or /etc/init/cron.override directly. See     # the init(5) man page for more information      I'm using cron 3.0pl1-120ubuntu4 on Ubuntu Linux.


title: How do I configure the driver for eth0 so I can use a kickstart file over the network?

text: I am trying to use a kickstart file hosted over the network to install Oracle Linux 5.8 (equivalent to RHEL 5.8 I believe). I am using the following at the boot prompt:               linux ks=http://1.2.3.4/my.ks ksdevice=eth0 ip=dhcp      The problem is that at this point, eth0 does not seem to be configured with a driver and I am prompted to select one. Having looked at the various Anaconda docs online, I can't see anything that would let me configure the driver for eth0 from the boot prompt, so that I am not prompted for one afterwards. Does anyone know of a way to set-up eth0 with a driver from the boot prompt?


title: Ipadm:operation failed

text: I am studying Solaris 11 in Virtualbox (64bit). I want to create network interface with command:               ipadm create-ip net3      But terminal says that               ipadm:cannot create interface net3:Operation failed      I stuck at this moment.Where is the problem? EDIT: I am already root. maybe virtualbox is causing this problem?


title: Why does my USB device not get recognized by Ubuntu?

text: I seem to have a problem that no else appears to have encountered before (at least a couple of hours Googling has shown this to be the case). I am running Ubuntu 12.04. I plug in the device (Linksys AE3000) and type `lsusb` in the terminal, but the device name doesn't show up at all. I have attempted to plug it into different USB ports, all of which work, and the device fails to be recognized. Now, I know the device works on this computer, because it also runs Windows with which the device works perfectly fine. What should I be doing?


title: My mp3player freezes when I eject it

text: When I eject(or safely remove) or unplug my mp3player from the USB, the screen freezes and an "ok to disconnect" message remains on its screen. Then I have to reset my mp3player. However when I shutdown my computer while the my3player is mounted it doesn't freeze and everything works correctly. I know this is a problem with my mp3player. The question is how can I eject my mp3player normally without forcing to shutdown the computer?


title: Installing oracle in pendrive Linux

text: I am thinking of installing Pendrive Linux (Ubuntu 12.0), and after that I need to install Oracle in Ubuntu. Does that mean Oracle get installed on my Pendrive space or Windows Partition? I am using Windows 8. If this is not possible, can someone suggest how to install Oracle on a pen drive only? Such that all the contents are in my pen drive, so that I can easily switch machines, only dependency will be pen drive.


title: How can I merge root and home in Fedora?

text: I've installed fedora with default configuration few months back and now I want to arrange the mount points. `/etc/fstab` look like that:               /dev/mapper/fedora_dhcppc4-root /                       ext4    defaults        1 1     UUID=9fb84dcf-739e-4368-8f90-cdd0a252a2a3 /boot                   ext4    defaults        1 2     /dev/mapper/fedora_dhcppc4-home /home                   ext4    defaults        1 2     /dev/mapper/fedora_dhcppc4-swap swap                    swap    defaults        0 0      and               [user@dhcppc4]$ df -h     Filesystem                       Size  Used Avail Use% Mounted on     devtmpfs                         984M     0  984M   0% /dev     tmpfs                           1002M  260M  742M  26% /dev/shm     tmpfs                           1002M  4.1M  998M   1% /run     tmpfs                           1002M     0 1002M   0% /sys/fs/cgroup     /dev/mapper/fedora_dhcppc4-root   47G  5.5G   39G  13% /     /dev/sdc1                        477M  142M  310M  32% /boot     /dev/mapper/fedora_dhcppc4-home   23G   19G  2.8G  88% /home      What I want is to merge the root and home that it all will be on the same fs.


title: Where is my eth0 configuration on Wheezy

text: I have a perfectly happy Debian Wheezy 7.4 install that sets up `eth0` as DHCP. But as I want to set a static IP address for it, I navigate to `/etc/network` and open up the `interfaces` file and see the entire contents:               auto lo     iface lo inet loopback      But .. but .. but where is `eth0` being configured? Using the graphical system tools I can set a static IP, but I'd prefer to do this via the command line. But where do I do this?


title: Linux sound: how does it work and why do I need to chain 3 architectures to use JACK?

text: Linux newbie: How do I use Jack? How does Linux sound work? I have an app that is trying to output sound through ALSA or JACK, but I am not hearing anything. Here are a couple of articles, from which I learned that ALSA is the kernel- mode sound driver for linux, and libasound is the user-space library to which applications interface. Furthermore PulseAudio and JACK are audio servers/routers to allow multiple applications to control multiple hardware and applications. Here is a nice article how to route `all-applications -> jack -> PulseAudi -> ALSA`. Looks pretty simple, but I do not understand why the need of so many layers. Why not directly jack to alsa?   * How do I list the client applications, using alsa? (I need to find out why am I not hearing anything)   * How do I route jack directly to alsa? Or should I do as the last article points out - route it through PulseAudio?   * After all this is done, how do I list information on all client applications to jack?


title: Which Debian package does /etc/environment come from?

text: I know that `/etc/profile` is installed by `base-files`, but it doesn't look like this package installs `/etc/environment`:               $ dpkg -S /etc/environment     dpkg-query: no path found matching pattern /etc/environment      Which package installs it, and how would I revert it to the package's default?


title: Disable USB drive from sleeping

text: I am loading fedora20 directly from a SATA drive connected via USB. The problem is that I will be working and all of a sudden the drive seems to have been put to sleep and nothing will work except what is already in RAM. If I restart the computer, the drive is still sleeping and will load windows instead of fedora even though the fedora drive is above the windows one. This is because the drive is connected via an alternate power supply and I suppose it thinks it is still sleeping. The only way to fix this is to disconnect the power from the fedora SATA drive and reboot. I found this article for Ubuntu http://askubuntu.com/questions/80638/how-to- disable-auto-power-off-of-usb-devices-like-usb-mouse How can I disable autosleep for USB on a fedora20 OS?


title: Activate WiFi on runlevel 3 startup

text: I am running SL6. During GNOME session, the wifi is connected as soon as I login, however the same does not happen until I login. The situation further worsens in runlevel 3 where the wifi is not connected even after login. I have tried many solutions related to *wpa_suppliant* over the internet but none seem to help. It seems like it is an open bug in Fedora (which, I believe, is near-upstream for RHEL family). Because I use the box in a headless manner and use it as NAT for other devices connected to it through ethernet, I would want it to be connected once it boots without logging in. Is there a solution?


title: Is it a good idea to use pwsafe - a password manager not updated since 2005?

text: I'm looking for a command-line Linux password-manager. It appears that pwsafe is the program most commonly used. However, its latest update was in 2005. Is it a good idea to use this? Has it been so stable that no updates are necessary, or am I risking using outdated software for an important task like password management?


title: Why piping find and grep returns nothing?

text: I'm trying to have `grep` search inside specified files that are returned by `find`:               find . -type d -name 'mydir*' -exec find '{}' -name '*.java' \; | grep 'MyClass'      This doesn't work. Meanwhile, this works.               grep 'MyClass' $(find . -type d -name 'mydir*' -exec find '{}' -name '*.java' \;)      What's the problem with my first example?


title: Is there a way to virtually split my monitor (for maximizing windows)

text: My question is essentially if I can fake the behaviour one gets using usual window managers on linux if one has a dual head setup. That is, if I maximize a window it maximizes only on one part of the desktop, matching the area of one physical display. I have only one screen, but it has a fairly large resolution and most of the time I will want to work on multiple separate windows, horizontally tiled. I have heard about tiling window managers, but all I know are more like corner groups and do not behave like other common window managers (xfwm, compiz). I am currently using xfwm, and would like to stick with it if possible. If this task _requries_ , I'd prefer one which either behaves similar to the common ones out of the box _or_ for which ready configuration is available. The first hack which came into my mind was trying to fake the information xrandr gives about the screen geometry and fool the window manager using that approach, but this seems like a healy hack which should not be neeccessary. I'm using fedora linux, but I'm also fine with building the software myself if its not in the package management.


title: Preferred mount points for internal HDDs

text: I am relatively new to Linux and I apologise if this is a silly question. I read the Linux FS Hierarchy document but it didn't answer my question. I would like to know if there is a typical drive mounting scheme for general- use internal HDDs in Linux. I ask because I have two HDDs that were mounted as "E:" and "F:" in Windows, but since they hold various types of files (movies, music, personal documentation, source code) I'm not sure where they fit in the Linux filesystem hierarchy. My instinct was to mount the HDDs in /mnt/hdd{1 | 2} or /media/hdd{1 | 2}, but that goes against what LFSH suggests is the purpose of these two directories. I think mounting in /home would be the most sensible. Thank you.


title: What are the differences between the current Linux kernel and the Unix SVR4 kernel in terms of device drivers+i/o and virtual files systems?

text: Yes I realize that Linux supports many more file systems and recognizes more devices than Unix SVR4. I'm interested in what the differences are in the abstraction on top of an actual file system, or the virtual file system as well as differences in how the two handle a device **in general**. Please provide a source.


title: Restarting Gnome 3 in Debian Wheezy?

text: What's the correct way to restart Gnome 3 (and Xorg) under Debian 7.0 Wheezy? I've seen older documentation on how to this, but it is outdated. The `ctrl`+`alt`+`backspace` shortcut no longer works by default. Running `sudo /etc/init.d/gdm3 restart` from Gnome terminal just gives me a blank screen with blinking underscore and never properly reboots the X session.


title: Explanation of the default Debian sources?

text: So I've looked online and haven't found a clear explanation of the default Debian source list. Specially, what do `main`, `updates`. `proposed-updates` and `security` mean in the context of `/etc/apt/sources.list`? I can make assumption about what they mean, but I haven't found enough information to understand if I should, for instance, include `updates` when switching to testing. https://wiki.debian.org/SourcesList has some information, but not omits any information on `updates` or `security`. I am fairly new to Debian, and while I think I could just muddle through the distinctions here, I'd really like just a clear explanation of what is going on instead of just copy and pasting lines into `/etc/apt/sources.list`.


title: How to compile kernel for KVM guest (without paravirtualization)?

text: So I have a KVM machine, where I run an Ubuntu 12.04 (server edition).   I want to compile a minimalistic kernel for the KVM guest, but I only found the howto for hosts, and guests with paravirtualization. I want to compile a kernel for a guest. Nothing more. With only the things it needs.


title: Can't understand this script. bash <<(curl -s http://xxx.com)

text: In a rails book, the author wrote the script to install ruby rvm. `bash <<(curl -s https://rvm.beginrescueend.com/install/rvm)` But I don't understand how it works. Could you explain this?


title: How can I profile a shell script?

text: I have several programs that i'm executing in a shell script:               ./myprogram1     ./myprogram2     ...      I know that I can profile each individual program by editing the sourcecode, but I wanted to know if there was a way I could measure the total time executed by profiling the script itself. Is there a timer program that I can use for this purpose? If so, how precise is its measurement?


title: Using wget to get file names from a text file

text: I have found a website that hosts a few files that I'm after, there's too many to download them all individually. The filenames take a fairly standard and reproduceable form i.e. 1_a, 1_b, 1_c etc Is there a way, using the Linux command line, to use `wget` to automate downloading them all? I can easily put the filenames in a 1 entry per line text file and direct the command line to look up from there, but it wouldn't be the whole URL, just the bit that changes so the command would need to look something like:               wget url.com/files/(bit from file).doc sourcefile.txt      And basically be able to substitute in an entry from the sourcefile to the bit in the brackets. Also, at one stage a large chunk (a few hundred) of the files are simply sequentially numbered, so could I use a for loop for that bit? If so, how would I do this syntactically in the command line?


title: Xmonad seems like a (physically) painful experience

text: I've been using Xmonad for several hours after hearing recommendations from several people. Currently my configuration is very basic. I mapped the modifier key to the "windows key" as suggested in several places. As I kept using it I noticed that jumping between workspaces is done very often. However, in order to jump I need to stretch my index finger to reach for the number, while the thumb needs to be folded in order to press the "windows key". Doing that stretch & fold position for every desktop switch made my thumb quite hurt. Since I don't have a right "windows key" in my keyboard I mapped the "menu key" to be a "windows key". However, if I don't want my right hand to leave the hjkl keys then I need to fold my right thumb each time I want to switch workspaces. I know I can remap everything I want, but I want to understand the logic behind the default settings before I start remapping keys. I feel petty for writing this question, but people say the work with XMonad for 10 hours in a a day. How is that possible without hurting your thumbs?


title: multicast is enabled on ubuntu?

text: I have one of my Ubuntu machine-               rkost@rj-vm9-14105:~/infinispan/infinispan-server-6.0.0.Alpha1/bin$ uname -a          Linux rj-vm9-14105 2.6.35-22-server #33-Ubuntu SMP Sun Sep 19     20:48:58 UTC 2010 x86_64 GNU/Linux      how do I make sure multicast is enabled on my network interfaces and infrastructure? I have tried several solutions but not able to understand whether it is actually enabled or not. I am trying to start the Infinispan server as the remote cache on both of my machines but somehow they are not able to form a cluster of two nodes so I am suspecting multicast feature is disabled somehow.


title: How do I resolve "xrandr: cannot find crtc for output"?

text: Whenever I come to work I type               xrandr --auto     xrandr --output VGA1 --right-of LVDS1      This gets my second display working, however now I get               xrandr: cannot find crtc for output VGA1      For reference here is the output of xrandr,               Screen 0: minimum 320 x 200, current 3286 x 1080, maximum 8192 x 8192     LVDS1 connected 1366x768+1920+0 (normal left inverted right x axis y axis) 277mm x 156mm        1366x768       60.0*+        1360x768       59.8     60.0          1024x768       60.0          800x600        60.3     56.2          640x480        59.9       VGA1 connected (normal left inverted right x axis y axis)        1680x1050      59.9 +        1600x1200      60.0          1680x945       60.0          1400x1050      74.9     60.0          1600x900       60.0          1280x1024      75.0     60.0          1440x900       75.0     59.9          1280x960       60.0          1366x768       60.0          1360x768       60.0          1280x800       74.9     59.8          1152x864       75.0          1280x768       74.9     59.9          1280x720       60.0          1024x768       75.1     70.1     60.0          1024x576       60.0          832x624        74.6          800x600        72.2     75.0     60.3     56.2          848x480        60.0          640x480        72.8     75.0     66.7     60.0          720x400        70.1       HDMI1 disconnected (normal left inverted right x axis y axis)     DP1 disconnected (normal left inverted right x axis y axis)     HDMI2 disconnected (normal left inverted right x axis y axis)     HDMI3 disconnected (normal left inverted right x axis y axis)     DP2 disconnected 1920x1080+0+0 (normal left inverted right x axis y axis) 0mm x 0mm     DP3 disconnected (normal left inverted right x axis y axis)       1920x1080 (0x1df)  148.5MHz             h: width  1920 start 2008 end 2052 total 2200 skew    0 clock   67.5KHz             v: height 1080 start 1084 end 1089 total 1125           clock   60.0Hz


title: Creating a terminal application from a shell script

text: I have a shell script. I want to convert the shell script to an application for Ubuntu which can be installed using (`sudo apt-get install)` command and after installing, the application can run from the terminal by typing the name of the application. I am new to Ubuntu and I am not able to understand how do I proceed.


What video cards for a Desktop computer compatible with Linux can support Dual Monitors? Our start up needs to use two monitors but our default enviroment needs two monitors, can somebody recommend a cheap Video Card that could help us to use two monitors?


title: Weird issue with unmet dependencies when cloning package states from earlier installation on same machine

text: I've been doing the usual routine of saving the package selections and also marking the packages as `auto` or `manual` as outlined in the question and answer here: Restoring all data from backup of `dpkg --set-selections '*'`. Now when I try to run `apt-get -u dselect-upgrade` I get:               # apt-get -u dselect-upgrade     Reading package lists... Done     Building dependency tree     Reading state information... Done     The following packages have unmet dependencies:      cron : Depends: adduser but it is not going to be installed      upstart : Depends: initscripts                Depends: mountall                Depends: ifupdown (>= 0.6.10ubuntu5)     E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.     E: Internal error, problem resolver broke stuff      The alternative `aptitude install` doesn't give me anything at all:               # aptitude install     No packages will be installed, upgraded, or removed.     0 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded.     Need to get 0 B of archives. After unpacking 0 B will be used.      So when I check whether `cron` and `adduser` are installed, they of course are:               # dpkg -l|grep -E '(adduser|cron)'     ii  adduser                           3.113ubuntu2                 add and remove users and groups     ii  cron                              3.0pl1-120ubuntu4            process scheduling daemon      So two questions: **what's going on and how do I resolve it?** NB: the package selections were taken from another 12.04 installation, same architecture and everything. In fact it's a system that ran on the same machine before reinstalling on a different disk. This is the first time I run into this kind of problems when cloning an existing setup by means of package states and then copying over relevant contents from the original `/etc`. For the second set of allegedly unmet dependencies I get:               # dpkg -l|grep -E '(upstart|initscripts|mountall|ifupdown)'     ii  ifupdown                          0.7~beta2ubuntu8             high level tools to configure network interfaces     ii  initscripts                       2.88dsf-13.10ubuntu11.1      scripts for initializing and shutting down the system     ii  mountall                          2.36.4                       filesystem mounting tool     ii  upstart                           1.5-0ubuntu7.2               event-based init daemon      So all installed. No held packages either. Output of `aptitude search ~i|grep ^ih` is empty. * * * The system in question is a Ubuntu Server 12.04.2 installation, otherwise upgraded to latest packages. No third-party repositories configured, no package pinning or so going on. * * * btw: I would appreciate if the answer would include some pointers about what to do generally when hitting such an issue without relying in the subtly different problem resolvers in the various `dpkg` front ends. Most suggestions I've come across seem to rely solely on that and that's why I'm out of luck now. So I need to know some of the nitty gritty, too.


title: dealing with un-executable commands inside a shell-script

text: I am given an assignment like this: Write a Bash script that takes a *.tex file as command-line argument and checks if the file executes correctly without any errors. If it executes without any error and warning, assign a mark of 2 to that file. (1 mark if it compiled with a warning, and 0 marks if it shows an error). I am able to assign marks for files which executed without any warnings and for files which gave a warning. Here, I am giving some of the lines of my code,               #!/bin/bash     rm t.txt     pdflatex $1 >> t.txt     message=`tail -2 t.txt|grep -i "output"|cut -c 1-6`      After executing the command `pdflatex`, my script searches for appropriate words like "output" and "warning", and accordingly assigns marks. But in the case of a file which has errors, the `pdflatex` command exits only if we give a 'x'. Since it is expecting an 'x' from the user, it waits there. If I run the script, it is not showing any output; but if I print an x, it assigns the mark to that file as zero. But I have to give this program to an automatic code-evaluator which checks for my code, and tells if my code is correct for all the cases... How do I accomplish that?


title: Localhost .htaccess not working on Ubuntu

text: I have been trying to get my `.htaccess` file to work on my localhost. I know that the file works because it is on my server and works. However it doesn't seem to be working locally. I have followed the tutorials I could find to set overrides to all, below is my `/etc/apache2/sites-available/default` file start:               <VirtualHost *:80>         ServerAdmin webmaster@localhost              DocumentRoot /var/www         <Directory />             Options FollowSymLinks             AllowOverride All         </Directory>         <Directory /var/www/>             Options Indexes FollowSymLinks MultiViews             AllowOverride All             Order allow,deny             allow from all         </Directory>      This is the code in the same directory for my nibble site:               <VirtualHost *:80>         ServerName nibble.local         DocumentRoot /var/www/nibble_framework/web/         <Directory /var/www/nibble_framework/web/>             AllowOverride All             Options Indexes FollowSymLinks MultiViews             Allow from All         </Directory>         RewriteLog /var/www/rewrite.log         ErrorLog /var/log/apache2/error.log     </VirtualHost>      I have enabled this site using a2ensite and restarted apache. I have also added the site to my hosts file:                 127.0.0.1  nibble.local      I have enabled mod rewrite using a2enmod and restarted/reloaded apache multiple times.                 $ a2enmod rewrite        Module rewrite already enabled      My `.htaccess` file is in `/var/www/nibble_framework/web/.htaccess` and has the following code:                 Options +FollowSymLinks +ExecCGI            <IfModule mod_rewrite.c>       RewriteEngine On            RewriteCond %{REQUEST_FILENAME} !-f       RewriteCond %{REQUEST_FILENAME} !-d       RewriteRule ^([^/]*)/?.*$ - [E=FILE:%{DOCUMENT_ROOT}/$1.php]            RewriteCond %{ENV:FILE} !^$       RewriteCond %{ENV:FILE} -f       RewriteRule ^([^/]*)/?(.*)$ $1.php?url=$2 [QSA,L]            RewriteCond %{ENV:FILE} !^$       RewriteCond %{ENV:FILE} !-f       RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]       </IfModule>      When I do a `print_r($_REQUEST)`, it is allways an empty array even when the url is poplulated by a long string. Does anyone have any idea why this might be failing? Edit: apache2 access log:               ~$ tail -f /var/log/apache2/access.log     ::1 - - [16/Aug/2011:07:32:39 +0100] "OPTIONS * HTTP/1.0" 200 152 "-" "Apache/2.2.16 (Ubuntu) (internal dummy connection)"     ::1 - - [16/Aug/2011:07:32:39 +0100] "OPTIONS * HTTP/1.0" 200 152 "-" "Apache/2.2.16 (Ubuntu) (internal dummy connection)"     ::1 - - [16/Aug/2011:07:32:39 +0100] "OPTIONS * HTTP/1.0" 200 152 "-" "Apache/2.2.16 (Ubuntu) (internal dummy connection)"     ::1 - - [16/Aug/2011:07:32:40 +0100] "OPTIONS * HTTP/1.0" 200 152 "-" "Apache/2.2.16 (Ubuntu) (internal dummy connection)"     ::1 - - [16/Aug/2011:07:32:40 +0100] "OPTIONS * HTTP/1.0" 200 152 "-" "Apache/2.2.16 (Ubuntu) (internal dummy connection)"     ::1 - - [16/Aug/2011:07:32:40 +0100] "OPTIONS * HTTP/1.0" 200 152 "-" "Apache/2.2.16 (Ubuntu) (internal dummy connection)"     ::1 - - [16/Aug/2011:07:32:40 +0100] "OPTIONS * HTTP/1.0" 200 152 "-" "Apache/2.2.16 (Ubuntu) (internal dummy connection)"     ::1 - - [16/Aug/2011:07:32:40 +0100] "OPTIONS * HTTP/1.0" 200 152 "-" "Apache/2.2.16 (Ubuntu) (internal dummy connection)"     ::1 - - [16/Aug/2011:07:32:40 +0100] "OPTIONS * HTTP/1.0" 200 152 "-" "Apache/2.2.16 (Ubuntu) (internal dummy connection)"     ::1 - - [16/Aug/2011:07:32:40 +0100] "OPTIONS * HTTP/1.0" 200 152 "-" "Apache/2.2.16 (Ubuntu) (internal dummy connection)"


title: "Swap file xxx already exists" when editing apache configuration file in vim?

text: Using vim I keep getting a message saying "Swap file xxx already exists" when I'm editing an apache config. However, I don't see it in the working directory on in tmp. How do I delete this?


title: condition && command + exit

text: While writing a simple shell tool, I found a piece where I don't know how to get it to work.                 [ "$#" -ne 3 ] || echo "wrong number of arguments" && exit      The above works as intended because it's hard to conceive conditions where echo could fail. But what if I replaced echo with a command that can fail, and still execute `exit` nevertheless? This won't work, because `exit` quits the shell spawned with `( )` and not the main one:                 [ "$#" -ne 3 ] && ( command ; exit )      This will exit always:                 [ "$#" -ne 3 ] && command ; exit       I could use the verbose syntax:                if [ "$#" -ne 3 ] ; then            command            exit      fi      but if I don't want to engage `if` and keep the syntax terse - how can I string conditional execution of commands, including `exit` like that?


title: Customize Logitech M600 mouse in Fedora 20?

text: I just got a fancy Logitech M600 touch mouse, and there are very specific things I want it to do on my Fedora 20 64-bit KDE spin. Unfortunately, there don't seem to be any config files where I can just state my demands. I've been looking for a few days now, and have determined that touchegg and HIDPoint are completely out of the question (on account of having absolutely no support for F20). By default, it has middle-touch vertical scrolling, two-finger vertical scrolling, left-swipe is browser back, right-swipe is browser forward. I need left and right swipe to cycle through virtual desktops, _two_ -finger swipes (not natively a gesture at all) to be browser forward and back, and it'd be nifty if three-finger down swipe was minimize or alt+tab. On Windows, this can actually be done easily with Logitech's software, but of course they don't have a Linux version. I'd be happy to edit config files and remap input manually if necessary, but without that additional software the mouse has no idea that half the gestures I want are even significant. I'm hoping someone here has a solution. If not, I can thankfully return the mouse.


title: Setting headers using the /bin/mail command

text: I have a bash script that I use with nagios that sends notifications by email. The key part of it looks like this:               # $1 (FROM) | $2 (TO) | $3 (SUBJECT) | $4 (BODY)     /usr/bin/printf "%b" "$4" | /bin/mail -s "$3" "$2" -- -f $1      I know I could use the `sendmail` command directly (like this) but it would mean reworking a few scripts to take care of building the entire message including all headers. Is there any way to specify additional SMTP headers using `/bin/mail`, in my own case I am trying to add the `Importance: high` header? I'm running exim 4.63 as my MTA and CentOS 5.6 x64.


title: Any relatively new binary distro causes kernel panics

text: I'm having trouble using **_any_** relatively new binary distro on this machine. The last binary distro to work without issue was Ubuntu 8.04. I'm currently using Gentoo with the latest 3.2.1 kernel and its working fine with all peripherals functional. I was using Gentoo before (since I've always had this problem) but I decided I was tired of configuring everything myself and waiting for things to compile all the time. I tried installing Linux Mint 12, Fedora 16 and Debian Squeeze all with the same results, the kernel panics. It seems to happen more frequently when waking the notebook up or when the wireless card is connected to a network. I've read various articles indicating that there are issues with the wireless card I have, but I would think that using `rmmod iwl4965` and `rmmod iwl_legacy` as well as shutting off the wireless radio would ensure that the wireless card could not cause a kernel panic. This didn't fix the problem. I have also tried using both proprietary `nvidia` drivers and the open-source `nouveau` drivers after reading that some people had issues with the video card. I also find it hard to believe that it's a hardware problem since all of my hardware works when everything is compiled on the system with Gentoo. I have proprietary video drivers working, the machine sleeps and wakes without issue, and I have no issues using `wpa_supplicant` and `wicd` on my wireless card. Does anyone have any thoughts? _**Background information:_**   * Notebook computer: Lenovo T61 _**Output of`lspci`:_**               00:00.0 Host bridge: Intel Corporation Mobile PM965/GM965/GL960 Memory Controller Hub (rev 0c)     00:01.0 PCI bridge: Intel Corporation Mobile PM965/GM965/GL960 PCI Express Root Port (rev 0c)     00:19.0 Ethernet controller: Intel Corporation 82566MM Gigabit Network Connection (rev 03)     00:1a.0 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI  Controller #4 (rev 03)     00:1a.1 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #5 (rev 03)     00:1a.7 USB Controller: Intel Corporation 82801H (ICH8 Family) USB2 EHCI Controller #2 (rev 03)     00:1b.0 Audio device: Intel Corporation 82801H (ICH8 Family) HD Audio Controller (rev 03)     00:1c.0 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 1 (rev 03)     00:1c.1 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 2 (rev 03)     00:1c.2 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 3 (rev 03)     00:1c.3 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 4 (rev 03)     00:1c.4 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 5 (rev 03)     00:1d.0 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #1 (rev 03)     00:1d.1 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #2 (rev 03)     00:1d.2 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #3 (rev 03)     00:1d.7 USB Controller: Intel Corporation 82801H (ICH8 Family) USB2 EHCI Controller #1 (rev 03)     00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev f3)     00:1f.0 ISA bridge: Intel Corporation 82801HBM (ICH8M-E) LPC Interface  Controller (rev 03)     00:1f.2 IDE interface: Intel Corporation 82801HBM/HEM (ICH8M/ICH8M-E) SATA IDE Controller (rev 03)     00:1f.3 SMBus: Intel Corporation 82801H (ICH8 Family) SMBus Controller (rev 03)     01:00.0 VGA compatible controller: nVidia Corporation Quadro NVS 140M (rev a1)     03:00.0 Network controller: Intel Corporation PRO/Wireless 4965 AG or AGN [Kedron] Network Connection (rev 61)     15:00.0 CardBus bridge: Ricoh Co Ltd RL5c476 II (rev ba)     15:00.1 FireWire (IEEE 1394): Ricoh Co Ltd R5C832 IEEE 1394 Controller (rev  04)     15:00.2 SD Host controller: Ricoh Co Ltd R5C822 SD/SDIO/MMC/MS/MSPro Host Adapter (rev 21)     15:00.3 System peripheral: Ricoh Co Ltd R5C843 MMC Host Controller (rev 11)     15:00.4 System peripheral: Ricoh Co Ltd R5C592 Memory Stick Bus Host Adapter (rev 11)     15:00.5 System peripheral: Ricoh Co Ltd xD-Picture Card Controller (rev 11)      _**/proc/cpuinfo_**               processor       : 0     vendor_id       : GenuineIntel     cpu family      : 6     model           : 15     model name      : Intel(R) Core(TM)2 Duo CPU     T7300  @ 2.00GHz     stepping        : 10     microcode       : 0x92     cpu MHz         : 2000.000     cache size      : 4096 KB     physical id     : 0     siblings        : 2     core id         : 0     cpu cores       : 2     apicid          : 0     initial apicid  : 0     fpu             : yes     fpu_exception   : yes     cpuid level     : 10     wp              : yes     flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx lm constant_tsc arch_perfmon pebs bts rep_good nopl aperfmperf pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm lahf_lm ida dts tpr_shadow vnmi flexpriority     bogomips        : 3989.02     clflush size    : 64     cache_alignment : 64     address sizes   : 36 bits physical, 48 bits virtual     power management:          processor       : 1     vendor_id       : GenuineIntel     cpu family      : 6     model           : 15     model name      : Intel(R) Core(TM)2 Duo CPU     T7300  @ 2.00GHz     stepping        : 10     microcode       : 0x92     cpu MHz         : 1200.000     cache size      : 4096 KB     physical id     : 0     siblings        : 2     core id         : 1     cpu cores       : 2     apicid          : 1     initial apicid  : 1     fpu             : yes     fpu_exception   : yes     cpuid level     : 10     wp              : yes     flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx lm constant_tsc arch_perfmon pebs bts rep_good nopl aperfmperf pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm lahf_lm ida dts tpr_shadow vnmi flexpriority     bogomips        : 3989.80     clflush size    : 64     cache_alignment : 64     address sizes   : 36 bits physical, 48 bits virtual     power management:      _**ACPI related Kernel Flags_**               CONFIG_X86_64_ACPI_NUMA=y     CONFIG_ACPI=y     CONFIG_ACPI_SLEEP=y     CONFIG_ACPI_PROCFS=y     CONFIG_ACPI_PROC_EVENT=y     CONFIG_ACPI_AC=y     CONFIG_ACPI_BATTERY=y     CONFIG_ACPI_BUTTON=y     CONFIG_ACPI_FAN=y     CONFIG_ACPI_DOCK=y     CONFIG_ACPI_PROCESSOR=y     CONFIG_ACPI_HOTPLUG_CPU=y     CONFIG_ACPI_THERMAL=y     CONFIG_ACPI_NUMA=y     CONFIG_ACPI_BLACKLIST_YEAR=0     CONFIG_ACPI_CONTAINER=y     CONFIG_X86_ACPI_CPUFREQ=y     CONFIG_PNPACPI=y     CONFIG_ATA_ACPI=y


title: I messed up my zshrc on a remote server and now I can't run any commands!

text: On a remote machine I changed my `zsh` settings and it is now broken,   for every keypress it says: "url-quote-magic:1: url-quote-magic: function definition file not found " I don't have another account on that machine, What can I do to disable the faulty `.zshrc` so that I can use my shell again and fix it.


title: git grep colors differ from grep custom colors

text: I've setup grep colors in my `~/.bashrc` :               export GREP_COLORS='ms=01;34:mc=01;34:sl=:cx=:fn=35:ln=32:bn=32:se=36'      They work for   * `grep --color=auto`   * `grep --color=always` Unfortunately, those custom colors are ignored by:   * `git grep --color=auto`   * `git grep --color=always` How to make `git grep` to use above `$GREP_COLORS` colors ?


title: Apache server doesn't start when mod_sm.so is loaded

text: I have an Apache 1.3 on a Sun machine (SunOS 5.10 Generic_138888-01 sun4u sparc SUNW,Sun-Fire-15000). If I keep the following two lines in httpd.conf, the server will not start: ` LoadModule sm_module "/cmsm_sw/epiapr1/netegrity/webagent/bin/mod_sm.so"   SmInitFile "/apache/conf/WebAgent.conf" ` This is all I get when I try to start Apache: `:/apache/bin # ./apachectl start   1392: CSemCounter created a semaphore with ID 1157627995 using key 989855746.` The mod_sm.so is the netegrity siteminder module (iPlanet). Today there were some network issue (which were solved in the mean time) so I assume that this might have something to do. Maybe I should restart some services? I appreciate any help/hints. Thank you.


title: What does mkinitrd change when it adds kernel modules to the initrd?

text: When creating an initrd using mkinitrd (CentOS 5.5), the kernel modules it adds to the initrd get modified in the process. For example, the initrd's /lib/sata_via.ko is not binary identical to /lib/modules/2.6.18-194.32.1.el5/kernel/drivers/ata/sata_via.ko. I am just curious as to what happens when mkinitrd includes a kernel module - does it link in dependencies, or what is it that makes the module change?


title: How do I resize a partition in Ubuntu linux without losing data?

text: I ran out of space in my on the drive only to find that there was another unformatted partition in the system that is available. I now want to resize the current partition to take in the empty partition without losing data. Any ideas?


title: Is it common to split larger script into multiple scripts and source them in the main script?

text: At the moment I'm developing a larger Bash script (it's an Open Source project of mine) and it's starting to become a mess. I've split up logic into functions, use local variables where I can and have only declared a handful global variables. Still, it is becoming pretty hard to maintain. I thought about splitting the script up into multiple scripts and source them in my main script (similar to imports in other languages). But I wonder if this is a feasible approach. First, sourcing multiple scripts could severly slow the execution time of the script, and second, it makes distribution harder. So, is this a good approach, and do other (Open Source) projects do it the same way?


title: Convert UTF-8 character to xmodmap name

text: Is there a way of converting a UTF-8 character to its corresponding `xmodmap` name? So if the input is `”` the output would be `rightdoublequotemark`.


title: How to view adobeconnect video offline?

text: I want to watch some lectures created with adobeconnect. I have the lectures downloaded to my Ubuntu 12.04 machine. Each one consists of a stream that includes a video window of the professor lecturing (with audio) and another video window of his shared desktop. There is also some text/chat conversation from the students. Each lecture consists of these files:               cameraVoip_1_4.flv     cameraVoip_1_4.xml     ftchat0.flv     ftchat0.xml     ftcontent1.flv     ftcontent1.xml     ftstage3.flv     ftstage3.xml     indexstream.flv     indexstream.xml     mainstream.flv     mainstream.xml     screenshare_0_2.flv     screenshare_0_2.xml     telephony-files.xml     transcriptstream.flv     transcriptstream.xml      I can watch just the professor (audio and video) in this file:   **cameraVoip_1_4.flv** The professor's share desktop is in this file:   **screenshare_0_2.flv** (I haven't found the file with the student chat stream yet & I don't know what content is in the other files or if they are needed at all.) I can currently open each of the two flv files above in two different players (such as VLC & SM Player) and manually synchronize them, but that's a pain. **Is there a better way I view this content on Linux?** The main problem with the two-different-players approach is keeping the two streams synchronized. For example, I cannot easily back up and I cannot easily skip over the class break period. It is almost never the case that I just start the two players, synchronize them once and then listen to an entire 2 hour lecture. It always turns into a giant hassle that makes me not want to watch the lectures. I need a better way.


title: Linux Shell fundamentals: How can I check the file descriptors status, (where are redirected to) right now without lsof?

text: I am learning about **file descriptors** for the case of Linux, and I was wondering if there is any command showing a **complete list** that allows me to know **where is each one redirected** to in this moment.   Maybe some info like:               0  -->  <stdin     1  -->  >stdout     2  -->  >stderr     3  -->  >MyFileForWriting     4  -->  <MyFileForReading      I have found this thread that requires `lsof`, but it could be useful to have another method not depending on that command, if it exists.   I need this info concerning to Linux (I will try it too for CygWin, that does not include the 'lsof' tool until now, but behaves mostly like a POSIX compliant operating system).


title: Too many keys being added to ssh-agent in CentOS6 - how can I stop this?

text: I was trying to debug an ssh problem `Too many authentication failures`, and find with `ssh -vv` that ssh is presenting lots of keys before falling back to try a password. On investigation I find that these keys are added somehow with `ssh-agent` running from `startx` when X11 is started. I have a lot of keys in my `~/.ssh` directory for different machines, transferred through many system updates over the years. I had not even realized that `ssh-agent` was running. I thought that `ssh-add`, per the manpage, would add by default just `id_dsa`, `id_rsa` and `identity`. But somehow it is adding `BillBrewer.pub`, `JanStewer.pub`, `PeterGurney.pub`, `PeterDavy.pub`, `DanlWhiddon`, `HarryHawke.pub`, `OldUncleTomCobley.pub` as well, and presenting the whole lot on every login session when I expect to give a password. So sshd on the server decides that enough is enough and disconnects. How can I control this behaviour ? Apart from removing my extra public keys from my .ssh directory and just keeping the private ones I need, but that's always been a convenient place to keep them in the past. For that matter, how can I stop ssh-agent running if I want to ? Is this a security issue ( sending keys to servers that are not supposed to get them) ? I realize that I can override it on a per-session basis with `-o PreferredAuthentications=password` but I'd prefer a systemic fix.   * more strangeness: I tried using `ssh-add -D` to remove all identities, or `ssh-add -d *.pub`, but when I use `ssh-add -l`, they are all still there. CentOS release 6.5, OpenSSH_5.3p1, openssh-clients-5.3p1


title: Can't mount remote file system with sshfs

text: > **Possible Duplicate:**   >  How to apply changes of newly added user groups without needing to reboot? I have posted this question in linux mint users forum about some hours ago. I'm trying to mount a file system with sshfs on linux mint. When I simply try I get               fuse: failed to open /dev/fuse: Permission denied      Reading here I tried ls:               yotam@sumsum ~/Documents $ ls -lah /dev/fuse     crw-rw---- 1 root fuse 10, 229 Nov 19 13:00 /dev/fuse      So I tried to add myself to fuse:               sudo usermod -a -G fuse yotam      But:               yotam@sumsum ~/Documents $ groups     yotam sudo      I tried the GUI interface of Linux Mint and see there that I'm the only user on the fuse group. So.... what now? As a finlal note, I'll say that I can mount the file system with sudo Edit: After restart I can mount


title: Incompatible group permissions in Linux - Is it a bug?

text: > **Possible Duplicate:**   >  How to apply changes of newly added user groups without needing to reboot? I am on Ubuntu 11.04. I am creating another user and placing an existing user in the group of other user, hoping to write in the home directory of other user.               # uname -a     Linux vini 2.6.38-11-generic #50-Ubuntu SMP Mon Sep 12 21:18:14 UTC     2011 i686 athlon i386 GNU/Linux     # whoami     sachin     # su root     # useradd -m -U foo               // create user foo     # usermod -a -G foo sachin      // add user `sachin' to group `foo'     # chmod 770 /home/foo/     # exit     # whoami     sachin     # cd /home/foo/     bash: cd: /home/foo/: Permission denied     # groups sachin     sachin : sachin foo      This is totally weird. Though user sachin is in group foo, and group bits for /home/foo/ is set to rwx, sachin can't chdir to /home/foo/. I am not able to understand this. But, if at the exit step, I switch to sachin user from root, this is what happens:               # uname -a     Linux vini 2.6.38-11-generic #50-Ubuntu SMP Mon Sep 12 21:18:14 UTC     2011 i686 athlon i386 GNU/Linux     # whoami     sachin     # su root     # useradd -m -U foo               // create user foo     # usermod -a -G foo sachin      // add user `sachin' to group `foo'     # chmod 770 /home/foo/     # su sachin     # whoami     sachin     # cd /home/foo/     # ls     examples.desktop      Now, whatever is happening here is totally incomprehensible. Does su sachin inherits some permissions from the root user at this step? A solution that was suggested was to use `newgrp`, which updates the group and other user information. So if I do `newgrp - sachin`, then I get access to the directory of the newly created user, but if I create one more user and follow the same steps `sachin` does not get access to the latest users directory. This behavior is indeed very baffling. Any explanations would be much appreciated.


I'm trying to connect to an OpenVPN server. It works perfectly when I use root to give out the commands to connect:               openvpn /etc/openvpn/client.conf      but with a normal user I get this error messages in the log:               Aug 15 18:01:43 a openvpn[4755]: OpenVPN 2.1.1 i686-redhat-linux-gnu [SSL] [LZO2] [EPOLL] [PKCS11] built on Jan  5 2010     Aug 15 18:01:43 a openvpn[4755]: WARNING: you are using user/group/chroot/setcon without persist-tun -- this may cause restarts to fail     Aug 15 18:01:43 a openvpn[4755]: WARNING: you are using user/group/chroot/setcon without persist-key -- this may cause restarts to fail     Aug 15 18:01:43 a openvpn[4755]: WARNING: No server certificate verification method has been enabled.  See http://openvpn.net/howto.html#mitm for more info.     Aug 15 18:01:43 a openvpn[4755]: NOTE: OpenVPN 2.1 requires '--script-security 2' or higher to call user-defined scripts or executables     Aug 15 18:01:43 a openvpn[4755]: Control Channel Authentication: using '/home/MYUSERNAME/.cert/shared.key' as a OpenVPN static key file     Aug 15 18:01:43 a openvpn[4755]: LZO compression initialized     Aug 15 18:01:43 a openvpn[4756]: NOTE: UID/GID downgrade will be delayed because of --client, --pull, or --up-delay     Aug 15 18:01:43 a openvpn[4756]: UDPv4 link local: [undef]     Aug 15 18:01:43 a openvpn[4756]: UDPv4 link remote: 111.222.333.444:443     Aug 15 18:01:43 a openvpn[4756]: [vpnserver] Peer Connection Initiated with 192.168.1.1:443     Aug 15 18:01:46 a openvpn[4756]: Note: Cannot ioctl TUNSETIFF tun: Operation not permitted (errno=1)     Aug 15 18:01:46 a openvpn[4756]: Note: Attempting fallback to kernel 2.2 TUN/TAP interface     Aug 15 18:01:46 a openvpn[4756]: Cannot allocate TUN/TAP dev dynamically     Aug 15 18:01:46 a openvpn[4756]: Exiting      So it looks like I need root priviledges to run the mentioned command.      Solutions that I've googled:   - setuid bit: https://fedoraproject.org/wiki/Features/RemoveSETUID - not good anymore   - "visudo" as root, then append this to the file:                  MYUSERNAME ALL = NOPASSWD: /usr/sbin/openvpn      Then the "MYUSERNAME" user can launch the "sudo /usr/sbin/openvpn" binary with root priviledges.      p.s.1:                 $ which openvpn     /usr/sbin/openvpn      p.s.2: Using Fedora 14/bash.      THE QUESTION:   - Are there any better/safer methods to launch the OpenVPN client as a normal user?


title: How to resize a VirtualBox HDD image

text: I initially created a dynamically expanding VirtualBox image, and have tried to increase its hard drive space:               VBoxManage modifyhd "VirtualBox VMs/JHBuild/JHBuild.vdi" --resize 16384      After that, I saw from the UI that it has increased to 16GB logical size: ![enter image description here](http://i.stack.imgur.com/sp2U9.png) Sadly, when I boot the image, I still get the initial size (e.g. when I use `df`).


title: Is there a way to run an ssh server on an Android device?

text: I'm looking to install Debian over my Android installation so as to be able to use `openssh-server`, as it's _so_ much better than Dropbear. Is there an easy way to do this, or just to simply install openssh-server on my phone? I'm running Android 2.3.X on a Google Nexus One.


title: In tmux session, cannot connect to X server after ssh'ing

text: At work, I have a desktop with a monitor and a few running tmux sessions. At home, I frequently ssh into that desktop and enter my running tmux sessions. When I ssh from home, I do _not_ want to use X11, so I do not use the `-X` flag. When I go back to work (after ssh'ing from home) and use those tmux sessions on desktop, I can no longer do anything that would spawn a GUI. I can't open files in evince. When I try use matplotlib, I get a `: cannot connect to X server` message. After ssh'ing and opening an existing tmux session from home, how do I later reattach the ability to open up GUI stuff on the desktop? The ssh'ing from home seems to make the tmux session forget that it can spawn GUI stuff. EDIT:


title: Tell a regex expression to skip the beginning of a line before matching

text: If I had a string like `45mb ./aaaa/bbbb/cccc/dddd` and I use a regex like `[^\/]*\/` it will match `45mb ./aaaa/bbbb/cccc/` I only want it to match `./aaaa/bbbb/cccc/` but I can't figure out how to do it. I want to specifically match/find all occurrences of "everything before a forward slash up to and including the slash" as I want to use `sed` to substitute the matches like in the below `sed` command but not losing the file size bit at the start.               sed -e 's/[^\/]*\//--/g      Hopefully that makes some sense. I tried look ahead/behinds but I don't know if that's the correct regex solution for this.


title: wpa_passphrase must be 8..63 characters

text: I'd like to connect to wireless network via command line in Linux. When doing it I've stuck with this issue:                $ wpa_passphrase NETWORK_SSID NETWORK_PASSWORD      Passphrase must be 8..63 characters      The NETWORK_PASSWORD has only five characters. Via smartphone there is no problem with connection. Could you help me to solve this?


title: Is there a reverse of yank-last-arg/insert-last-argument?

text: `yank-last-arg` / `insert-last-argument` is probably better known by its usual shortcut, `Alt`-`.`. It's very nice to navigate through the last argument of earlier commands, but if you're navigating a little too fast it's easy to miss the argument you wanted, and then it seems you have no other choice but to start all over again. This slows down the navigation, so I hope there's a command to **navigate this list in reverse**. A quick look at `bind -P` didn't show any obvious candidates for this purpose.


title: mutt: Use gpgme or classic gpg?

text: Mutt's wiki on GnuPG integration and many other places (like default on Debian) use the classic way of connecting mutt to gnupg. That is, one configures a bunch of commands to call `gpg` directly. On the other hand, there is a library called `gpgme`, which tries to standardize exactly that. Seaching the web for "mutt gpgme" did not give any really useful results to me. What are the pros and cons of using `set crypt_use_gpgme=yes` in `.muttrc`? Why is it so seldom used?


title: Set persistent routing table on Debian

text: I have modified my routing table by deleting one rule, and adding two new rules for my second interface eth1:               route del -net 10.1.2.0 netmask 255.255.255.0     route add -host 10.1.2.51 eth1     route add -host 10.1.2.52 eth1      I want the rules to survive reboot. I could write a simple rc script to remove 1 rule and insert 2 new, but I was wondering whether there is a way to configure ifconfig, not to add a route rule for the interface (eth1) when it is started, or even better, to specify which rules should be added. What would be a clean way to do it? Does `ifconfig` allow me to specify custom rules for routing?


title: Debian on Mac via reFINd: New Partitions doesnt Boot

text: im trying to get on Debian via the refind Bootmanager. I was able to create partitions on HDD (Swap + /) and install Debian, but i couldn't install a bootloader on the installation, nor Grub neither LILO and now the partitions dont start. what can i do.


title: How to configure CentOS 6 as a Proxy Server

text: I have installed new server with CentOS 6. How do I configure it to become a Proxy Server?


title: Is there a global grep.conf in Unix/Linux?

text: I would like to make a utility that always enables the `\--color` argument for the `grep` command in any distribution. Is there a way to do this or do I have to search for a way for each distribution?


title: -bash: /dev/null: Permission denied

text: I'm trying to create a new user on a Centos 6 system. First, I do               useradd kevin      Then, I tried to run commands as that user               su - kevin      However, I get the following error messages               -bash: /dev/null: Permission denied     -bash: /dev/null: Permission denied     -bash: /dev/null: Permission denied     -bash: /dev/null: Permission denied     -bash: /dev/null: Permission denied     -bash: /dev/null: Permission denied     [kevin@gazelle ~]$      And I can't do very much as that user. The permissions on /dev/null are as follows:               -rwxr-xr-x  1 root root           9 Jul 25 17:07 null      Roughly the same as they are on my Mac,               crw-rw-rw-   1 root   wheel         3,   2 Jul 25 14:08 null      It's _possible_ , but really unlikely, that I touched dev. As the root user, I tried adding `kevin` to the `root` group:               usermod -a -G root kevin      However I still am getting /dev/null permission denied errors. Why can't the new user write to /dev/null? What groups should the new user be a part of? Am I not impersonating the user correctly? Is there a beginners guide to setting up users/permissions on Linux? Thanks, Kevin


title: Problem with installation of camera drivers

text: When I install my video camera's drivers with a command:               modprobe usbserial vendor=... product=...      it gets installed as "sg3" instead of something like "ttyUSB0". Why is that? I did look at the dmesg, it looks like this (this is where I got that it is sg3, I am not a daily linux user, I just need to get something done, so please don't judge me for my poor knowledge):               [  292.940045] usb 2-4: new high speed USB device using ehci_hcd and address 7     [  293.094070] usb-storage 2-4:1.0: Quirks match for vid 0525 pid a4a5: 10000     [  293.094125] scsi7 : usb-storage 2-4:1.0     [  294.095461] scsi 7:0:0:0: Direct-Access     Linux    File-Stor Gadget 031a PQ: 0 ANSI: 2     [  294.096689] sd 7:0:0:0: Attached scsi generic sg3 type 0     [  294.103465] sd 7:0:0:0: [sdc] 838860800 512-byte logical blocks: (429 GB/400 GiB)     [  294.208275] sd 7:0:0:0: [sdc] Write Protect is on     [  294.208284] sd 7:0:0:0: [sdc] Mode Sense: 0f 00 80 00     [  294.208290] sd 7:0:0:0: [sdc] Assuming drive cache: write through     [  294.318200] sd 7:0:0:0: [sdc] Assuming drive cache: write through     [  294.318222]  sdc:     [  294.428212] sd 7:0:0:0: [sdc] Assuming drive cache: write through     [  294.428225] sd 7:0:0:0: [sdc] Attached SCSI removable disk


title: Configuring network settings manually in Qubes OS

text: I'm trying to setup Qubes OS on my desktop but struggling to get the network/internet working. This is the configuration i want to setup -               ip - 192.168.1.2     Subnet - 255.255.255.0     Gateway - 192.168.1.1     DNS - 8.8.8.8     interface - eth0      i tried following with limited success -               ifconfig eth0 192.168.1.2 netmask 255.255.255.0       route add default gw 192.168.1.1      also edited /etc/resolv.conf to added dns entry. Now when i check ifconfig - I get my ip & netmask configured and when i check routes i get 2 routes displayed with 192.168.1.1 as default. But i still cannot surf or even ping domains (eg. www.google.com). Qubes has various security domains called AppVm's. So i guess we could/might need to setup a network config for each VM. Its all a little new to me (+ its documented sparsely) so any help appreciated!


title: Where to put commands to run when X starts with SLiM

text: I'm having trouble determining where to add these two commands:               setxkbmap latam      to set the correct keyboard layout, and               xcompmgr -c -C &      to enable transparency. Before installing SLiM, I used this recommendation, and it worked, but it stopped working afterwards. I tried adding it to ~/.xinitrc, like shown below:               #!/bin/sh     #     # ~/.xinitrc     #     # Executed by startx (run your window manager from here)          if [ -d /etc/X11/xinit/xinitrc.d ]; then       for f in /etc/X11/xinit/xinitrc.d/*; do         [ -x "$f" ] && . "$f"       done       unset f     fi          exec setxkbmap latam     exec xcompmgr -c -C &     exec startxfce4      But this seemed to crash it, and it just froze before starting XFCE4 (after logging in). I also tried using this recommendation from the Arch Wiki, but it didn't seem to do anything. Any recommendations? Note that I'd like these commands to be the default setting for all users that log into xfce4. Thanks


title: Postfix: force local users (PHP) to use the SMTPD for outside recipients

text: My server has been hacked and was sending lots of spam over the Internet. The first thing I did is shutdown postfix, close the outgoing port 25 and take the time to clean the website, the postfix queues, and to re-setup postfix completely. I enabled lots of restrictions on the Postfix SMTPD, like forcing SASL authentification and TLS. But I'm just thinking, PHP `mail()` function doesn't care about SMTPD, because it calls `sendmail`, whose emails end in the `maildrop` queue, and finally in the `incoming` queue (and bypass all of my SMTPD protections). I made a small sketch of Postfix daemons and queues for myself, in order to understand better how it works. ![Postfix overview](http://i.stack.imgur.com/nyzft.png) I would like following setup:   * **Prevent sendmail from delivering emails to outside recipients, but allow it to deliver emails to local users, and allow it to follow mappings in /etc/aliases even if it is an "ouside" mapping.** My aim is that at the end, users have no other choice than contact local SMTPD directly, thus forced to login thanks to my `smtpd_client_restrictions = permit_sasl_authenticated, reject` configuration.


title: how to re-enable input on a serial console

text: I have an old router which runs Linux and I'd like to have a serial console on. This used to work fine, but after a firmware update, I can now only get output on the console and cannot give any input back to the device. During boot there is a line that says "Console input is disabled" that wasn't there before. Without changing the firmware, how do I re-enable input on the serial console? ... my attempts so far ... I can log in over the LAN and load any files (and cross compile tools if need be), and there is a small non-volatile user flash partition, so any solution requiring me to write a quick program using ioctl or whatnot is fine. The embedded Linux has the system files like `/sys/bus` and `/sys/devices/platform/serial8250.0` and so on in case that is useful. The files `/dev/console`, `/dev/ttyS0`, `/dev/tty` all have read and write permissions. Running `getty -L 115200 ttyS0` makes a login prompt appear on the serial console, but I can't get it to accept any input. Adding the line               ::respawn:-/bin/sh      to `inittab` makes busybox give a shell prompt ... but again, the serial console won't take input. dmesg reports               Kernel command line: root=/dev/ram rw init=/init console=ttyS0,115200      and `stty` gives               speed 38400 baud; line=0;        along with a bunch of unimportant looking settings, `stty -a -F /dev/ttyS0` gives               speed 115200 baud; stty: /dev/ttyS0       line = 0;        (and a whole bunch of settings that don't look important, but I'll type them up if people need them.) I'm at a loss here, so I'm not sure what information is needed.   Any ideas for solving this puzzle? I have a feeling there is something simple I forgot to try.


title: Logging outgoing connections as they happen

text: Is there a way to log to file all the outgoing connections that a process creates? I am aware of `netstat` but that seems to be more of a snapshot of a point in time rather than something that runs and logs information over a period. I only need the IP or hostname, port and the process making the connection.


title: is there an open source tool to measure cpu performance?

text: I have used many times `ab` for measuring web performance, `hdparm` for measuring hard disk performance and `netperf` for measuring network performance. But I didn't find any tools to measure cpu performance. Do you know a tool allowing to measure cpu performance? I am more specifically looking to measure Gflops.


title: Log in using a 4-digit PIN, with a password fallback

text: Windows 8 has this feature where you can log in with a 4-digit PIN which is really convenient. Is there such a thing in Linux? In Windows 8, you get five attempts to log in using the PIN, then it reverts to only allowing you to log in with your regular password. This isn't the same as a password that consists of 4 digits, because there's a fallback to a longer password, and there's a hard limit on the number of PIN attempts.


title: Where does the output go from `at` and `cron` jobs

text: Where does standard output go given there is now screen? It's not appearing in the same directory or my home directory. How could I actually figure this out given that I don't know how to run debug or trace on a background job.


title: Can't boot from Fedora PreUpgrade image

text: I have been happily using, for several months, Fedora 12 on a PC with a crashed Windows XP3 as the other operating system, and have just used `preupgrade` to download Fedora 16, which now appears as the second entry in my `/boot/grub/menu.lst` file. Booting with this as the default entry just hangs up the machine. So, my question is: what do I do now to complete the upgrade? I have searched the Internet and found a lot of relevant entries, but they are all either long out-of-date, or just too confusing.


title: Loop with 2 variables in a bash script

text: I am trying to utilize an API. I need to either do some type of "for loop" that replaces or utilizes 2 variables... In pseudo..               # Declare New Servers     newserver=(     box001     box002     box003     box004     box005     )               # Declare hostnames     newhostname=(     box001.domain.com     box002.domain.com     box003.domain.com     box004.domain.com     box005.domain.com     )      I need to replace NEWSERVER and NEWHOSTNAME in               http://server/api/duplicateobject.htm?id=2928&name=NEWSERVER&host=NEWHOSTNAME&targetid=3120      so that it looks like this               http://server/api/duplicateobject.htm?id=2928&name=box001&host=box001.zcloud.com&targetid=3120      I just need it to loop through all of hosts listed.


title: Solaris SPARC 10 32bit mode

text: I'm looking for a definitive answer, does Solaris 10 running on a SPARC machine support booting into 32bit mode? I've found one site that states Solaris 8 was the last version that supported booting in a 32bit mode for SPARC. I've read multiple items that explain how to boot Solaris into 32bit mode, however they did not list the Solaris version. We've tried all the ways specified, but the system keeps booting into 64bit mode.


title: What are the Implications of moving to Huge mem kernel on RHEL4

text: I've been asked to investigate adding extra memory (> 16gb) to a RHEL 4 server and moving to a huge mem kernel. The server is used for Oracle RAC. Is it just a case of installing the hugh mem kernel and booting into ? or is it more complex than that ? Any tips / gotcha's ?


title: vi command for adding blank line?

text: In vi, I can use `o` or `O` to add a blank line and go into insertion mode. But what if I want to stay in command mode, is there a command for this? In googling, I'm seeing suggestions to add stuff to my vimrc, but it seems like there should be an easier way (that will always work.)


title: How do I use tee to redirect to grep

text: I don't have much experience of using tee, so I hope this is not very basic. After viewing one of the answers to this question I came across a strange beheviour with `tee`. In order for me to output the first line, and a found line, I can use this:               ps aux | tee >(head -n1) | grep syslog     USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND     syslog     806  0.0  0.0  34600   824 ?        Sl   Sep07   0:00 rsyslogd -c4      However, the first time I ran this (in zsh) the result was in the wrong order, the column headers were below the grep results (this did not happen again however), so I tried to swap the commands around:               ps aux | tee >(grep syslog) | head -n1     USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND      Only the first line is printed, and nothing else! Can I use tee to redirect to grep, or am I doing this in the wrong manner? As I was typing this question, the second command actually worked once for me, I ran it again five times and then back to the one line result. Is this just my system? (I am running zsh within tmux). Finally, why with the first command is "grep syslog" not shown as a result (there is only one result)? For control here is the grep without the `tee`               ps aux | grep syslog     syslog     806  0.0  0.0  34600   824 ?        Sl   Sep07   0:00 rsyslogd -c4     henry    2290  0.0  0.1  95220  3092 ?        Ssl  Sep07   3:12 /usr/bin/pulseaudio --start --log-target=syslog     henry   15924  0.0  0.0   3128   824 pts/4    S+   13:44   0:00 grep syslog      * * * **Update:** It seems that head is causing the whole command to truncate (as indicated in the answer below) the below command is now returning the following:               ps aux | tee >(grep syslog) | head -n1     USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND     syslog     806


title: In irssi, how do I display previous chats of current chan, or current user if in bitblee?

text: When I reopen irssi, I'd like to display - easily and from inside irssi - previous conversations of a chan, or a query window with specific user (mostly for private conversation in bitlbee). I can obviously find logs, it's set in my ~/.irssi/config :               autolog_path = "~/.irclogs/$tag/$0.log";      but i can't display them in active and corresponding irssi window. That seems a basic chat feature I'd like to enjoy.


title: OpenSUSE graphical login lost after distribution upgrade from 11.2 to 11.3

text: I attempted to perform an in-place distribution upgrade from openSUSE 11.2 to openSUSE 11.3 following the instructions. The upgrade appeared to succeed, but after I rebooted I was presented with a console login. It seems that I lost the graphical login. How do I restore the graphical login?


title: How to add all binaries to bash tab completion for some command?

text: I've installed program `trickle` that allow to throttle the net for specified command like:               trickle -u10 -d10 <COMMAND>      How to add bash completion for all binaries to `trickle` command?


title: Changing my toolchain architecture (in gentoo)

text: This is somewhat gentoo-specific, so I'll explain it in that context, then try to abstract it to a generic linux machine. I accidently set my CHOST to "i686-pc-linux-gnu" in the beginning, not paying attention, when my machine is a Athlon64. I would like to change it to "x86_64-pc-linux-gnu". There is a guide for this. It doesn't work. The first step is "Recompile binutils, then recompile gcc" Here's the problem illustrated:   1. Compile binutils using gcc - this succeeds producing new as, ar, and the like files   2. This _breaks_ gcc. gcc is now trying to use the new /usr/bin/as - but it can't work with them   3. Since gcc can't compile anything, I can't compile gcc. I have to revert as, ar, etc; then revert the CHOST change, and recompile binutils. So I tried the following:   1. back up as, ar, etc   2. Compile binutils, rendering gcc inoperabe   3. link ar, as, etc to the old versions I backed up   4. try to compile gcc The gcc compile fails with:               /usr/x86_64-pc-linux-gnu/bin/ld: skipping incompatible /usr/lib/libc.so when searching for -lc     /usr/x86_64-pc-linux-gnu/bin/ld: skipping incompatible /usr/lib/libc.a when searching for -lc     /usr/x86_64-pc-linux-gnu/bin/ld: cannot find -lc     collect2: ld returned 1 exit status      _This_ is a glibc error (completing the chain). So it seems:   1. for gcc to compile it has a dependency on the new version glibc   2. for gcc to run, binutils must be the older version The steps I _haven't_ tried, because it's so complicated I wanted to get opinions first, are:   1. compile binutils under new architecture,   2. relink as, ar, etc to old executables   3. compile new glibc with old-gcc and old-binutils   4. compile new-gcc with old-gcc and old-binutils but new-glibc   5. relink as, ars, etc to new-binutils   6. recompile everything like a boss Is there any chance of #4 above working? Do I have any hope of accomplishing this without a complete reinstall?


title: Fedora 18 guest in VirtualBox 4.2: How to assign static IPv4 address to guest regardless of active ethernet interface on host

text: I have a Ubuntu 13.04 host running VirtualBox 4.2.12. This host has both a wired and a wireless network interface, but only one of which would usually be active at any given time. For example, at home wireless would be active, and at office wired one would be active. **Now, I would like to** set up a Fedora 18 VirtualBox guest in "Bridged Networking" mode in such a way that the guest and the host can freely `ssh` to each other (and to the network that the host is connected to) using their static IPv4 addresses. And if I add more such guests in future, then the guests should also be able to `ssh` to each other. However, **I'm facing the following problems** :   1. Upon selecting "Bridged Networking" mode for the guest in VirtualBox settings, the guest ends up getting a dynamically assigned, IPv6 address (whereas I want a statically assigned address that is an IPv4 address).   2. When the wireless interface is active on the host, I get to see only the "lo" and the "wlan0" entries in the output if `ip addr` on the host. So, the static IPv4 address that I assigned to the host's p2p1 (or, the wired) interface when it was active earlier in the day (in office) simply cannot be seen when the wired interface is not active later (at home).   3. I tried the instructions given here (using the `ifcfg-p2p1` file for my case), but they didn't work for me. For example, I was able to `stop` and `disable` `NetworkManager.service` just fine, but I could not `restart` `network.service` (it gave me the error `"Restarting network (via systemctl): Job for network.service failed. See 'systemctl status network.service' and 'journalctl -n' for details."` **Also** ,   1. Is there any distribution-independent way to assign static IPv4 address to my F18 VM? Meaning, since each Linux distro keeps its network settings in different file/dir structures (and with maybe different properties too inside), is there any way I can achieve the above setup via commands like `ifconfig`, `ip`, `route`, etc and then also be able to persist their changes to whatever files those changes need to go in?   2. To avoid problem #2 above, do I have to use a manually created tun/tap device to use for "Bridged Networking"? If so, how can I do that on Ubuntu 13.04?


title: mon linux monitor install on centos - can't find glib.h although present

text: I am trying to install the linux_monitor package under Centos 5.5. When I try make I get:               make[3]: Entering directory `/tmp/linux_monitor-2.0RC3/src/server'     if gcc -DHAVE_CONFIG_H -I. -I. -I../../src   -I/usr/include/openssl  -g -O2 -Wall -MT linux_mond.o -MD -MP -MF ".deps/linux_mond.Tpo" \           -c -o linux_mond.o `test -f 'linux_mond.c' || echo './'`linux_mond.c; \         then mv -f ".deps/linux_mond.Tpo" ".deps/linux_mond.Po"; \         else rm -f ".deps/linux_mond.Tpo"; exit 1; \         fi     In file included from linux_mond.c:23:     linux_mond.h:40:18: error: glib.h: No such file or directory     linux_mond.c: In function ‘server’:     linux_mond.c:155: warning: pointer targets in passing argument 3 of ‘accept’ differ in signedness     linux_mond.c: In function ‘client’:     linux_mond.c:334: warning: pointer targets in passing argument 1 of ‘strlen’ differ in signedness      I understand it is not finding glib.h, right? I know it is present at /usr/include/glib-1.2/, but I tried several configure flags and looked at the different files and can't find how to let know to configure where that library is.


title: How to parse multiple string patterns in linux shell script

text: I am new to linux shell and I had a hard time thinking of the solution to this. Can somebody help how to parse multiple strings (data) in a file? For below file, I want to parse all the values next to `BIG*20021208*00001**` which are the following: `A999`, `A1000`, `1001`.               ST*810*0001     BIG*20021208*00001**A9     99*N1*ST*XYZ Test Corporation*9*122334455     N3*987 Freeway Dr.     N4*New York*NY*98765     N1*BT*ABC Test Company*9*122334455     N3*123 Highway Street     N4*Los Angeles*CA*12345     ITD*01*3*2**30**30*****60     FOB*PP     IT1**1*EA*200**UA*EAN     PID*F****Lamp     IT1**4*EA*50**UA*EAN     PID*F****Chair     TDS*2000     CAD*****Routing     ISS*30*CA     CTT*50     SE*19*0001     ST*810*0002     BIG*20021208*00001**A1000     N1*ST*XYZ Test Corporation*9*122334455     N3*987 Freeway Dr.     N4*New York*NY*98765     N1*BT*ABC Test Company*9*122334455     N3*123 Highway Street     N4*Los Angeles*CA*12345     ITD*01*3*2**30**30*****60     FOB*PP     IT1**1*EA*200**UA*EAN     PID*F****Lamp     IT1**4*EA*50**UA*EAN     PID*F****Chair     TDS*2000     CAD*****Routing     ISS*30*CA     CTT*50     SE*19*0002     ST*810*0003     BIG*20021208*00001**10     01N1*ST*XYZ Test Corporation*9*122334455     N3*987 Freeway Dr.     N4*New York*NY*98765     N1*BT*ABC Test Company*9*122334455     N3*123 Highway Street     N4*Los Angeles*CA*12345     ITD*01*3*2**30**30*****60     FOB*PP     IT1**1*EA*200**UA*EAN     PID*F****Lamp     IT1**4*EA*50**UA*EAN     PID*F****Chair     TDS*2000     CAD*****Routing     ISS*30*CA     CTT*50     SE*19*0003      Now, as you can see in the BIG segment, A999 value were separated already(no longer intact) . Then my problem now is when I get the data (e.g.A999) it will only generated this A9 and not the whole value which is A999.Is there any workaround for this?


title: Howto to boot an attached external hard disk (without formating)? (Solution: Repair grub easily)

text: I have a former internal hard drive, which I now use as external USB drive. I tried to boot from it, but it doesn't work (2 PCs tried, on my: blank screen + blinking cursor). This - I think - is normal, because to make a USB device bootable it must be prepared before the installation / during formating. Since I don't understand, if the situation of other threads here fit on mine, please tell me: _Is it possible to boot the system, which is already on the external drive (and which has worked, when it was an internal drive)._ My ideas were:   * use this device in a virtual machine as already installed system or try to boot from it (which doesn't work, since it's not prepared).   * change grub on the system, where I attach the external HDD Edit: I have used `gparted` to set the partition as active / bootable. Buuuut: it is a logical partition and not the first on the HDD. When I now try to boot from the computer gets into a reset loop: right after the BIOS messages my computer restarts instead of booting. Thanks!


title: "../../src/filesdb.c:683: findnamenode: Assertion `(*pointerp)->name[0] == '/'' failed."

text: I have been trying to update `Ubuntu 12.04` on the command line by using the two commands               sudo apt-get update     sudo apt-get dist-upgrade      which ends with the following error:               (Reading database ... 70%dpkg: ../../src/filesdb.c:683: findnamenode: Assertion `(*pointerp)->name[0] == '/'' failed.     E: Sub-process /usr/bin/dpkg exited unexpectedly      How to fix this **on the command line**?


title: Boot graphical application straight from Linux bootup (without verbose boot messages and desktop)

text: Is it possible to boot from minimum Linux core(Linux/Android) to an application (preferably created in interchangeable platform languages such as C# - Mono / GTK / Java / C) without any verbose Linux boot messages on screen? Basically power-on the OS and see nothing except your GUI application (no Linux messages, no desktop). I would hope to do this on a well established simple platform, perhaps Linux, Android or even Chrome or any other options which makes even more sense. What options is most easily or most appropriate. (for the sake of simplicity and reduce production time). The purpose is to create a single purpose application on a PC/Raspberry pi/embedded (similar to XBMC or any other media application that serves as a single purpose device).


title: How to make bash history prefix-sensitive?

text: How can I make pressing up/down on bash bring up the last command that started with the prefix I already entered? E.g.               $ ls foo     $ echo hello     $ ls <UP_ARROW>      Clicking UP after entering ls should bring up "ls foo" and not "echo hello"


title: Install vmware-tools using yum in vmware fusion

text: I added vmware-tools repo [1] to my virtual CentOS box. What is the exact set of packages I have to install? The rationale is to be able to update vmware-tools using yum. Environment: Host OS: Mac OS X 10.8 Guest OS: CentOS-6.4-x86_64 VMware-fusion: 5.0.3 [1] http://packages.vmware.com/tools/esx/latest/repos/index.html


title: GNU screen :fit equivalent in tmux

text: I'm experiencing this problem where I've attached a single tmux session at multiple terminals with differing console sizes. Is there a solution to rid of the view-port without having to disconnect the other terminal, like screen's :fit command? It seems rather silly that it is possible to attach tmux at multiple terminals and yet always have to use the lowest-common denominator of all terminals attached.


title: grep for an alphanumeric strings of any length with a colon on each side

text: How would you grep for an alphanumeric strings of 1 to 50 characters (ideally, any length would work too) with a colon on each side – a typical result would be all the lines containing the string `:shopping:`. So far I've got the code below (I've tried some variations on it) which doesn't work:               grep ':[[:alnum:]]{1,100}:' ~/x.txt


title: How to get infrared image data with sane on an epson v700 scanner?

text: I have read a number of posts on the topic and it seems that for now it is not possible to use sane to read infrared data (second pass) with my Epson Perfection V700 scanner out of the box. But are there any options to get that working? Any known patch? Any configuration behind the scenes? Any undocumented feature? I just asked the question on Avasys' message board, but if any of you guys out there had relevant information, I would appreciate greatly. Of particular interest is the 6400dpi resolution in 16bits per channel to scan slides, so I need the infrared option on the `epkowa` driver as the `epson2` driver seems limited to 3200dpi anyway. As far as I can tell neither `epkowa` nor `epson2` offers the infrared scan, though it seems that it should be a simple option (`vuescan` actually can do the job, it does two scan passes, one for the RGB and one for the infrared, but I would much prefer to be able to do my scans from the command-line). Note that I don't mind if the infrared scan comes out as a separate image, I can manage to combine them as needed. Also of interest and not included in the current `sane-epkowa` driver are:   1/ scans with multiple samples   2/ confirmation that the `scanimage` `-brightness` setting actually changes the CCD exposure time (rather than performing software image processing) * * * Edit 2011-02-01: check sane-devel for the start of an answer. sane-backends v1.0.21 has code that's unused by default. A tweak in epson2.c to enable my scanner (GT-X900) and a configure option to enable IR (CPPFLAGS=-DSANE_FRAME_IR) gets me a version that can at least pretend to do the job. I still have to solve two significant issues before I can call it a victory:   1/ with --mode=Infrared, the output image format seems incorrect, it seems like it produces grayscale, albeit in a funny format.   2/ --mode=Infrared does not actually produce IR data, the data looks like Grayscale from ordinary colour, it does not look like the result of an Infrared scan. More tweaking will be necessary before I get the desired result. Again, if any of you has any idea that would help debug and fix (such as where to start in the code, debug settings...), please shout.


title: What does readonly mean or do?

text: What does readonly mean or do in this case? I have never seen or heard of it.               a="testString"; b=a; readonly b; b=25;      Also, would the final value of b at the end be 25?


title: What's the progress regarding improving system performance/responsiveness during high disk I/O?

text: Whenever there is high disk I/O, the system tends to be much slower and less responsive than usual. What's the progress on Linux kernel regarding this? Is this problem actively being worked on?