title: Trouble setting up wireless fedora 17

text: My distro is fedora 17 Gnome -64, and the wireless adapter is Edimax EW-7612UAn V2. I never used wireless on this computer and it is not so long ago I installed this op system. I installed wireless on another computer with fedora 17 few years ago, but I don't remember how to set it up. There is no wireless showing up anywhere, and I couldn't set it up with network connection because it didn't see the adapter, I think. This is what I've done: I've built the wpa_supplicant, had one error, but fixed it. The driver won't build I think, the only directions where to build and make wpa_supplicant, but now I found that there is a driver folder to with a makefile, can't build that one, says that a folder is missing. This is from the file on their website to build. But there is no wireless. I've done everything in the readme file from the vendor. But no wireless showing up?               sudo lshw -c network -sanitize     *-network                       description: Ethernet interface        product: 82573E Gigabit Ethernet Controller (Copper)        vendor: Intel Corporation        physical id: 0        bus info: pci@0000:02:00.0        logical name: p1p1        version: 03        serial: [REMOVED]        size: 100Mbit/s        capacity: 1Gbit/s        width: 32 bits        clock: 33MHz        capabilities: pm msi pciexpress bus_master cap_list ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation        configuration: autonegotiation=on broadcast=yes driver=e1000e driverversion=2.2.14-k duplex=full firmware=1.0-7 ip=[REMOVED] latency=0 link=yes multicast=yes port=twisted pair speed=100Mbit/s        resources: irq:42 memory:d0080000-d009ffff memory:d0000000-d007ffff ioport:4000(size=32)      After I took the extension cord "off" the adapter, the system could see it:                  description: Wireless interface        physical id: 1        bus info: usb@3:1        logical name: wlan0        serial: [REMOVED]        capabilities: ethernet physical wireless        configuration: broadcast=yes driver=rtl8192cu driverversion=3.9.10-100.fc17.x86_64 firmware=N/A link=no multicast=yes wireless=IEEE 802.11bgn      But it says that the hardware is disabled? In the network manager


title: Passing in parameters to Upstart

text: I can do               mongod -f /etc/mongodb.conf       How do I achieve the same effect when starting mongodb as a service? ie               sudo service start mongodb      By default this does not read from the config file. I am on Ubuntu.


title: Cursor movement related tput commands under zsh: can the 'clear' behavior be configured?

text: Using the `zsh` shell, I've noticed a difference in the behavior of the `tput` command compared to `bash`. For instance With `zsh`, if you have many things output to a terminal emulator window and you're at the "bottom", if you do `tput cup 1`, you go back up and everything below is cleared. With `bash` the output remains and is not cleared (on my setup). This comparison is valid for every terminal capability that moves the cursor around (cuu, cud, sc & rc, home, etc.). Do you have any control over that behavior in `zsh` i.e. not clearing? I'm looking at the possible options, but there's lots of things... If you cannot alter the behavior, can you use some other command which doesn't behave like such?


title: Firefox in Linux doesn't interpret 12px Arial correctly, but 1em or 0.9 does

text: The problem is only with 12px and smaller. Other sizes seems to be OK. Why is that? If I use `height: 12px;` and the font family is `arial`, it is stretched and not the same height as in Windows. If I use `0.9em` or `1em` it shows OK. Why is that? How can I set Ubuntu to show `12px` as `12px`? I have installed `ms-fonts` including Arial so there is no problem. I have already set aliasing to RGBS and hinting is set to `slight`. **EDIT:** E.g. here: ![enter image description here](http://i.stack.imgur.com/5npbq.jpg)


title: Host process for multiple processes?

text: I am maintaining an application that currently consists of 4 processes that are dependant on each other in various ways. At the moment these processes are started, stopped and monitored via a rather "grown" bash script, which contains pearls like these:               # And another rather dirty way to identify the node Api     # process by knowing the filename that is given to node.js.     # Keep in mind not to kill the retrieved process directly, but     # check the running user and the used port to make sure you     # actually got the correct process.     findApiProcessId() {         local pid=`ps ax | grep node | grep api/server\.js | cut -c -5`              if [ $pid ]         then             echo $pid          else             echo -1         fi     }      The other processes are checked using similar means. I am now allowed to completely rework this process management, but to be honest I have no real idea where to start. The processes I need to monitor are   * lighttpd which manages a "stable" pid file   * mongod which manages a pid file that doesn't seem to be quite reliable. Sometimes it points to a pid that belongs to an entirely different process.   * At least two node.js instances (running with nohup), which try to do maintain some pid file but fail quite miserably. I need to be able to start and stop single processes and to query their status, all from the command line. And I need to be able to start that program multiple times in different directories for different "groups" of our application. The child processes currently check the current working directory for configuration files and are able to "choose" their ports without blocking other running instances. My first thought was to write up a simple process host using Python or C, but I guess that's kind of overkill. So I was looking for an existing tool but searches for "linux process host tool" don't reveal anything useful. So are there any "standard" process host tools that are able to watch over multiple child processes?


title: Access Remote files through http path

text: I am using lamp on CentOS 6. Application code is written in CakePHP. Application files path is " **/var/www/html/my_app** ". Another file server is mounted with an Application Server. Mounted path on Application Server is " **/home/new1/fs_path/scanned/** " which contain some folders like "ajain". I am uploading the files on File Server through SSH. However, I am not able to show the documents because I am not saving the files on application server. If the file would be on local application server, I will be able to access it through "http:// localhost/my_app/app/webroot/scanned/ajain/abc.jpg". But instead of it, if the file exists on file server. How do I access it through http path. Possible solution I tried is to change the document root path from " **/var/www/html** " to " **/home/new1/fs_path/scanned/** ". But this forced me to put my application code on the later path (on file server). Which is not making sense for me. I also tried to use JkMount command in httpd.conf file using jkmod module, but didn't get any success. Please suggest the solution. Any help would be appreciated.


title: How to replace a char at the cursor in emacs lisp

text: I want to create a minor mode that helps to input thai tone character. This is what I wrote:               (defvar thai-input-mode-map       (let ((map (make-sparse-keymap)))         (define-key map "2" (lambda () (interactive)                   (replace-string "o" "ô")                   ))         map)       "Keymap used by `thai-input-mode'.")     (easy-mmode-define-minor-mode thai-input-mode                                   "Input mode for Thai"                                   nil  " TH" thai-input-mode-map)     (global-set-key "\C-x\C-t" 'thai-input-mode)      Of course I must implement more details, but I'm already have problems. First of all the `replace-string` function doesn't work even if there is `o` in a buffer. Secondly I couldn't figure out how to replace only a character that is at the cursor. How can I write to implement that kind of function? ## Edit By following Gilles's advice I wrote like this:               (defvar thai-tone-conversion-list         '(("o" . "ô") ("u" . "û")))     (defun thai-add-tone ()       (interactive "*")       (when (let ((case-fold-search t))               (looking-back "[ou]"))         (replace-match (assoc (match-string 0) (thai-tone-conversion-list)))))     (defvar thai-input-mode-map       (let ((map (make-sparse-keymap)))         (define-key map "2" 'thai-add-tone)         map)       "Keymap used by `thai-input-mode'.")     (easy-mmode-define-minor-mode thai-input-mode                                   "Input mode for Thai"                                   nil  " TH" thai-input-mode-map)     (global-set-key "\C-x\C-t" 'thai-input-mode)      But I get `assoc: Symbol's function definition is void: thai-tone-conversion- list` error, when I put `2` in `thai-input-mode`.


title: Running the wizard again after a new system installation

text: I'm interested in installing Linux Mint on old laptops and giving them away. During initial installation, I'm going to add VNC (or other tools to allow remote support), but interested in leaving the installation similar to that when you receive a new computer from a major vendor. Example, if you buy a Dell machine and power it own, it asks you basic questions, Full Name, username, password, timezone, etc. Is there a way I can setup Ubuntu (or Linux Mint preferred) to allow run a similar wizard on next reboot? See this as essential, since I'm not likely to ever meet the person that receives the machine I've just built. Figured it would be good to have that 'initial setup' wizard to make the person feel as if they are making the machine their own/custom.


title: How can I set up Cygwin to automatically update and download without the GUI?

text: How can I set up Cygwin to automatically update itself? How can I get Cygwin to download a package without having to go via the GUI thing?


title: Bootstrapping a DSL installation onto a machine with no BIOS boot support

text: I have a vintage 2001 laptop (Vaio R505) which is very hardware limited. Fortunately there is much that works, but I can't figure how to make it work better. The two biggest constraints are 256MB RAM and no floppy or CD and it cannot boot from a USB drive because the BIOS is ancient. It does have enough disk for a shrunken WinXP partition, an Ubuntu Lucid partition, swap, and 60MB unallocated. Even stripped down Xubuntu installation with a custom built minimal kernel is a little too heavyweight for the small core and ultra-slow swap. I'd like to install Damn Small Linux because it is designed for machines of this vintage and specs but I can't figure out how to get it loaded. To get Xubuntu on, I started WUBI in windows which is designed to then install Unbuntu. My bootloader is now GRUB2 and happily boots Linux or XP (which I keep around for no good reason). I'm almost certain that putting the right materials on my free partition and telling GRUB about the DSL installation is possible, I just don't know what the right materials are. As this is a pretty odd circumstance and I am capable of rolling a custom kernel, I'm mostly looking for pointers to information to demystify the boot process and what update-grub needs to see to add DSL to the boot-list.


title: As we call `#!/bin/perl` 'shebang', what we call `-*- perl -*-`?

text: The first line of a script may be in format of `#! interpreter`, so the shell will execute the script using the specific _interpreter_. This is so called `shebang` or `shbang`. Similarly, there can be some special comment like               # -*- language -*-      or               # vim: tabstop=4 :      etc. Just like `shbang` is used to denote which interpreter to use, these comments are used to adjust the editor's behavior. How to call these special comments? Maybe `shdash` or `shvim`? Are there some already defined slangs for these? And is there wiki pages to show the list of `shxxx`, and those softwares follow such conventions?


title: Is it possible to control which monitor is considered the primary monitor?

text: I just added a 2nd monitor and I ran into that oh so typical issue where the monitors are swapped. Apparently, the 2nd monitor has been identified as "monitor 0" by X.org, but it's # 2 according to the ATI configuration applet. (The applet numbers the monitors starting with 1, not 0.) That said, this 2nd monitor is the first one listed by the applet. This concerns me, as I have run into issues on Windows with dual-monitors swapping randomly after reboots. Moving the Gnome panels over was easy enough, if not exactly obvious. However, I wonder about the possibility of other things using "monitor 0" when, in this case, I would expect them on "monitor 1." So, can I control which monitor is considered primary?


title: Dot Matrix printer setup in Debian

text: I am using Debian which is similar to Ubuntu. They have 7 dot matrix printers, some of which are very old (example), which have worked since 1979 and are faster than many inkjets at printing text. I believe that it has his own language, since sending text to serial port (port server) prints garbage. However I think is prints only capital English up to 95 ASCII and Greek and the rest up to 127 I think Greek capital. (special chip) I think that sending English capital letters prints garbage, but I am not sure and will try again. The other printers are ESC/P compatible and I use a generic Epson driver provided by ghostscript. However, I think that sending text via               lp -dpr1 filename      prints the text as a graphic and changing the printer's font face (courier, times roman, etc) or pitch has no effect. I am wondering if there is any workaround for this? In AIX they claim that the `lp` command printed output as text as it prints and Cobol programs send raw text to lp printers. However, in AIX they use some custom filters for the printers and have more options for dot matrix printers. I would like to know if there is a way to avoid graphics mode for text and change the font face. The most straightforward approach would be to use no driver, just send ESC/P from Cobol but this requires too much work.


title: Is there truth to the philosophy that you should sync; sync; sync; sync?

text: When I was first introduced to Linux, working at Cisco Systems in 2000, I was taught the merits of the `sync` command, used to flush buffers to disk to prevent filesystem corruption / data loss. I was told not only by coworkers there, but by friends in college to always run `sync` "a few" or "a bunch" of times, that is, maybe 5 - 10 times, instead of just once. I've continued this habit ever since, but, is there any merit to this? Has anyone else ever heard this? And most importantly, can anyone provide good rationale / empirical evidence for/against the idea that you need to run `sync` more than once for it to be effective?


title: Reassigning Ctrl + Arrow keys in Vim

text: > **Possible Duplicate:**   >  How to fix Ctrl + arrows in Vim? Through the several tutorials and tips and tricks site about Vim, I think I happened to read that one can reassign a combination of keys in Vim. I would have loved to switch between vim tabs more easily and quicker that typing `:tabn` or `:tabp` each time. For the moment `Ctrl` \+ `Left` or `Right` arrow, makes me switch from `command mode` to `insert mode`, and pastes the character `c` or `d` according the arrow pressed. So I plan to assign `Ctrl + Arrows` (Left Right) to `:tabn` `:tabp` However as I am still relatively **really new** to Vim, I wonder if they may have a superuseful utility that I might not know about. Am I safe to re-use them this way ?


title: / permissions on a linux filesystem

text: Does the `/` have permissions attached to it? If so what are they and what command do you run to find out? The reason why I ask this is to know weather a NFS mount reflect this if your export is set to `/ 192.100.0.0/24(....)`


title: How do I merge two *.avi files into one

text: I have two `*.avi` files:               sequence1.avi     sequence2.avi      How do I merge these two files using a command-line or GUI?


title: Cross Compiling - Platform Vs Architecture

text: Could someone explain, what is the precise definition of cross compilation. I am asking this because.   * When a program is compiled to a different platform (operating system) other than the host platform on which the code is compiled, many refer to this as cross compilation. Eg : Compiling for Linux arm on Windows.   * On the other hand, If you compile a program on Linux desktop ( i386 architecture ) to be run on Linux arm (ARM architecture). Does this process can be called as cross compilation ? Thank you.


title: How to prevent massive file delete on Debian

text: Today I noticed that I lost approximately 1 TB of very old movies in my collection. I have no idea how it happened, but Munin shows what happened. I'm pretty sure it was my fault. (I was awake at that hour, yes; but, I am not 100% sure.) How can I prevent something like that from happening again? How can I prevent myself (or a program/script) from deleting more than x GB of data? Any suggestion is welcome. ![Munin - Disk usage](http://i.stack.imgur.com/70JHi.png)


title: How do I enable IPv6 inbound traffic to get forwarded to my machine?

text: It seems that IPv6 traffic on my router is being dropped. How do I configure `ip6tables` appropriately, so that traffic is forwarded/accepted to my machine? Here's the `syslog` for my IPv6 traffic:               Jun 29 18:44:52 kernel: DROP IN=eth3 OUT=br0 MAC=MAC_ADDR_1 SRC=2002:xxxx:ba3d:0000:0000:0000:74ca:ba3d DST=My_IPv6_IP_ADDR LEN=68 TC=0 HOPLIMIT=119 FLOWLBL=0 PROTO=TCP SPT=58154 DPT=63282 SEQ=3810938415 ACK=0 WINDOW=8192 RES=0x00 SYN URGP=0 OPT (020404C401010402)      Jun 29 18:44:52 kernel: DROP IN=eth3 OUT=br0 MAC=MAC_ADDR_1 SRC=2002:xxxx:ba3d:0000:0000:0000:74ca:ba3d DST=My_IPv6_IP_ADDR LEN=78 TC=0 HOPLIMIT=119 FLOWLBL=0 PROTO=UDP SPT=28798 DPT=63282 LEN=38      Jun 29 18:44:57 kernel: DROP IN=eth3 OUT=br0 MAC=MAC_ADDR_1 SRC=2001:xxxx:0008:e8ad:0000:0000:0000:0001 DST=My_IPv6_IP_ADDR LEN=80 TC=0 HOPLIMIT=50 FLOWLBL=0 PROTO=TCP SPT=40930 DPT=80 SEQ=2391968293 ACK=0 WINDOW=14400 RES=0x00 SYN URGP=0 OPT (020405A00402080A7E7DEFB80000000001030307)      Jun 29 18:44:58 kernel: DROP IN=eth3 OUT=br0 MAC=MAC_ADDR_1 SRC=2001:xxxx:0008:e8ad:0000:0000:0000:0001 DST=My_IPv6_IP_ADDR LEN=80 TC=0 HOPLIMIT=50 FLOWLBL=0 PROTO=TCP SPT=40930 DPT=80 SEQ=2391968293 ACK=0 WINDOW=14400 RES=0x00 SYN URGP=0 OPT (020405A00402080A7E7DF0B20000000001030307)      Jun 29 18:44:59 kernel: DROP IN=eth3 OUT=br0 MAC=MAC_ADDR_1 SRC=2a02:xxxx:c310:a5a0:81eb:84c7:22af:7539 DST=My_IPv6_IP_ADDR LEN=72 TC=0 HOPLIMIT=43 FLOWLBL=0 PROTO=TCP SPT=58249 DPT=63282 SEQ=1653524828 ACK=0 WINDOW=8192 RES=0x00 SYN URGP=0 OPT (020405A00103030801010402)      Jun 29 18:44:59 kernel: DROP IN=eth3 OUT=br0 MAC=MAC_ADDR_1 SRC=2a02:xxxx:c310:a5a0:81eb:84c7:22af:7539 DST=My_IPv6_IP_ADDR LEN=78 TC=0 HOPLIMIT=43 FLOWLBL=0 PROTO=UDP SPT=23103 DPT=63282 LEN=38      Jun 29 18:45:00 kernel: DROP IN=eth3 OUT=br0 MAC=MAC_ADDR_1 SRC=2001:xxxx:0008:e8ad:0000:0000:0000:0001 DST=My_IPv6_IP_ADDR LEN=80 TC=0 HOPLIMIT=50 FLOWLBL=0 PROTO=TCP SPT=40930 DPT=80 SEQ=2391968293 ACK=0 WINDOW=14400 RES=0x00 SYN URGP=0 OPT (020405A00402080A7E7DF2A70000000001030307)      Jun 29 18:45:02 kernel: DROP IN=eth3 OUT=br0 MAC=MAC_ADDR_1 SRC=2a02:xxxx:c310:a5a0:81eb:84c7:22af:7539 DST=My_IPv6_IP_ADDR LEN=72 TC=0 HOPLIMIT=43 FLOWLBL=0 PROTO=TCP SPT=58249 DPT=63282 SEQ=1653524828 ACK=0 WINDOW=8192 RES=0x00 SYN URGP=0 OPT (020405A00103030801010402)      Jun 29 18:45:02 kernel: DROP IN=eth3 OUT=br0 MAC=MAC_ADDR_1 SRC=2a02:xxxx:c310:a5a0:81eb:84c7:22af:7539 DST=My_IPv6_IP_ADDR LEN=78 TC=0 HOPLIMIT=43 FLOWLBL=0 PROTO=UDP SPT=23103 DPT=63282 LEN=38      Jun 29 18:45:06 kernel: DROP IN=eth3 OUT=br0 MAC=MAC_ADDR_1 SRC=2601:xxxx:8380:06b8:5d87:46c7:7e85:08c9 DST=My_IPv6_IP_ADDR LEN=72 TC=0 HOPLIMIT=42 FLOWLBL=0 PROTO=TCP SPT=52362 DPT=63282 SEQ=3069346662 ACK=0 WINDOW=8192 RES=0x00 SYN URGP=0 OPT (020405A00103030201010402)      Jun 29 18:45:08 kernel: DROP IN=eth3 OUT=br0 MAC=MAC_ADDR_1 SRC=2a02:xxxx:c310:a5a0:81eb:84c7:22af:7539 DST=My_IPv6_IP_ADDR LEN=68 TC=0 HOPLIMIT=43 FLOWLBL=0 PROTO=TCP SPT=58249 DPT=63282 SEQ=1653524828 ACK=0 WINDOW=8192 RES=0x00 SYN URGP=0 OPT (020405A001010402)      Jun 29 18:45:09 kernel: DROP IN=eth3 OUT=br0 MAC=MAC_ADDR_1 SRC=2601:xxxx:8380:06b8:5d87:46c7:7e85:08c9 DST=My_IPv6_IP_ADDR LEN=72 TC=0 HOPLIMIT=42 FLOWLBL=0 PROTO=TCP SPT=52362 DPT=63282 SEQ=3069346662 ACK=0 WINDOW=8192 RES=0x00 SYN URGP=0 OPT (020405A00103030201010402)       Here is the contents of the router's `ip6t_filter.default` file:               *filter     :INPUT ACCEPT [0:0]     :FORWARD ACCEPT [0:0]     :OUTPUT ACCEPT [0:0]     :maclist - [0:0]     :bfplimit - [0:0]     :logaccept - [0:0]     :logdrop - [0:0]     -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT     -A INPUT -i lo -j ACCEPT     -A INPUT -i br0 -j ACCEPT     -A INPUT -p 58 ! --icmpv6-type echo-request -j ACCEPT     -A INPUT -m state --state INVALID -j DROP     -A INPUT -p udp --sport 547 --dport 546 -j ACCEPT     -A INPUT -j DROP     -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT     -A FORWARD -i br0 -o br0 -j ACCEPT     -A FORWARD -p 58 -j ACCEPT     -A FORWARD -m state --state INVALID -j DROP     -A FORWARD -o br0 -j DROP     -A logaccept -m state --state NEW -j LOG --log-prefix "ACCEPT " --log-tcp-sequence --log-tcp-options --log-ip-options     -A logaccept -j ACCEPT     -A logdrop -m state --state NEW -j LOG --log-prefix "DROP " --log-tcp-sequence --log-tcp-options --log-ip-options     -A logdrop -j DROP     COMMIT      Here's the `br0` interface:               br0       Link encap:Ethernet  HWaddr AA:BB:49:E3:62:8E               inet addr:192.168.0.1  Bcast:192.168.0.255  Mask:255.255.255.0               inet6 addr: IPv6_1 Scope:Global               inet6 addr: fe80::e23f:49ff:fee3:628e/64 Scope:Link               UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1               RX packets:2233491 errors:0 dropped:0 overruns:0 frame:0               TX packets:1930092 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:0               RX bytes:998010242 (951.7 MiB)  TX bytes:348204643 (332.0 MiB)      Here's the `eth3` interface:               eth3      Link encap:Ethernet  HWaddr MAC_ADDR_1               inet addr:MyIPv4_HOST_ADDR  Bcast:X.Y.223.255  Mask:255.255.224.0               inet6 addr: IPv6_2 Scope:Global               inet6 addr: fe80::e23f:49ff:fee3:628d/64 Scope:Link               UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1               RX packets:9909832 errors:0 dropped:0 overruns:0 frame:0               TX packets:15334176 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:1000               RX bytes:1243667320 (1.1 GiB)  TX bytes:19852159929 (18.4 GiB)


title: Write log for a false statement of an if condition which returns exit 2

text: I have a script running every 5 mins with two exits in a condition clause.               #!/bin/bash     date=$(date +%Y)     if [ $date -eq '2014' ]     then         echo "Current year is $date"         exit 0     else         echo "Current year is not $date"         exit 2     fi      How could I specify to only write a log when exit 2? Could this be possible in crontab?               5 * * * * /home/user/script.sh >> script.log 2>> script.err      I have understood that **" >> script.log "** writes all the return of the script and **" 2 >> script.err "** writes only if the script didn't run correct. So I don't know if there's a chance to write only where exit 2 down the script.


title: SSH connection timeout

text: I'm periodically establishing short SSH connections to one of the local servers. I observe intermittent timeouts. After investigating the issue, I found that SSH timeouts happen when there is a lot of IO write activity to the server's RAID array. What happens is that SSH connection "hangs up" for the duration of that write burst. The server has plenty of available user memory (18 out of 64GB), swap space, and its CPUs are definitely not overloaded. Is it:   1. a normal behaviour    2. indicates some RAID hardware problem    3. something is not configured properly


title: Is it necessary to disown a process for it to continue running after disconnecting?

text: Would someone be kind enough to explain if & why `disown` is necessary if you wish to keep a job running even after you disconnect. I ask because every site I have visited says to use `disown` and `bg` but `bg` on its own is working for me and I'm not sure why. Is it because I haven't fully understood what `disown` is for or are there some settings somewhere that are affecting the default behavior of the `bg` command? Here's what I did:   * Connected to my CentOS 6 box via SSH   * Created a simple process:              tar zcvf example.tar.gz ./examplepath > /dev/null 2>&1        * Suspended the job   * Resumed it in background via `bg 1`   * Disconnected from SSH server I then checked via FTP to see if the `.tar.gz` file was still growing in size and it was.


title: No KDE: how to use strigi to index my files?

text: I'm not running KDE4 , but how can I use strigi to index my documents manually ? I already have strigi installed , but don't know how to utilize it.


title: What is the realtime equivalent of the module r8169?

text: From here: http://www.xenomai.org/index.php/RTnet:Installation_%26_Testing#Testing_with_a_single_node_.28local_loopback.29 > TODO: simplify the following steps.   >  \- Then you need to edit the file rtnet.conf under the /usr/local/rtnet/etc > folder for the correct setup to run RTnet. Edit the following parameters:   >  \- Set the host up as master or slave depending on how you are going to use > it.   >  **\- The RT_DRIVER should be the realtime equivalent of the module you > removed nl. rt_8139too.** Kernel: 2.6.38.8               linux-y3pi:~ # ethtool -i eth0     driver: r8169     version: 2.3LK-NAPI     firmware-version:     bus-info: 0000:01:00.0      After RTnet installation I get:               linux-y3pi:/usr/local/rtnet/modules # ls     rt_8139too.ko rtcfg.ko rt_eepro100.ko rt_loopback.ko rtnet.ko rtudp.ko     rtcap.ko      rt_e1000.ko  rtipv4.ko       rtmac.ko        rtpacket.ko  tdma.ko      How to find what corresponds to `r8169`?


title: grep second time faster

text: Suppose I do a time consuming recursive `grep` search. After seeing the results I want a different output; for example I want to add the option `-C 3` for 3 context lines. I can do the whole search again with the new option added, but I have to wait the same time as before. Is there any clever way to make `grep` perform the second search faster?


title: Transactional installation process like windows installer in Unix/Linux

text: Is there any transactional installation process like Windows installer in Unix/Linux? Installation scripts like Makefile or package manager (such as deb) usually simply copy files directly to overwrite existing files.


title: send keystroke to process

text: I'd like to run some applications in fullscreen. Even though they don't have an explicit such option, it is possible with the `metacity` Alt-F11 command. So, I thought I could create such an input like this: full.txt:               KeyStrPress Alt_L     KeyStrPress F11     KeyStrRelease F11     KeyStrRelease Alt_L      and then: `xmacroplay "$DISPLAY" < full.txt` (in my case, the same as `xmacroplay :0.0 < full.txt`) But, it works in the terminal where it is run. How do I send it to the `stdin` of some other process? **Edit** : I found a better way to do this: `wmctrl -r urxvt -b toggle,fullscreen` (for urxvt). Check out my answer to this question for (a bit) more on that.


title: Understanding tcpdump output on a linux router

text: My router has an `atm0` interface and a VLAN (`atm0.1`) interface, `atm0.1` has the WAN IP address. When using `tcpdump -i atm0`, the packets captured are only outgoing packet (LAN to WAN).               05:34:19.504895 IP 10.110.51.83 > 74.125.71.104: ICMP echo request, id 768, seq 29184, length 40     05:34:20.506885 IP 10.110.51.83 > 74.125.71.104: ICMP echo request, id 768, seq 29440, length 40     05:34:21.507868 IP 10.110.51.83 > 74.125.71.104: ICMP echo request, id 768, seq 29696, length 40      When using `tcpdump -i atm0.1`, the packets captured include both outgoing packets and incoming packets.               05:36:33.517705 IP 10.110.51.83 > 74.125.71.104: ICMP echo request, id 768, seq 30208, length 40     05:36:33.827969 IP 74.125.71.104 > 10.110.51.83: ICMP echo reply, id 768, seq 30208, length 40     05:36:34.519715 IP 10.110.51.83 > 74.125.71.104: ICMP echo request, id 768, seq 30464, length 40     05:36:34.685847 IP 74.125.71.104 > 10.110.51.83: ICMP echo reply, id 768, seq 30464, length 40     05:36:35.521643 IP 10.110.51.83 > 74.125.71.104: ICMP echo request, id 768, seq 30720, length 40     05:36:35.679061 IP 74.125.71.104 > 10.110.51.83: ICMP echo reply, id 768, seq 30720, length 40      Why? linux version is 2.6.30, atm driver are from broadcom.


title: Сan I configure FreeBSD to use DHCP or a static IP depending on the detected ssid?

text: I have a FreeBSD 8 machine which can use several wireless access points. I want it to use the first available network and automatically use DHCP or a static address as required (this should be configured separately for every network). Is it possible under FreeBSD?


title: Bridged TAP interface to virtualbox

text: I need bridged TAP interface on client side of my VPN to virtual machine. I use VirtualBox 4.3.12. But in Adapter Network options in `Attached to: Bridged adapter` I do not see my TUN adapter. I have searched for this and I found some common cases. But I do not find in my VirtualBox configuration: > Step 11: > > At the VirtualBox startup panel, choose “Host Interface” and add “name of > tap adapter″ to “Interface Name”. Next I need to bridge absolutely all traffic from/to my VPN to this virtual machine, so there will not be any traffic routed to a real physical system. Will it be possible to realize this via `iptables`? I use Linux Debian 7.5. My `OpenVPN` server configuration:               dev tun     ifconfig 10.1.1.1 10.1.1.2     secret static.key     comp-lzo     keepalive 10 60     ping-timer-rem     persist-tun     persist-key     user openvpn     group openvpn     daemon      My `OpenVPN` client configuration:               dev tun     remote REMOTE_IP     ifconfig 10.1.1.2 10.1.1.1     secret static.key     comp-lzo     keepalive 10 60     ping-timer-rem     persist-tun     persist-key     user openvpn     group openvpn     daemon


title: Setting linux time

text: $ date 042612492005     $ hwclock -w      The code above shows how to set the system time, but how's the timestamp string generated in the first place?


title: What's the right way to set "dynamic" PATH in bash? (for android sdk)

text: I have android sdk installed, and I want the binaries in `build-tools/android- VERSION` to be available in PATH, so I add few lines:               ANDROID_SDK=/Application/Binaries/adt-bundle-linux-x86_64-20140321/sdk/     ANDROID_PATH=$ANDROID_SDK/tools:$ANDROID_SDK/platform-tools:$ANDROID_SDK/build-tools/android-4.4.2/      Here's the problem, I might update the SDK at any time, so `build- tools/android-4.4.2/` might change upon that. If so I would have to edit the file again and update the `android-version` part in $PATH So I changed the profile to something like this,               ANDROID_SDK=/Application/Binaries/adt-bundle-linux-x86_64-20140321/sdk/     ANDROID_PATH=$ANDROID_SDK/tools:$ANDROID_SDK/platform-tools     for x in $ANDROID_SDK/build-tools/android-*/; do         export PATH=$PATH:$x     done      That looks dumb, any better way to write it?


title: Grab from a webcam

text: > On Linux it is easy to use an audio or video grabbing device as input to > FFmpeg: > > ffmpeg -f oss -i /dev/dsp -f video4linux2 -i /dev/video0 out.flv Today someone in kirupa forums said they used to create flash webcam netstream but now just use linux. That would be great but how do you do it!? I mean how would you do it in Linux to simultaneously grab from a webcam, input to ffmpeg and output to player. If not using a swf webcam publisher, what could you use instead? Right now I have a webcam grab created in flash cs6 which is working but I cannot find necessary instructions on how to add a netstream in actionscript.


title: CentOS partitioning

text: I have a CentOS server with two 1 TB disks. However, it is badly partitioned. Please check below:               [root@p16282558 ~]# fdisk -l          Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes     255 heads, 63 sectors/track, 121601 cylinders     Units = cylinders of 16065 * 512 = 8225280 bytes     Sector size (logical/physical): 512 bytes / 4096 bytes     I/O size (minimum/optimal): 4096 bytes / 4096 bytes     Disk identifier: 0xd4f28eb2             Device Boot      Start         End      Blocks   Id  System     /dev/sdb1               1         523     4194304   fd  Linux raid autodetect     Partition 1 does not end on cylinder boundary.     /dev/sdb2             523         784     2097152   82  Linux swap / Solaris     Partition 2 does not end on cylinder boundary.     /dev/sdb3             784      121602   970470104   fd  Linux raid autodetect     Partition 3 does not end on cylinder boundary.          Disk /dev/sda: 1000.2 GB, 1000204886016 bytes     255 heads, 63 sectors/track, 121601 cylinders     Units = cylinders of 16065 * 512 = 8225280 bytes     Sector size (logical/physical): 512 bytes / 4096 bytes     I/O size (minimum/optimal): 4096 bytes / 4096 bytes     Disk identifier: 0x724abfe3             Device Boot      Start         End      Blocks   Id  System     /dev/sda1               1         523     4194304   fd  Linux raid autodetect     Partition 1 does not end on cylinder boundary.     /dev/sda2             523         784     2097152   82  Linux swap / Solaris     Partition 2 does not end on cylinder boundary.     /dev/sda3             784      121602   970470104   fd  Linux raid autodetect     Partition 3 does not end on cylinder boundary.          Disk /dev/md3: 993.8 GB, 993761296384 bytes     2 heads, 4 sectors/track, 242617504 cylinders     Units = cylinders of 8 * 512 = 4096 bytes     Sector size (logical/physical): 512 bytes / 4096 bytes     I/O size (minimum/optimal): 4096 bytes / 4096 bytes     Disk identifier: 0x00000000               Disk /dev/md1: 4294 MB, 4294901760 bytes     2 heads, 4 sectors/track, 1048560 cylinders     Units = cylinders of 8 * 512 = 4096 bytes     Sector size (logical/physical): 512 bytes / 4096 bytes     I/O size (minimum/optimal): 4096 bytes / 4096 bytes     Disk identifier: 0x00000000               Disk /dev/mapper/vg00-usr: 4294 MB, 4294967296 bytes     255 heads, 63 sectors/track, 522 cylinders     Units = cylinders of 16065 * 512 = 8225280 bytes     Sector size (logical/physical): 512 bytes / 4096 bytes     I/O size (minimum/optimal): 4096 bytes / 4096 bytes     Disk identifier: 0x00000000               Disk /dev/mapper/vg00-var: 4294 MB, 4294967296 bytes     255 heads, 63 sectors/track, 522 cylinders     Units = cylinders of 16065 * 512 = 8225280 bytes     Sector size (logical/physical): 512 bytes / 4096 bytes     I/O size (minimum/optimal): 4096 bytes / 4096 bytes     Disk identifier: 0x00000000               Disk /dev/mapper/vg00-home: 4294 MB, 4294967296 bytes     255 heads, 63 sectors/track, 522 cylinders     Units = cylinders of 16065 * 512 = 8225280 bytes     Sector size (logical/physical): 512 bytes / 4096 bytes     I/O size (minimum/optimal): 4096 bytes / 4096 bytes     Disk identifier: 0x00000000      When I ran `df`:               [root@p16282558 ~]# df -h     Filesystem            Size  Used Avail Use% Mounted on     /dev/md1              4.0G  4.0G     0 100% /     /dev/mapper/vg00-usr  4.0G  1.5G  2.4G  38% /usr     /dev/mapper/vg00-var  4.0G  880M  2.9G  23% /var     /dev/mapper/vg00-home                           4.0G  136M  3.7G   4% /home     none                  7.9G  556K  7.9G   1% /tmp      `/opt` is within `/`, and there is no space left in `/` My `/etc/fstab` looks like this:               /dev/md1        /               ext3    defaults        1 1     /dev/sda2   none            swap    sw     /dev/sdb2   none            swap    sw     /dev/vg00/usr   /usr            ext4    defaults        0 2     /dev/vg00/var   /var            ext4    defaults,usrquota   0 2     /dev/vg00/home  /home           ext4    defaults,usrquota   0 2     devpts          /dev/pts        devpts  gid=5,mode=620  0 0     none            /proc           proc    defaults        0 0     none            /tmp    tmpfs   defaults        0 0      So there is a full `md1` disk, and a non-utilised Disk `/dev/md3` with 993.8 GB free?? But,               [root@p16282558 ~]# df -h /dev/md3     Filesystem            Size  Used Avail Use% Mounted on     -                     7.9G  204K  7.9G   1% /dev      Does this mean `/dev` is not being mounted at system start (as per fstab)?               Output of vgdisplay:          --- Volume group ---       VG Name               vg00       System ID       Format                lvm2       Metadata Areas        1       Metadata Sequence No  4       VG Access             read/write       VG Status             resizable       MAX LV                0       Cur LV                3       Open LV               3       Max PV                0       Cur PV                1       Act PV                1       VG Size               925.51 GiB       PE Size               4.00 MiB       Total PE              236931       Alloc PE / Size       3072 / 12.00 GiB       Free  PE / Size       233859 / 913.51 GiB      My problem is: `/opt` should be mounted in a disk/partition with more space. How can I restructure the disk to utilize all disk space in an efficient way?


title: How to recover saved (stored) emails after damage to KMail configuration?

text: Recently my computer had to be hard-reset, and fsck ran on `/home` filesystem, producing lots of errors (old HDD drive). After reset I don't see all my saved emails in KMail (KDE 3.5.3), at least those that were present in folder that was opened when computer crashed. The files are there physically in `~/Mail/folder/cur`, but they are not visible in KMail component of Kontact. The configuration files got damaged -- beside not seeing all saved emails, I have lost configuration of all my email accounts. Is it possible to fix KMail configuration to make those saved emails visible again? * * * Nb. I have month old backup, so KMail config should be recoverable.


title: bash find lines starting with string

text: I have a bunch of files and I want to find which one contains sequential lines starting with a certain string. For example for the following file :               Aaaaaaaaaaaa     Baaaaaaaaaaa     Cxxxxxxxxx     Cyyyyyyyyy     Czzzzzzzzz     Abbbbbbbbbbb     Bbbbbbbbbbbb     Caaaaaa     Accccccccccc     Bccccccccccc     Cdddddd     Ceeeeee      There is more than one line starting with 'C', so I want this file to be found by command.   For example for the following file :               Aaaaaaaaaaaa     Baaaaaaaaaaa     Cxxxxxxxxx     Abbbbbbbbbbb     Bbbbbbbbbbbb     Caaaaaa     Accccccccccc     Bccccccccccc     Cdddddd      There is always one line starting with 'C', I don't want this file. I thought of using a `grep` or a `sed` but I don't know exactly how to do it. Maybe using a regexp `^C.*$^C` or something like that. Any idea ?


title: How to force the fan to always spin?

text: I am using ArchLinux on an HP Pavilion dv9000t which has overheating problems. I did all what I can do to get a better air flow in the laptop and put a better thermal paste but there is still a problem: the fan stops spinning when the CPU temperature is low (even if the GPU temperature is high, which is problematic). I found out I can get the fan running by launching some heavy processing commands (like the `yes` command). However, it is not a solution because I need to stop this command when the CPU gets too hot and launch it again when the fan stops (so that the GPU does not get hot). I tried to control the fan using this wiki, but when I run `pwmconfig`, I get this error:               /usr/bin/pwmconfig: There are no pwm-capable sensor modules installed      Do you know what can I do to get the fan always spinning? **Edit:** The `sensors-dectect` output is the following:               ~/ sudo sensors-detect      # sensors-detect revision 6170 (2013-05-20 21:25:22 +0200)     # System: Hewlett-Packard HP Pavilion dv9700 Notebook PC [Rev 1] (laptop)     # Board: Quanta 30CB          This program will help you determine which kernel modules you need     to load to use lm_sensors most effectively. It is generally safe     and recommended to accept the default answers to all questions,     unless you know what you're doing.          Some south bridges, CPUs or memory controllers contain embedded sensors.     Do you want to scan for them? This is totally safe. (YES/no):      Module cpuid loaded successfully.     Silicon Integrated Systems SIS5595...                       No     VIA VT82C686 Integrated Sensors...                          No     VIA VT8231 Integrated Sensors...                            No     AMD K8 thermal sensors...                                   No     AMD Family 10h thermal sensors...                           No     AMD Family 11h thermal sensors...                           No     AMD Family 12h and 14h thermal sensors...                   No     AMD Family 15h thermal sensors...                           No     AMD Family 15h power sensors...                             No     AMD Family 16h power sensors...                             No     Intel digital thermal sensor...                             Success!         (driver `coretemp')     Intel AMB FB-DIMM thermal sensor...                         No     VIA C7 thermal sensor...                                    No     VIA Nano thermal sensor...                                  No          Some Super I/O chips contain embedded sensors. We have to write to     standard I/O ports to probe them. This is usually safe.     Do you want to scan for Super I/O sensors? (YES/no):      Probing for Super-I/O at 0x2e/0x2f     Trying family `National Semiconductor/ITE'...               No     Trying family `SMSC'...                                     No     Trying family `VIA/Winbond/Nuvoton/Fintek'...               No     Trying family `ITE'...                                      No     Probing for Super-I/O at 0x4e/0x4f     Trying family `National Semiconductor/ITE'...               No     Trying family `SMSC'...                                     No     Trying family `VIA/Winbond/Nuvoton/Fintek'...               No     Trying family `ITE'...                                      No          Some hardware monitoring chips are accessible through the ISA I/O ports.     We have to write to arbitrary I/O ports to probe them. This is usually     safe though. Yes, you do have ISA I/O ports even if you do not have any     ISA slots! Do you want to scan the ISA I/O ports? (YES/no):      Probing for `National Semiconductor LM78' at 0x290...       No     Probing for `National Semiconductor LM79' at 0x290...       No     Probing for `Winbond W83781D' at 0x290...                   No     Probing for `Winbond W83782D' at 0x290...                   No          Lastly, we can probe the I2C/SMBus adapters for connected hardware     monitoring devices. This is the most risky part, and while it works     reasonably well on most systems, it has been reported to cause trouble     on some systems.     Do you want to probe the I2C/SMBus adapters now? (YES/no):      Using driver `i2c-i801' for device 0000:00:1f.3: Intel 82801H ICH8     Module i2c-dev loaded successfully.          Next adapter: nouveau-0000:01:00.0-0 (i2c-0)     Do you want to scan it? (yes/NO/selectively):           Next adapter: nouveau-0000:01:00.0-1 (i2c-1)     Do you want to scan it? (yes/NO/selectively):           Next adapter: nouveau-0000:01:00.0-2 (i2c-2)     Do you want to scan it? (yes/NO/selectively):           Now follows a summary of the probes I have just done.     Just press ENTER to continue:           Driver `coretemp':       * Chip `Intel digital thermal sensor' (confidence: 9)          Do you want to overwrite /etc/conf.d/lm_sensors? (YES/no):      Unloading i2c-dev... OK     Unloading cpuid... OK      The file `/etc/conf.d/lm_sensors` contains:               HWMON_MODULES="coretemp"      And the file `/etc/modules-load.d/lm_sensors.conf` contains:               coretemp     acpi-cpufreq      The command `sensors` outputs this:               ~/ sensors     coretemp-isa-0000     Adapter: ISA adapter     Core 0:       +46.0°C  (high = +85.0°C, crit = +85.0°C)     Core 1:       +47.0°C  (high = +85.0°C, crit = +85.0°C)          acpitz-virtual-0     Adapter: Virtual device     temp1:        +49.0°C            nouveau-pci-0100     Adapter: PCI adapter     temp1:        +60.0°C  (high = +95.0°C, hyst =  +3.0°C)                            (crit = +115.0°C, hyst =  +5.0°C)                            (emerg = +115.0°C, hyst =  +5.0°C)


title: How to convert a .txt subtitle file to .srt format?

text: I have a subtitle file, it looks like this:               00:00:44:" Myślę, więc jestem".|Kartezjusz, 1596-1650     00:01:01:Trzynaste Pietro     00:01:06:Podobno niewiedza uszczęśliwia.     00:01:10:Po raz pierwszy w życiu|zgadzam się z tym.     00:01:13:Wolałbym...     00:01:15:nigdy nie odkryć|tej straszliwej prawdy.     00:01:19:Teraz już wiem...      I'm not sure what format this is, but I wanted to convert the subtitles to .srt. Unfortunately `gnome-subtitles` and `subtitleeditor` can't recognize this kind of format. `gnome-subtitles` says: > Unable to detect the subtitle format. Please check that the file type is > supported. `subtitleeditor` says: > Please check that the file contains subtitles in a supported format. `file` output:               UTF-8 Unicode text      Is there a way to convert this file to .srt format?


title: How to use SFTP on a system that requires sudo for root access & ssh key based authentication?

text: I want to be able to use SFTP to edit files that require root permissions. I'm using SSH Key based authentication - rsa key on smart card. If the system requires sudo to perform root level commands, How do I get around this? Can I create a way of bypassing sudo for SFTP only? Is there a way to keep sudo & key authentication. I'm using windows to connect to Ubuntu. I need this to work with Mac connecting to Ubuntu as well. I understand how to do SSH Tunneling to admin the system services. Currently, I use root user login directly, but password login is disabled. I didn't understand how to use sudo and SFTP at same time. It seems to be a best practice to require login as a non-root user and then require use of sudo since the logs will record who was given escalated privileges for each command. Should I concern myself with this when using Key based authentication or is this a trivial difference in security/logging? It seems like Key based authentication records user's serial number in the logs, and you can have multiple keys for the root user to identify each user. This seems to be the same effect as using sudo to me. Am I wrong?


title: What is SSH - the protocol and what is ssh - the utility?

text: What is SSH - the protocol?   What is `ssh` \- the unix utility and how does it work?   How is SSH protocol related to SFTP?   What is `sshd`?   Does the command `su` use `ssh` or `sshd`?


title: rsyslog is not discarding message as it should

text: I have setup `rsyslog` to write messages from `local0.*` to a seperate logfile, and then discard the messages. For some reason, the logs are going to _both_ `/var/log/syslog`, and the new logfile. I have put the config in `rsyslog.d/30-local0.conf`, which as far as I know, should come before the `50-default.conf`, and so the message should be discarded before hitting the standard rules and being written to syslog?


title: reading offline Maildir archive with graphical email client

text: I have an archive of old emails in `Maildir` format. The directory (let's call it `my_archive`) has proper `Maildir` structure               $ ls ./my_archive     cur  new  tmp      I am able read the emails with `mutt` by specifying the mailbox to load:               mutt -f ./my_archive      Mutt is OK, but I would like to read the archive with a graphical email client, so that I can easily work with attachments. Is there some similar way to open my archive in some email client like Thunderbird?


title: how do I make a $VAR empty so it don't effect the command line argument and still be within that argument?

text: This is the basic setting for hsetroot for it to work: hsetroot -center /path/to/image/ - setting the wallpaper with just that the picture. To use these options, just one has to be place within the same line of argument, using just one of these three. -flipd , -fliph , -flipv giving a total of 4 options that can be used when setting hsetroot, therefore one of the options would be "void" or not there. Therefore in order to able to use all four options the $variable that is needed to be placed within the calling of the program has to "disappear" so that the system does not see it, with the $var still placed within the argument when it is called by the script. A case statement is perfect for this to work. Just have RANDOM give you one of 4 numbers then the case statement picks one, or the number matches which ever case it be, then sets it into the line of argument for hestroot. The format for that would then be, hsetroot -flipd -center /path/to/image -- to replace having to manually change that option we just use a $var then reassign that same $var within a function so that we can eliminate having to open up a terminal or script and write in again but differently. Now we can just use that variable to take the place of all four options that is given to the user to set hsetroot like this instead: hsetroot $var -center /path/to/image where $var now becomes one of either, 1) -fliph , 2) -flipd , 3) -flipv and the 4) forth one or last option is nothing at all. HUSTON WE NOW HAVE A PROBLEM! As we want to eliminate having to open up that script and manually change it we have to make the system believe that the $var that is written in that line of code is no longer there. It has to disappear or turn invisible so that it does not effect the program that is looking for all of the arguments it needs to have in order for it to run without errors. How do we do that? in other words: I have a case statement with 4 options one having to be "empty" to indicate that it is not even there. It goes as such: it is case '0' that I am having problems with as the $variable has to stay within the line of arguments but if RANDOM gives the variable a value of zero (0) then it needs to 'disappear' like it is not even there and still allow the program to use all the other arguments to still do what it does. I have all ready tried all of these:               setS="" and setS='' and setS="NULL" and unset -v setS      none of them work               flipS()     {      RANGE=3      val=$RANDOM      let  "val %= $RANGE"           case $val in          1 )             setS="-flipd"               echo "$setS 1"             ;;         2 )                  setS="-fliph"               echo "$setS 2"                 ;;         3 )                  setS="-flipv"               echo "$setS  -- 3"                 ;;         0 )                   setS=' '                echo "$setS   -- 4"                 ;;     esac     }      flipS       this is for hsetroot to randomize the screen setting Syntaxis: hsetroot [command1 [arg1..]] [command2 [arg1..]]... with -flipv etc. they take no arg after it. just the placing of that in itself. NOTE: I am using just about every argument that hsetroot has in a RANDOM fashion therefore the using the case statement like this is not an option:                RANGE=3      val=$RANDOM      let  "val %= $RANGE"             cast $val in       1 )        hsetroot -flipd -center /path/to/image        ;;       2 )        hsetroot -flipv -center /path/to/image         ;;       .......


title: How can I pipe commands to any terminal?

text: I often use more than one terminal (or terminal emulator) at a time; and while in X I can copy-paste commands, besides not being very practical, it obviously does not work on the real TTY. The first idea that occurs to me is something alike:               command > /dev/sometty      Unfortunately, the `command` is run **before** it is piped, and no tricks like `echo `command`` will work, no matter how many weird bash characters (`$`, ```, `"`, etc.) are there. So `/dev/sometty` simply gets some text. The problem is that, sometimes, it is even worth for I to pipe those commands into a file, make it executable, etc., or shortly: making a script and running it from the appropriate terminal. But that is a lot of work. I've been thinking of making a script to make these files, for an instruction:               termpipe -e "command1\ncommand2\"command 1 argument\\n(s)\"" -t /dev/sometty       it would do something like:   1. pipe the commands to, say, `/tmp/termpipe-20140208-153029-1.sh`   2. make the file executable   3. run the file in the appropriate terminal   4. delete the script when it is done executing AFAIK, the problem is in **3.** : this doesn't solve any problem, as I'd need another `termpipe` instance to run the first on the appropriate terminal. And one for that one. And another for that, _ad infinitum_. **So this cannot work.** Or can it?... The solution could be to use a named pipe per terminal, and when each starts, a script would tell the pipe to forward anything it receives to the terminal, and then to execute it (like a sort of _daemon_ ). I think this might work but I don't know how to set up the initial script. How can I? **How can I tell the FIFO to give piped commands for the respective terminal to run?** I don't know much Bash, so I'd appreciate full explanations.


title: Change default position of Dialog Windows KDE 4.10

text: I have KDE 4.10 running on my system, today when configure to work with two monitors top/bottom i get the surprise that modal dialogs show in the middle of two monitors, example the Intellij's Search everywhere dialog. this is annoying, how i can chage the default position of this for every dialog of this type


title: print all matches or replace all strings in a BIG file which is NOT line organised (no line separators)

text: The 5GB files I have are streams of data rows formed:                   {datarow1...},{datarow2...},...,{datarowN...}      so actually could say that there are lines `{}`, and even line separators, but coming as a three char sequence: `},{` I want to do two things:   1. print "`lines`" that have string `"error"` in it:              grep -o -P {[^{}]+?error.+?} ES01.log > ES01.err.log        2. make the file more "friendly" by explicitly producing files with new line separators              <ES01.log sed -e 's/},{/}\n{/g' > ESnl01.log      While the above works for relatively small files (up to ~100MB), my files are unfortunately a lot bigger therefore hitting the memory problems here:                   grep: memory exhausted         sed: couldn't re-allocate memory      as both grep and sed try to read/process files line by line which in this case (no separators) leads to loading whole files into memory. Any idea how to approach this using some another smart one-liner?


title: CentOS 6.5 Login Screen GDM Issues

text: I have a few issues with the GDM login screen. I am using CentOS 6.5 and installed GNOME. I was able to change the background of the login screen by replacing the `default.png` image on the system. However:   1. ~~Whenever the login screen loads, the "Appearance Settings" window shows - as if it is asking for a specific theme for GNOME. I really want this to go away...~~   2. I cannot figure out how to change the icon loaded in the login panel, nor how to change the name of the OS on this same panel (CentOS 6.5). Can anyone offer suggestions on how to make these changes? I've read a few articles on using the "Login Screen" manager, but I don't have that installed (and can't find it in the repo's). **EDIT #1** : The first was solved by removing a link from within `/usr/share/gdm/autostart/LoginWindow/` called `gnome-appearance- properties.desktop`. **EDIT #2** : Looking in `/usr/share/gdm/gdm-greeter-login-window.ui`, I found the following code:               <object class="GtkImage" id="computer">         <property name="visible">True</property>         <property name="pixel_size">64</property>         <property name="icon_name">computer</property>     </object>      If I comment this chunk out, the icon disappears on the login window. However, I cannot figure out which file it is referencing. I did a `find / -name "computer*"` and looked at every file this returned and none of them were the icon matching what is displayed. Another interesting thing: I can change the `icon_name` property from `computer` to `start-here` and the icon stays the same. However, if I change it to something more absurd such as `my-custom-icon`, it shows a broken (perhaps default) image in its place. Again, I searched for any file named `start-here` and they all are different.


title: Shortening build command

text: Is there any way I can shorten this openCV build command?               g++ file.cpp -o newFileName `pkg-config --cflags --libs opencv`      I tried adding:               -o newFileName `pkg-config --cflags --libs opencv`      to an alias but it just keep returning command not found, is there any other way to shorten this command? EDIT: As per suggestions below I have created a `makefile` with the following content:               OPENCV='pkg-config --cflags --libs opencv'     %: %.cpp         $(CXX) -o $* $*.cpp $(OPENCV)      but when I run `make surfPoints` I am getting the following output (the file builds fine when the command is manually ran):               $ make surfPoints     g++ -o surfPoints surfPoints.cpp      /tmp/ccxxAU92.o: In function `main':     surfPoints.cpp:(.text+0x81): undefined reference to `cv::imread(std::string const&, int)'     surfPoints.cpp:(.text+0xf3): undefined reference to `cv::imread(std::string const&, int)'     surfPoints.cpp:(.text+0x17f): undefined reference to `cv::SURF::SURF(double, int, int, bool, bool)'     surfPoints.cpp:(.text+0x1d0): undefined reference to `cv::FeatureDetector::detect(cv::Mat const&, std::vector<cv::KeyPoint, std::allocator<cv::KeyPoint> >&, cv::Mat const&) const'     surfPoints.cpp:(.text+0x212): undefined reference to `cv::FeatureDetector::detect(cv::Mat const&, std::vector<cv::KeyPoint, std::allocator<cv::KeyPoint> >&, cv::Mat const&) const'     surfPoints.cpp:(.text+0x280): undefined reference to `cv::drawKeypoints(cv::Mat const&, std::vector<cv::KeyPoint, std::allocator<cv::KeyPoint> > const&, cv::Mat&, cv::Scalar_<double> const&, int)'     surfPoints.cpp:(.text+0x2c1): undefined reference to `cv::drawKeypoints(cv::Mat const&, std::vector<cv::KeyPoint, std::allocator<cv::KeyPoint> > const&, cv::Mat&, cv::Scalar_<double> const&, int)'     surfPoints.cpp:(.text+0x2d7): undefined reference to `cv::_InputArray::_InputArray(cv::Mat const&)'     surfPoints.cpp:(.text+0x30b): undefined reference to `cv::imshow(std::string const&, cv::_InputArray const&)'     surfPoints.cpp:(.text+0x339): undefined reference to `cv::_InputArray::_InputArray(cv::Mat const&)'     surfPoints.cpp:(.text+0x36d): undefined reference to `cv::imshow(std::string const&, cv::_InputArray const&)'     surfPoints.cpp:(.text+0x38f): undefined reference to `cv::waitKey(int)'     /tmp/ccxxAU92.o: In function `cv::Mat::~Mat()':     surfPoints.cpp:(.text._ZN2cv3MatD2Ev[_ZN2cv3MatD5Ev]+0x39): undefined reference to `cv::fastFree(void*)'     /tmp/ccxxAU92.o: In function `cv::Mat::release()':     surfPoints.cpp:(.text._ZN2cv3Mat7releaseEv[_ZN2cv3Mat7releaseEv]+0x47): undefined reference to `cv::Mat::deallocate()'     /tmp/ccxxAU92.o: In function `cv::Feature2D::~Feature2D()':     surfPoints.cpp:(.text._ZN2cv9Feature2DD2Ev[_ZN2cv9Feature2DD2Ev]+0x69): undefined reference to `cv::DescriptorExtractor::~DescriptorExtractor()'     surfPoints.cpp:(.text._ZN2cv9Feature2DD2Ev[_ZN2cv9Feature2DD2Ev]+0x80): undefined reference to `cv::FeatureDetector::~FeatureDetector()'     surfPoints.cpp:(.text._ZN2cv9Feature2DD2Ev[_ZN2cv9Feature2DD2Ev]+0x98): undefined reference to `cv::Algorithm::~Algorithm()'     surfPoints.cpp:(.text._ZN2cv9Feature2DD2Ev[_ZN2cv9Feature2DD2Ev]+0xcc): undefined reference to `cv::FeatureDetector::~FeatureDetector()'     surfPoints.cpp:(.text._ZN2cv9Feature2DD2Ev[_ZN2cv9Feature2DD2Ev]+0xe9): undefined reference to `cv::Algorithm::~Algorithm()'     /tmp/ccxxAU92.o: In function `cv::SURF::~SURF()':     surfPoints.cpp:(.text._ZN2cv4SURFD1Ev[_ZN2cv4SURFD1Ev]+0xe): undefined reference to `vtable for cv::SURF'     surfPoints.cpp:(.text._ZN2cv4SURFD1Ev[_ZN2cv4SURFD1Ev]+0x26): undefined reference to `vtable for cv::SURF'     surfPoints.cpp:(.text._ZN2cv4SURFD1Ev[_ZN2cv4SURFD1Ev]+0x2e): undefined reference to `vtable for cv::SURF'     surfPoints.cpp:(.text._ZN2cv4SURFD1Ev[_ZN2cv4SURFD1Ev]+0x3b): undefined reference to `VTT for cv::SURF'     surfPoints.cpp:(.text._ZN2cv4SURFD1Ev[_ZN2cv4SURFD1Ev]+0x62): undefined reference to `cv::Algorithm::~Algorithm()'     surfPoints.cpp:(.text._ZN2cv4SURFD1Ev[_ZN2cv4SURFD1Ev]+0x97): undefined reference to `cv::Algorithm::~Algorithm()'     collect2: error: ld returned 1 exit status     make: *** [surfPoints] Error 1


title: cntlm: the request was denied

text: I have configured **CNTLM** server between users and **Windows TMG** firewall. **CNTLM** configured with "allow all" - no any `ACL` or something like it:               Gateway yes          #     # Useful in Gateway mode to allow/restrict certain IPs     #     #Allow          127.0.0.1     #Deny           0/0      From Sun 05:25 (!) I got next errors in `/var/log/messages`:               Jan 19 05:25:50 teamcity cntlm[7923]: The request was denied!     Jan 19 05:26:25 teamcity cntlm[7923]: Connection accepted from 10.***.***.183:53717      And there is a lot of them:               # cat /var/log/messages | grep "10.***.***.183" | wc -l     64900      Eventually- server goes down with `"Virtual machine cpu usage"` alert. What means here "`The request was denied`"? **Google** says only about `ACL` \- but it's not configured here. Also - host `10.***.***.183` are "trusted" host of our developer and he often uses this proxy when his `Maven` download new artifacts in it's repository.


title: 64bit VM host environment for debian linux similar to VMware player on Wintel?

text: I have an Intel Core Duo i3-2100 running a flavour of Debian. I understand Virtual Box is x86-only so is there any similar open source Virtualisation environment that can host images like VMware player on a Windows platform?


title: Why do some scripts need constant re-sourcing during debian init?

text: Studying the init scripts, I'm puzzled as to why some subsidiary functions need to be re-sourced again and again. Specifically the logging functions found in `/lib/lsb/init-functions`. Every script that wants log messages needs to re-source that, why isn't it possible to do it once and that's that? It's as if each new init script is run in it's own shell. If that's the case, why do it like that? The same issue shows up with 'vars.sh' which needs to be re-sourced all the time. Is this necessary? Suppose 'init-functions' and 'vars.sh' were added to the list of scripts to run in the appropriate runlevels?


title: Installing a plugin for quodlibet as a patch

text: I'm trying to update a plugin for quodlibet. I fetched a `.patch` file from here. I navigate into the directory where the plugin is placed               /usr/share/pyshared/quodlibet/plugins/events      and copy in the `.patch` file. Then I run the command               sudo patch -b notify.py new-notify-plugin.patch      which gives me               patching file notify.py Hunk #1 FAILED at 1.     1 out of 1 hunk FAILED -- saving rejects to file notify.py.rej      The `.rej` file contains the whole content of the `.patch` file, just the first three lines changed to               --- notify.py     +++ notify.py      What I am doing wrong in this case?


title: shell script to check if process is running

text: I want to implement a shell script in Ubuntu that checks if process is running. If not, I want it to launch existing byobu (screen) session 1, and then run the command "mygateway" which will run the process. This is what I came up with so far, but the byobu part is a bit tricky for me:               #!/bin/bash     service=mygateway          if (( $(ps -ef | grep -v grep | grep $service | wc -l) > 0 ))     then     echo "$service is running!!!"     else     byobu     1     cd ~     mygateway     fi      I do not know how to simulate the process of running byobu and pressing 1 in a shell script.


title: How to resolve issue of system proxy?

text: I live in an institute where two proxies work. Lets say they are proxy A and proxy B. A works well for almost all websites, however my institution has blocked many of the essential sites in B using a very poor filtering mechanism. The problem is that A is live for only select periods of time (which is unpredictable), however B remains live 99% of the time. Hence, I use tor-browser for that proxy, which provides me a tunnel to access all the banned websites. Now, every time A is down, I need to go to apt.conf in the etc/apt/ folder and configure the socks proxy of the tor browser there. This obviously takes up most of the time and reopening shell instances again and again is a headache. So, is there any way I could easily switch between proxies using a GUI / shell (and apply them system-wide)in a way similar to that of proxyswitchy extension of chrome.


title: gnome "switch user" shortcut or command line

text: Is it possible to switch user of gnome desktop environment by single command or any shortcut key, in centos 6.0, or Can we create shortcut key? I found "fusa", but still unable to install it.


title: Shift-Space in less

text: In modern web browsers and other software with text content, `Space` scrolls down more or less a screenful. `Shift``Space` scrolls up in everything but `less`. How can one use `Shift``Space` to scroll up in `less`? Or alternatively, is there another pager (POSIX compatibility is my only requirement) that could do the job? I was told some terminal emulators, and some terminal UI libraries (ncurses?), don't recognize `Shift``Space`. Is that a valid issue?


title: Wheezy RC1: Bug Report?: “Oh No! Something Has Gone Wrong.”

text: I got a new Thinkpad T430 but had all sorts of hardware/driver issues with Debian Squeeze since it's outdated. Major issues - wireless wasn't working after numerous attempts, yadayada. So I upgraded to Wheezy RC1 and most of those issues were solved. I've had some issues like random freezes but nothing that prevented me from working..until today. Yesterday I downloaded some JRE packages and today upon heading to work the Wireless wasn't able to connect to the network at work.. my old thinkpad was able to perfectly. After restarting, I get: "Bug Report?: “Oh No! Something Has Gone Wrong.”" after logging in and selecting Gnome/Gnome Classic and it asks me to login again, and this becomes an endless loop. I can access other ttys in console mode. I can create a new user and login to Gnome, but how can I solve this for my primary user? Here is xsession-errors. http://static.arounds.org/xses.txt Also, I had display issues and wasn't ever able to legitimately install drivers through nVidia - I believe I need to do this, but I've never had issues logging in even without doing that. Would appreciate any help. **Edit:** upon using another username all day i logged in as my original and when trying to 'filezilla&' it gives me:               Unable to initialize gtk, is DISPLAY set properly?      So this is the root of my issue, as I predicted.


title: Alias for File Manager

text: I'm writing a script to use as a button on a personal toolbar. Well, I'd like to know if there is a generic command to call the file manager which would work in any distro (or maybe in any ubuntu derived distro). For example:   1. on Ubuntu I'd call `nautilus`   2. on Lubuntu I'd call `pcmanfm`   3. on Xubuntu I'd call (`thunar`?) But I'd like to simply use a general command, for example, `filemanager`. Is it possible?


title: How to install Gnome 3.10 on Debian

text: I am using Debian Testing (Sid) and i want to install Gnome 3.10. How can i do it? Is there a repository I can add in order to upgrade? I have searched a lot and the only thing I have found is the Ubuntu repositories but I don't think that's safe.               sudo add-apt-repository ppa:gnome3-team/gnome3-next     sudo add-apt-repository ppa:gnome3-team/gnome3-staging     sudo apt-get update     sudo apt-get dist-upgrade


title: Change sudo and root password on Debian

text: I have sudo access, but I don't remember the sudo or root password; how do I change it from my limited account using sudo?


title: Failing to format flashdrive to UDF

text: I'm trying to create a UDF partition on a flash drive to install grub2 (to boot ISOs from)               ~$ export DSK=/dev/sdd     # wipe the disk     ~$ sudo dd if=/dev/zero of=${DSK} bs=512 count=2048     ~$ sudo sgdisk --zap-all ${DSK}          # create partition for udf     ~$ #sudo parted -s ${DSK} mklable msdos     ~$ #sudo parted -s ${DSK} -a optimal unit MB -- mkpart primary 1 -1     ~$ (echo o; echo n; echo p; echo 1; echo ; echo ; echo t ; echo 6 ; echo w) | sudo fdisk -b 512 ${DSK}          ~$ sudo mkudffs --media-type=hd --blocksize=512 ${DSK}1     trying to change type of multiple extents


title: Whonix & Android VM

text: I'm running a whonix gateway as well as an Android VM via Genymotion. Would it be possible to route my traffic on the Android VM through the whonix gateway? I know whonix can be used in conjunction with other OSes but have been unable to find anything regarding whonix and Android.


title: How to get started with bash?

text: I need a way to be able to run a script that will automate terminal commands, one after another. As I understand it, this is exactly what bash does. (Am I right, even on this count?) Where can I learn, basically, how to set them up? Also, how can I make one run at startup? PS Are the shell and the terminal/command line the same?


title: How I append the data of Multiple files into one file?

text: I want to append data of approx 500 files into one file and each of these files are located in their respective dirs. Also How i can verify the contents of merged file e.g How i verify that data merged have data from all files or does not miss any data from all these file or each file got processed well.


title: Determine status of laptop lid

text: I have a weird problem where my laptop will wake when it's closed, generating a lot of heat and causing much frustration. Is there a way that I can tell if the laptop's lid is closed so that I can automatically suspend the computer (via a cron script) if it wakes itself while the lid is closed? Closing the lid _does_ currently suspend the machine and opening it does wake it, so that works properly. It's a 2011 MacBook Pro running Ubuntu 12.04.


title: Bluehost to Digital Ocean: Building a Web Development / Test Environment on Laptop

text: For the past few years I've been a Bluehost / LAMP site developer, but now i intend to switch to Digital Ocean to get a competitively-priced VPS i can use to pursue other technologies (nginx, Scheme & Clojure development). I've a couple of laptops i'm using to test my current LAMP / Joomla! / JQuery -based domain & subdomains on to make sure I can get them to work on Digital Ocean. QUESTION: how would i setup DNS / IP resolution on the test / development environment? Would I create a "closed" environment using my real domain name and local DNS to "mimic" the Digital Ocean VPS? Would i create a "ficitious" domain on the test laptop(s), get my current site up and running then "translate" the working config to the real domain? What caveats do i need to pay attention to (DNS, nginx, CGI)? Thanks!


title: Simulate a USB drive using Linux?

text: Is there any way that I could use what I'll call PC-A to act like a USB device to a second PC, PC-B? i.e. PC-A <<\-- Double male USB cable --> PC-B The result I'm looking to achieve is have various directories or images on PC-A appear as a USB drive to PC-B when connected and be able to change directories when needed and appear to PC-B like a different USB drive has been inserted. Also as an extension of my question could I achieve a similar result but emulate a USB mouse or keyboard, or forward the mouse and keyboard from PC-A to PC-B through said interface? PC-B would be one of any number of old PCs I am testing. PC-A would ideally be a means of simplifying or somewhat automating the process. I'm also simply curious if it can be done just because I like to try out of the box stuff anyways even if the end result isn't practical for my use-case. :P


title: Get daily averages from sar

text: Is there a way to just display a given days averages using sar. I currently do something like the following:               sar -u -s 00:00:00 -e 23:59:59 -f /var/log/sysstat/sa10      And just take the last (average) line to add to a report. But it would be nice and easy to just gen my report if I could pass an argument to just spit-out the average. I could not find such an option in the sar documentation. So, unless I am missing it, I am guessing the option is no. However, It's very possible I'm missing it or there might be another tool other than sar that might expose this functionality.


title: Linux routing for receiving packet

text: Maybe this is a dumb question. I have two NIC and they are in the same subnet. ![enter image description here](http://i.stack.imgur.com/X9wIB.png) ip route commnad show above. Kernel was build WITHOUT policy routing. My question is: When receiving packet whether from eth0 or eth1, why all the traffic are coming from eth0? (I use "ifconfig" to watch the RX bytes) is it because kernel don't have policy routing, the local routing table doesn't work? or there is something I didn't notice. Thanks!


title: Different layouts and specific key mapping for different keyboards

text: Here's the deal I have an apple aluminium usb keyboard connected to my laptop with "windows" keyboard. And almost everything works great on my apple keyboard except three annoying problems.   1. Each keyboard must have a different layout, can I specify a layout for each one automatically or do I need to change manually every time ?   2. On the apple keyboard the key with the ">" and "<" is switched the key with "\" and "|". I know that I can remap keys with **xmodmap** , but is it possible to remap only to the apple keyboard since the "windows" keyboard is perfectly fine?   3. This is connected with the second, if can change cmd with alt, but only for the apple keyboard I'm using linux mint 17 with mate **Edit** I've managed to fix the second problem from the list, it seems it's a known bug from ubuntu https://bugs.launchpad.net/ubuntu/+source/linux/+bug/214786 After reading the comments on launchpad and this page to fix that I had to this:   1. Append the configuration line to the file /etc/modprobe.d/hid_apple.conf creating it if necessary: echo options hid_apple iso_layout=0 | sudo tee -a /etc/modprobe.d/hid_apple.conf   2. Trigger copying the configuration into the initramfs bootfile. sudo update-initramfs -u -k all **Edit 2** So this is the info I get with `setxkbmap -print`               xkb_keymap {         xkb_keycodes  { include "evdev+aliases(qwerty)" };         xkb_types     { include "complete"  };         xkb_compat    { include "complete"  };         xkb_symbols   { include "pc+pt(mac)+pt:2+inet(evdev)"   };         xkb_geometry  { include "pc(pc105)" };     };      If I try to set the macintosh layout only to my apple keyboard with this command:               setxkbmap -device 11 -v pt -variant mac       This is the result I get:               xkb_keymap {         xkb_keycodes  { include "evdev+aliases(qwerty)" };         xkb_types     { include "complete"  };         xkb_compat    { include "complete"  };         xkb_symbols   { include "pc+pt(mac)+inet(evdev)"    };         xkb_geometry  { include "pc(pc105)" };     };      If you notice on the line **xkb_symbols** I have this: include "pc+pt(mac)+inet(evdev)" Instead of this:               include "pc+pt(mac)+pt:2+inet(evdev)"      If I find a way of adding the option `pt:2` I could create a bash script that would run on startup to set the layout for my apple keayboard solving my first issue from the list.


title: Install Drivers Offline Arch Linux

text: I have been attempting to install Arch Linux on my Macbook Pro but the wireless and ethernet drivers don't work. Because of this, I cannot access the internet on it. So whilst searching for a solution I downloaded these drivers: http://www.lwfinger.com/b43-firmware/broadcom-wl-5.100.138.tar.bz2 (I got the link for the drivers from this AUR repo: https://aur.archlinux.org/packages/b43-firmware/) The problem is though, is that I have absolutely no idea how to install the drivers from the command line during the install procedure. To make myself absolutely clear, I do not have an internet connection of any sort on said MacBook, nor do I have a working install. So because of this every solution must be able to be done from the installation media command line. NOTE: I have also noticed that during startup I get a brief message about wireless drivers not found but it goes by so fast I cannot properly read it.


title: Want to rsync some files after they've been sedded

text: I would like to rsync some HTML files to a webserver that are in production form. To get them in production form I have to trivially insert a ".production" string in a script tag. I can do this with this sed command:               sed 's/steal\.js/steal\.production\.js/g' */*.html      I know I can sed `-i` inplace and rysync those files then sed `-i` them back when I'm done, but I'd like to be able to do something like rsync standard out to a destination file on the remote machine. This way I wouldn't ever need to worry about corrupting my html files by canceling the script in mid transfer. Any recommendations on how to approach this?


title: OpenBSD SMP support

text: The OpenBSD 4.9 release announcement says > "SMP kernels can now boot on machines with up to 64 cores;"   > So OpenBSD does support several CPU's/cores? If i have a Core2Duo cpu in my laptop (t7100) then would it bring greater performance if I use "SMP" kernel? If this is true, then how can I install/use an SMP kernel under OpenBSD 4.9?


title: FreeBSD: Mixing packages and ports?

text: I would like to build the newest port of Firefox (version 4.0.1,1). I currently have the package version installed (3.6.13). How well does the packages/port system handle mixing ports and packages? Will the dependencies be handled correctly? For example: Firefox 4.0.1 requires nspr-4.8.7 whereas the packaged version is nspr-4.8.6. A whole slew of things (mostly from the gnome2-lite meta-package depend on nspr). If I install the newer version from ports will I completely wreck things? I guess this begs a larger question: Can I mix packages and ports? Or do I have to pick one and stay with it? If I do decide to build a mixed system, will it be stable? Will there be appropriate dependency checking and resolution?


title: Ubuntu : puppet f5 device config : Partition '' doesn't exist

text: This is a Puppet question that I've posted on the PuppetLabs forums with no response. I'm also posting here because I'm hoping that with a wider audience I might find someone knowledgeable re Puppet config of f5 devices. Here is my setup : puppet (v3.2.2) master + agent on single server (Ubuntu 12.04.2 LTS) with agent serving as f5_proxy `http://forge.puppetlabs.com/puppetlabs/f5` provides instructions on using the **puppetlabs-f5** module to install/config the **f5-icontrol** gem on a proxy agent **f5_proxy** responsible for remote configuration of an f5 hardware node. NOTE: in my case **f5_proxy** is co-located on the puppet server. I've located the **puppetlabs-f5** module at `/etc/puppet/modules/f5` and in `puppet.conf` I set `modulepath=/etc/puppet/modules/` In my nodes manifest `site.pp` I've included the section to install the **f5-icontrol** gem on my **f5_proxy** agent :               node.pp          node my_f5_proxy {       include f5            f5::config { "f5.test.mydomain.com":         username => 'admin',         password => 'admin',         url      => 'f5.test.mydomain.com',         target   => '/etc/puppet/device/f5.test.mydomain.com.conf'       }     }      And I've pointed my device.conf at the f5 :               device.conf          [f5.test.mydomain.com]     type f5     url https://admin:admin@f5.test.mydomain.com/      And I've revised my RUBYLIB system environment variable :               export RUBYLIB=/etc/puppet/modules/f5/lib:$RUBYLIB      But when I attempt `puppet device` , it throws an exception :               Error: Can't load f5 for http://f5.test.mydomain.com : Exception caught in Management::urn:iControl:Management/Partition::set_active_partition()     Exception: Common::OperationFailed             primary_error_code   : 16908289 (0x01020001)             secondary_error_code : 0             error_string         : Partition '' doesn't exist     /usr/lib/ruby/vendor_ruby/puppet/util/network_device.rb:10:in `init'     /usr/lib/ruby/vendor_ruby/puppet/application/device.rb:190:in `main'     /usr/lib/ruby/vendor_ruby/puppet/application/device.rb:176:in `each_value'     /usr/lib/ruby/vendor_ruby/puppet/application/device.rb:176:in `main'     /usr/lib/ruby/vendor_ruby/puppet/application.rb:372:in `run_command'     /usr/lib/ruby/vendor_ruby/puppet/application.rb:364:in `run'     /usr/lib/ruby/vendor_ruby/puppet/application.rb:456:in `plugin_hook'     /usr/lib/ruby/vendor_ruby/puppet/application.rb:364:in `run'     /usr/lib/ruby/vendor_ruby/puppet/util.rb:504:in `exit_on_fail'     /usr/lib/ruby/vendor_ruby/puppet/application.rb:364:in `run'     /usr/lib/ruby/vendor_ruby/puppet/util/command_line.rb:132:in `run'     /usr/lib/ruby/vendor_ruby/puppet/util/command_line.rb:86:in `execute'     /usr/bin/puppet:4      This is a strange error because my f5 is configured with only the default Common partition, and the f5 docs state that unless a named partition is explicitly stated Common is assumed by default.


title: w_scan: no data from PAT

text: I'm using w_scan to get channel list for my DVB-T stick. But despite channels being found, channels.conf file is empty. I suspect `Info: no data from PAT` has something to do with this. I know the DVB-T stick is working, because if I enter the frequency into VLC player, I can watch the first channel (SLO1). Terminal output:               [rok@rok-laptop ~]$ w_scan -c SI > channels.conf     w_scan version 20120605 (compiled for DVB API 5.6)     using settings for SLOVENIA          842000: (time: 03:54)      850000: (time: 03:59)      858000: (time: 04:03)      tune to: QAM_64   f = 562000 kHz I999B8C23D0T8G4Y0      (time: 04:06) Info: no data from PAT         service = SLO1 (RTV SLOVENIJA)         service = SLO2 (RTV SLOVENIJA)         service = SLO3 (RTV SLOVENIJA)         service = POP TV (PROPLUS)         service = KANAL A (PROPLUS)         service = GOLICA TV (GOLICA TV)         service = VAS KANAL (TV NOVO MESTO)         service = TV PINK 3 (AGENCIJA MEDIAS)         service = TV NAKUPI (DOMATES)     dumping lists (0 services)     Done.


title: how to setup: proxy with confirmation of rules for browsing internet

text: I'm trying to achieve something like acceptance of rules before user gets connected to the internet. For example: when users enters address http://google.com (or any other) first thing he will see is the page with short description of rules an big "Accept" and "Decline" button. When he clicks accept then the Google page appears and he can browse internet for that day, but when he clicks decline he will be redirected to internal page explaining rules. I think this could be achieved with squid but I don't know how. Any one can point me where or what to search...


title: How can I zoom/magnify Cinnamon desktop using the mouse wheel?

text: There is a wonderful feature of compiz that allows me to use a key+mouse wheel (I use `win`+wheel to zoom into the desktop. Is there a way to get the same effect in Cinnamon? UPDATE: Following Mikko Rantalainen's solution below, I checked gnome-shell- mousewheel-zoom out from git and added the included executable to my start up programs.


title: How do I opt out of recieving broadcast messages?

text: I am logged in to a university system and a very annoying n00b thinks he or she is some awesome hacker because she or he can broadcast an object dump to everyone using pipes. I bet they think it is funny because it looks like the matrix. I was just wondering if there is a quick and easy way to opt out of recieving these messages from this user. Also what would be the command for all users (sometimes I would not want to recieve a message when I am in the depths of a difficult problem).


title: How an application is chosen over others to open a particular filetype in Linux

text: Earlier my `text/xml` files were by default opened by `firefox` I think. Not sure of this because I do not remember exactly. Then I think I installed `geany` and then my `text/xml` files were always by default opened by Geany until I installed `google-chrome`. Now I see they are by default opened by `google-chrome`. Until now I did not bother to check what are the default applications associated with a particular filetype. Now when I check my `/usr/share/applications/defaults.list` file I see this:               text/html=firefox.desktop;google-chrome.desktop     text/xml=google-chrome.desktop;     application/xhtml_xml=google-chrome.desktop;      My default browser is still set to `firefox`. The first line above shows both Firefox and Chrome for `text/html` but for `text/xml` it is only Chrome. I think earlier it was Geany for `text/xml` because that's the reason by default Geany used to open XML files. I'm not sure on this because I've never checked. ### Questions   * I'm wondering how it is set. How a particular application is chosen over another.   * Also how the semicolon (`";"`) is read in the file. I'm using Fedora 20 - Mate desktop environment. ### Query based on Answer by _slm_ Based on the Answer by @slm, I see my xml filetypes are associated with Geany. But I see them opening with Chrome instead.               $ xdg-mime query default application/xml     geany.desktop     $       As I mentioned above my `/usr/share/applications/defaults.list` file shows               text/xml=google-chrome.desktop;      So what is the difference and which should override?


title: Can't install WP plugin with wp-user:www-data 775 permissions

text: Setup is on Ubuntu 14.04. Apache2 running under `www-data` Wordpress was installed with `wp-user:wp-user` directory ownership. I added `wp-user` to the `www-data` group and change group ownership of the Wordpress directory to `www-data`. I enabled `rwx` for both group and user (`775`) I could not get any plugins installed and as I messed around with the `g+x` `g+w` `g+s` flags, I got error messages ranging from `could not create directory` to `could not copy file`—clearly a permissions issue. I tried changing the owner to `www-data:www-data` and that seemed to solve the problem (also `chmod 777` worked). But I don't understand why `775 wp-user:www-data` would not work? [Edit: Changed ownership back to wp-user:www-data with permission 775, and plugins seem to install fine now]


title: No output using parallel in tandem with ag or ack

text: I have a list of java reserved words, first letter capitalised.               $ tail -n5 ~/reservedjava.txt     Break     While     True     False     Null      I'm trying to look through all my java source code to find methods that look like `getWhile()`.               cat ~/reservedjava.txt | parallel 'ag "get{}\(\)$"'      This shows me nothing. Now, I know that I have a method `getBreak()`:               $ ag "getBreak\(\)$"     src/main/java/Foo.java     154:  public Break getBreak()      Here's what a dry run looks like:               $ cat ~/reservedjava.txt | parallel --dry-run 'ag "get{}\(\)$"' | tail -n5     ag "getBreak\(\)$"     ag "getWhile\(\)$"     ag "getTrue\(\)$"     ag "getFalse\(\)$"     ag "getNull\(\)$"      I'm using gnu parallel (v. 20130722) and the silver searcher (ag) (v. 0.18.1). If it makes a difference, I'm on Fedora 19, but have compiled these utilities myself. I get the same result with ack (v. 2.12).


title: What is the correct approach to reduce the size of the rootfs.cpio?

text: I use               cpio -idv <rootfs      to extract what all is inside my rootfs.cpio file. Following are the contents of a defualt rootfs.cpio that I get after compiling petalinux:               [root@xilinx ourput]# ls -ld *     drwxr-xr-x.  2 root root 4096 Apr 14 14:12 bin     drwxr-xr-x.  2 root root 4096 Apr 14 14:12 boot     drwxr-xr-x.  3 root root 4096 Apr 14 14:12 dev     drwxr-xr-x. 15 root root 4096 Apr 14 14:12 etc     drwxr-xr-x.  3 root root 4096 Apr 14 14:12 home     lrwxrwxrwx.  1 root root    9 Apr 14 14:12 init -> sbin/init     drwxr-xr-x.  3 root root 4096 Apr 14 14:12 lib     drwxr-xr-x. 10 root root 4096 Apr 14 14:12 media     drwxr-xr-x.  2 root root 4096 Apr 14 14:12 mnt     drwxr-xr-x.  2 root root 4096 Apr 14 14:12 proc     drwxr-xr-x.  2 root root 4096 Apr 14 14:12 sbin     drwxr-xr-x.  2 root root 4096 Apr 14 14:12 sys     lrwxrwxrwx.  1 root root    8 Apr 14 14:12 tmp -> /var/tmp     drwxr-xr-x.  9 root root 4096 Apr 14 14:12 usr     drwxr-xr-x.  8 root root 4096 Apr 14 14:12 var      also the following is the size of each folder:               [root@xilinx ourput]# du -sb *     680661  bin     4096    boot     8192    dev     160521  etc     8192    home     9       init     2572159 lib     36864   media     4136    mnt     4096    proc     730887  sbin     4096    sys     8       tmp     518578  usr     176548  var      The total size of the filesystem is around 6.9 MB which is too much for my system. I just need a `login prompt` in my application and nothing else, so why shoiud l I have so much of unnecessary stufs. What should be my approach to remove packages I dont need, and reatin only login application. I saw in sbin there is a binary tinylogin, so would liek to keep it.But I think cannot blindly remove other files. So what is the correct approach to reduce the size of the rootfs.cpio **Update** I woulkd like to tell that I have got a file named `tinylogin`, in sbin filder which provides login that I will need. But I have no idea what to do next!


title: Why won't ntpd synchronize?

text: I'm transferring from one server to another. Identical configuration, newer hardware, same data center. The new machine CAN speak NTP:               $ sudo ntpdate -d ntp.jentfoo.com     Password:     24 Aug 14:50:59 ntpdate[10935]: ntpdate 4.2.6p5@1.2349-o Sun Aug 24 17:40:33 UTC 2014 (1)     Looking for host ntp.jentfoo.com and service ntp     host found : stripes.jentfoo.com     transmit(173.203.211.73)     receive(173.203.211.73)     transmit(173.203.211.73)     receive(173.203.211.73)     transmit(173.203.211.73)     receive(173.203.211.73)     transmit(173.203.211.73)     receive(173.203.211.73)     server 173.203.211.73, port 123     stratum 2, precision -20, leap 00, trust 000     refid [173.203.211.73], delay 0.04141, dispersion 0.00014     transmitted 4, in filter 4     reference time:    d7a4aec6.c2942e94  Sun, Aug 24 2014 14:34:46.760     originate timestamp: d7a4b299.ef951806  Sun, Aug 24 2014 14:51:05.935     transmit timestamp:  d7a4b29a.0400cdfd  Sun, Aug 24 2014 14:51:06.015     filter delay:  0.04141  0.04160  0.04147  0.04152              0.00000  0.00000  0.00000  0.00000     filter offset: -0.08754 -0.08769 -0.08770 -0.08774              0.000000 0.000000 0.000000 0.000000     delay 0.04141, dispersion 0.00014     offset -0.087543     24 Aug 14:51:06 ntpdate[10935]: adjust time server 173.203.211.73 offset -0.087543 sec      So there's no firewall issue. But no matter how long I leave it running, the ntpd server never synchronizes with its peers:               $ ntpq 127.0.0.1     ntpq> pe          remote           refid      st t when poll reach   delay   offset  jitter     ==============================================================================      andromeda.cs.pu .INIT.          16 -    - 1024    0    0.000    0.000   0.000      ns.nts.umn.edu  .INIT.          16 -    - 1024    0    0.000    0.000   0.000      stan.greyware.c .INIT.          16 -    - 1024    0    0.000    0.000   0.000      stripes.jentfoo .INIT.          16 -    - 1024    0    0.000    0.000   0.000     ntpq> as          ind assid status  conf reach auth condition  last_event cnt     ===========================================================       1 18223  8011   yes    no  none    reject    mobilize  1       2 18224  8011   yes    no  none    reject    mobilize  1       3 18225  8011   yes    no  none    reject    mobilize  1       4 18226  8011   yes    no  none    reject    mobilize  1     ntpq> rv     associd=0 status=c012 leap_alarm, sync_unspec, 1 event, freq_set,     version="ntpd 4.2.6p5@1.2349-o Sun Aug 24 17:40:33 UTC 2014 (1)",     processor="x86_64", system="Linux/3.15.5-hardened-r2", leap=11,     stratum=16, precision=-23, rootdelay=0.000, rootdisp=355.605, refid=INIT,     reftime=00000000.00000000  Sun, Dec 31 1899 19:00:00.000,     clock=d7a510c6.0be8b4ee  Sun, Aug 24 2014 21:32:54.046, peer=0, tc=3,     mintc=4, offset=0.000, frequency=0.000, sys_jitter=0.000,     clk_jitter=0.000, clk_wander=0.000     ntpq> rv 18226     associd=18226 status=8011 conf, sel_reject, 1 event, mobilize,     srcadr=stripes.jentfoo.com, srcport=123, dstadr=0.0.0.0, dstport=0,     leap=11, stratum=16, precision=-23, rootdelay=0.000, rootdisp=0.000,     refid=INIT, reftime=00000000.00000000  Sun, Dec 31 1899 19:00:00.000,     rec=00000000.00000000  Sun, Dec 31 1899 19:00:00.000, reach=000,     unreach=34, hmode=3, pmode=0, hpoll=10, ppoll=10, headway=0,     flash=1600 peer_stratum, peer_dist, peer_unreach, keyid=0, offset=0.000,     delay=0.000, dispersion=15937.500, jitter=0.000,     filtdelay=     0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00,     filtoffset=    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00,     filtdisp=   16000.0 16000.0 16000.0 16000.0 16000.0 16000.0 16000.0 16000.0      And I can't figure out why. The old server is using the exact same configuration, and it works fine. I don't know what to do. Update: ntpd has been running overnight and:               2014-08-24 14:57:46.244875500 Starting ntpd ...     2014-08-24 14:57:46.246304500 Finished Parsing!!     ... normal startup status ...     2014-08-25 01:24:53.871674500 receive: at 975 0.0.0.0<-212.1.209.194 mode 3 len 48     2014-08-25 01:24:53.871699500 transmit: at 975 0.0.0.0->212.1.209.194 mode 4 len 48     2014-08-25 01:24:53.871700500 receive: at 1117 0.0.0.0<-212.1.209.194 mode 3 len 48     2014-08-25 01:24:53.871700500 transmit: at 1117 0.0.0.0->212.1.209.194 mode 4 len 48     2014-08-25 01:24:53.871700500 receive: at 1300 0.0.0.0<-198.23.230.118 mode 3 len 48     2014-08-25 01:24:53.871701500 transmit: at 1300 0.0.0.0->198.23.230.118 mode 4 len 48     2014-08-25 01:24:53.871701500 receive: at 2115 0.0.0.0<-66.172.12.144 mode 3 len 48     2014-08-25 01:24:53.871725500 transmit: at 2115 0.0.0.0->66.172.12.144 mode 4 len 48     2014-08-25 01:24:53.871725500 auth_agekeys: at 4096 keys 1 expired 0     2014-08-25 01:24:53.871725500 auth_agekeys: at 8192 keys 1 expired 0     2014-08-25 01:24:53.871726500 auth_agekeys: at 12288 keys 1 expired 0     ...  more of the same ...      It does appear to be transmitting/recieving. All the `ntpq` output is identical except `rv 18226` answers `unreach=69` now.


title: What and how is the encoding of a raw (headerless) audio file?

text: I have done this:               me@riverbrain:~/sgf$ echo "test" | text2wave -otype raw -F 16000 >> test.raw      which produced a headerless audio file. The wonderful thing about this file is that it can be concatenated (using `cat`, like text) with another raw audio file. Of course, I've got a problem. The problem is that I can't play it yet.               me@riverbrain:~/sgf$ play test.raw           play FAIL formats: bad input format for file `test.raw': sampling rate was not specified      and also, when specifying sample rate               me@riverbrain:~/sgf$ play -r 16000 test.raw      play FAIL formats: bad input format for file `test.raw': data encoding was not specified      When I looked up some information 'encoding' I got the feeling that it had a lot to do with your processor architecture, but maybe I'm wrong. Anyway, I can't find any documentation about how to 'ask' the computer what the data encoding of the raw audio file is. And I also I know what the sample rate is, due to setting it myself, but that's as far as I'm able to get.


title: Can't terminate PHP daemon process

text: I've started a PHP daemon process via SSH with               php ./my-script.php --daemon      Now I want to quit this process, but I can't. It's still active in the foreground of my shell and I've hit `CTRL + C` multiple times, but to no avail.


title: Correlation between CHROOT and Crouton - -

text: I am trying to understand what purpose/function of CHROOT and how using it with Crouton will allow you to use certain Linux distros and libs. Does CHROOT essentially create some kind of a "pseudo-symlink" between the actual root directory and [specified path]? P.S. If someone could explain this to me like I am "a 3rd grader". I would appreciate it


title: How to get a device details only using awk commands

text: Friends, I have `fdisk -l` output in one file called `test1.txt`. Now I want to get the device name only using `awk`. How to get a device name? I want output like this:               /dev/sda1     /dev/sda2     /dev/sda3     /dev/sdb1     /dev/sdc1