title: TwinView: Switched placement (right/left)

text: I have a working twin view setup using nvidia graphics card and propriety drivers on Debian jessie.   * main monitor (DFP-0): Dell 2405FPW via DVI, placed to the right   * sencondary (DFP-1): Sharp TV screen via HDMI, placed to the left But in software, the position is switched and does not correspond to my hardware setup. How to change this _and make it permanent_ after restart? I can change it temporary using `gksu nvidia-settings`, but after restart, the ordering is reversed again. (note: I did run as root and save the resulting xorg.conf file directly from GUI, and also by copy pasting it into `sudo nano /etc/X11/xorg.conf`, with no effect) my `xorg.conf` after reboot:               # nvidia-settings: X configuration file generated by nvidia-settings     # nvidia-settings:  version 319.72  (pbuilder@cake)  Sat Nov  9 14:29:01 UTC 2013          Section "ServerLayout"         Identifier     "Layout0"         Screen      0  "Screen0" 0 0         InputDevice    "Keyboard0" "CoreKeyboard"         InputDevice    "Mouse0" "CorePointer"         Option         "Xinerama" "0"     EndSection          Section "Files"     EndSection          Section "InputDevice"         # generated from default         Identifier     "Mouse0"         Driver         "mouse"         Option         "Protocol" "auto"         Option         "Device" "/dev/psaux"         Option         "Emulate3Buttons" "no"         Option         "ZAxisMapping" "4 5"     EndSection          Section "InputDevice"         # generated from default         Identifier     "Keyboard0"         Driver         "kbd"     EndSection          Section "Monitor"         # HorizSync source: edid, VertRefresh source: edid         Identifier     "Monitor0"         VendorName     "Unknown"         ModelName      "DELL 2405FPW"         HorizSync       30.0 - 81.0         VertRefresh     56.0 - 76.0         Option         "DPMS"     EndSection          Section "Device"         Identifier     "Device0"         Driver         "nvidia"         VendorName     "NVIDIA Corporation"         BoardName      "GeForce GTX 460"     EndSection          Section "Screen"         Identifier     "Screen0"         Device         "Device0"         Monitor        "Monitor0"         DefaultDepth    24         Option         "Stereo" "0"         Option         "nvidiaXineramaInfoOrder" "DFP-0"         Option         "metamodes" "DFP-0: nvidia-auto-select +1920+0, DFP-1: nvidia-auto-select +0+0"         SubSection     "Display"             Depth       24         EndSubSection     EndSection      As far as i understand this should result in the correct setup. I did try different settings, like:   * `Option "metamodes" "DFP-0: 1920x1200_60 +1920+0, DFP-1: 1920x1080_50 +0+0"`   * `Option "metamodes" "DFP-1: nvidia-auto-select +1920+0, DFP-0: nvidia-auto-select +0+0"`   * `Option "metamodes" "DFP-0: nvidia-auto-select +0+0, DFP-1: nvidia-auto-select +1920+0"`   * `Option "metamodes" "DFP-1: nvidia-auto-select +1920+0, DFP-0: nvidia-auto-select +0+0"` but they all resulted in exaclty the same situation after restart, so I suppose I'm missing something else, and I don't think this is an error in xorg.conf? Any advice?


title: OpenSUSE can only boot into Failsafe mode

text: I installed the latest version of OpenSUSE and tried to install the driver for my touchpad. It would not install, so I installed it in this way:               zypper install ./filename_.rpm      After that my OpenSUSE will not load. When I boot and choose OpenSUSE in the Grub menu, I only see the OpenSUSE logo (about 4sec) and then only a black screen.. Failsafe mode is working. Is it possible that teh system isn't working due to the driver I installed? If yes, is there a way to "delete" the driver, which I installed or maybe remove it from startup?


title: Launchpad equivalent for Debian

text: I am thinking of switching to Debian (Squeeze) from Ubuntu (10.10). But these questions have been bugging me:   1. Is there a Launchpad equivalent repository for Debian? I am not able compile packages every time by myself without a comprehensive guide. So, I need a fairly large repository like Launchpad to keep my favorite apps up-to-date.   2. What about the kernel? Do I have to update it myself or Squeeze is gonna take care it for me (fairly recent updates)? I am asking this for I have read that stable releases of Debian rarely update their packages. P.S: My main reason for using Ubuntu so far is that it has vast repositories, as compiling apps from tar-balls is cumbersome for me.


title: Using a named pipe as ffmpeg/avconv's input for streaming

text: So I'm in a situation in which I want to feed a .wav (or other kind of sound) file to a named pipe/FIFO, and use the pipe as ffmpeg's input source (with a ffserver feed as an output). This is as far as I've gotten (ffserver is already running, and I think is unrelated to my issue):               $ mkfifo audio.wav          $ mplayer -ao pcm:file=audio.wav soundfile.wav &     [2] 30864     Symbol `ff_codec_bmp_tags' has different size in shared object, consider re-linking     MPlayer 1.0rc4-4.5.2 (C) 2000-2010 MPlayer Team          [2]+  Stopped                 mplayer -ao pcm:file=audio.wav soundfile.wav          $ avconv -f wav -i audio.wav http://127.0.0.1:8090/feed1.ffm     avconv version 0.8, Copyright (c) 2000-2011 the Libav developers       built on Mar 16 2012 15:30:40 with gcc 4.5.2          (Hangs here, won't output anything else)      However, ffmpeg ends up stuck right there, with the process seemingly hanging, and it doesn't seem like ffmpeg is doing anything, and the end feed seems to be inactive. The warning up there relating to ff_codec_bmp_tags seems unrelated as well. I've read a few forum threads in which people seem to have success with something very close to this, but I suppose there's something I'm doing wrong. If anyone could help me as to why this is happening, I'd really appreciate it. Is there some flag I should be using to indicate it's a FIFO I'm using a source? Thanks in advance.


title: Dragging and resizing floating windows in xmonad without the  modkey

text: In my `.xmonad/xmonad.hs` file, I have the following lines, which control howto drag and resize windows. How can I change this, such that I don't need any mod key?               myMouseBindings (XConfig {XMonad.modMask = modm}) = M.fromList $              -- mod-button1, Set the window to floating mode and move by dragging         [ ((modm,button1), (\w -> focus w >> mouseMoveWindow w                                            >> windows W.shiftMaster))              -- mod-button2, Raise the window to the top of the stack         , ((modm,button2), (\w -> focus w >> windows W.shiftMaster))              -- mod-button3, Set the window to floating mode and resize by dragging         , ((modm,button3), (\w -> focus w >> mouseResizeWindow w                                            >> windows W.shiftMaster))              -- you may also bind events to the mouse scroll wheel (button4 and button5)         ]


title: Have tmux wait until I SSH in, to complete rest of Tmuxinator script

text: After recently discovering tmux and Tmuxinator, I've been trying to set up a development environment to use. Per protocol, we aren't allowed to store passwords/passphrases in scripts. So what I'm looking for is a wait for tmux to wait for the SSH tunnel to get set up (password supplied, enter pressed, and logged in). I know that there's a "wait-for" command in tmux 1.8+. I'm running 1.9a via Cygwin. But even though I've read over the documentation, I'm just having a difficult time understanding it.               tmux new-session -s development -n editor -d     tmux split-window -v     tmux split-window -v          "Need to send to all panes.     tmux send-keys -t development 'ssh user@example.com' C-m      So, here's a very simple version of what I have. Thoughts? I know I can synchronize-sessions, I'm still working out the kinks in this. **Edit** : Looking into commands, and pulling variables from the pane to the command from synchronized-panes. This might be a "better" way to go about, until I can figure out how to get TMUX to prompt me for user-input. Might issue a feature request.


title: Dual booting Scientific Linux 6 and 64 bit Windows 7

text: For a school project we need to run Scientific Linux as well. So I tried installing it. I had Windows 7 running on on drive C (NTFS). Drives D and E(500 GB each; NTFS format) were empty. I ran the Scientific Linux 6.0 Live cd and booted from it. I deleted drive E during installation process and reformatted it. This is what my partitions now look like in gparted: ![screen photo](http://i.stack.imgur.com/xIgRB.jpg) After successfully installing SL6, my pc directly boots into SL! How do I get a boot menu where I chose the OS each time I boot. Iam very new to linux systems and have no clue about stuff like GRUB. Please help me out!


title: How to use rsync with GNU parallel?

text: I am using scp to copy the files in parallel using GNU parallel with my below shell script and it is working fine. I am not sure how can I use `rsync` in place of `scp` in my below shell script. I am trying to see whether `rsync` will have better performance as compared to `scp` or not in terms of transfer speed. Below is my problem description - I am copying the files from `machineB` and `machineC` into `machineA` as I am running my below shell script on `machineA`. If the files is not there in `machineB` then it should be there in `machineC` for sure so I will try copying the files from `machineB` first, if it is not there in `machineB` then I will try copying the same files from `machineC`. I am copying the files in parallel using GNU Parallel library and it is working fine. Currently I am copying five files in parallel both for PRIMARY and SECONDARY. Below is my shell script which I have -               #!/bin/bash          export PRIMARY=/test01/primary     export SECONDARY=/test02/secondary     readonly FILERS_LOCATION=(machineB machineC)     export FILERS_LOCATION_1=${FILERS_LOCATION[0]}     export FILERS_LOCATION_2=${FILERS_LOCATION[1]}     PRIMARY_PARTITION=(550 274 2 546 278) # this will have more file numbers     SECONDARY_PARTITION=(1643 1103 1372 1096 1369 1568) # this will have more file numbers          export dir3=/testing/snapshot/20140103          do_Copy() {       el=$1       PRIMSEC=$2       scp david@$FILERS_LOCATION_1:$dir3/new_weekly_2014_"$el"_200003_5.data $PRIMSEC/. || scp david@$FILERS_LOCATION_2:$dir3/new_weekly_2014_"$el"_200003_5.data $PRIMSEC/.     }     export -f do_Copy          parallel --retries 10 -j 5 do_Copy {} $PRIMARY ::: "${PRIMARY_PARTITION[@]}" &     parallel --retries 10 -j 5 do_Copy {} $SECONDARY ::: "${SECONDARY_PARTITION[@]}" &     wait          echo "All files copied."      Is there any way of replacing my above `scp` command with `rsync` but I still want to copy 5 files in parallel both for `PRIMARY` and `SECONDARY` simultaneously? This is what I have tried so far. After reading some of the tutorials for `rsync` \-               for n in "${PRIMARY_PARTITION[@]}"     do         primary_files="$primary_files :$dir3"/new_weekly_2014_"$n"_200003_5.data     done          for n in "${SECONDARY_PARTITION[@]}"     do         secondary_files="$secondary_files :$dir3"/new_weekly_2014_"$n"_200003_5.data     done          rsync -avz david@$FILERS_LOCATION_1"${primary_files}" $PRIMARY/ 2>/dev/null     rsync -avz david@$FILERS_LOCATION_2"${primary_files}" $PRIMARY/ 2>/dev/null          rsync -avz david@$FILERS_LOCATION_1"${secondary_files}" $SECONDARY/ 2>/dev/null     rsync -avz david@$FILERS_LOCATION_2"${secondary_files}" $SECONDARY/ 2>/dev/null       But not sure how do I fit this in my above GNU Parallel shell script so that I can copy five files in parallel both for `PRIMARY` and `SECONDARY` simultaneously?


title: comparing user given time for log file time

text: Apologies straight away for bad-styled-question-and-heading.....learning unix and its command these days, m trying to figure out a solution for below scenario : Lets say i have a log file which looks like :                01-02-1988     12:00:00    I start       01-02-1988     12:00:01    I start      01-02-1988     12:00:02    I start       01-02-1988     12:00:03    I start      01-02-1988     12:00:04    I start       01-02-1988     12:00:05    I start      01-02-1988     12:00:06    I start       01-02-1988     12:00:07    I start      01-02-1988     12:00:08    I start       01-02-1988     12:00:09    I start      01-02-1988     01:00:10    I start      and i take a time bracket from user for which he wants to see the status.To filter out all the process, i can do :               egrep $usr_time log.txt      But is there any way i can do the same for a particular time period, like `awk`, can match the value for me for `$2` here...but how to compare it for seconds(ss in hh:mm:ss)??? Like for example : assume i want records from `12:00:01 - 12:00:06`, so basically what i would need is to extract 3rd value from `:` delimiter and compare it....how can this be achieved....please help!!!!


title: OpenBSD with adsuck: nslookup works, other applications not

text: (The problem that nslookup works but other applications can't resolve name is asked very often, mainly for windows. I read a lot of these answers but none of them was applicable.) I use OpenBSD with the adsuck deamon. I start adsuck with               cp /etc/resolv.conf /var/adsuck/files     echo "nameserver 127.0.0.1" > /etc/resolv.conf     /etc/rc.d/adsuck start      The deamon is running with two process from user _adsuck:               /usr/local/sbin/adsuck -c /var/adsuck -f /files/resolv.conf -r /files/regex /files/hosts.small     adsuck: [resolv monitor] (adsuck)      I can resolve names with nslookup or dig, but ping or browser does not work. What can be the problem? (I tried addresses which should not be blocked by adsuck like www.google.com) Edited: I should have looked in /var/log/daemon earlier, adsuck had complained about the line               ::1 localhost #[IPv6]      in /var/adsuck/files/hosts.small, now adsuck seems to work fine. But I still do not understand why nslookup had worked when DNS for other applications did not.


title: Implementation Logic

text: I have two files,which is something like this: file1               msgid "New"     msgstr ""     dsvhuvchvdhcvhc     msgid "Old"     msgstr "hsvhs"     kdnvcjdbvj     msgid "Bold"     msgstr ""      file2               dcbjdsbc     msgid "New"     msgstr "Alas"     msgid "Old"     msgstr "hsvhs"     dcjdbcjdbc     msgid "Bold"     msgstr "Next"      After processing , i want my file1 as:               msgid "New"     msgstr "Alas"     dsvhuvchvdhcvhc     msgid "Old"     msgstr "hsvhs"     kdnvcjdbvj     msgid "Bold"     msgstr "Next"      Implementation steps:               ***Search msgstr "" pattern in file1        take its previous line, find this line in file2      if found then replace the next line of file1 with next line of file2***      Please provide me the implementation details: How do i implement script for following logic. I have written a shell script with O(n^2) ,where my n is no of lines,which is around 50k,so,its making whole thing very slow. Please provide optimized solution for this.


title: Mount an SD card over USB?

text: I'm currently using: > insmod g_file_storage.ko file=/dev/mmcblk0p1 stall=0 removable=1 This works as I can see the device in Windows. However when it comes to changing a file, the changes are not reflected on the Linux device. If I were to add a new file, this change is reflected. Same thing goes for renaming and removing. I've been reading around that g_file_storage mounts a block rather than a filesystem. Is there any way to either: 1) Update the block when a file is changed so the Linux device sees the change   2) Use some other method to mount a filesystem over USB (can't use g_ether/g_serial) This is for a GP2X Caanoo device.


title: AIX auditing for LDAP users

text: I've discovered a problem with the way AIX uses `auditclasses` to determine which system calls are audited. If a user is defined in LDAP, their `auditclasses` attribute is blank. I found an APAR which states, prior to AIX 5.3, the default user stanza in `/etc/security/audit/config` was applied to users without an `auditclasses` attribute. However, this no longer seems to be the case in AIX 5.3 or higher. I know there's a RFC2307AIX schema, which defines this LDAP attribute. However, I'd like to set a local default `auditclasses` and not have to convince the Active Directory admins to apply a schema extension. Besides, I cannot find a schema extension for eDirectory, which is also used. Has anyone else seen this problem?


title: Korn Shell: Show elapsed time in a specific format

text: In a log file, I need to print the Elapsed time, in the following format:               "Process completed %s - Elapsed %s",     <time now in HH:MM:SS format>,     <difference from start date to end date in HH:MM:SS format>      Example:               Process completed 23:57:59 - Elapsed 103:22:59      How could I achieve this?


title: Is it possible to add granular permissions on a folder without installing acl?

text: I have a folder `public_html` with several subfolders on Ubuntu 12.04 server. Is it possible to add different permissions on individual subfolders for two new individual users without changing the group ownership of the folders or interfering with apache permissions? If so, how? I would like to add two new users but restrict their write permissions to specific subfolders Each user would have access to different folders e.g. `user1` should be able to write to `public-html/folder1` and `user2` should be able to write to:               public_html/folder2 and      public_html/folder3      If this can be done in ftp permissions separately (proftpd) that would also be an option. ls -al in the home folder of the user which owns `public_html` gives me :               drwxrwxr-x 27 user1 user1 4096 Feb 12 16:54 public_html      all subfolders i'm interested in changing the permissions for have the permissions:               drwxrwsr-x  2 user1 user1  4096 Nov 22 12:52 views      usernames have been changed to protect the innocent. This server was not set up by myself and I have a feeling permissions are far too permissive.


title: Swap on video ram in a VM

text: I have a very small VM running in a cloud with only 512 MB ram. I read, it is possible to use the video card as swap as descriped here: > Graphics cards contain a lot of very fast RAM, typically between 64 and 512 > MB. With Linux, it's possible to use it as swap space, or even as RAM disk. Is it possible to use the virtual video card inside a VM also? So I could use more ram than I actually have to pay for? `lspci -v` output for the virtual video card:               00:0f.0 VGA compatible controller: VMware SVGA II Adapter (prog-if 00 [VGA controller])         Subsystem: VMware SVGA II Adapter         Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-         Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-         Latency: 64, Cache Line Size: 32 bytes         Interrupt: pin A routed to IRQ 16         Region 0: I/O ports at 1070 [size=16]         Region 1: Memory at ec000000 (32-bit, prefetchable) [size=64M]         Region 2: Memory at fe000000 (32-bit, non-prefetchable) [size=8M]         [virtual] Expansion ROM at 20000000 [disabled] [size=32K]         Capabilities: [40] Vendor Specific Information: Len=00 <?>         Kernel driver in use: vmwgfx


title: How can I add an external CD/DVD writer ?

text: I want to add an external CD/DVD writer to my Ubuntu 14.04 system (System 76 Ratel): the writers in my local electronics store have USB interfaces, and the drives are advertised as windows and mac compatible. So far I have not found a site listing ubuntu compatible external optical read-write drives, and I cannot return the drives after I open them and plug them in. Has anyone - used an external CD/DVD R/W usb drive with Ubuntu 14.04? Are there compatibility issues with this kind of hardware? What makes/models are known to be compatible?


title: Recover GUI window after minimizing in ratpoison

text: I'm running `ratpoison`. I was running `emacs` started through a keybinding (hence no xterm). Then I hit Ctrl-Z by mistake and emacs disappeared (emacs `iconify-or-deiconify-frame`). I know it is still there, as when I leave ratpoison and go to mwm emacs comes back to the foreground. However, starting an xterm and running `%emacs` bash tells me `bash: fg: %emacs: no such job`. How can I de-iconify emacs in ratpoison?   1. similar problem within Gnome   2. bugreport _(this post was heavily edited)_


title: Error installing protocol buffer on Solaris 8

text: Tried to run `make` for protobuf 2.5.0 on Solaris 8 which I download from this source. First, there were issues regarding a missing `stdint.h` which has been solved here. But it still fails to run the make with different error. So I did more googling which lead me to here. Where it shows that some files need to be change. After I follow the changes, I still got error complaining about atomic undeclared. The complete error can be seen here. I know this is not the right place to ask, but I have no access to post a new issue inside the google group protobuf. Just hoping if there is anyone that have experience installing protobuf on solaris 8, please share your workaround on how to solve the issues. This is the platform that I'm trying to install:               SunOS ms-sparc8 5.8 Generic_108528-13 sun4u sparc SUNW,Sun-Blade-100


title: Dell Laptop is overheating and shutting down

text: I recently updated from Linux Mint 16 to Linux Mint 17 on my Dell Inspiron 5420 with NVIDIA graphics card. After upgrading, the laptop is overheating seriously with temperature going above 90. Previously, I had bumblebee installed on Linux Mint 16 and the temperature was fine. I have installed Bumblebee but the problem is not solved. Here are the fixes I have tried and it hasn't helped me:               Installed Bumblee     Installed Thermald     Installed tlp      I have also installed i8kutils and checked the fans. Here's the output:               >> i8kctl fan     -1 2      It seems the left fan is not working. I tried to change the fan speed but it remains constant:               >> i8kctl fan 1 1     -1 2      Edit: I have found that my fan is not running. Can this be an issue with driver rather than the hardware?


title: Hardcoded /usr/bin/env in configure scripts

text: I'm building a Linux system that doesn't have a /usr directory. Getting the toolchain to work was surprisingly easy, but I'm hitting this irritation with a lot of auto* scripts: configure, etc. often seem to assume `env` is in `/usr/bin`. A workaround is to do `ln -sv .. /usr` during the build, but obviously that's aesthetically unappealing and runs the risk of a path with `/usr` in it leaking into the final system. (There will be a network mounted `/usr` in production, and I don't want the base system to even know it exists.) Did I install my autotools wrong, or is this just an irritating assumption configure often makes? Am I breaking FHS by not putting `env` in `/usr/bin`? (That's not a deal breaker for me; I'm already breaking it by having `/inc` and `/share`.)


title: Where are information stored information about hard/soft links

text: Where does the *nix system store information about number of hard links to a specific inode? I can't find any information about that. Everywhere what a hard link is but rarely a bit more advanced information that touches inodes related stuff. An inode stores information about number of links but where does it get it from? Can I locate all the links (both hard and soft) by knowing only the inode number?


title: Why does aptitude refrain from upgrading [UNAVAILABLE] packages?

text: Why does aptitude refrain from upgrading in the example below? Is it solely because existing package metadata is not in cache anymore? If package is marked as `[UNAVAILABLE]`, does it mean the only sensible action is to keep it?               system-config-printer-common will not be upgraded to version     1.4.2+20130920-0ubuntu1.2, to avoid breaking the following dependencies:            * system-config-printer-common replaces system-config-printer [UNAVAILABLE]       * system-config-printer-common replaces system-config-printer-gnome (<         1.3.11+20120807-0ubuntu7) [UNAVAILABLE]


title: How do I combine two logical volumes that reside on a single physical volume in LVM?

text: I have two logical volumes, one is mounted as /, the other is mounted as /home. I want to combine them, because the `/` volume is constantly running out of space. (Yes, I know what's using all that space; no, I can't remove it.) I'm willing to take the machine down for a day or two to do it. OS: `Linux xxxxx 2.6.32-279.22.1.el6.x86_64 #1 SMP Wed Feb 6 03:10:46 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux` (CentOS)


title: access a command line via a web browser

text: 2 questions: Question 1   My job blocks ssh which means that I cannot ssh to my home server. However, they do allow https out. Is there a package out there for ubuntu that will allow me to connect to the command line via https? I already have apache installed and can install additional software if needed. Question 2   We use Samba at home on our ubuntu server (same server as in question 1). How do I configure it so that a) password change on a regular interval and b) when its time to change the password, windows (7 in this case) will display a pop- up window asking the user to change the password. Note: to connect to the server, I created a batch file which uses "net use" commands.       thanks,   frank


title: How to place an application on the second monitor with awesome-wm?

text: I recently got a second monitor at work and want to configure all with my window-manager: awesome. I run into a problem to put some applications on a tag on a screen. For example I have a rule for urxvt, to put it into tag one on the first screen:                             { rule = { class = "URxvt" },                                          properties = { tag = tags[1][1] }                   }      That works fine, as long my mouse-cursor is on the first monitor. If I move my cursor on the second screen and start an instance of urxvt, it will be placed into the actual tag on the second monitor. Same, if I configure the app for an tag on the second screen, when it don't work if my mouse-cursor is on the first screen. How can I fix this?


title: Include colouring in GNU ls time-style

text: I know, I can specify custom time format for `ls` like this               ls -lAF --time-style="+ %Y-%b-%d  %H:%M:%S" --color=always      but I would like to "smuggle in" colors inside the time format. For example, I would like to have the year `2014` in red color. How would I do that? I have tried putting the color code `\033[0;31m` in front of the `%Y`, but the code does not get interpreted as color but as gibberish.


title: telnet implementation using C

text: The program in general is I want to implement telnet program. On the client side user send its logging name and password, and if it is correct he starts to send commands to the server On the Server side I am check on the user authentication on the system and if it is true I must run his default shell which is stored in the `passwd` file, to execute his commands. The problem that when I tried to run his shell using the `system` C function the shell is run and then closed, because the `system()` use `fork()` and `exec()`, and after it finished the opened shell for the user is closed. How can I run a new shell in my process and keep it running for the following command execution?


title: vsftpd full anonymous access

text: I'm runnning vsftpd on Raspberry Pi, Debian 7.0. I want to use it to do backups in my Home-LAN only, so security is not an issue (behind NAT/Firewall, only trusted users). I would like full access as anonymous user to a given path `/mnt/hd1` which has owner root and full rights 777. My conf is currently               # cat /etc/vsftpd.conf     listen=YES     anonymous_enable=YES     write_enable=YES     anon_upload_enable=YES     anon_mkdir_write_enable=YES     anon_root=/mnt/hd1      With this I get the client error               500 OOPS: vsftpd: refusing to run with writable root inside chroot()      I tried adding               allow_writeable_chroot=YES      but then my vsftps doesn't start anymore. How should I configure vsftpd to have full access to a given directory as an anonymous user?


title: Listing directories based on size from largest to smallest on single line

text: I can use the following command to get a list of directories and their sizes and sort them from largest to smallest (in the example I renamed the directories to numbers to make this easier to understand).               $: du -sk [a-z]* 2>/dev/null | sort -nr     413096  one     106572  two     97452   three     76428   four     55052   five     45068   six     33680   seven     23220   eight     17716   nine      I'm writing a program that requires input of these directories from largest to smallest, but for matters of convenience it needs them all on one line. Is there a command that will allow me to sort the directories from largest to smallest on one line without the size? I would like the output to be like this:               one two three four five six seven eight nine


title: Auto-switching PulseAudio profiles based on input(s) channel count

text: I'm running audio over HDMI to my receiver, which has a full 7.1 setup connected to it. However, most of the stuff that I listen to has far fewer channels—some is mono, most is stereo, a bit is 5.1. When the receiver is fed with the right number of channels, it has various DSP effects which work fairly well (e.g. in splitting out a center channel, in sending base to the subwoofer, auto-detecting Dolby matrix surround, etc.). This ceases working if you send it a full 7.1 signal with a bunch of silent channels. The number of output channels in PulseAudio is configured, per-card/sink, by the profile assigned to the card. You can change the assigned profile with `pacmd`, `pactl`, and various GUI programs. **How can I set it up to automatically change the profile based on the channel usage in the input stream(s)?** E.g., if the input streams are only using front-left and front-right, switch to the stereo profile. If they're using back-left and back-right as well, switch to quadrophonic, etc.


title: Why can't I enable Transmission on FreeNAS 9.2? I keep getting an error

text: I have installed the plugin correctly, but every time I try and start it either using service transmission start, or trying to flip the on switch from the plugins page, I get this error:             ![ss](http://i.stack.imgur.com/NRXuE.png) I also have tried creating a new standard jail and using portsnap to get transmission, but same error.


title: Networking with Linux and Windows 7 using Samba

text: I've installed Samba on my Arch Linux, and I wanted to share files with Windows 7 on other PC via local network. I want it to work both ways, i.e. Windows can read and write freely without any authentication into designated public share on Linux machine, and Linux can do the same thing with Windows machine. I have configured Samba and created appropriate share, but it's not working, i.e. neither PC can see the other. Windows is in MSHOME workgroup, and Linux is in LINUX workgroup. I made smb.conf from smb.conf.default, the only changes were setting computer name and workgroup, and adding the following at the end:               [publiczny]         path = /media/public         public = yes         read only = no      The only configuration I did on Windows was adding registry entries to HKLM/SYSTEM/CurrentControlSet/services/LanmanWorkstation/Parameters: DNSNameResolutionRequired set to 0 and DomainCompatibilityMode set to 1, as was said to do on Samba Wiki. What should I do to make things work?


title: What can I (not) shred from root while it is mounted?

text: I am performing a test migration from old server to new one. Part of the procedure involves cleaning up the old server of any traces of passwords, php scripts and custom configurations while remotely connected. While connected on ssh, I managed to rename `/etc`, `/var`, `/root` without the system making much of a complaint. Does it mean I am able to `shred` these directories without dismounting the `root` file system?


title: How to set Bluetooth transmit power?

text: I am trying to set the (inquiry) transmit power of Bluetooth dongles with both Broadcom and CSR chipsets using `hciconfig`, e.g.:               hciconfig hci0 inqtpl 3      But whatever valid parameter I pass, reading the value afterwards always yields 0, like so:               hci0:   Type: BR/EDR  Bus: USB             BD Address: 00:02:72:D6:6B:25  ACL MTU: 1021:8  SCO MTU: 64:1             Inquiry transmit power level: 0      When I pass invalid values, I get an error message:               Can't set inquiry transmit power level on hci0: Input/output error (5)      So obviously the parameter is checked for validity. I am pretty sure it's checked by the chipsets, as I get the same results when sending the appropriate HCI commands manually. Both chipsets also state they support this feature:               # hciconfig hci0 features     hci0:   Type: BR/EDR  Bus: USB             BD Address: 00:02:72:D6:6B:25  ACL MTU: 1021:8  SCO MTU: 64:1             Features page 0: 0xbf 0xfe 0xcf 0xfe 0xdb 0xff 0x7b 0x87                     [...]                     <err. data report> <non-flush flag> <LSTO> <inquiry TX power>                     [...]      Am I getting something wrong, or is it just by occasion that both chipsets I'm using do not support this feature?


title: Is there a way to put comments in an rsync --files-from file?

text: I have a file that rsync uses as --files-from:               dir1     dir2     dir3      I want to be able to put comments above each dir entry like that:               # my dir1 comment     dir1          #dir2 comment     dir2          #yet another comment     dir3      but rsync complains "No such file or directory" So far I have tried #,//,--,,SPACE Is there a way to comment out/disable entries?


title: How to cause kernel panic with a single command?

text: Is it possible to cause a kernel panic with a single command line? What would be the most straightforward such command for a sudoing user and what would it be for a regular user, if any? Scenarios that suggest downloading something as a part of the command do not count.


title: Definition of sane

text: Does `sane` have a technical definition in a unix / linux context? I mean in situations such as this:               checking whether build environment is sane... yes


title: I need to zip all the folders available in a path

text: I have a scenario where I need to zip all the folders. Please suggest me few. I tried using:               tar -zcv      and `gzip -r` folder name. But it did not work.


title: What are PCI devices?

text: In Linux, the `lspci` command lists all the devices in my laptop (including AGP, USB, SATA, SCSI, bridges, ethernet, etc.). The `man lspci` command gives me this information: > `lspci` \- list all PCI devices What are PCI devices? Does this relate to PCI bus (or PCI slot)?


title: What are the dangers with using "--assume-yes" with apt-get?

text: While making some improvements to my `.bashrc` file, I noticed a frequently used alias:               alias install='sudo apt-get -y install'      I wasn't familiar with the `-y` (aka `--assume-yes` or `--yes`) option with `apt-get`, which I learned automatically says "Yes" to any prompt that comes up with `apt-get`. This sounds handy. What's the catch?


title: wvdial connection always shows status disconnected

text: I use wvdial to connect my usb modem. However, the system always shows "disconnected" as the status. As a result, I cannot use applications which are connectivity-aware. How do I go about correcting this?


title: Fedora 18 Live CD is hanging on boot

text: When I boot up Fedora 18 (`Fedora-18-x86_64-Live-Desktop.iso`) in a Virtual Machine, I just get this screen: ![Fedora](http://i.imgur.com/QoW0lJJ.jpg) I've verified the SHA sum, and I've tried starting it up in "basic graphics mode", yet I still get the same problem. That's all I get, there is nothing else. What is wrong?


title: Meaning of root:wheel

text: What does root:wheel mean in the following? > chown root:wheel myfile


title: Why can't boot this process at launch?

text: I have two scripts `/etc/init.d/puma_a.sh` and `/etc/init.d/puma_b.sh` with identical configs. I try to set both boot like this, but one of them doesn't load on boot. If I manually launch it from console it works. Any idea?               root@site:~# update-rc.d puma_a.sh defaults 98      Adding system startup for /etc/init.d/puma_a.sh ...        /etc/rc0.d/K98puma_a.sh -> ../init.d/puma_a.sh        /etc/rc1.d/K98puma_a.sh -> ../init.d/puma_a.sh        /etc/rc6.d/K98puma_a.sh -> ../init.d/puma_a.sh        /etc/rc2.d/S98puma_a.sh -> ../init.d/puma_a.sh        /etc/rc3.d/S98puma_a.sh -> ../init.d/puma_a.sh        /etc/rc4.d/S98puma_a.sh -> ../init.d/puma_a.sh        /etc/rc5.d/S98puma_a.sh -> ../init.d/puma_a.sh         `/etc/init.d/puma_a.sh`:               #! /bin/sh               ### BEGIN INIT INFO     # Provides:   pumacontrol     # Required-Start: $remote_fs $syslog     # Required-Stop:  $remote_fs $syslog     # Default-Start:  2 3 4 5     # Default-Stop:   0 1 6     # Short-Description: Puma web server      ### END INIT INFO          # Simple move this file into /etc/init.d/pumacontrol.sh     # Also make sure you `chmod +x pumacontrol.sh`.          # If you need to start puma at boot time run this in debian/ubuntu: update-rc.d pumacontrol.sh defaults     # It will create some links to execute /etc/init.d/pumacontrol.sh start at the begining          # I use this in a system where the rails app is running by a normal user,  where puma is      # configured in PUMA_CONFIG_FILE. In PUMA_CONFIG_FILE is stated to create a pid file with the PID of      # puma in the PUMA_PID_FILE file. The socket where nginx is redirecting the web traffic and puma is      # listening is PUMA_SOCKET          # You need to specify a location for the PUMA_CONFIG_FILE               # /etc/init.d/puma_a.sh     PUMA_CONFIG_FILE=/var/www/site_a.com/current/config/puma.rb # WRITE HERE PUMA CONFIG FILE LOCATION     # strip out quotes, remove comments, initial spaces, and get only the filename     # if desired write here the path to the desired file for example:     # PUMA_PID_FILE=/path/foo.pid     PUMA_PID_FILE=/var/run/site_a.pid     PUMA_SOCKET=/var/run/site_a.sock     WORKING_DIR=/var/www/site_a.com/current     if [ $1 -a $2 ] ; then # If passed 2 params the second one should be the puma config file       PUMA_CONFIG_FILE=$2     fi     PUMA_CONFIGFILE_OWNER=`ls -l $PUMA_CONFIG_FILE |cut -d' ' -f3`          #------------------------ checkings -------------------------------------     if [ ! -r $PUMA_CONFIG_FILE ] ; then # if not readable       echo "File $PUMA_CONFIG_FILE not found or not readable"       echo "You should write in pumacontrol.sh the location of your config/puma.rb"       echo "or run this script like this 'pumacontrol.sh start /path/railsapp/config/puma.rb'"       exit 1     fi     if [ -z $PUMA_PID_FILE ] ; then # if empty string       echo "pidfile option in $PUMA_PID_FILE not found. You should write something like"       echo 'pidfile "/path/puma.pid"'       exit 1     fi     if [ -z $PUMA_SOCKET ] ; then # if empty string       echo "bind option in $PUMA_SOCKET not found. You should write something like"       echo 'bind "unix://path/railsAppName.sock"'       exit 1     fi     if [ -z $WORKING_DIR ] ; then # if empty string       echo "directory option in $WORKING_DIR not found. You should write something like"       echo "directory '/path/yourRailsAppRootDir/'"       exit 1     fi               #------------------------ functions -------------------------------------     # check if puma process is running     puma_is_running() {       if [ -S $PUMA_SOCKET ] ; then # if file exist and its a socket         if [ -r $PUMA_PID_FILE ] ; then # if file exist and readable           if cat $PUMA_PID_FILE | xargs pgrep -P > /dev/null ; then             return 0           else             echo "No puma process found"           fi         else           echo "No puma pid file found"         fi       else         echo "No puma socket found"       fi            return 1     }          #------------------------ script -------------------------------------     case "$1" in       start)         echo "Starting puma..."           if [ -e $PUMA_SOCKET  ] ; then # if socket exists             rm -f $PUMA_SOCKET             echo "removed $PUMA_SOCKET"           fi           # Exec puma as the owner, so we need to be either root or the real owner"*           if [ `whoami` = $PUMA_CONFIGFILE_OWNER ] # owner           then             /bin/bash --login -c "(cd $WORKING_DIR && bundle exec puma -C $PUMA_CONFIG_FILE)" 2>&1 >> /var/log/site_a.log           elif [ `whoami` = root ] # root           then             su -l $PUMA_CONFIGFILE_OWNER -c "(cd $WORKING_DIR && bundle exec puma -C $PUMA_CONFIG_FILE)"           else # error             echo "you should be root or the owner of the file to have the gemset ready to start the rails stack"           fi              echo "done"         ;;            stop)           if [ -e $PUMA_PID_FILE ] ; then # if pid file exists             echo "Stopping puma..."             /bin/bash --login -c " kill -s SIGTERM `cat $PUMA_PID_FILE` "             echo "Killed puma PID `cat $PUMA_PID_FILE`"             rm -f $PUMA_PID_FILE             echo "removed $PUMA_PID_FILE"           fi           if [ -e $PUMA_SOCKET ] ; then # if socket exists             rm -f $PUMA_SOCKET             echo "removed  $PUMA_SOCKET"           fi         echo "done"         ;;            restart)         if puma_is_running ; then           echo "Hot-restarting puma..."           if [ -e $PUMA_PID_FILE ] ; then             /bin/bash --login -c " kill -s SIGUSR2 `cat $PUMA_PID_FILE` "             echo "Killed puma PID `cat $PUMA_PID_FILE`"           fi           echo "Doublechecking the process restart..."           sleep 5           if puma_is_running ; then             echo "done"             exit 0           else             echo "Puma restart failed :/"             exit 1 # return error           fi         fi              echo "Trying cold reboot"         $0 start         ;;            status)         if puma_is_running ; then           echo "puma is running"           exit 0         else           echo "puma is not running"           exit 1 # return error         fi              ;;       *)         echo "Usage: script/puma.sh {start|stop|restart|status}" >&2         ;;     esac      and               ls -l /etc/init.d/puma     -rwxr-xr-x 1 root root  4995 Sep 19 20:26 puma_a.sh     -rwxr-xr-x 1 root root  4985 Sep 19 19:21 puma_b.sh      **Update:** By looking into the logs I can see puma is unable to launch. Its weird because when I do `/etc/init.d/puma_a.sh start` manually it works.               [1791] Puma starting in cluster mode...     [1791] * Version 2.5.1, codename: Astronaut Shoelaces     [1791] * Min threads: 8, max threads: 32     [1791] * Environment: production     [1791] * Process workers: 6     [1791] * Preloading application     [1791] ! Unable to load application      **Update 2** : Result of `diff puma_{a,b}.sh`               93c93     <         /bin/bash --login -c "(cd $WORKING_DIR && bundle exec puma -C $PUMA_CONFIG_FILE)" 2>&1 >> /var/log/site_a.log     ---     >         /bin/bash --login -c "(cd $WORKING_DIR && bundle exec puma -C $PUMA_CONFIG_FILE)" 2>&1 >> /var/log/site_b.log     96c96     <         su -l $PUMA_CONFIGFILE_OWNER -c "(cd $WORKING_DIR && bundle exec puma -C $PUMA_CONFIG_FILE)" 2>&1 >> /var/log/site_a.log     ---     >         su -l $PUMA_CONFIGFILE_OWNER -c "(cd $WORKING_DIR && bundle exec puma -C $PUMA_CONFIG_FILE)"


title: Rename files in the local folder adding a prefix or suffix

text: I have many files in a folder and I want to add either prefix or a suffix (not **both** ) to them. I checked here and found out I can use               for filename in *.jpg; do mv "$filename" "prefix_$filename"; done;      to add a prefix to all files ending in `.jpg` (and if I remove the `.jpg`, it will add the prefix to all the files in the current folder). However, I'd like to be able to   * Add a sufix (that is, rename `filename.ext` to `filename.whatever.ext`),   * Check if the prefix or suffix is already present and then skip,   * Create an alias that accepts arguments such as `addprefix whatever *.ext` or `addsufix whatever *.*`


title: FreeBSD telnet does not take root login

text: I have just installed FreeBSD 8.1 as a VMWare host and can establish ipv4 connectivity to the instance and `telnet` through the virtual console. I have also uncommented the `/etc/inetd.conf` lines               telnet  stream  tcp nowait  root    /usr/libexec/telnetd    telnetd     telnet  stream  tcp6    nowait  root    /usr/libexec/telnetd    telnetd      When I login without telnet via new virtual console terminals with `login: root` and `password` the default of empty, the login is accepted. However, when I login remotely via telnet, I am prompted exactly the same as before, except for an additional first line that reads `(freebsd.westell.com) (pts/0)`. I use the same login of `root` as before but get `login incorrect` message. What is missing here to successfully login to a telnet session? For example, `root` is the only user currently, am I missing `adduser`? * * * Alternatively, if someone can show how to configure SSH and login remotely on FreeBSD 8.1, in `<` 5 easy steps which spell out exactly which configuration files and lines need to be edited, I'll take that. I haven't found this in their documentation.


title: keeping keys on an auxiliary removable drive

text: It seems that servers are only as secure as the machine that holds the keys and that in turn means the desktop/screensaver password is the line of defence for not only the desktop itself but any remote servers normally accessed. Is there a way to run a normal disk-based system but always have `ssh`, `scp`, `secure vnc`, and `secure rsync` rely on keys from a removable drive system such as a USB flash drive? This way, even if the desktop security is broken (example: stolen desktop or laptop with no password) the servers are safe as long as the USB flash drive is not present.


title: Ubuntu 12.04 Gnome 3 "freezes" randomly - not a normal freeze though

text: Since upgrading to 12.04, I've randomly experienced this strange phenomenon where my mouse mostly doesn't work and keyboard mostly does. I have not been able to identify a cause for this. Sometimes it will happen minutes after I start-up, other times after the computer has been idle for a while, and other times in the middle of working on something. It lasts until I reboot the computer or restart Gnome. The mouse won't be able to interact with any open windows, but if I do ALT+Tab, I can't keyboard nav through those, I can only click to change windows that way. Same if I press the Windows key; the keyboard remains focused in whatever window was just active but I can click things with my mouse to open new programs. Anyone else experienced this? What might be causing it? Is there a fix?


title: mount.cifs not respecting file permissions in Ubuntu 12.04.2 LTS

text: I am attempting to mount a cifs drive in standard Ubuntu 12.04.2 LTS using the following line in /etc/fstab:               //server-name/share-name  /mnt/archive  cifs  uid=1002,file_mode=0440,credentials=/etc/.smbcredentials,iocharset=utf8,sec=ntlmi  0  0      This mount will be used to store backups, so I would like to mount it with permissions to create files, but not delete them. Everything seems to be working as it should, except I can go in and delete away with nothing but a warning.               myuser@localhost:/mnt/archive$ ls -l     -r--r----- 0 myuser root     51 Sep 19 17:56 deleteThis.txt     -r--r----- 0 myuser root     51 Sep 19 17:31 deleteThis.txt.bak          myuser@localhost:/mnt/archive$ rm deleteThis.txt.bak     rm: remove write-protected regular file `deleteThis.txt.bak'? y          myuser@localhost:/mnt/archive$ ls -l     -r--r----- 0 myuser root     51 Sep 19 17:56 deleteThis.txt      Why are my file privileges not being respected? Is this an Ubuntu thing? Is there a way to mount the network share through cifs without exposing the files to deletion?


title: Disk problems prevent me from booting, or set the disk to read-only. How do I fix the disk?

text: **Problem:** Since about one week ago, my Ubuntu system encounters various severe and strange problems. Sometimes the whole system suddenly freezes. I have to push the power button to shut down the machine by brute force. Sometimes, all files suddenly become read-only. I have to reboot the machine, and then it seems normal, but might have the above problems later. When I am trying to shut down Ubuntu, sometimes a black screen shows message about disk error. * * * **Attempts to Fix:** I think my WD 1T hard drive has some errors that needed to be fixed. So I run the following commands in Ubuntu installation disc or Ubuntu in another hard drive, after unload the hard drive in problem. However, I cannot fix the problem. In particular, when I try to run `sudo e2fsck -b 8193 /dev/sda1`, there is error message saying "invalid argument". The details are as follows, 1) first of all, `fdisk -l` shows the following message (copy only the part relevant to `/dev/sda1` I am trying to fix):               WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't support GPT. Use GNU Parted.          Disk /dev/sda: 1000.2 GB, 1000204886016 bytes     255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 4096 bytes     I/O size (minimum/optimal): 4096 bytes / 4096 bytes     Disk identifier: 0x00000000     Device Boot      Start         End      Blocks   Id  System     /dev/sda1              1    1953525167   976762583+  ee  GPT     Partition 1 does not start on physical sector boundary.      2) run `sudo fsck.ext4 -ck /dev/sda1`, trying to fix the hard drive               e2fsck 1.42.5 (29-Jul-2012)     ext2fs_open2: Bad magic number in super-block     fsck.ext4: Superblock invalid, trying backup blocks...     fsck.ext4: Bad magic number in super-block while trying to open /dev/sda1     The superblock could not be read or does not describe a correct ext2     filesystem.  If the device is valid and it really contains an ext2     filesystem (and not swap or ufs or something else), then the superblock     is corrupt, and you might try running e2fsck with an alternate superblock:     e2fsck -b 8193       3) `sudo e2fsck -b 8193 /dev/sda1`, trying to recover super block from block 8193               e2fsck 1.42.5 (29-Jul-2012) e2fsck: Invalid argument while trying to     open /dev/sda1          The superblock could not be read or does not describe a correct ext2     filesystem.  If the device is valid and it really contains an ext2     filesystem (and not swap or ufs or something else), then the     superblock is corrupt, and you might try running e2fsck with an     alternate superblock:         e2fsck -b 8193       4) `sudo mke2fs -n /dev/sda1`, to locate other backup blocks               mke2fs 1.42.5 (29-Jul-2012)     Filesystem label=     OS type: Linux     Block size=1024 (log=0)     Fragment size=1024 (log=0)     Stride=4 blocks, Stripe width=4 blocks     48768 inodes, 194560 blocks     9728 blocks (5.00%) reserved for the super user     First data block=1     Maximum filesystem blocks=67371008     24 block groups     8192 blocks per group, 8192 fragments per group     2032 inodes per group     Superblock backups stored on blocks:          8193, 24577, 40961, 57345, 73729      5) redo step 3 for all other superblock backups returned in 4. The same error is shown as step 3. PS: according to comments, I paste the output of `gdisk` and `parted` as follows:               sudo gdisk -l /dev/sda                    GPT fdisk (gdisk) version 0.8.5          Partition table scan:       MBR: protective       BSD: not present       APM: not present       GPT: present          Found valid GPT with protective MBR; using GPT.     Disk /dev/sda: 1953525168 sectors, 931.5 GiB     Logical sector size: 512 bytes     Disk identifier (GUID): 6166B96C-AD2A-4EF1-8967-1ACFA23FE2E4     Partition table holds up to 128 entries     First usable sector is 34, last usable sector is 1953525134     Partitions will be aligned on 2048-sector boundaries     Total free space is 3437 sectors (1.7 MiB)          Number  Start (sector)    End (sector)  Size       Code  Name        1            2048          391167   190.0 MiB   EF00          2          391168          890879   244.0 MiB   0700          3          890880      1953523711   931.1 GiB   8E00                      `sudo parted -l `                    Model: ATA WDC WD10EZEX-00R (scsi) (note: this is the disk in problem)     Disk /dev/sda: 1000GB     Sector size (logical/physical): 512B/4096B     Partition Table: gpt          Number  Start   End     Size    File system  Name  Flags      1      1049kB  200MB   199MB   fat32              boot      2      200MB   456MB   256MB   ext2      3      456MB   1000GB  1000GB                     lvm               Model: ATA SAMSUNG HD103SJ (scsi)  (note: this is another normal disk)     Disk /dev/sdb: 1000GB     Sector size (logical/physical): 512B/512B     Partition Table: msdos          Number  Start   End     Size    Type      File system     Flags      1      1049kB  30.0GB  30.0GB  primary   ext4      4      30.0GB  1000GB  970GB   extended                  lba      6      30.0GB  983GB   953GB   logical   ext4      5      983GB   1000GB  16.9GB  logical   linux-swap(v1)               Model: Linux device-mapper (linear) (dm)     Disk /dev/mapper/ubuntu-root: 983GB     Sector size (logical/physical): 512B/4096B     Partition Table: loop          Number  Start  End    Size   File system  Flags      1      0.00B  983GB  983GB  ext4               Model: Linux device-mapper (linear) (dm)     Disk /dev/mapper/ubuntu-swap_1: 16.9GB     Sector size (logical/physical): 512B/4096B     Partition Table: loop          Number  Start  End     Size    File system     Flags      1      0.00B  16.9GB  16.9GB  linux-swap(v1)


title: Neworking getting Disabled

text: I am using Fedora 13 and its working great. The only problem which I am facing is that the networking gets automatically disabled if I put my system on the "SUSPEND" mode for > 30mins. I am unable to enable it even after right clicking. Then I have to restart my system, to get the internet working. Can anyone show me how to rectify this!


title: How to Update Apache to allow Pseudostreaming on CENTOS 5.5 & WHM

text: I can't figure out how to get pseudostreaming on my Apache server (CENTOS 5.5 i686). I've read this article and these install instructions. I cannot install `httpd-devel` or `mod_ssl` via yum; I get the error "package not found". One person mentioned that they think WHM/CPanel breaks yum. I have found some RPM packages: > > rpm.pbone.net/index.php3/stat/4/idpl/13945478/dir/centos_5/com/mod_ssl-2.2.3-43.el5.centos.x86_64.rpm.html > > rpm.pbone.net/index.php3/stat/4/idpl/13944425/dir/centos_5/com/httpd- > devel-2.2.3-43.el5.centos.x86_64.rpm.html But as I am not a unix admin, I am unsure of where to go from here. Can someone point me in the right direction? (Please remember that I am very junior in linux administration.)


title: How to display size of each file next to it after executing the "locate" command?

text: Is there anyway to display the size of each file next to it after executing the "locate" command?


title: USB ports not working

text: Ok, got a Puppy Linux Wary 5.3. running on an old laptop with USB ports. Now, here's the strange part ... none of them work. When I stick in a USB- stick there's no reaction. Still, `lsusb` lists them:               # lsusb          Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub     Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.0 root hub     Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.0 root hub     Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.0 root hub      and even stranger ... when I plugin a PCMCIA Card Bus USB 2.0 adapter, those work: every one of the four adapter USB slots DO recognize the USB stick.               Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub     Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.0 root hub     Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.0 root hub     Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.0 root hub     Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.0 root hub     Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.0 root hub     Bus 007 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub      This was the case, too, when some strange operating system called win- something was installed on this laptop. Gee, I can't even remember, it wasn't Solaris. Any suggestions how to check if it's just a hardware problem? How to fix this? Further details: The laptop is an Acer Travelmate 2301LM. * * * **Update after Salton feedback** : "Onboard USB supports only USB 1.0" I ran `lspci -v` to verify the speed of the lsb ports ... Three controllers use `uhci_hcd` module indicating USB 1.x. One controller uses `ehci_hcd`, though, indicating USB 2.0. Mhmm, not sure how to interpret this info? There are only three USB ports on this laptop. None seem to use the USB 2.0 controller.               00:1d.0 USB Controller: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #1 (rev 03) (prog-if 00 [UHCI])         Subsystem: Acer Incorporated [ALI] Device 0064         Flags: bus master, medium devsel, latency 0, IRQ 6         I/O ports at 1820 [size=32]         Kernel driver in use: uhci_hcd          00:1d.1 USB Controller: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #2 (rev 03) (prog-if 00 [UHCI])         Subsystem: Acer Incorporated [ALI] Device 0064         Flags: bus master, medium devsel, latency 0, IRQ 6         I/O ports at 1840 [size=32]         Kernel driver in use: uhci_hcd          00:1d.2 USB Controller: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #3 (rev 03) (prog-if 00 [UHCI])         Subsystem: Acer Incorporated [ALI] Device 0064         Flags: bus master, medium devsel, latency 0, IRQ 6         I/O ports at 1860 [size=32]         Kernel driver in use: uhci_hcd          00:1d.7 USB Controller: Intel Corporation 82801DB/DBM (ICH4/ICH4-M) USB2 EHCI Controller (rev 03) (prog-if 20 [EHCI])         Subsystem: Acer Incorporated [ALI] Device 0064         Flags: bus master, medium devsel, latency 0, IRQ 10         Memory at e0100000 (32-bit, non-prefetchable) [size=1K]         Capabilities: [50] Power Management version 2         Capabilities: [58] Debug port: BAR=1 offset=0080         Kernel driver in use: ehci_hcd


title: How does coreutil's date manage to get such weird results?

text: I was playing around with `date` to try to convert expressions such as "2 hours" to a number of seconds like 7200. I thought I could perform this with invocations such as:               date -d "1970-01-01 00:00:00 + 2 hours" +"%s"      Yet, I noticed extremely strange results while so doing. (My `/etc/timezone` contains "Europe/Paris", hence the use of `TZ` to force UTC times.)               omega:~$ TZ=utc date -d "1970-01-01 00:00:00" +"%s"                  0     omega:~$ TZ=utc date -d "1970-01-01 00:00:00 + 0 minutes" +"%s"     60     omega:~$ TZ=utc date -d "1970-01-01 00:00:00 + -1 minutes" +"%s"      3660     omega:~$ TZ=utc date -d "1970-01-01 00:00:00 + 1 minutes" +"%s"      -3540      The first result is reasonable enough, but I'm really totally puzzled about how `date` might have come up with the three last results. Does anyone understand the logic between those results?


title: Waking an Ibook G4 (powerpc) running Debian Linux from suspend based on timer

text: I have recently received an Ibook G4 from a friend. I plan to use it as a server and have installed Debian Wheezy (7.0.0, release version) on it. However, I would like to suspend it at some points and wake it up - either after a specified time period or when the power cable is plugged in. As per the documentation for pbbuttonsd, which seems to be slightly more powerful and up to date than pmud, there is in fact an option in the Power Management Unit on these computers to wake up on the basis of a time period. However, the pbbuttonsd manpage simply says "Other wake up options [other than wake up on button press or lid open] are not foreseen by the kernel at this time." Since that documentation dates from 2007, I am hoping that this is no longer true. Trying out the standard `rtcwake` command gives me an error, saying there is no wakeup option in the /sys directory. Is there any way to wake up this computer on the basis of a timer / when it is plugged in? **NB** : I believe that Wheezy uses kernel version 3.2.0.


title: Expand subshell before executing it?

text: I often run commands using subshells, and sometimes would like to have the subshells expanded before I run something.. This way I could verify what I'm doing, and possibly edit what's about to happen as well. For example, how can I get the following command line to be expanded before I run it, so I can edit the results of the subshell? e.g.               $ find -name "test.txt"      /tmp/test.txt          $ mv $(!!) /tmp/new.txt      I'd like to see the subshell expanded _before_ I run the command, like so:               $ mv /tmp/test.txt /tmp/new.txt      Is there some way to do this?


title: Shell script execution

text: I have two shell script files with exactly the same permissions etc. I can run one of them by just giving its name in the command line but for the other one I should use sh or ./ to run it. What is the reason?


title: QEMU Direct Access to Video Card (or, QEMU Video Output without X11)

text: I have a system that boots up into Linux at power on and then needs to boot into Windows XP Embedded. After messing around with kexec and grub4dos, things aren't working out too well. One idea that has been brought up is running Windows XP Embedded inside of QEMU instead of live booting from Linux to Windows. The problem here is that the Linux OS is not running an X server and I would like to keep it that way. Is there a way to run QEMU with direct access to the video card so the virtualized OS (in my case Windows XP Embedded) can output directly to the monitor?


title: Does any OS support ZFS on MIPS?

text: Does there exist an operating system supporting ZFS under the MIPS architecture? If so, _which_ operating system(s)? I am especially interested in:   * Support for ZFS on Loongson.   * OSes free from binary blobs.


title: Sourcing nested sourced bash script multiple times causes an infinite loop

text: I have a cronjob that sources a configuration file, so as to put some variables in the environment, and then runs a script. This config script sources another more general config file that sources other settings, aka it's a nested source. All these config files essentially don't do anything else than `export SOMEVARIABLES`. Occasionally, I run this manually, and I've noticed that sourcing the same configuration file more than 5 times in a row results in bash going into an infinite loop. It will suddenly start printing the following forever:               -bash     -bash     -bash     -bash     -bash      -bash     -bash     -bash      ...      I have to `kill` the shell to get out of this, but this process will never end unless I manually kill it using `kill -9 <pid>`. In the meantime it will eat loads of CPU time. I know sourcing the same file multiple times is completely unnecessary (basically a result of me being lazy and just executing the same command), but AFAIK it only overwrites the same variables.   * If so, then why does error happen?   * And what does `-bash` even mean anyway? Using `ps auxww | grep <username>` will show me only something like:               <username>    7120 15.0  0.0  27116 15252 ?        R    Jul01 1959:27 -bash      Additionally, one of the scripts contains multiple lines of the same pattern like this:               export SOMEPATH=$SOMEPATH:/some/thi/ng:/some/thi/ng2:/some/more/


title: pcap and raw socket

text: I want to develop an application (module or user-level if possible) to create a raw socket in RHEL stealing all level-2 packets directly from kernel (without being routed or handled by other open sockets). I would like to feed packets to pcap to programatically handle some packet types. What would be the best of doing it? I have seen articles on zero copy networking, pcap, BPF but I guess they are all working with packet captures/copies?


title: How to limit network bandwidth?

text: Problem: We are hosting an application on remote server. We need to test it with a limited network bandwidth (for users with bad Internet access). Question: Can I limit my internet bandwidth (in Fedora 14)? For instance: 128 KB per second.


title: Is it possible to disconnect a GUI program launched within vifm from vifm?

text: One can launch GUI programs, for example, `gv` or `xpdf` from `vifm` in background in `vifm`'s command line:                :!gv %f &      However, if `gv` is launched by pressing `Enter` on a file like aPSfile.ps in `vifm`, it blocks the `vifm`. Is it possible to run it in the background as well when it is launched this way? The following setup in `vifmrc` does not work:               FILETYPE=PS=ps,eps,epsi=gv &      My current solution is to run `vifm` in GNU `screen`. `gv` launched by pressing `Enter` will run in a new screen instead of blocking `vifm`. However, I'd like to save that screen as well...


title: How can I install Ubuntu messaging menu on Mint?

text: One thing I like about Ubuntu is the messaging menu. Can I add the ubuntu messaging menu to Mint 12?


title: How can I get full Unicode font coverage for Gentoo Linux?

text: I've installed over 159 new fonts, all that were possible in Gentoo mirror. But even then, gnucharmap doesn't have:   * Arabic mathematical alphabet symbols 01ee00 1eebb      * Arabic Extended-A ࢠ ࣾ   * Chakma     * Meetei Mayek Extensions ꫠ ꫠ     * Miao      * Sharada      * Sundanese᮫ ᮭ ᮺ ᮿ (almost done)     * Sundanese Supplement ᳀     * Sora Compeng      * Supplementary Private Use Area-B      * Takri      * Supplementary Private Use Area-A (partially)     * Rumi Numeral Symbols (done)   * Aegean numbers U+10100 - 1013F (done , code2001 font)   * Avestan 10b00 010b3e (done)   * Bamum supplement 016800 (done)   * Brahmi 011000 01106f (done)   * cjk unified ideogram extension (done)   * cjk unified ideogram extension B (done) sunsim-extb.ttf font   * cjk unified ideogram extension C (done) babelstonehan.ttf universalia   * cjk unified ideogram extension D (done)   * Carian (done)   * Cuneiform (done)   * Cuneiform Numbers and Punctuation (done)      * Egyptian Hieroglyphs Enclosed (aegyptus , gardiner) -done     * Kana Supplement done     * Lycian - (done)      * Lydian Letter A - (done)     * Meroitic Cursive (done)      * Meroitic Hieroglyphs (done)     * Arabian (done)     * Old Turkic (done)     * Variation Selectors Supplement (done)


title: What's the problem with terminals vs colors?

text: I'm a long time linux/unix user, as almost anyone working with this kind of OSs I use the terminal or a terminal emulator a lot, but I never understood why it's so hard for any GNU/Linux distribution to offer a decent color palette inside a terminal or a terminal emulator ( even with properly installed drivers ) . For example under Ubuntu you GTK that "prettifies" everything, but even if you have a VGA capable of rendering a palette of million of colours you are still likely to be confined to a 8 or 256 color palette: Why ? What's the missing piece ? What is the reasoning adopted by who still writes terminal emulators ?


title: Why does my rsync not allow block-size>128K?

text: Running rsync with a large* `--block-size` like this:               rsync -avvz --rsh 'ssh -c arcfour' --block-size 1048576 --inplace --progress example.com:/big.file /big.file      I get the following error:               Invalid block length 1048576 [sender]      Both ends are running 64bit CentOS 6.4. From Googling I've seen `--block-size` used with much higher values, why is this not working for me? * _I'm using a large block size because I'm trying to work around a bug where rsync just spins CPU forever 44% into a 300GB file_


title: How do I install userscripts in Chrome on Linux?

text: Help! The only way that Chrome allows userscripts to be installed now is by downloading the file to my local system then dragging and dropping it into the extension manager interface. However when I try to drag it over, nothing happens! I've tried using the file managers in both Gnome and KDE environments, neither one works.


title: What are your best practices and future plans for deploying unixoid desktops?

text: I have been setting up Linux desktops for a non-profit radio observatory. For me, this was the first time I had to think about "deploying" several identical machines, centralizing login, home directories and so on. It quickly became clear to me that, perhaps contrary to intuition, the "everything is textual" philosophy does not necessarily make that an easy task, and I wondered what seasoned admins do about this. In my case, I was installing Ubuntu 10.04 LTS on each machine. After installation, I ran a custom script that alters config files, removes and installs software and copies some files, like background images or browser bookmarks, from the server. I think, however, that my questions are distro- independent. ## Problems I was mainly encountering two problems: Firstly, inconsistent tools and config files, both across distributions and across versions, and secondly some crucial software not exposing settings to config files in an easy and intuitive manner. Let me give two short examples for what I mean: The `ifconfig` tool is being replaced by `ip`. All scripts relying on the presence of the former will break if, for example, run on a current ArchLinux box. So, I would need to check which tools in which versions are present on a machine I run a script on... this somehow feels like reinventing autoconf on a small scale. For the second problem, consider that I wanted to give the desktops some sort of "common identity". In my post-install-config-script, I use the following lines to achieve this:               scp user@server:/export/admin/*.jpg /usr/share/backgrounds/     scp user@server:/export/admin/ubuntu-wallpapers.xml /usr/share/gnome-background-properties/     sed 's/warty-final-ubuntu\.png/MyBackground\.jpg/' -i /usr/share/gconf/defaults/10_libgnome2-common     sed 's/warty\-final\-ubuntu\.png/MyBackground\.jpg/' -i /usr/share/gconf/defaults/16_ubuntu-wallpapers     sed 's/ubuntu-mono-dark/ubuntu-mono-light/' -i /usr/share/gconf/defaults/16_ubuntu-artwork     sed 's/Ambiance/Clearlooks/' -i /usr/share/gconf/defaults/16_ubuntu-artwork      I suppose that creating a CI is a common task for organizational admins. So, how come there is no central config facility, perhaps even cross-desktop? Having to set two (identical!) undocumented values in two distinct config files strikes me as odd. ## Questions In an organizational environment, how do you handle central, unified configuration across multiple clients? Do systems like Debian's FAI offer significant advantages (aside from not having to change CDs) over my method of "install first, run script afterwards"? What are good practices for the transition between major versions of your distribution? And, apart from the technical stuff: Is there a desktop environment that promises long-term stability as far as the user experience is concerned? I don't think I can migrate my users to KDE 4 or GNOME 3, but XFCE still has some functional drawbacks... Is there a *nix system that adresses this type of configuration issues? For example, I'd assume there are systems that ask you for some imagery of your organization (logos, background images, colour and font sets etc) and apply them to the login manager, users' desktops, web apps (!) and so on. Note: In our case, I have to work with fat clients, so a purely thin-client solution won't help.


title: How to print several files at the same time using lpr?

text: I am trying to print a number of files from shell using lpr. I enter something like:               lpr -P PRINTERNAME ./*/dir/file.pdf      but I get "lpr: No file in print request.". When I use ls as               ls ./*/dir/file.pdf      it correctly lists the files I want to print. Can someone help me understand what is going on?


title: how to invoke fonts dir in ghostscript

text: I am trying to create a PDF out of a text file with Courier as font and trying to use gswin32c.exe on Windows, but unnable to pass parameters correctly, I think. The gswin32c.exe is the Windows exe of Ghostscript. Here is my command:               gswin32c.exe -dNOPAUSE -dBATCH -dSAFER -sDEVICE=pdfwrite -sFONTPATH="C:\Temp\Fonts2\" -sOUTPUTFILE="C:\Temp\Outputfile.pdf" A1401227.TXT      I don't get a output file, why? How can I trigger the Font, pass the fonts dir?


title: Why date +3 equals 3?

text: Yes, this is a minor issue, but I wonder why               date +3      outputs               3       Other options like:               date -3      raise an error.


title: Longest common substring using grep

text: I have a huge text file called dictionary.txt with entries like                   ABC_SEQ_NUM This represents....         ABC_RANK This represents....         ABC_BSC_ID This represents...         PQR_TA_DATE_AF This represents...         XYZ_C_ID This represents...      In another file, I have the source for a program that is using some of these abbreviations as part of its variable names. The variable names often use the above entries as follows                    Facilitator.TMP_ABC_SEQ_NUM       So I am not able to simply search for TMP_ABC_SEQ_NUM using grep, because it would return no match. However, the last part of the variable name ("ABC_SEQ_NUM") is actually present in the text file. So I would like to say something like                     grep (longest match for) TMP_ABC_SEQ_NUM in dictionary.txt      So that it would return the match for                     ABC_SEQ_NUM      How to write such a command?


title: xl2tpd redial doesn't work

text: `/etc/xl2tpd/xl2tpd.conf`:               redial = yes     redial timeout = 1     autodial = yes      Version of `xl2tpd` default, latest Ubuntu 14.04 ( Trusty ):               xl2tpd  1.3.6+dfsg-1 amd64  layer 2 tunneling protocol implementation      I'm always pinging some host like Google, default DNS - 8.8.8.8. From time to time I'm losing the connection, ping is silent and `xl2tpd` doesn't reconnect. Seems like `xl2tpd` doesn't know that the connection is broken. Is there any option to keep an internet connection alive, to keep `xl2tpd` redial automatically? Now, I use a raw and dirty bash script wrapper around ping and also `service xl2tpd restart` to redial `xl2tpd`. Is there a more program (`xl2tpd`) friendly way?


title: How to invoke root privileges from a password prompt of "Software Update" window?

text: When I try to install software updates using the "Software Update" GUI, I am asked for the root password. Although, I can 'su' in a terminal, the password is not recognized as correct in the GUI prompt. I believe this is due to the user account name being different from the root account name. How can I still use the GUI then?


title: Giving OVZ containers their own IP

text: Is it possible to give an OVZ container its own external IPv4 address? Say I hire a dedicated server and purchase extra IP addresses. Can I assign those extra IPs to the containers? If so how would I do this?


title: Combining multiple process substitution

text: Suppose you tried something like this:               $ paste ../data/file-{A,B,C}.dat      and realize that you want to sort each file (numerically, let's suppose) before pasting. Then, using process substitution, you need to write something like this:               $ paste <(sort -n ../data/file-A.dat) \             <(sort -n ../data/file-B.dat) \             <(sort -n ../data/file-C.dat)      Here you see a lot of duplication, which is not a good thing. Because each process substitution is isolated from one another, you cannot use any brace expansion or pathname expansion (wildcards) that spans multiple process substitution. Is there a tool that allows you to write this in a compact way (e.g. by giving `sort -n` and `../data/file-{A,B,C}.dat` separately) and composes the entire command line for you?


title: Is there a drawback when using a chroot in high performance computing?

text: My (small) company uses an out-of-date linux (centos) software stack to run a proprietary software on a small cluster. Understandingly, IT is reluctant to upgrade since everything works now. I'd like to do some performance tests on these machines and plan to install a lot of software that shouldn't interfere with the production root. It also includes compiling scientific packages and therefor I need up-to-date libraries. One possiblity is to install an entire up-to-date root in a different location and `chroot` into it. **My question is:** How will this impact the performance of the tools running inside the chroot? Are there any benchmark references available? Is this technique widespread/disadvantegous/dangerous? Other ideas? See also my related question.


The disk cache takes too much memory in my OpenVZ VPS. How can I disable or limit disk cache memory usage globally? I am using CentOS 6.4.


title: How to use ' in alias?

text: I have one-line that I want to call using alias. `while printf '%s ' "$(df -P / | awk 'NR==2 { print $(NF-1) }')"; do sleep 30; done` I tried to escape `'` like `\'` but it didn't work. What is the correct syntax to use above one-liner in alias?


title: Why there are only two user defined signals?

text: In the list of signals defined in a linux system, there are two signals stated as User Defined signals (`SIGUSR1` and `SIGUSR2`). Other signals will be raised or caught in specific situations, but SIGUSRs are left for user application's use. So why only two signals?


title: How to get a list of applications associated with a file using command line

text: File associations usually are made in the desktop environment, but how to get a list of applications associated with a file using command line? Something like:               $ getassoc foo.pdf <CR>     $ acroread, okular      Does not need to be a command, can a `cat` \+ `grep` on any Gnome file I'm using Gnome 2.28.2. A response with other environments would help but not solve.


title: Tab completion of "../" in zsh

text: One noob question from a new zsh user: In bash, I can use tab-completion to move one directory up and descend down again another path. For example, suppose I'm in `$HOME/folder1`, and I want to `cd` to `$HOME/folder2`. `$HOME` only has the two child directories `folder1` and `folder2`. In bash, I could just type               cd ..[TAB]f[TAB]2      and would end up in `$HOME/folder2`. In my fresh zsh installation, pressing `cd ..[TAB]` produces a list of those child directories of `$HOME/folder1` which have two `.` in their name. Is there a simple way to get the behaviour I'm used to? Or is there something even easier to achieve what I want in zsh?


title: Can't print to PDF using cups-pdf; used to work, now "failed to set file mode" printing as non-root

text: Here's something really odd: something that used to work fine in Debian, and then broke, even without a dist-upgrade. I used to be able to use the CUPS PDF virtual printer to print anything to a PDF file. Now, it doesn't work: nothing shows up in ~/PDF when I print as an ordinary user. If I log into the CUPS administration interface and use that to print a test page to the printer, though, it works; the PDF shows up nicely in ~root/PDF. **But I want to be able to print to PDF as a non-root user...** /var/log/cups/cups-pdf_log has this to say:               Fri Feb  7 18:31:57 2014  [STATUS] ***Experimental Option: DecodeHexStrings     Fri Feb  7 18:31:57 2014  [ERROR] failed to set file mode for PDF file (non fatal) (/michael/home/PDF/PDF_-_CUPS_1_5.pdf)     Fri Feb  7 18:31:57 2014  [STATUS] PDF creation successfully finished (michael)      OK, so there's `failed to set file mode for PDF file`. Googling for that, however, doesn't help much. I did find one web page that suggested changing the `Out` directory in /etc/cups/cups-pdf.conf, so I did (`Out /tmp/${USER}.cups-pdf`) and restarted CUPS, and when I try to print to PDF it picks up that change because it created such a directory, but then complained about the same error in the new location. Despite seemingly being at the latest version (CUPS 1.5.3-5+deb7u1, CUPS-PDF 2.6.1-6, Debian Wheezy), I decided to reinstall CUPS just in case it had broken somehow.               sudo apt-get --reinstall -u install cups cups-pdf cups-bsd cups-client cups-common cups-driver-gutenprint cups-filters cups-pk-helper cups-ppdc      However, I am still getting the same error. Setting `LogType 7` in /etc/cups/cups-pdf.conf produces this:               Fri Feb  7 19:01:29 2014  [DEBUG] switching to new gid (lpadmin)     Fri Feb  7 19:01:29 2014  [DEBUG] initialization finished (v2.6.1)     Fri Feb  7 19:01:29 2014  [DEBUG] user identified (michael)     Fri Feb  7 19:01:29 2014  [DEBUG] output directory name generated (/tmp/michael.cups-pdf)     Fri Feb  7 19:01:29 2014  [DEBUG] user information prepared     Fri Feb  7 19:01:29 2014  [DEBUG] spoolfile name created (/var/spool/cups-pdf/SPOOL/cups2pdf-18015)     Fri Feb  7 19:01:29 2014  [DEBUG] source stream ready     Fri Feb  7 19:01:29 2014  [DEBUG] destination stream ready (/var/spool/cups-pdf/SPOOL/cups2pdf-18015)     Fri Feb  7 19:01:29 2014  [DEBUG] owner set for spoolfile (/var/spool/cups-pdf/SPOOL/cups2pdf-18015)     Fri Feb  7 19:01:29 2014  [DEBUG] using traditional fgets     Fri Feb  7 19:01:30 2014  [DEBUG] found beginning of postscript code (%!PS-Adobe-3.0)     Fri Feb  7 19:01:30 2014  [DEBUG] now extracting postscript code     Fri Feb  7 19:01:30 2014  [DEBUG] found title in ps code ((What does the CUPS PDF printer need to be able to set file mode? - Unix & Linux Stack Exchange))     Fri Feb  7 19:01:30 2014  [DEBUG] found end of postscript code (%%EOF)     Fri Feb  7 19:01:30 2014  [DEBUG] all data written to spoolfile (/var/spool/cups-pdf/SPOOL/cups2pdf-18015)     Fri Feb  7 19:01:30 2014  [DEBUG] trying to use PS title ((What does the CUPS PDF printer need to be able to set file mode? - Unix & Linux Stack Exchange))     Fri Feb  7 19:01:30 2014  [DEBUG] removing trailing newlines from title ((What does the CUPS PDF printer need to be able to set file mode? - Unix & Linux Stack Exchange))     Fri Feb  7 19:01:30 2014  [STATUS] ***Experimental Option: DecodeHexStrings     Fri Feb  7 19:01:30 2014  [DEBUG] checking for hex strings ((What does the CUPS PDF printer need to be able to set file mode? - Unix & Linux Stack Exchange))     Fri Feb  7 19:01:30 2014  [DEBUG] not a hex string, has no start marker ((What does the CUPS PDF printer need to be able to set file mode? - Unix & Linux Stack Exchange))     Fri Feb  7 19:01:30 2014  [DEBUG] removing enclosing parentheses () from full title ((What does the CUPS PDF printer need to be able to set file mode? - Unix & Linux Stack Exchange))     Fri Feb  7 19:01:30 2014  [DEBUG] calling alternate_replace_string     Fri Feb  7 19:01:30 2014  [DEBUG] removing alternate special characters from title (What does the CUPS PDF printer need to be able to set file mode? - Unix & Linux Stack Exchange)     Fri Feb  7 19:01:30 2014  [DEBUG] truncating title (What_does_the_CUPS_PDF_printer_need_to_be_able_to_set_file_mode_)     Fri Feb  7 19:01:30 2014  [DEBUG] title successfully retrieved (What_does_the_CUPS_PDF_printer_need_to_be_able_to_set_file_mode_)     Fri Feb  7 19:01:30 2014  [DEBUG] input data read from stdin     Fri Feb  7 19:01:30 2014  [DEBUG] output filename created (/tmp/michael.cups-pdf/What_does_the_CUPS_PDF_printer_need_to_be_able_to_set_file_mode_.pdf)     Fri Feb  7 19:01:30 2014  [DEBUG] ghostscript commandline built (/usr/bin/gs -q -dCompatibilityLevel=1.4 -dNOPAUSE -dBATCH -dSAFER -sDEVICE=pdfwrite -sOutputFile="/tmp/michael.cups-pdf/What_does_the_CUPS_PDF_printer_need_to_be_able_to_set_file_mode_.pdf" -dAutoRotatePages=/PageByPage -dAutoFilterColorImages=false -dColorImageFilter=/FlateEncode -dPDFSETTINGS=/prepress -c .setpdfwrite -f /var/spool/cups-pdf/SPOOL/cups2pdf-18015)     Fri Feb  7 19:01:30 2014  [DEBUG] output file unlinked (/tmp/michael.cups-pdf/What_does_the_CUPS_PDF_printer_need_to_be_able_to_set_file_mode_.pdf)     Fri Feb  7 19:01:30 2014  [DEBUG] TMPDIR set for GhostScript (/var/tmp)     Fri Feb  7 19:01:30 2014  [DEBUG] waiting for child to exit     Fri Feb  7 19:01:30 2014  [DEBUG] entering child process     Fri Feb  7 19:01:30 2014  [DEBUG] GID set for current user     Fri Feb  7 19:01:30 2014  [DEBUG] supplementary groups set for current user     Fri Feb  7 19:01:30 2014  [DEBUG] UID set for current user (michael)     Fri Feb  7 19:01:30 2014  [DEBUG] ghostscript has finished (256)     Fri Feb  7 19:01:30 2014  [ERROR] failed to set file mode for PDF file (non fatal) (/tmp/michael.cups-pdf/What_does_the_CUPS_PDF_printer_need_to_be_able_to_set_file_mode_.pdf)     Fri Feb  7 19:01:30 2014  [DEBUG] ERRNO: 2     Fri Feb  7 19:01:30 2014  [DEBUG] no postprocessing     Fri Feb  7 19:01:30 2014  [DEBUG] spoolfile unlinked (/var/spool/cups-pdf/SPOOL/cups2pdf-18015)     Fri Feb  7 19:01:30 2014  [DEBUG] all memory has been freed     Fri Feb  7 19:01:30 2014  [STATUS] PDF creation successfully finished (michael)      I do notice that it looks like Ghostscript is exiting with status 256 (`[DEBUG] ghostscript has finished (256)`), but I can't find anything that tells me why exactly it would exit with that error code. My user account is not a member of the `lp` or `lpadmin` groups, but that hasn't changed. Printing to the physical printer on my desk works fine; I did that just recently, long after printing to PDF started acting up like this. What might be my problem?


title: Debian Squeeze not detecting any hardware after Gnome 3.8 upgrade

text: So, somehow I accidentally upgraded to Gnome 3.8 (Don't ask me how, I have no idea). And after a reboot, none of my peripheral devices or interfaces are working. The built in mouse and keyboard do not respond and I have to unplug and replug them before I get any response. Additionally, my realtek ethernet controller is not visible in the network settings window, even though it is listed in /etc/network/interfaces. Also, when using the debian install disk for recovery, all hardware is detected without a problem. I've searched for an answer for days but I've come up short, and I unfortunately don't know enough about Linux to do much more than examine things. Any help you could provide with be extremely appreciated.


title: How can I create a clean shell environment for temporary use?

text: I am a frequent answerer on a Unix-focused popular Q&A site, and in many of my answers I provide examples using the `bash` shell. However, each time I do this I have to manually go through the process of creating a clean environment to make sure that every step is accounted for and documented. How can I make this process more straightforward? I am ideally looking to type a single command and get a clean environment, and have all traces of that temporary environment removed after I am done.


title: Who can use cron? I can't help myself. Who is using cron?

text: I want to run cron every minute OR hour xclock. It's not that simple as I guessed:( I'll wait for your answer, sir. Maybe It'll be too late, before the right answer as 1 2 3...


title: Extract binaries from pcap using command line (script)

text: As the title says, I'm looking for a way to extract binaries from PCAP's using the command line. I realize it is possible using Wireshark -> File -> Export -> http objects etc. But `tshark` doesn't seem to support this. Is there a way to do this or code around this, preferably using `python` or `bash`. Or does anyone know of tools that can do this that I am not aware of. I'd prefer if the method is automatable / scriptable.


title: Output multiple files from a single grep?

text: I'm not very experienced in shell scripting, but I'm trying to understand how to grep for a pattern and for each file where there is a match write a file to disk that contains the matched line from grep. For example:               $ grep -E "MY PATTERN" myfile{1,3}      Then write out new files that contain the matching lines:               matches-myfile1     matches-myfile2     matches-myfile3      Is this possible? How can I do this? I'm looking for an answer is bash or zsh.


title: Fedora19 -- Mouse pointer suddenly disappears

text: I'm running a desktop machine with Fedora19, Gnome3, dual monitors (30" left, 27" right). Once in a while my mouse pointer disappears from the primary screen. If I move the mouse to the secondary screen, it appears and moves normally but as a garbled icon that looks like this: ![garbled mouse pointer](http://i.stack.imgur.com/mHNf7.png) This happens at random times right in the middle of me working. Although it seems to happen usually when I move the mouse around (e.g. to change focus to another window) rather than when I'm typing on the keyboard. In any case, it isn't due to the system going on suspend or hibernate like in other similar questions. When that happens, so far I haven't found any way to restore the mouse pointer. I found in this answer an idea on how to set the pointer to some other icon and I'll be sure to try that next time it happens. But up until now, even switching user, or logging out and re-logging in doesn't change the situation: invisible mouse on the 30" screen and garbled one on the 27". Not knowing any better solution, I have to reboot. Any ideas? Links:   * output of lsmod   * excerpt of /var/log/messages around the time the pointer gets nuked and up to reboot   * /var/log/Xorg.0.log   * output of dmesg after reboot Other info:               # uname -a     Linux evian 3.14.7-100.fc19.x86_64 #1 SMP Wed Jun 11 22:34:02 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux     # lspci     00:00.0 Host bridge: Intel Corporation 2nd Generation Core Processor Family DRAM Controller (rev 09)     00:01.0 PCI bridge: Intel Corporation Xeon E3-1200/2nd Generation Core Processor Family PCI Express Root Port (rev 09)     00:16.0 Communication controller: Intel Corporation 6 Series/C200 Series Chipset Family MEI Controller #1 (rev 04)     00:1a.0 USB controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #2 (rev 05)     00:1b.0 Audio device: Intel Corporation 6 Series/C200 Series Chipset Family High Definition Audio Controller (rev 05)     00:1c.0 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 1 (rev b5)     00:1c.2 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 3 (rev b5)     00:1c.3 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 4 (rev b5)     00:1c.4 PCI bridge: Intel Corporation 82801 PCI Bridge (rev b5)     00:1c.5 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 6 (rev b5)     00:1c.6 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 7 (rev b5)     00:1c.7 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 8 (rev b5)     00:1d.0 USB controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #1 (rev 05)     00:1f.0 ISA bridge: Intel Corporation P67 Express Chipset Family LPC Controller (rev 05)     00:1f.2 RAID bus controller: Intel Corporation 82801 SATA Controller [RAID mode] (rev 05)     00:1f.3 SMBus: Intel Corporation 6 Series/C200 Series Chipset Family SMBus Controller (rev 05)     01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] RV730 GL [FirePro V3750]     01:00.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] RV710/730 HDMI Audio [Radeon HD 4000 series]     03:00.0 SATA controller: Marvell Technology Group Ltd. 88SE9123 PCIe SATA 6.0 Gb/s controller (rev 11)     04:00.0 USB controller: NEC Corporation uPD720200 USB 3.0 Host Controller (rev 04)     05:00.0 PCI bridge: ASMedia Technology Inc. ASM1083/1085 PCIe to PCI Bridge (rev 01)     06:02.0 FireWire (IEEE 1394): VIA Technologies, Inc. VT6306/7/8 [Fire II(M)] IEEE 1394 OHCI Controller (rev c0)     07:00.0 USB controller: NEC Corporation uPD720200 USB 3.0 Host Controller (rev 04)     08:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 06)     09:00.0 SATA controller: JMicron Technology Corp. JMB362 SATA Controller (rev 10)


title: How to set the default gcc version for only one user

text: I share a server (Ubuntu 11.04) with other people and I am the only one who has to use gcc 4-4 for my code, the rest is using 4.5. I already installed gcc 4.4 but how do I make it the default for me, without disturbing the others? **Clarification** The solution needs to work for Makefiles and such. **Update** I tried jw013 idea, but I think I screwed up. I created the symlink with `ln -s /usr/bin/gcc-4.4 ~/bin/gcc` and now my `.bashrc` wont load again. Here are the error messages:               Command 'lesspipe' is available in the following places      * /bin/lesspipe     * /usr/bin/lesspipe     The command could not be located because '/usr/bin:/bin' is not included in the PATH environment variable.     lesspipe: command not found     Command 'dircolors' is available in '/usr/bin/dircolors'     The command could not be located because '/usr/bin' is not included in the PATH environment variable.     dircolors: command not found     Command 'uname' is available in '/bin/uname'     The command could not be located because '/bin' is not included in the PATH environment variable.     uname: command not found     -bash: [: =: unary operator expected     Command 'sed' is available in '/bin/sed'     The command could not be located because '/bin' is not included in the PATH environment variable.     sed: command not found     Command 'ls' is available in '/bin/ls'     The command could not be located because '/bin' is not included in the PATH environment variable.     ls: command not found


title: How to configure permissions to allow gedit, apache, and an IDE play together?

text: I'm using plain Ubuntu Desktop 11.04 and installed my lamp stack using lamp- server. I am trying to use Netbeans as my IDE. Currently, all virtual hosts are being run from `/var/www/vhostname` \-- but as I have not configured any groups or permissions, if I try to open any of the files through Netbeans it does not have write permission. How can I properly set up permissions (or configure Apache or Netbeans) so that:   * Files created by a php script can be `rw` by Netbeans   * Files created by Netbeans can be `rw` by Apache I attempted to `chown` everything to my user/group which gave Netbeans write permission, but then Apache did not have write permission. _Note: This is purely for a development machine -- not used in production, and I am the only user on this box._


title: The reverse of `tree` - reconstruct file and directory structure from text file contents?

text: We all know we can use `tree` to get a nicely formatted text "visualization" of the structure of a directory; say:               $ tree -spugD /usr/include/boost/accumulators/numeric/     /usr/include/boost/accumulators/numeric/     ├── [drwxr-xr-x root     root            4096 Dec 19  2011]  detail     │   ├── [-rw-r--r-- root     root            2681 Oct 21  2010]  function1.hpp     │   ├── [-rw-r--r-- root     root             406 Oct 21  2010]  function2.hpp     │   ├── [-rw-r--r-- root     root             409 Oct 21  2010]  function3.hpp     │   ├── [-rw-r--r-- root     root             409 Oct 21  2010]  function4.hpp     │   ├── [-rw-r--r-- root     root            6725 Oct 21  2010]  function_n.hpp     │   └── [-rw-r--r-- root     root             530 Oct 21  2010]  pod_singleton.hpp     ├── [drwxr-xr-x root     root            4096 Dec 19  2011]  functional     │   ├── [-rw-r--r-- root     root            2316 Oct 21  2010]  complex.hpp     │   ├── [-rw-r--r-- root     root           16627 Oct 21  2010]  valarray.hpp     │   └── [-rw-r--r-- root     root           12219 Oct 21  2010]  vector.hpp     ├── [-rw-r--r-- root     root            9473 Oct 21  2010]  functional_fwd.hpp     └── [-rw-r--r-- root     root           21312 Oct 21  2010]  functional.hpp          2 directories, 11 files      What I would want, is the reverse of this - given a text file with the contents as above save in `dirstruct.txt`, I could write something like this (pseudo):               $ reverse-tree dirstruct.txt -o /media/destpath      ... and so, `/media/destpath` directory would be created if it doesn't exist, and inside I would get `detail` subfolder with files `function1.hpp`, etc; as per the tree above. Of course, I can always do a copy `cp -a` and get the same; the idea here would be, that I could change filenames, directory names, sizes, permissions and timestamps in the textfile - and have _that_ reconstructed in the output structure. For files, I first thought I'd be happy with them just being `touch`ed (that is, 0 bytes in size) - but it's probably better that the size is reconstructed too - by filling either 0x00 or random bytes, up to the requested size. Primary use of this would be actually to post questions `:)` \- some of those rely on a directory structure, say from a program I have installed; but the program in itself is irrelevant to the question; then instead of targetting answerers that may happen to have the program installed, I could simply ask a question in respect to an "anonymized" directory tree, which they themselves could quickly reconstruct on their machines, simply by pasting the tree text description in the post. So - is there a straightforward way to achieve this?


I'm looking to experiment with Jython and the default Jython shell leaves a lot to be desired. Is there a way to run Jython in IPython?