title: How to generate a lot of (blank) images files?

text: For a test, I need to quickly create 1700 jpg-images (even blank) in a defined size 1000x706. I wonder if we could do this with a shell script or a program (like ImageMagick). I wish they called `img_0.jpg`, `img_1.jpg`… Someone knows a simple solution?


title: DIY: how to make double-layer install DVD?

text: Facts:   * online repo (official) is more than 20GB -- I have access to it   * downloadable DVD is for single layer disks -- I have access to it   * boxed openSUSE DVD is double layer -- I do **NOT** have access to it Is it possible and if yes -- how -- to make this double-layer DVD on your own? Legally of course.


title: Fedora location of /usr/share/v86d/initramfs

text: I compiled and installed v86d, yet I can only locate one binary file in /sbin. There is supposed to be the initramfs file in /usr/share/v86d, but this directory does not exist. I don't think that the location of this file should vary between distros, but I am using fedora 15 and it isn't there. Notes: Compiled with klibc against a custom kernel tree I can't think of anything else.


title: What's the difference between STDIN and arguments passed to command?

text: I could use the either form to execute the `cat` method:               cat file_name     cat < file_name      The result is the same Then I want to execute `man` in the format of STDIN               man < file_name      For the `file_name` contains:               # file_name     cat      But it pops up `What manual page do you want?` instead of execute `man cat`. I want to know the why `cat` could accept STDIN as arguments but `man` cannot. And what's the difference between command line arguments and stdin?


title: Change the red border between windows in xmonad

text: Is it possible to set somewhere in configuration the color of the border between windows from red to black or remove the border completely?


title: Tips for putting ~ under source control

text: I want to put my home directory (~) under source control (git, in this case), as I have many setting files (.gitconfig, .gitignore, .emacs, etc.) in there I would like to carry across machines, and having them in git would make it nice for retrieving them. My main machine is my MacBook, and the way that OS X is set up, there are many folders i want to ignore (Documents, Downloads, .ssh). There are also folders which are already using git (.emacs.d). My thought was to just add all these directories to my .gitignore file, but that seems kind of tiresome, and could potentially lead to some unforeseen consequences. My next thought was to periodically copy the files I want to store into some folder in home, then commit that folder. The problem with that will be that I have to remember to move them before committing. Is there a clean way to do this?


title: iptables does not list rules i have created

text: I'm using this guide to set-up a shared internet connection between two PC's. At **step 8** it says I should run the commands:               iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE     /etc/rc.d/iptables save     /etc/rc.d/iptables start      Doing this seems to have no effect on iptable's **rules** , if I run `iptables -nvL` my output is:               Chain INPUT (policy ACCEPT 2223 packets, 2330K bytes)      pkts bytes target     prot opt in     out     source         destination          Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)       pkts bytes target     prot opt in     out     source        destination          Chain OUTPUT (policy ACCEPT 2272 packets, 277K bytes)       pkts bytes target     prot opt in     out     source        destination      Is that correct or am I doing something wrong?


title: using find in Bash Script and checking if file is present

text: var= "$(find . -name 'gen*.bt2')"                 if [ "$var" == "" ]         then              echo bad         else              echo great        fi      I get errors **./script.sh: line 4:** ./gen.4.bt2 ./gen.rev.1.bt2 ./gen.rev.2.bt2 ./gen.1.bt2 ./gen.3.bt2 ./gen.2.bt2: **No such file or directory** great However, when I run the same code in terminal, files are listed perfectly, without any error. Can someone correct me, where am I going wrong? I need to check, if certain files are present or not, if present then proceed.


title: How to convert multiple XCF files to PNG?

text: I have a folder with a lot of `xcf` files which I want all to be converted to `png` files, at best via a one-liner from bash. How can I achieve such a task?


title: Why there are multiple shells in a Unix like system?

text: I have just started learning the fundamentals of Unix and wondering why there are so many shells in a unix like system . From the book Advanced programing in Unix Environment: > A shell is a command-line interpreter that reads user input and executes > commands.The user input to a shell is normally from the terminal (an > interactive shell) or sometimes from a ﬁle (called a shell script). And then the book goes on to list a number of shell programs like Bourne shell,Bourne-again shell,Cshell, etc . My question is basically why do we need multiple shells ?


title: How to stop mail with PHP error messages to root?

text: Today, my Centos has a problem. When I type `df -h` in `SSH` I get:               /dev/vzfs  61G  61G   0.3G  99% /      The disk is full. I found that `/var/spool/mail/root` is nearly `53GB`. `tail /var/spool/mail/root -n 50 | more`, I find there are full of `php errors`. Now I use `cat /dev/null > /var/spool/mail/root` to clean the `error logs`, the hard disk is normal:               /dev/vzfs  61G  7.3G   53G  13% /      But how can I stop `sendmail` sent php error message? I do not want them stored there (I have set php error in `/var/log/httpd.log`).


> **Possible Duplicate:**   >  Why does this compound command report errors when copying directories? if one executes the following two commands in one line, as follows, > rm -rf dir ; cp -r dir2 dir it may complain that cp can not create directory `dir/subdir`: File exists but if these two commands are executed in two lines, no errors will be thrown. I am just wandering what is the difference? and more importantly, how to execute two commands in one line, with the effect exactly the same as by two lines... PS: what is in `dir` or `dir2` is hugh, typically 4gb


title: Bash: passing braces as arguments to bash function

text: I love using the following pattern for searching in files:               grep --color=auto -iRnHr --include={*.js,*.html,} --exclude-dir={release,dev,} "span" .      I'd like, however, to have this one wrapped into a bash comand like this:               findinfiles {*.js,*.html,} {release,dev,} "span"  // syntax is just a guessing      I cannot solve the problem of passing this kind of braces into a bash function and using them with `$1`, `$2` and so on. When I use the following:               function findinfiles() {         echo $1, $2, $3     }      Then:               me@pc ~> findinfiles {*.js,*.html,} {release,dev,} "span"     *.js, *.html, release      Ofc, passing arguments to grep won't work this way. It seems that arguments are indexed but not properly grouped. Can anyone teach me how to deal with this kind of arguments?


title: proxy settings ignored by apt-get manager in Ubuntu 13.04

text: I am using Ubuntu 13.04 in company network, http proxy works fine with my user account but still I cannot install or update anything with apt-get : Proxy Authentication Required ( Forefront TMG requires authorization to fulfill the request. Access to the Web Proxy filter is denied. ) I have system-wide proxy in System configuration > Network > Network Proxy > manual configured properly and : env | grep proxy shows both http_proxy, https_proxy variables with proper settings. but still apt-get still fails to connect. What to try next ?


title: How to install kdesudo in OpenSUSE 12.3

text: I'm hoping this is a stupid question with a simple answer, but I've been hunting around for half an hour and cannot find a way to install kdesudo in OpenSUSE 12.3. I need to use kdesudo because kdesu (which is pre-installed in OpenSUSE 12.3) is a basic tool which does not obey the sudoers configuration. I'm happy to build from source if it comes to it, but I can't work out where the authentic source can be safely downloaded for kdesudo.


title: Reload ~/.profile for desktop

text: > **Possible Duplicate:**   >  how do i tell gnome to reread my ~/.profile   >  How to change environment variables without re-logging to UI? I'm trying to reload my ~/.profile without login out. I can use `source` to reload it in bash for example, but I haven't found out how to reload it for the whole desktop. When I launch applications from menus, they aren't aware of the changes in ~/.profile. Those changes are exclusively `export` commands. How can I reload it for the whole desktop?


title: how do i tell gnome to reread my ~/.profile

text: Gnome reads `~/.profile` upon login. When I change something in `.profile` (for example `LC_MESSAGES`) I want gnome to reread the `.profile` file without logging out and back in. In bash I can tell bash to source `.profile`. How can I do that for the running gnome session?


title: How can I change the keyboard layout before I log in?

text: In order to switch to a new keyboard layout I have added an `setxkbmap` command to my Openbox's `autostart.sh`. However, this only takes effect once I log in (when Openbox starts). _While_ logging in, in GDM (I suppose), the layout I chose when installing the system is still active - which is distracting in my efforts. What do I have to do to have this default layout changed? (OS: Debian 7.1)


title: VIM only files, cd only directories

text: When using `Tab` for completion on the Bash shell prompt, is there any way to configure it to complete only files for the command `vim` and only directories for the command `cd`? In large directories with many files and subdirectories, the should reduce by half the amount of corrections to be done while completing. Note that moving to a different shell is impractical, but I would still be interested in hearing non-Bash solutions if no Bash solution exists.


title: Fixing a broken X initialization

text: ### Here are the symptoms: On reboot of my Fedora 14 system, I get to the Fedora loading screen progress bar. The system seems to progress normally, then the nvidia logo flashes, a wait cursor shows, then it kicks back to Fedora loading bar. This flashes across the screen about 4 or 5 more times before kicking me back to the completed fedora progress bar. At this point it does NOT start the GUI. ### What I can do: I can `ctrl`+`alt`+`F2` (or `F3` to `F6`) to get to a login shell. In the login shell I can run the `startx` command and I get to my GUI, but with limited functionality (I.e. my network devices are not initialized) ### What I think I broke: I had mistakenly deleted the `/tmp/.X0-lock` file on experiencing some other odd behavior with my X server (odd behavior = starting a gnome gui program and receiving an error I cant recall now about the X server not being valid and the program never starting) ### Question This is now occurring on every reboot. How can I troubleshoot the X initialization and fix it so that the Fedora GUI starts auto-magically as it did before?


title: What makes a distribution GNU and are there Linux distributions, that are not GNU?

text: So GNU/Linux is an operation system, consisting of several programs at a minimum: Linux kenel, gcc, gnu-binutils, Gnome desktop, etc.   * _What makes a Linux distribution GNU? Is it the tools, with which the kernel was compiled? Is it the tools, with which the distribution is shipped?_   * _Do there exist fully functional, desktop operating systems, that are Linux based but not GNU?_


title: Extracting help message from script itself

text: I want that my help message be extracted from the script itself.               #!/bin/bash     #     # foo - do things     # Author: John Doe <jhon@doe>     # ----------------------------------------------     # SYNOPSIS     #   foo [OPTIONS] FILE     #      # DESCRIPTION     #   At vero eos et accusamus et iusto odio     #   dignissimos ducimus qui blanditiis praesenti     #   voluptatum deleniti atque corrupti quos.     # ----------------------------------------------          sed -n '/# -\+$/,/# -\+$/ p' $0      It works! It prints only what is between the two `# -\\+$` delimiters, inclusive. The problem is that I don't want print the delimiters. And do you have suggestions for a man page generator with human friendly syntax? **Update:** Maybe stated my problem poorly. I want to print only what is between the two lines starting with `# -----` and ending with `\----`. I know this solution:               sed -n '/# -\+$/,/# -\+$/ p' $0 | head -n -1 | tail -n +2      But I want a clean and elegant solution that doesn't look hackish.


title: How do I specify the keyserver with GPG?

text: Tutorials online say to use the option `\--keyserver`, like this:               gpg --send-keys <keyID> --keyserver 'hkp://keyserver.ubuntu.com:11371'      but `gpg` doesn't recognise the option `\--keyserver`. What am I doing wrong?


title: Recursively compare two directories with diff -r without output on broken links

text: I am using `diff -r a b` to recursively compare directories **a** and **b**. It often happens though that there are some broken links (the same broken links in both **a** and **b** directories and to the same, non-existing targets). **diff** then outputs error messages for those cases and exists with a non- zero exit code though I would like it to stay silent and exit with 0 as the directories are the same in my book. How can I do that?


title: Smallest linux distribution for PPTP VPN server (poptop)?

text: I want to run Poptop, an Open Source PPTP Server for Linux. I need the smallest possible GNU/Linux distribution which I can install in VMware Workstation 8 and which will be able to support this software. Which Linux distribution should I choose/download? A GUI would also be nice because I'm the regular windows- user/programmer/whatever I can call myself. (but is not required, I am comfortable with command lines) I would also be very thankful if someone could post step-by-step installation and configuration instructions for this specific setup.


title: Installing Linux on a SATA partition, with Windows installed on SSD

text: My computer has a SSD drive along with a HDD drive. I've installed Windows on the SSD drive (Intel) already and I would like to install Linux Mint on a partition created on the HDD hard drive. So I partitioned the HDD like so:   * linux-swap   * EXT4    * FAT32 partition.  I installed Mint on the EXT4 partition, and when I restarted the computer, there is no GRUB! It starts Windows automatically without asking to choose the OS. I'm assuming I have to do something with GRUB. Or no? I really don't want to mess up my Windows installation and start over. How do I fix this? ### UPDATE: my motherboard has a shortcut key `F8` which if pressed during bootup, allows me to pick which hard drive to boot from and I've gotten to prefer this method over GRUB. This way I can install different OS's on separate hard drives without messing up my other installations (Thanks to cheap hard disk though!)


title: TCP dies on a Linux laptop

text: Once in several days I have the following problem. My laptop (Debian testing) suddenly becomes unable to work with TCP connections to the internet. The following things continue working fine:   * UDP (DNS), ICMP (ping) — I get instant response   * TCP connections to other machines in the local network (e.g. I can ssh to a neighbour laptop)   * everything is ok for other machines in my LAN But when I try TCP connections from my laptop, they time out (no response to SYN packets). Here's a typical curl output:               % curl -v google.com          * About to connect() to google.com port 80 (#0)     *   Trying 173.194.39.105...     * Connection timed out     *   Trying 173.194.39.110...     * Connection timed out     *   Trying 173.194.39.97...     * Connection timed out     *   Trying 173.194.39.102...     * Timeout     *   Trying 173.194.39.98...     * Timeout     *   Trying 173.194.39.96...     * Timeout     *   Trying 173.194.39.103...     * Timeout     *   Trying 173.194.39.99...     * Timeout     *   Trying 173.194.39.101...     * Timeout     *   Trying 173.194.39.104...     * Timeout     *   Trying 173.194.39.100...     * Timeout     *   Trying 2a00:1450:400d:803::1009...     * Failed to connect to 2a00:1450:400d:803::1009: Network is unreachable     * Success     * couldn't connect to host     * Closing connection #0     curl: (7) Failed to connect to 2a00:1450:400d:803::1009: Network is unreachable      Restarting the connection and/or reloading the network card kernel module doesn't help. The only thing that helps is reboot. Clearly something is wrong with my system (everything else works fine), but I have no idea what exactly. My setup is a wireless router that is connected to the ISP via PPPoE. Any advice? # Answers to comments ## What NIC is it?               12:00.0 Network controller: Broadcom Corporation BCM4313 802.11b/g/n Wireless LAN Controller (rev 01)       Subsystem: Dell Inspiron M5010 / XPS 8300       Flags: bus master, fast devsel, latency 0, IRQ 17       Memory at fbb00000 (64-bit, non-prefetchable) [size=16K]       Capabilities: [40] Power Management version 3       Capabilities: [58] Vendor Specific Information: Len=78 <?>       Capabilities: [48] MSI: Enable- Count=1/1 Maskable- 64bit+       Capabilities: [d0] Express Endpoint, MSI 00       Capabilities: [100] Advanced Error Reporting       Capabilities: [13c] Virtual Channel       Capabilities: [160] Device Serial Number 00-00-9d-ff-ff-aa-1c-65       Capabilities: [16c] Power Budgeting <?>       Kernel driver in use: brcmsmac      ## What is the state of your NIC when the problem occurs? `iptables-save` prints nothing. `ip rule show`:               0:  from all lookup local      32766:  from all lookup main      32767:  from all lookup default       `ip route show table all`:               default via 192.168.1.1 dev wlan0      192.168.1.0/24 dev wlan0  proto kernel  scope link  src 192.168.1.105      broadcast 127.0.0.0 dev lo  table local  proto kernel  scope link  src 127.0.0.1      local 127.0.0.0/8 dev lo  table local  proto kernel  scope host  src 127.0.0.1      local 127.0.0.1 dev lo  table local  proto kernel  scope host  src 127.0.0.1      broadcast 127.255.255.255 dev lo  table local  proto kernel  scope link  src 127.0.0.1      broadcast 192.168.1.0 dev wlan0  table local  proto kernel  scope link  src 192.168.1.105      local 192.168.1.105 dev wlan0  table local  proto kernel  scope host  src 192.168.1.105      broadcast 192.168.1.255 dev wlan0  table local  proto kernel  scope link  src 192.168.1.105      fe80::/64 dev wlan0  proto kernel  metric 256      unreachable default dev lo  table unspec  proto kernel  metric 4294967295  error -101 hoplimit 255     local ::1 via :: dev lo  table local  proto none  metric 0      local fe80::1e65:9dff:feaa:b1f1 via :: dev lo  table local  proto none  metric 0      ff00::/8 dev wlan0  table local  metric 256      unreachable default dev lo  table unspec  proto kernel  metric 4294967295  error -101 hoplimit 255      All of the above is the same when the machine works in normal mode. `ifconfig` — I ran it, but somehow forgot to save before rebooting. Will have to wait till the next time the problem occurs. Sorry about that. ## Any QoS in place? Probably not — at least I haven't done anything specifically to enable it. ## Have you tried sniffing the traffic actually sent on the interface? I ran curl and tcpdump several times, and there were two patterns. The first is just SYN packets without answers.               17:14:37.836917 IP (tos 0x0, ttl 64, id 4563, offset 0, flags [DF], proto TCP (6), length 60)         192.168.1.105.42030 > fra07s07-in-f102.1e100.net.http: Flags [S], cksum 0x27fc (incorrect -> 0xbea8), seq 3764607647, win 13600, options [mss 1360,sackOK,TS val 33770316 ecr 0,nop,wscale 4], length 0     17:14:38.836650 IP (tos 0x0, ttl 64, id 4564, offset 0, flags [DF], proto TCP (6), length 60)         192.168.1.105.42030 > fra07s07-in-f102.1e100.net.http: Flags [S], cksum 0x27fc (incorrect -> 0xbdae), seq 3764607647, win 13600, options [mss 1360,sackOK,TS val 33770566 ecr 0,nop,wscale 4], length 0     17:14:40.840649 IP (tos 0x0, ttl 64, id 4565, offset 0, flags [DF], proto TCP (6), length 60)         192.168.1.105.42030 > fra07s07-in-f102.1e100.net.http: Flags [S], cksum 0x27fc (incorrect -> 0xbbb9), seq 3764607647, win 13600, options [mss 1360,sackOK,TS val 33771067 ecr 0,nop,wscale 4], length 0      The second is this:               17:22:56.507827 IP (tos 0x0, ttl 64, id 41583, offset 0, flags [DF], proto TCP (6), length 60)         192.168.1.105.42036 > fra07s07-in-f102.1e100.net.http: Flags [S], cksum 0x27fc (incorrect -> 0x2244), seq 1564709704, win 13600, options [mss 1360,sackOK,TS val 33894944 ecr 0,nop,wscale 4], length 0     17:22:56.546763 IP (tos 0x58, ttl 54, id 65442, offset 0, flags [none], proto TCP (6), length 60)         fra07s07-in-f102.1e100.net.http > 192.168.1.105.42036: Flags [S.], cksum 0x6b1e (correct), seq 1407776542, ack 1564709705, win 14180, options [mss 1430,sackOK,TS val 3721836586 ecr 33883552,nop,wscale 6], length 0     17:22:56.546799 IP (tos 0x58, ttl 64, id 0, offset 0, flags [DF], proto TCP (6), length 40)         192.168.1.105.42036 > fra07s07-in-f102.1e100.net.http: Flags [R], cksum 0xf301 (correct), seq 1564709705, win 0, length 0     17:22:58.511843 IP (tos 0x0, ttl 64, id 41584, offset 0, flags [DF], proto TCP (6), length 60)         192.168.1.105.42036 > fra07s07-in-f102.1e100.net.http: Flags [S], cksum 0x27fc (incorrect -> 0x204f), seq 1564709704, win 13600, options [mss 1360,sackOK,TS val 33895445 ecr 0,nop,wscale 4], length 0     17:22:58.555423 IP (tos 0x58, ttl 54, id 65443, offset 0, flags [none], proto TCP (6), length 60)         fra07s07-in-f102.1e100.net.http > 192.168.1.105.42036: Flags [S.], cksum 0x3b03 (correct), seq 1439178112, ack 1564709705, win 14180, options [mss 1430,sackOK,TS val 3721838596 ecr 33883552,nop,wscale 6], length 0     17:22:58.555458 IP (tos 0x58, ttl 64, id 0, offset 0, flags [DF], proto TCP (6), length 40)         192.168.1.105.42036 > fra07s07-in-f102.1e100.net.http: Flags [R], cksum 0xf301 (correct), seq 1564709705, win 0, length 0      ## ethtool output `ethtool -k wlan0`:               Features for wlan0:     rx-checksumming: off [fixed]     tx-checksumming: off       tx-checksum-ipv4: off [fixed]       tx-checksum-unneeded: off [fixed]       tx-checksum-ip-generic: off [fixed]       tx-checksum-ipv6: off [fixed]       tx-checksum-fcoe-crc: off [fixed]       tx-checksum-sctp: off [fixed]     scatter-gather: off       tx-scatter-gather: off [fixed]       tx-scatter-gather-fraglist: off [fixed]     tcp-segmentation-offload: off       tx-tcp-segmentation: off [fixed]       tx-tcp-ecn-segmentation: off [fixed]       tx-tcp6-segmentation: off [fixed]     udp-fragmentation-offload: off [fixed]     generic-segmentation-offload: off [requested on]     generic-receive-offload: on     large-receive-offload: off [fixed]     rx-vlan-offload: off [fixed]     tx-vlan-offload: off [fixed]     ntuple-filters: off [fixed]     receive-hashing: off [fixed]     highdma: off [fixed]     rx-vlan-filter: off [fixed]     vlan-challenged: off [fixed]     tx-lockless: off [fixed]     netns-local: on [fixed]     tx-gso-robust: off [fixed]     tx-fcoe-segmentation: off [fixed]     fcoe-mtu: off [fixed]     tx-nocache-copy: off     loopback: off [fixed]      ## iptables               # namei -l "$(command -v iptables)"     f: /sbin/iptables     drwxr-xr-x root root /     drwxr-xr-x root root sbin     lrwxrwxrwx root root iptables -> xtables-multi     -rwxr-xr-x root root   xtables-multi          # dpkg -S "$(command -v iptables)"     iptables: /sbin/iptables          # iptables -nvL     Chain INPUT (policy ACCEPT 0 packets, 0 bytes)      pkts bytes target     prot opt in     out     source               destination                   Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)      pkts bytes target     prot opt in     out     source               destination                   Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)      pkts bytes target     prot opt in     out     source               destination              # iptables -t mangle -nvL     Chain PREROUTING (policy ACCEPT 0 packets, 0 bytes)      pkts bytes target     prot opt in     out     source               destination                   Chain INPUT (policy ACCEPT 0 packets, 0 bytes)      pkts bytes target     prot opt in     out     source               destination                   Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)      pkts bytes target     prot opt in     out     source               destination                   Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)      pkts bytes target     prot opt in     out     source               destination                   Chain POSTROUTING (policy ACCEPT 0 packets, 0 bytes)      pkts bytes target     prot opt in     out     source               destination              # iptables -t nat -nvL     Chain PREROUTING (policy ACCEPT 0 packets, 0 bytes)      pkts bytes target     prot opt in     out     source               destination                   Chain INPUT (policy ACCEPT 0 packets, 0 bytes)      pkts bytes target     prot opt in     out     source               destination                   Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)      pkts bytes target     prot opt in     out     source               destination                   Chain POSTROUTING (policy ACCEPT 0 packets, 0 bytes)      pkts bytes target     prot opt in     out     source               destination              # iptables -t security -nvL     Chain INPUT (policy ACCEPT 0 packets, 0 bytes)      pkts bytes target     prot opt in     out     source               destination                   Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)      pkts bytes target     prot opt in     out     source               destination                   Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)      pkts bytes target     prot opt in     out     source               destination               ## module info               # ethtool -i wlan0                        driver: brcmsmac     version: 3.2.0-3-686-pae     firmware-version: N/A     bus-info: 0000:12:00.0     supports-statistics: no     supports-test: no     supports-eeprom-access: no     supports-register-dump: no     supports-priv-flags: no          # modinfo brcmsmac     filename:       /lib/modules/3.2.0-3-686-pae/kernel/drivers/net/wireless/brcm80211/brcmsmac/brcmsmac.ko     license:        Dual BSD/GPL     description:    Broadcom 802.11n wireless LAN driver.     author:         Broadcom Corporation     alias:          pci:v000014E4d00000576sv*sd*bc*sc*i*     alias:          pci:v000014E4d00004727sv*sd*bc*sc*i*     alias:          pci:v000014E4d00004353sv*sd*bc*sc*i*     alias:          pci:v000014E4d00004357sv*sd*bc*sc*i*     depends:        mac80211,brcmutil,cfg80211,cordic,crc8     intree:         Y     vermagic:       3.2.0-3-686-pae SMP mod_unload modversions 686       There's no `/sys/module/brcmsmac/parameters`. Here's what I have there:               # tree /sys/module/brcmsmac     /sys/module/brcmsmac     ├── drivers     │   └── pci:brcmsmac -> ../../../bus/pci/drivers/brcmsmac     ├── holders     ├── initstate     ├── notes     ├── refcnt     ├── sections     │   └── __bug_table     └── uevent      ## Some sites actually work As suggested by _dr_ , I tried some other sites, and to my great surprise some of them indeed worked. Here are some hosts that worked:   * rambler.ru   * google.ru   * ya.ru   * opennet.ru   * tut.by   * ro-che.info   * yahoo.com   * ebay.com And here are some that didn't:   * vk.com   * meta.ua   * ukr.net   * tenet.ua   * prom.ua   * reddit.com   * github.com   * stackexchange.com ## Network capture I made a network capture and uploaded it here.


title: How to change shells via script?

text: I have to repeat following operation a lot of times, hence I want to automate it.               sudo su     tcsh     cd $workDir      Here `$workDir` is set in `~/.tcshrc`. I tried writing two shells scripts. Script1 is `temp.sh`               #!/bin/bash     sudo su     ./temp.csh      Script2 is `temp.csh`               #!/usr/bin/tcsh     tcsh     cd $workDir      But it doesn't work as expected i.e. I don't see the cshell prompt (still on bash prompt, unlike in without-script approach) neither have I CDed into $workDir. Any help/pointers?


title: Multiple concurrent SSH sessions from different clients but with the same user/password

text: Opening multiple concurrent ssh sessions from different clients but with the same user/password. Is that possible?


title: CronJob every 25 minutes

text: I want to know whether there is any easier way to run a job every 25 minutes. In cronjob, if you specify the minute parameter as */25, it'll run only on 25th and 50th minute of every hour


title: Need help on setting up tty autologin on FreeBSD

text: I was trying to setup tty auto login for FreeBSD, I copied the `P|Pc|Pc` part and made a change:               Pcal console:\       :al=root:ht:np:sp#9600      And modify the tty for ttyv0: `ttyv0 "/usr/libexec/getty Pcal" xterm on secure` But now if I do `init q`, I get: ![enter image description here](http://i.stack.imgur.com/fVcaa.png)


title: How can I fix my X11 draw garbled icons?

text: I'm running linux mint 12:               $ cat /etc/issue          Linux Mint 12 Lisa \n \l      This started happening recently: ![sample garbled images](http://i.stack.imgur.com/D4EaY.jpg) And I'm not sure why. It's not just limited to the above icons and text.               $ lspci | grep VGA      04:00.0 VGA compatible controller: nVidia Corporation NV44A [GeForce 6200] (rev a1)      I haven't noticed anything amiss in kern, syslog, or dmesg, but I really don't know what's causing this issue or where to look. How can I make my X draw properly?


title: Wait for interface to brought up before UDHCP

text: I am using an embedded linux distro with busybox utilities. During system boot I am configuring my interface via DHCP in startup scripts. /etc/rcS.d/S40networking |---------> ifup -a Now the problem is my interface link is brought up after some time (i.e 3 - 4 seconds), but after bringing up the interface (before Link is actually up), the ifup calls udhcp to get IP address from DHCP which is eventually failed as interface is not brought up at this time. Just after S40networking I am running one of my own script / application which utilizes network stuff, again at this time interface is still not brought up and I don't have an IP, so my application also fails. My question is how can I pause S40networking to not continue until my Link is actually up, or why my interface is taking long to bring up the actual link. sleep 5 after ifup -a in S40networking does work, but I want to avoid it. I am sending ip::::::eth0:off in my kernel command line. Thoughts ? Regards, Farrukh Arshad.


title: How to change timezone to UTC without rebooting AIX

text: # oslevel     6.1.0.0      From `smitty` it say's it needs a reboot, but I don't want to reboot. How can I change the TimeZone to UTC without rebooting?


title: Mount a folder without noexec

text: Is it possible to mount a single folder without the `noexec` option. I have a situation in which a web app in the users home folder on the server has to be mounted without `noexec` to run correctly, however, I don't want to remove the restriction for all users, just for that one. The fstab looks like this:               # /dev/sda3       /home           ext3    defaults        0       2     UUID=cae3a489-22c1-43d8-aaf1-27306b32ebb0       /home           ext3    defaults,noexec        0       2      So, removing `noexec` from here would allow all the users to run executables, and I need a solution to allow it only for the user `user`.


title: Double and triple substitution in bash and zsh

text: Follow-up to the background part in this question. In `bash` I can use `{!FOO}` for double substitution, in `zsh` `${(P)FOO}`. In both, the old-school (hack-y) `eval \$$FOO` works. So, the smartest and most logical thing for me would be `${${FOO}}, ${${${FOO}}}…` for double/triple/n substitution. Why doesn’t this work as expected? Second: What does the `\` do in the `eval` statement? I reckon it’s an escape, making something like `eval \$$$FOO` impossible. How to do a triple/n substitution with that that works in every shell?


title: Check the Existence of a Network Interface Card Redhat

text: I'm aware that I can use `ethtool eth0|eth1|eth2` to check the existence of a NIC. But I wonder where the files are on the machine that contain information of an existing interface, as I need to use the Ruby language to check for available NICs.


title: Shrinking a partition

text: I'm trying to shrink a partition on a 64GB SD Card down so that I can fit it on a 32GB USB thumb drive, but I'm not having any success. I have the SD card plugged into a USB adapter, which is plugged into a Raspberry Pi running Raspbian. Here is the output of `fdisk -l`:               Disk /dev/mmcblk0: 7948 MB, 7948206080 bytes     4 heads, 16 sectors/track, 242560 cylinders, total 15523840 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x0002c262                  Device Boot      Start         End      Blocks   Id  System     /dev/mmcblk0p1            8192      122879       57344    c  W95 FAT32 (LBA)     /dev/mmcblk0p2          122880    15523839     7700480   83  Linux          Disk /dev/sda: 63.9 GB, 63864569856 bytes     4 heads, 32 sectors/track, 974496 cylinders, total 124735488 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x000798a3             Device Boot      Start         End      Blocks   Id  System     /dev/sda1            4096      147455       71680    c  W95 FAT32 (LBA)     /dev/sda2          151552   124735487    62291968   83  Linux      It's _/dev/sda2_ that I want to shrink, but when I try `resize2fs /dev/sda2 20G` I get:               resize2fs 1.42.5 (29-Jul-2012)     resize2fs: Bad magic number in super-block while trying to open /dev/sda2     Couldn't find valid filesystem superblock.      I also tried shrinking the partition first via `fdisk` and then running `resize2fs`, but it failed with the same error message. How can I shrink my partition? PS. I have already imaged the card so I can restore should anything go wrong.


title: Running a process multiple times at the same time

text: I have a c++ program with opencv library which takes an image as input and perform pose estimation,color detection,phog. When I run this program from the command line it takes around 4-5sec to complete. It takes around 60%cpu. When I try to run the same program from two different command line windows at the same time the process takes around 10-15 sec to finish and both the process finish in almost the same time. The CPU Usage reaches upto 100%. I have a website which calls this c++ exe using exec() command. So when two users try to upload an image and run it takes more time as I explained above in the command line. Is this because the c++ program involves high computation and the CPU reaches 100% it slows down? But I read that the CPU reaching 100% is not a bad thing as the computer is using its full capacity to run the program. So is this because of my c++ program or is it something to do with my server(computer) settings? This is probably not the apache server problem because when I try to run it from the command line also it slows down. I am using a quad core processor and all the 4 CPU reaches 100% when I try to run the same process at the same time so I think that its distributed among all the processor. So I have few more questions: 1) Can this be solved by using multithreading in my c++ code?As for now I am not using it but will multithreading make the c++ code more computationally expensive and increase the CPU usage(if this is the problem). 2) What can be the reason of it slowing down? Is the process in a queue and each process is ran only a certain amount of time and it switches between the two process? 3) If this is because it involves high computation will it help if I change some functions to opencv gpu functions? 4) Is there a way I can solve this problems any ideas or tips? I have inserted the result of top when running one process and running the same process twice at the same time: Version5 is the process,running it once ![enter image description here](http://i.stack.imgur.com/V9KVi.png) Two Version5 running at the same time ![enter image description here](http://i.stack.imgur.com/h6aP4.png)


title: How to make processes not die after its parent dies?

text: I've been messing with forkbombs and noticed that if I just fork() processes repeatedly, killing the initial process will bring down the whole tree. This is not the case for forkbombs written in BASH using its backgrounding operator &, so I know there's a way around this. How do I achieve the same result in C? I've been using forkbomb examples from Wikipedia: http://en.wikipedia.org/wiki/Fork_bomb#Example_fork_bombs


title: After removing linux Grub error

text: I have a dual boot Windows & Linux system. I removed the Linux partition, but after that I am not able to go in to Windows XP. It is not booting. It gives me a GRUB error.


title: Optimal Setup for Windows & Linux - Sharing and Partitioning

text: This question gets a little complicated so please bear with me. So we have a new custom designed desktop which we will be mostly a dedicated machine for scientific computations in FORTRAN and MATLAB. The IT initially installed Windows 7 on it and gave it to us. Our preferred OS is Ubuntu. The second choice is Fedora but we won't go there unless we absolutely have to and if someone here can give us good arguments that Fedora makes things mentioned below easier than Ubuntu. If we were to just reformat the entire drive and install Ubuntu, things are easy but my adviser makes a good case that we should keep Windows too in addition to ubuntu.   1. First question, are there any good replacements for microsoft office in a linux environment? I know about open office of course and have even used it but if I receive a complicated .doc form or something and open it in open office, boxes/tables/text/spaces/margins are messed up and misaligned. Same happens in power point. In addition, if I prepare documents in open office (document or a presentation) it is messed up when opened in microsoft office. So what is the "best" replacement for office for linux? If this question has no good answer, then we have to keep windows.   Keeping windows, I was just going to repartition the hard drive, give windows a tiny bit of space and have ubuntu on the rest. But then there is the problem of sharing files between the two. So then I thought about having a tiny partition for windows, a decent chunk for ubuntu, and the largest one for documents.   2. What is a good file system for my documents partition which will be stable in the long run and both windows and ubuntu can read and write to easily? Note some files will be quite large like giant text files containing the output from a long simulation. Should I use NTFS or ext3 or what? Windows can't use ext3, right? But how good is ubuntu with NTFS? There won't be any read/write/checksum errors/issues? And what about FAT32? Any better alternatives I don't know about?   3. Any recommendations for a good free partitioning/formatting utility? I won't be able to format the entire drive. Windows is already on it and we want to keep it without removing it and reinstalling it. So I'll just shrink windows partition, repartition the rest into two more, then format the other two appropriately. There is only one physical drive involved in all this.   4. Now is the complicated part, given two partitions on the same physical hard drive, one with windows and one with ubuntu, is there any way for me to have some sort of a virtual machine which can mount another physical partition on the same physical HD? For example, if I am logged onto ubuntu and I have some figures I need to add into and modify a powerpoint, I want to be able to start a VM in ubuntu, mount my (physical) windows partition and use powerpoint. Is there anything for ubuntu that can do this like VMWare or something? Preferably free? What about the other way if I want to use ubuntu quickly while logged into windows?   5. Given question 3, will there be any licensing issues when mounting windows on a VM from a physical partition? We only have a single license and I imagine the MAC address will change when mounting windows to a virtual drive so will windows ask us to put in the license info again or something? I know too many questions but they are all related. Just trying to plan carefully to build this machine in the least complicated way that can do everything we need and make sure it lasts a long time. I put this all here together so that the bigger picture can be seen by all and perhaps a better suggestion/strategy will be offered. FYI, I am a fairly advanced computer user, as you can tell, not afraid to partition/reformat drives but I am rather inexperienced with linux so don't be afraid to go into detail if necessary.


title: What is a remote config server?

text: I found myself enabling one of my computer on LAN to connect to a server through port 1236. A check on the list of services show:               bvcontrol 1236/tcp rmtcfg # Daniel J. Walsh, Gracilis Packeten remote config server     bvcontrol 1236/udp # Daniel J. Walsh      I really can't recall why I open up this particular port. Would appreciate if someone can explain what is a `bvcontrol` and what a remote config server does? So that I can figure out whether to keep this port open or close.


title: Having issue with codec_g729x installation

text: I am trying to compile codec_g729x but having issue with its compilation here is the link for that codec https://bitbucket.org/arkadi/asterisk-g72x and I am getting below error after make all command               [root@localhost@asterisk-g72x]# make all     make  all-am     make[1]: Entering directory `/usr/src/asterisk-g72x'     /bin/sh ./libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.    -DG72X_ASTERISK=100 -I"/opt/intel/ipp/include"  -include "/opt/intel/ipp/tools/intel64/staticlib/ipp_u8.h" -Wall -D_GNU_SOURCE -Iipp -DG72X_3 -O3 -fomit-frame-pointer -march=native   -MT codec_g723_la-codec_g72x.lo -MD -MP -MF .deps/codec_g723_la-codec_g72x.Tpo -c -o codec_g723_la-codec_g72x.lo `test -f 'codec_g72x.c' || echo './'`codec_g72x.c     libtool: compile:  gcc -DHAVE_CONFIG_H -I. -DG72X_ASTERISK=100 -I/opt/intel/ipp/include -include /opt/intel/ipp/tools/intel64/staticlib/ipp_u8.h -Wall -D_GNU_SOURCE -Iipp -DG72X_3 -O3 -fomit-frame-pointer -march=native -MT codec_g723_la-codec_g72x.lo -MD -MP -MF .deps/codec_g723_la-codec_g72x.Tpo -c codec_g72x.c  -fPIC -DPIC -o .libs/codec_g723_la-codec_g72x.o     codec_g72x.c: In function 'lintog72x_sample':     codec_g72x.c:313: warning: implicit declaration of function 'ast_format_set'     codec_g72x.c:313: error: request for member 'format' in something not a structure or union     codec_g72x.c:320: error: request for member 'ptr' in something not a structure or union     codec_g72x.c: In function 'g72xtolin_sample':     codec_g72x.c:331: error: request for member 'format' in something not a structure or union     codec_g72x.c:338: error: request for member 'ptr' in something not a structure or union     codec_g72x.c: In function 'g72xtolin_framein':     codec_g72x.c:440: error: request for member 'i16' in something not a structure or union     codec_g72x.c:470: error: request for member 'ptr' in something not a structure or union     codec_g72x.c:473: error: request for member 'ptr' in something not a structure or union     codec_g72x.c: In function 'lintog72x_framein':     codec_g72x.c:494: error: request for member 'ptr' in something not a structure or union     codec_g72x.c: In function 'lintog72x_frameout':     codec_g72x.c:533: error: request for member 'uc' in something not a structure or union     codec_g72x.c: At top level:     codec_g72x.c:619: error: unknown field 'native_plc' specified in initializer     codec_g72x.c: In function 'parse_config':     codec_g72x.c:656: error: too many arguments to function 'ast_config_load'     codec_g72x.c: In function 'g72x_toggle_debug':     codec_g72x.c:707: error: 'CLI_FAILURE' undeclared (first use in this function)     codec_g72x.c:707: error: (Each undeclared identifier is reported only once     codec_g72x.c:707: error: for each function it appears in.)     codec_g72x.c:711: error: 'CLI_SUCCESS' undeclared (first use in this function)     codec_g72x.c: At top level:     codec_g72x.c:720: warning: 'struct ast_cli_args' declared inside parameter list     codec_g72x.c:720: warning: its scope is only this definition or declaration, which is probably not what you want     codec_g72x.c: In function 'handle_cli_g72x_toggle_debug':     codec_g72x.c:723: error: 'CLI_INIT' undeclared (first use in this function)     codec_g72x.c:724: error: 'struct ast_cli_entry' has no member named 'command'     codec_g72x.c:727: error: 'CLI_GENERATE' undeclared (first use in this function)     codec_g72x.c:730: error: dereferencing pointer to incomplete type     codec_g72x.c:731: error: 'CLI_SHOWUSAGE' undeclared (first use in this function)     codec_g72x.c:732: error: dereferencing pointer to incomplete type     codec_g72x.c:733: error: 'CLI_SUCCESS' undeclared (first use in this function)     codec_g72x.c: At top level:     codec_g72x.c:736: warning: implicit declaration of function 'AST_CLI_DEFINE'     codec_g72x.c:736: error: invalid initializer     codec_g72x.c: In function 'load_module':     codec_g72x.c:758: error: 'struct ast_translator' has no member named 'src_format'     codec_g72x.c:759: error: 'struct ast_translator' has no member named 'dst_format'     codec_g72x.c:761: error: 'struct ast_translator' has no member named 'src_format'     codec_g72x.c:762: error: 'struct ast_translator' has no member named 'dst_format'     codec_g72x.c: At top level:     codec_g72x.c:812: error: unknown field 'buildopt_sum' specified in initializer     make[1]: *** [codec_g723_la-codec_g72x.lo] Error 1     make[1]: Leaving directory `/usr/src/asterisk-g72x'     make: *** [all] Error 2     enter code here      **EDIT:** After asterisk-devel installation               make  all-am     make[1]: Entering directory `/usr/src/asterisk-g72x'     /bin/sh ./libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.    -DG72X_ASTERISK=100 -I"/opt/intel/ipp/include"  -include "/opt/intel/ipp/tools/intel64/staticlib/ipp_u8.h" -Wall -D_GNU_SOURCE -Iipp -DG72X_3 -O3 -fomit-frame-pointer -march=native   -MT codec_g723_la-codec_g72x.lo -MD -MP -MF .deps/codec_g723_la-codec_g72x.Tpo -c -o codec_g723_la-codec_g72x.lo `test -f 'codec_g72x.c' || echo './'`codec_g72x.c     libtool: compile:  gcc -DHAVE_CONFIG_H -I. -DG72X_ASTERISK=100 -I/opt/intel/ipp/include -include /opt/intel/ipp/tools/intel64/staticlib/ipp_u8.h -Wall -D_GNU_SOURCE -Iipp -DG72X_3 -O3 -fomit-frame-pointer -march=native -MT codec_g723_la-codec_g72x.lo -MD -MP -MF .deps/codec_g723_la-codec_g72x.Tpo -c codec_g72x.c  -fPIC -DPIC -o .libs/codec_g723_la-codec_g72x.o     codec_g72x.c: In function 'lintog72x_sample':     codec_g72x.c:313: warning: implicit declaration of function 'ast_format_set'     codec_g72x.c:313: error: 'union ast_frame_subclass' has no member named 'format'     codec_g72x.c: In function 'g72xtolin_sample':     codec_g72x.c:331: error: 'union ast_frame_subclass' has no member named 'format'     codec_g72x.c: In function 'load_module':     codec_g72x.c:758: error: 'struct ast_translator' has no member named 'src_format'     codec_g72x.c:759: error: 'struct ast_translator' has no member named 'dst_format'     codec_g72x.c:761: error: 'struct ast_translator' has no member named 'src_format'     codec_g72x.c:762: error: 'struct ast_translator' has no member named 'dst_format'     make[1]: *** [codec_g723_la-codec_g72x.lo] Error 1     make[1]: Leaving directory `/usr/src/asterisk-g72x'     make: *** [all] Error 2      Anyone have idea about this error, why its giving error about some methods which are not found and what extra tools I need to install to make it working ?


title: How to setup VLAN on same subnet as Ethernet ?

text: I have a physical NIC with dev name eth0 with ip 192.168.1.2 and gateway 192.168.1.1 and I want to setup a VLAN with ip 192.168.1.x and same gateway as eth0. Setting up the VLAN runs smoothly and I give the VLAN a iface name of eth0.10 and an ip of 192.168.1.69. Now when trying to establish a connection I get an error:               holmen@filserver:~$ sudo ifup eth0.10     Set name-type for VLAN subsystem. Should be visible in /proc/net/vlan/config     RTNETLINK answers: File exists     Failed to bring up eth0.10.      So how do I get the VLAN to connect to the internet and what does the error message mean? My guess is that it have something to do with the broadcast. **Settings:** /etc/network/interfaces               # The loopback network interface     auto lo     iface lo inet loopback          # The primary network interface     auto eth0     iface eth0 inet dhcp             address 192.168.1.2             netmask 255.255.255.0             network 192.168.1.0             gateway 192.168.1.1          iface eth0.10 inet static             address 192.168.1.69             netmask 255.255.255.0             gateway 192.168.1.1      _I have removed the auto eth0.10 since I dont want to establish it at startup_ **Settings:** ifconfig               holmen@filserver:~$ ifconfig     eth0      Link encap:Ethernet  HWaddr 00:1a:4d:5b:02:5c               inet addr:192.168.1.2  Bcast:192.168.1.255  Mask:255.255.255.0               inet6 addr: fe80::21a:4dff:fe5b:25c/64 Scope:Link               UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1               RX packets:11670807 errors:0 dropped:0 overruns:0 frame:0               TX packets:22363842 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:1000               RX bytes:833725090 (833.7 MB)  TX bytes:31876321312 (31.8 GB)               Interrupt:44 Base address:0x4000          eth0.10   Link encap:Ethernet  HWaddr 00:1a:4d:5b:02:5c               inet addr:192.168.1.69  Bcast:192.168.1.255  Mask:255.255.255.0               inet6 addr: fe80::21a:4dff:fe5b:25c/64 Scope:Link               UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1               RX packets:0 errors:0 dropped:0 overruns:0 frame:0               TX packets:432 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:0               RX bytes:0 (0.0 B)  TX bytes:41501 (41.5 KB)          lo        Link encap:Local Loopback               inet addr:127.0.0.1  Mask:255.0.0.0               inet6 addr: ::1/128 Scope:Host               UP LOOPBACK RUNNING  MTU:16436  Metric:1               RX packets:4899 errors:0 dropped:0 overruns:0 frame:0               TX packets:4899 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:0               RX bytes:697405 (697.4 KB)  TX bytes:697405 (697.4 KB)      **Settings:** netstat output               holmen@filserver:~$ netstat -anr     Kernel IP routing table     Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface     0.0.0.0         192.168.1.1     0.0.0.0         UG        0 0          0 eth0     192.168.1.0     0.0.0.0         255.255.255.0   U         0 0          0 eth0     192.168.1.0     0.0.0.0         255.255.255.0   U         0 0          0 eth0.10      **Test:** ping output domain name               holmen@filserver:~$ ping -I eth0.10 www.dn.se     PING a1910.g1.akamai.net (23.60.69.161) from 192.168.1.2 eth0.10: 56(84) bytes of data.     From filserver.local (192.168.1.69) icmp_seq=1 Destination Host Unreachable     From filserver.local (192.168.1.69) icmp_seq=2 Destination Host Unreachable     From filserver.local (192.168.1.69) icmp_seq=3 Destination Host Unreachable     ^C     --- a1910.g1.akamai.net ping statistics ---     5 packets transmitted, 0 received, +3 errors, 100% packet loss, time 4025ms     pipe 3      **Test:** ping output ip addr               holmen@filserver:~$ ping -I eth0.10 8.8.8.8     PING 8.8.8.8 (8.8.8.8) from 192.168.1.2 eth0.10: 56(84) bytes of data.     From 192.168.1.69 icmp_seq=1 Destination Host Unreachable     From 192.168.1.69 icmp_seq=2 Destination Host Unreachable     From 192.168.1.69 icmp_seq=3 Destination Host Unreachable     ^C     --- 8.8.8.8 ping statistics ---     5 packets transmitted, 0 received, +3 errors, 100% packet loss, time 4023ms     pipe 3


title: Guided tour at the console?

text: I think it would really enjoy a guided tour of either just the typical Linux filesystem (which I realize varies from system to system), or a guided tour of the filesystem and common console productivity patterns and everything else! Imagine you're a newbie to gnu Linux and you're sitting at a console and you type               guided-tour      Then just like the interactive REPL-aided programming tutorials that are showing up on more and more home pages for new languages and frameworks, you would be guided through the filesystem, what goes where, and common console tasks. For example the following fictional session snippet:               #Please cd to /tmp     $ cd /tmp     #This is a place to store stuff that is just for currently running programs, using the handy filesystem. Now try creating a file here.      $ nano myfile     ....etc...      Does anything remotely similar to this already exist, and do you see the appeal?


title: How to setup HP printer in CUPS?

text: `hplip` and `hplip-cups` are installed. The model is LaserJet P4515, but is not listed when I want to setup the printer. How do I setup a HP printer?


title: How to bring up a wi-fi interface from a command line?

text: I can't figure out how to properly bring up the wi-fi card on my laptop. When I turn it on and issue               $ sudo iwconfig wlan0 txpower auto     $ sudo iwlist wlan0 scan     wlan0     Interface doesn't support scanning : Network is down      it reports that the network is down. Trying to bring it up fails too:               $ sudo ifup wlan0     wlan0     no private ioctls.          Failed to bring up wlan0.      Apparently I'm missing some basic low-level `iw...` command. When I issue `dhclient` on the interface:               $ sudo dhclient -v wlan0     Internet Systems Consortium DHCP Client 4.2.2     Copyright 2004-2011 Internet Systems Consortium.     All rights reserved.     For info, please visit https://www.isc.org/software/dhcp/          ^C$      and interrupt it, it brings the device up somehow and then scanning etc. works. I'd like to avoid this obviously superfluous step.


title: local yum repository with grouplist not working

text: I am trying to create a local yum repository with group list for RHEL 6. Packages from DVD are dumped at the following location `/var/www/html/rhelisos/` To create the repo, I used the following commands.               1.  createrepo -g /var/www/html/rhelisos/repodata/8afad1febf2d8844a235a9ab1aa5f15c9cec1219b9d01060d4794435cf59dffe-comps-rhel6-Server.xml /var/www/html/rhelisos/Packages     2. yum clean all     3. yum makecache      Updated config file at /etc/yum.repos.d/ to point to the yum repository . But `yum grouplist` is still failing with the error `Error: No group data available for configured repositories` `yum install` commands are working fine               # yum install httpd     Loaded plugins: product-id, security, subscription-manager     Updating certificate-based repositories.     rhel-source-beta                                                      2804/2804     Setting up Install Process     Resolving Dependencies      --> Running transaction check      ---> Package httpd.i686 0:2.2.15-15.el6 will be installed      --> Processing Dependency: libpcre.so.0 for package: httpd-2.2.15-15.el6.i686      --> Processing Dependency: libldap-2.4.so.2 for package: httpd- 2.2.15-15.el6.i686      --> Finished Dependency Resolution           Dependencies Resolved            ================================================================================       Package        Arch       Version                 Repository              Size       ================================================================================       Installing:       httpd          i686       2.2.15-15.el6           rhel-source-beta       817 k       Installing for dependencies:       apr            i686       1.3.9-3.el6_1.2         rhel-source-beta       129 k       apr-util       i686       1.3.9-3.el6_0.1         rhel-source-beta        89 k       openldap       i686       2.4.23-20.el6           rhel-source-beta       261 k       pcre           i686       7.8-3.1.el6             rhel-source-beta       195 k            Transaction Summary       ================================================================================       Install       5 Package(s)            Total download size: 1.5 M       Installed size: 4.5 M        Is this ok [y/N]:      What I am missing in the configuration steps for making `yum grouplist` to work ? Or it is problem with the `*Comps*.xml` file ? Please suggest.


title: What is the proper way to shrink a LVM partition?

text: I want to shrink a Linux LVM partition from 200GB to 150GB. A test is carried out with the following steps:   * Shrink a file system in a logical volume with `reszie2fs`   * Shrink the logical volume with `lvreduce`   * Delete the 200GB LVM partition with `fdisk`   * Recreate the same LVM partition, but with size a reduced of 150GB I am able to access a test file using the above method. But, `vgdisplay` and `vgs` both reported the old size of 200GB. I think I might have missed out a `vgreduce` step after shrinking the logical volume. But, from the man page, it seems to say that `vgreduce` can only be performed on an empty physical volume. In my situation above, the whole volume group resides in one physical volume. What is the correct way to shrink this LVM partition?


title: How can i keep the mtime of files and directories in bash when I use rsync or cp? For use in Backup/Incremental Backup

text: I have a new NAS box and after looking through numerous backup solutions I've found doing it manually through PuTTy to work the best. After logging in to the box through PuTTy as root, I first need to copy the entire disk onto a USB HDD (well once every week). I have been using:               cp -Rp /data/Backup /media/USB_HDD_3/Backup      I have tried with `rysnc -a` instead and I get the similar results in that the files themselves keep the mtime but directories do not. Then everyday I will be doing an incremental backup. For which I have been building:               find . -mtime -2 -exec cp -Rp {} /media/USB_FLASH_1/ \;      Again, I've tried substituting `cp - Rp` with `rsync -a` to no avail. I just end up getting the whole of the backup transferred, like it hasn't even looked at the mtime. I'm rather new to Linux and Unix so most of this I have adapted from things I have found on the net and then tried to slot them together which is probably the reason it doesn't work.


title: Using tput in $PS1 is breaking line wrapping

text: Good Morning- I'm trying to use tput outputs in my $PS1 to set the background color to red in the event I'm on a production server:               if [[ `hostname -s` = prod-db ]]; then       export PS1="${TITLEBAR}`tput setab 1`[\u@\h \W \$ORACLE_SID]\$`tput setab 0` "     else       export PS1="${TITLEBAR}[\u@\h \W \$ORACLE_SID]\$ "     fi However, I'm finding that when I'm on prod-db, the line wrapping is quite messed up; it seems fixed to a certain number of characters and does that fun thing where modifying a command that goes too long goes up a line without redrawing the screen as though the terminal is entirely messed up. When the background color is not set, none of those issues occur... I'm happy. PS1 is being set to `[\e]0;\u@\h `echo $ORACLE_SID`\a]^[[41m[\u@\h \W $ORACLE_SID]$^[[40m` with colors and to `[\e]0;\u@\h `echo $ORACLE_SID`\a][\u@\h \W $ORACLE_SID]$` without colors. The only difference being the escape characters being set to set the colors, I don't see what would be breaking the line wrapping. I'm running GNU bash 4.1.2. Why does the introduction of the color escape codes cause line wrapping to break, and what is the proper way to resolve the issue?


title: Multiple FM radio streams from /dev/radio* via v4l2, ices2 and icecast

text: I have an FM radio USB dongle (Silicon chip), I have managed to stream the radio reception via icecast using the following configuration:   * the USB dongle is recognized by v4l2 driver and mounted at /dev/radio0 as a separate audio device   * Pulseaudio uses the FM radio device as a record device   * ices2 uses the 'alsa' module with 'pulse' as device   * ices2 connects and streams to an icecast server. This is fine, but if there is a second FM radio USB dongle mounted at /dev/radio1, I would like to have a second stream at the same time. Is there any possibility that ices2 can receive audio data directly from /dev/radio0 and /dev/radio1 separately and stream different channels? Would there be any other solution, like the Pulseaudio serve different recording input to each software source?


title: Keeping track of the latest releases

text: How do people keep a track of the latest softwares being released? Let me say a distro group like slackware. A distro has ~25K+ packages and about a score of people involved. I hardly think these people keep checking the site of individual developers to see if they have released anything. Is there a an automatic way? A script? A standardized RSS feed? or a mailing list (parsable mails)?


title: How can I extend the wait time for the watch command beyond 4200 or so seconds?

text: I have encountered a limitation of the watch command. Even though I specify `watch -n 14400` to run the command every 4 hours or so, the command executes every 4200 or so seconds, which is about an hour's worth of wait. Otherwise very useful command, is there a way to extend the range beyond 4200 seconds. I think the limit comes from time being measured in microseconds and 4200 million micro seconds, and 4200 M is 2^32 or something.


title: Is there any option in wget to get the referers or parent of a link that are crawled by wget

text: Is there any to get or find the referrers of a link that were crawled by wget? Suppose that some link returns a 400 error. wget only shows the url on which the 400 error occurrs, not the referrer of error url. If possible please provide any utility similar to wget in linux or wget option for doing this.


title: Volume on Linux much lower than on Windows

text: I dualboot Slackware64 and Windows 7. The volume under Linux when maxed seems a lot lower than when it is maxed on Windows. My soundcard chip is Realtek ALC662. Volume is set to 100% for PCM and Master in alsamixer and in whatever application I am playing sound with. Is there anything further I can do to get the volume as loud as it is in Windows?


title: Email Configuration in Cent OS

text: I have hosted my web application in VPS Cent OS. Its working well, in that application if a vendor registered or any events occurs between users and website, admin needs to send emails regarding the event, password, order details, etc. I need to configure the settings to do that. I am a database administrator, this is new to me. FYI:   1. Email hosted in another third party server (Business mail).   2. I am accessing the server using putty. I have doubt that, if I redirected the domain name from email server (business mail), if it will work, whether the Cent OS **Sendmail** or **Postfix** will work similar to using my business mail? I just need to send mails from the application using my business id (sales@example.com). For remaining emails (contact/info/support) I need to access the same server as I am using now.


title: When update Linux Mint from 15 to 16?

text: I would like to know if I have to, every time the new release of `Linux Mint` come out, upgrade my OS? I had `Ubuntu` someday, and every half a year I burnt a CD and installed everything from the scratch (the whole OS and all my programs I need for work). It was kind of annoying but everytime I tried to do it with terminal, I always got some problems, so I burnt a CD ... Anyway, now I have Mint 15. Should I upgrate to Mint 16? How long can I use Mint 15 to be able to get the newest available software and be secure?


title: Format of SMTP headers for scanning inbox email

text: I am looking for a simple procedure to extract email from my inbox into a file for further processing, using e.g. `awk`. With "extract" I mean use e.g. regex to get emails with a particular subject. My Inbox is currently over 1Gb, so I use the `tail` command to get the last part. Here is an example of two messages:               From aaa.aaa@uni.no Tue Nov 26 17:27:33 2013     Return-path: <aaa.aaa@uni.no>     Envelope-to: fcihh@uib.no     Delivery-date: Tue, 26 Nov 2013 17:27:33 +0100     Received: from alfons.uib.no [2001:700:200:30::141]          by alfred.uib.no  with esmtp  (Exim 4.77)         id 1VlLU5-0003Gg-8R; Tue, 26 Nov 2013 17:27:33 +0100     Received: from thoralf.uib.no (smtp.uib.no) [2001:700:200:13:129:177:13:16]          by alfons.uib.no  with esmtps (TLSv1:AES256-SHA:256) (Exim 4.77)         id 1VlLU5-0002Po-4p; Tue, 26 Nov 2013 17:27:33 +0100     Received: from cipr064089.klientdrift.uib.no [129.177.64.89]:35068          by smtp.uib.no  with esmtpsa (Exim 4.69)         id 1VlLU5-0006dY-35; Tue, 26 Nov 2013 17:27:33 +0100     Message-ID: <5294CBFA.3030408@uni.no>     Date: Tue, 26 Nov 2013 17:27:38 +0100     From: bb b <bb.bb@uni.no>     Organization: Uni Research AS     User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.1.1     MIME-Version: 1.0     To: b b <bbb.bbb@uni.no>     CC: Haakon Haegland <hakon.hagland@uni.no>     Subject: Re: ddd     References: <5294C625.9010403@uni.no>     In-Reply-To: <5294C625.9010403@uni.no>     Content-Type: text/plain; charset=ISO-8859-1; format=flowed     Content-Transfer-Encoding: 8bit     X-checked-clean: by exiscan on alfons.uib.no     X-Scanner: 2db488888a1c80ee768332c03a147d00 http://tjinfo.uib.no/virus.html     X-UiB-SpamFlag: NO UIB: -18 hits, 8.0 required     X-UiB-SpamReport: spamassassin found;       -15 From is listed in 'whitelist_SA'      -3.0 Message received from Norway     X-sender_host_address: 2001:700:200:13:129:177:13:16     X-sender_host_name: thoralf.uib.no     X-UID: 28258                                                      Status: RO          On 11/26/2013 05:02 PM, b b wrote:     > ggg     > hhh          qqq               From bbb.bbbk@uni.no Tue Nov 26 17:33:10 2013     Return-path: <bbb.bbb@uni.no>     Envelope-to: fcihh@uib.no     Delivery-date: Tue, 26 Nov 2013 17:33:10 +0100     Received: from alfons.uib.no [2001:700:200:30::141]          by alfred.uib.no  with esmtp  (Exim 4.77)         id 1VlLZW-0004jv-7u; Tue, 26 Nov 2013 17:33:10 +0100     Received: from thoralf.uib.no (smtp.uib.no) [2001:700:200:13:129:177:13:16]          by alfons.uib.no  with esmtps (TLSv1:AES256-SHA:256) (Exim 4.77)         id 1VlLZW-0002wL-3T; Tue, 26 Nov 2013 17:33:10 +0100     Received: from cipr064186.klientdrift.uib.no [129.177.64.186]:57257          by smtp.uib.no  with esmtpsa (Exim 4.69)         id 1VlLZW-0006iZ-29; Tue, 26 Nov 2013 17:33:10 +0100     Message-ID: <5294CD3D.9020407@uni.no>     Date: Tue, 26 Nov 2013 17:33:01 +0100     From: b b <bbb.bbb@uni.no>     Organization: Uni CIPR     User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20131028 Thunderbird/17.0.10     MIME-Version: 1.0     To: a a <aaa.aaa@uni.no>     CC: Haakon Haegland <hakon.hagland@uni.no>     Subject: Re: ddd     References: <5294C625.9010403@uni.no> <5294CBFA.3030408@uni.no>     In-Reply-To: <5294CBFA.3030408@uni.no>     Content-Type: text/plain; charset=ISO-8859-1; format=flowed     Content-Transfer-Encoding: 8bit     X-checked-clean: by exiscan on alfons.uib.no     X-Scanner: 467bf36c80a8700bd89776b495ccd761 http://tjinfo.uib.no/virus.html     X-UiB-SpamFlag: NO UIB: -17.9 hits, 8.0 required     X-UiB-SpamReport: spamassassin found;       -15 From is listed in 'whitelist_SA'      -3.0 Message received from Norway       0.0 BODY: ReplaceTags: Contact     X-sender_host_address: 2001:700:200:13:129:177:13:16     X-sender_host_name: thoralf.uib.no     X-UID: 28259                                                      Status: RO          txtxt      I guess the format of this email is SMTP http://en.wikipedia.org/wiki/SMTP_protocol ? (I have also seen the words MIME and RFC used, I don't know if these are related) Questions:   * How do I know where a message ends and another starts?   * How can I use a tool like `awk` to extract messages with a given subject field?


title: Help required for LAMP Stack fail-over Configuration

text: I am using cloud servers of digital ocean for last some months. Recently One of my cloud servers disappeared from panel with backups @ ubiquity, the server co guys put it back after 1 day. However my websites were down during those time. So I want to setup a fail over LAMP stack with one machine at digital ocean and one at ubiquity Servers. I do not want to use any third load balancer. Is there any way to achieve my goal? If yes how to do that please elaborate!


title: How to insert the output of previous command into current command line?

text: $ pidof qqq     12345     $ cd /proc/                ^ cursor here      And now I want to auto-insert the previous line here. Of course I can manually type `12345` or ``pidof qqq``, but how to do it conveniently? The question is not solely about `pidof` and `/proc`, but about any such situation of reusing previous command output.


title: Solved - Solaris 10 - Is it possible to reboot a system from a startup script?

text: I have a Solaris 10 test guest logical domain (LDom). I plan to have the network on this be reconfigured before rebooting using a startup script in `/etc/rc0.d`. At the moment, when the system boots, everything in the startup script is run as I want it to be, except that the reboot does not occur. I have created a test script, and stripped it of everything except the essentials:               #!/sbin/sh          # MAIN          case "$1" in     start)        if [ -f /etc/DR_Network_Configured ]; then           exit 0        else           touch /etc/DR_Network_Configured           reboot        fi        exit 0        ;;     *)        echo "Usage: $0 { start }"        exit 1        ;;     esac     exit 0      If I run the script from the command line, `/etc/rc0.d/S99testing start`, the file `/etc/DR_Network_Configured` is created and the system immediately reboots, i.e. the desired behaviour. However, if I remove the file `/etc/DR_Network_Configured`, shut the system down, and boot it again, the file `/etc/DR_Network_Configured` gets recreated by the script during boot, but no subsequent reboot occurs. Is there a fail-safe mechanism to stop startup scripts from potentially causing infinite reboots? If so, is there a way around this?


title: How match different column in file 1 and file2 with awk?

text: I have the following two files. The first file is :                3184 2014-07-28 04:15 global.Remote-Access 10.111.8.25 81.245.6.25 tcp      3268           3035 2014-07-28 04:16 global.Remote-Access 10.111.8.12 81.245.6.25 tcp      3268      The second file is:                1 Jul 28 04:12 2014-07-28 id967254(group3)[attribute1 attribute2]      Tunneling: User with IP 10.111.8.12 10 connected           1 Jul 28 04:15 2014-07-28 id920767(group2)[attribute3 attribute4 ....      attribute n] Tunneling: User with IP 10.111.8.25 connected           1 Jul 28 04:16 2014-07-28 ID926072(group3)[attribute1 attribute2]      Tunneling:User with IP 10.111.8.12 connected      If the source IP address in the file 1 is equal to file 2 , and if the time (`hh:mm`) and date (`yyyy-mm-dd`) in the file 1 are equal to file2, the third file will be as follows:                3184 04:15 2014-07-28 global.Remote-Access id920767(group2)[attribute3      attribute4 .... attribute n] 10.111.8.25 81.245.6.25 tcp 3268           3035 04:16 2014-07-28 global.Remote-Access ID926072(group3)[attribute1      attribute2] 10.111.8.12 81.245.6.25 tcp 3268      How can I realise this using `awk`?


title: Encrypt root file system and decrypt using U-Boot with key stored in FPGA

text: We are using Cyclone V, which essentially is a SOC comprised of FPGA + ARM core. Is it possible to encrypt the root file system and decrypt it by using U-Boot with a key which is located in the FPGA?


title: How to connect to ssh-server running on embedded linux without /etc/passwd?

text: After installing ssh server on my remote machine (which runs embedded Linux), I tried to connect to ssh server from host machine but it failed. This is because I could not specify user account when connecting to ssh-server (ssh connection requires to enter password of an account) since my target embedded Linux does not have `/etc/passwd` and `/etc` is not writable. Thus there are no user accounts on that system. Do we have alternative ways to connect to ssh-server on remote machine from host machine? I want to log in as the root user. This question is a follow-up to my previous question How to check my account on embedded linux without "/etc/passwd"?


title: How to add calendars and contacts support to mail server

text: I have installed Postfix, Dovecot and MySQL to set a personal mail server with virtual users stored in the database. It works great, but there are two things missing: Calendars and Contacts. For example when you add Gmail account to your desktop / mobile app for emails you have options to sync Calendars, Contacts, Notes. I am missing the Calendars and Contacts. I am not sure what software I need (or what settings to the current software have to be made). I've Googled several times, but I don't know what software exactly I need and didn't find anything that could help me.


title: Scripting window behavior in KDE to depend on monitor being used

text: I plug my laptop into a number of different monitors, all of which have aspect ratios not supported by my laptop. I want the built-in and plug-in monitors to be at their maximum respective resolutions and the corresponding aspect ratios, share the same lower left corner, and have the extra space "hanging over the edge". I finally wrote a script that runs from /etc/kde4/kdm/Xsetup that uses xrandr this behavior. Now I'm trying to make all the application windows open by default in the rectangular region where the two screens overlap. Does anybody have any suggestions for how to do this? So far I can think of two approaches, below, but have questions about both: 1) Setting default size and position in the Window Behavior control panel, finding what file it keeps those settings in, and having a different such file for each monitor configuration, copying it to the system-wide one when Xsetup runs. Question: where does the Window Behavior control panel keep its settings? 2) Setting some kind of global variable that will affect the starting geometry X11 assigns to programs when they launch. Questions: Is there a variable or file that X11 checks every time a program launches, or does the variable need to be passed to X11 from the command-line when launching the program? If so, what is the syntax? Where is a good place to set such a variable so that everything running in the X11/KDE session can see it? Can this variable be altered after KDE has already started? System: Linux 2.6.32-33-generic #72-Ubuntu SMP Fri Jul 29 21:07:13 UTC 2011 x86_64 GNU/Linux KDE 4.4.5 Kubuntu, Lucid Lynx


title: How to check if a file is tab-delimited and has 8 columns?

text: I have two things I need to check a text file for:   1. If it is tab-delimited   2. If it has exactly 8 columns How can I check those things and show an error message if either is false?


title: Update install repository on liveUSB?

text: I'm using a kubuntu liveUSB with persistence. It's possible to update the liveUSB itself, such that the updates persist. However, the update packages aren't used for installation, as far as I can tell. Is there any way of updating the packages on the install image, such that on the next install, those packages don't need to be re-downloaded?


title: Plotting data from a text file on the desktop

text: I want to monitor some simulations I run In a way similar to how text monitor display data. I can easily generate a bunch of text files or image files with the data/plot I want to follow. How can I display them as a part of my desktop background in an eye-pleasing way? I tried conky but I couldn't get it to display image. For example, following conky's wiki I have set up this:               TEXT     ${image /home/yotam/Downloads/images.jpg -p 20,20 -s 200x200}${image /home/yotam/Downloads/images.jpg -p 20,240 -s 200x200}${image /home/yotam/Downloads/images.jpg -p 20,460 -s 200x200}      And now nothing is displayed.


title: How to enable OpenGL rendering on Fedora 18 with an Intel Corporation 82852/855GM?

text: On an older laptop that runs Fedora 18, and has a Intel Corporation 82852/855GM Integrated Graphics Device, I cannot get OpenGL to run on it. In fact, I have no 3D acceleration whatsoever. I have the correct drivers installed, but I can't get OpenGL to work. `glxinfo` reports:               name of display: :0.0     X Error of failed request:  BadAlloc (insufficient resources for operation)       Major opcode of failed request:  152 (GLX)       Minor opcode of failed request:  3 (X_GLXCreateContext)       Serial number of failed request:  22       Current serial number in output stream:  25      In fact no GLX application will start, all stop with the same error message. Do I have to enable it in the Kernel or put something into xorg.conf? As it has been requested, here's my `xorg.0.log`, and the ouptut of `lspci`.


title: Stream error logs

text: I want to stream the contents of an error log (`/log/spo.error`) as it's written, but pipe the stream through `sed` before I see it. How can I do that?


title: Cannot lock group file: already locked

text: I'm trying to add a group using this command:               groupadd somegroup      which returns:               Cannot lock group file: already locked.      I did some research and most of the solutions require removing a lock file in `/etc`, but I do not have root privilege. I used to be able to do this before, but at some point it stopped working. My OS is SUSE. My admin already added me to this group. In order to see it working though, I either have to logout and login or make this command work. I don't want to logout and login again, though, since I have a lot of applications running.


title: Why Nethogs won't see the PID of the processes the generating some NFS traffic?

text: I usually use Nethogs to see the network bandwidth per process. However, Nethogs won't see the PID of the processes generating some NFS traffic, and as a result they are aggregated over one single line with `?` as PID: ![enter image description here](http://i.stack.imgur.com/Vl9dL.gif) Why does that happen and is there any way to circumvent it so that I can see NFS bandwith per PID? I use NFSv3 on Ubuntu 12.04 (client).


title: What does 'mergemaster' do that 'make distribution' doesn't?

text: After calling `make installworld` (or `make world`), there are two ways of updating source files in the new world: calling `mergemaster -p` or `make distribution`. I know that `mergemaster` calls `make distribution` but what else does it do and why would I call it instead of just `make distribution`?


title: Debian init.d with a working C++ daemon, unexpected results

text: I am fairly new to programming for Linux, and init.d scripts, and I have a problem with my init.d script adapted from an example I found via a lot of google searching. Instead of getting a status, starting or stopping, or restarting, my daemon shows up as another process no matter what I do. The daemon works as expected, adding a syslog entry every minute. Actually, it works when multiples are running, logging an entry at one minute intervals each depending on when they start. My Daemon 'sbecd'               #include <sys/types.h>     #include <sys/stat.h>     #include <stdio.h>     #include <stdlib.h>     #include <fcntl.h>     #include <errno.h>     #include <unistd.h>     #include <syslog.h>     #include <string.h>          using namespace std;          #define DAEMON_NAME "vsbecdaemon"          void process(){              syslog (LOG_NOTICE, "SBEC Communications Daemon Entry");     }             int main(int argc, char *argv[]) {              //Set our Logging Mask and open the Log         setlogmask(LOG_UPTO(LOG_NOTICE));         openlog(DAEMON_NAME, LOG_CONS | LOG_NDELAY | LOG_PERROR | LOG_PID, LOG_USER);              syslog(LOG_INFO, "Entering SBEC Communications Daemon");              pid_t pid, sid;             //Fork the Parent Process         pid = fork();              if (pid < 0) { exit(EXIT_FAILURE); }              //We got a good pid, Close the Parent Process         if (pid > 0) { exit(EXIT_SUCCESS); }              //Change File Mask         umask(0);              //Create a new Signature Id for our child         sid = setsid();         if (sid < 0) { exit(EXIT_FAILURE); }              //Change Directory         //If we cant find the directory we exit with failure.         if ((chdir("/")) < 0) { exit(EXIT_FAILURE); }              //Close Standard File Descriptors         close(STDIN_FILENO);         close(STDOUT_FILENO);         close(STDERR_FILENO);              //----------------         //Main Process         //----------------         while(true){             process();    //Run our Process             sleep(60);    //Sleep for 60 seconds         }              //Close the log         closelog ();     }      My init.d script               #! /bin/sh     ### BEGIN INIT INFO     # Provides:          sbecd     # Required-Start:    $remote_fs $syslog $network $mysql     # Required-Stop:     $remote_fs $syslog $network     # Default-Start:     2 3 4 5     # Default-Stop:      0 1 6     # Short-Description: Seed Bed Environment Control Daemon init.d Script     # Description:       SBEC Daemon init.d control script     ### END INIT INFO          # Author: Gary Rubin of HopWorks <myemail>     #          # Do NOT "set -e"          # PATH should only include /usr/* if it runs after the mountnfs.sh script     PATH=/sbin:/usr/sbin:/bin:/usr/bin     DESC="Serial Communications Controller - Seed Bed Environmental Control"     NAME=sbecd     DAEMON=/usr/sbin/$NAME     #DAEMON_ARGS="--options args"     PIDFILE=/var/run/$NAME.pid     SCRIPTNAME=/etc/init.d/$NAME          # Exit if the package is not installed     [ -x "$DAEMON" ] || exit 0          # Read configuration variable file if it is present     [ -r /etc/default/$NAME ] && . /etc/default/$NAME          # Load the VERBOSE setting and other rcS variables     . /lib/init/vars.sh          # Define LSB log_* functions.     # Depend on lsb-base (>= 3.2-14) to ensure that this file is present     # and status_of_proc is working.     . /lib/lsb/init-functions          #     # Function that starts the daemon/service     #     do_start()     {         # Return         #   0 if daemon has been started         #   1 if daemon was already running         #   2 if daemon could not be started         start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \             || return 1         start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \             $DAEMON_ARGS \             || return 2         # Add code here, if necessary, that waits for the process to be ready         # to handle requests from services started subsequently which depend         # on this one.  As a last resort, sleep for some time.     }          #     # Function that stops the daemon/service     #     do_stop()     {         # Return         #   0 if daemon has been stopped         #   1 if daemon was already stopped         #   2 if daemon could not be stopped         #   other if a failure occurred         start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME         RETVAL="$?"         [ "$RETVAL" = 2 ] && return 2         # Wait for children to finish too if this is a daemon that forks         # and if the daemon is only ever run from this initscript.         # If the above conditions are not satisfied then add some other code         # that waits for the process to drop all resources that could be         # needed by services started subsequently.  A last resort is to         # sleep for some time.         start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON         [ "$?" = 2 ] && return 2         # Many daemons don't delete their pidfiles when they exit.         rm -f $PIDFILE         return "$RETVAL"     }          #     # Function that sends a SIGHUP to the daemon/service     #     do_reload() {         #         # If the daemon can reload its configuration without         # restarting (for example, when it is sent a SIGHUP),         # then implement that here.         #         start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME         return 0     }          case "$1" in       start)         [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"         do_start         case "$?" in             0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;             2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;         esac         ;;       stop)         [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"         do_stop         case "$?" in             0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;             2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;         esac         ;;       status)         status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?         ;;       #reload|force-reload)         #         # If do_reload() is not implemented then leave this commented out         # and leave 'force-reload' as an alias for 'restart'.         #         #log_daemon_msg "Reloading $DESC" "$NAME"         #do_reload         #log_end_msg $?         #;;       restart|force-reload)         #         # If the "reload" option is implemented then remove the         # 'force-reload' alias         #         log_daemon_msg "Restarting $DESC" "$NAME"         do_stop         case "$?" in           0|1)             do_start             case "$?" in                 0) log_end_msg 0 ;;                 1) log_end_msg 1 ;; # Old process is still running                 *) log_end_msg 1 ;; # Failed to start             esac             ;;           *)             # Failed to stop             log_end_msg 1             ;;         esac         ;;       *)         #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2         echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2         exit 3         ;;     esac          :      My processes (filtered) after running 'sbecd start' and then 'sbecd status'               ~# ps -A | grep sbecd      3399 ?        00:00:00 sbecd      3594 ?        00:00:00 sbecd      Webmin shows the daemon as set to start at boot but that doesn't happen until I key in 'sbecd ', and 'sbecd stop' has no effect. I would like to know what I am doing wrong, and why I am seeing the behavior that I am. I have read through numerous tutorials and seen many examples, including this great one by Devin Watson at http://www.netzmafia.de/skripten/unix/linux-daemon-howto.html and was wondering if it is the daemon itself that is affecting the init.d where it is something I missed or set incorrectly.


title: Want to sort files by update date including sub-directories

text: I want to sort only files by update dates including sub-directories. I found out `ls -lrtR | grep ^-`. but it doesn't seem to sort by update dates. And I need to save this list into a file. Is it possible?               Apr 01 2010  InsideDoosanServiceImpl.class  // in A directory     Apr 08 2010  MainController.class  // in B directory     Apr 07 2010  RecommendController.class  // in B directory     Apr 01 2010  MainDao.class  // in B directory      I mean the whole list is not ordered by date, but first ordered by folder, and ordered by date. I want a list first ordered by date including all sub-directories.


title: Understanding Unit Masks on Perf

text: I'm counting events with `perf stat -e`. I consulted my processor manufacturer's manual and found the event I'm interested in. However, not only does it have the event number, but it also has a list of unit masks and their descriptions. What are they and how do I indicate to perf which I want? I know how to measure an event, but I don't know how to use unit masks. Update: here's the description from the manual: _NBPMCx1E0 CPU to DRAM Requests to Target Node_ This event counts all DRAM reads and writes generated by cores on the local node to the targeted node in the coherent fabric. This counter can be used to observe processor data affinity in NUMA aware operating systems.               UnitMask    Description     7           From Local node to Node 7     6           From Local node to Node 6     5           From Local node to Node 5     4           From Local node to Node 4     3           From Local node to Node 3     2           From Local node to Node 2     1           From Local node to Node 1     0           From Local node to Node 0


title: How do I create Restore Points in Arch Linux (or Linux in general)?

text: I am relatively new to Arch Linux and I really like its rolling-release concept. Now what I want to know is that before I do a system update via `pacman -Syu`, I want to create a _restore point_ so that should my system update fail, I can go back to the last good state my computer was in before the attempted system update. This is because once when I did a `pacman -Syu` on my Arch install, it b0rked my system and wouldn't boot. It happened when I still had minimal to no essential files on my computer so I did a fresh install. But now that I sort of slowly built a system much to my liking, I don't want to reinstall it from scratch and do all the things I have already done again should a system update break it. With a _restore point_ , I can most likely restore my computer without the hassle of reinstalling everything. So, how so I create, and use, _restore points_ in Arch linux?


title: Install Kali Linux on RAID0 (as dual boot Windows 7 & Kali)

text: I’m currently trying to install Kali Linux on my laptop as described here. The problem is I’ve a laptop (MSI GT70) with a Raid 0 (2x 500Gb) and Windows 7 installed on it. At the point where I’ve to select the device for the boot loader installation, selecting `/dev/sda5` (as described in the tutorial) won’t work. While searching for a solution I’ve found this Q&A which says that I’ve to enter the name of the raid array.   I’ve tried to find the name of my raid using the command `ls –l /dev/mapper`, which doesn’t work: it only prints one entry to the console (`crw-rw-rw 1 root ……. control`). How can I find the correct device for the boot loader? (Btw. I come from the windows world and I’ve almost no Linux experience…)


title: I need an fstab example for archivemount (want to umount without my password)

text: I am using archivemount to mount one of several tar.bz files in Ubuntu. It works very nicely for me. I mount and umount frequently (I'm in a testing phase). I want a solution that will allow me to umount without typing in my password. Here's my current script:               ARCHIVE=$(zenity --file-selection --filename=/share/);     archivemount $ARCHIVE /media/Archive/     echo "when finished use: sudo umount /media/Archive/"      My goal is to simply be able to `umount` quickly and easily without typing my password. I understand that adding an fstab entry will do the trick, but I cannot find the correct format for the fstab entry when using archivemount. Other solutions approaches are welcome.


title: What jabber server for personal use?

text: Using Debian or Ubuntu, what would be the jabber server of choice for small- scale setups? I mean a setup with probably under 100 user accounts. Key features:   * sane and secure defaults   * easy and convenient setup   * a good security track-record   * low resource usage


title: How to add additional control key?

text: I am using xkb to add an additional control key as follows:                  key <HENK> { [  Control_R                 ] };      However, it does not work. I even tried xmodmap without success:               xmodmap -e "keysym Henkan_Mode = Control_R"      I had no problems adding additional shift key using similar codes as above. So I don't understand why the same code does not work with the control key.


title: Getting error in modified GNOME extension code

text: Recently I am getting started with GNOME extensions development. By executing `gnome-shell-extension-tool --create-extension` in terminal I have created hello world extension but when I change the code to build a pop-up like extension I am getting this error ![enter image description here](http://i.stack.imgur.com/pFnce.png) The JS code I am using is               const St = imports.gi.St;     const Mainloop = imports.mainloop;     const Main = imports.ui.main;     const Shell = imports.gi.Shell;     const Lang = imports.lang;     const PopupMenu = imports.ui.popupMenu;     const PanelMenu = imports.ui.panelMenu;     const Gettext = imports.gettext;     const MessageTray = imports.ui.messageTray;          const _ = Gettext.gettext;          function _myButton() {         this._init();     }          _myButton.prototype = {         __proto__: PanelMenu.Button.prototype,              _init: function() {             PanelMenu.Button.prototype._init.call(this, 0.0);             this._label = new St.Label({ style_class: 'panel-label', text: _("HelloWorld Button") });             this.actor.set_child(this._label);             Main.panel._centerBox.add(this.actor, { y_fill: true });                  this._myMenu = new PopupMenu.PopupMenuItem(_('HelloWorld MenuItem'));             this.menu.addMenuItem(this._myMenu);             this._myMenu.connect('activate', Lang.bind(this, _showHello));         },              _onDestroy: function() {}     };          function _showHello() {              let text = new St.Label({ style_class: 'helloworld-label', text: _("Hello, world!") });         let monitor = global.get_primary_monitor();              global.stage.add_actor(text);         text.set_position(Math.floor (monitor.width / 2 - text.width / 2),                           Math.floor(monitor.height / 2 - text.height / 2));              Mainloop.timeout_add(3000, function () { text.destroy(); });     }               function main(extensionMeta) {              let userExtensionLocalePath = extensionMeta.path + '/locale';         Gettext.bindtextdomain("helloworld", userExtensionLocalePath);         Gettext.textdomain("helloworld");              let _myPanelButton = new _myButton();     }      Can anyone tell me why I am getting this error. I am using Fedora 20 with GNOME Shell 3.10.2.1


title: tshark command for finding MAC of a specified network

text: What tshark command could start listening to a specific network and see who (MAC-wise) is connecting to it? I already have the network card in monitor mode at the correct channel. WireShark can already perform this task, but I'd prefer something without a GUI.


title: After enabling SELinux (permissive mode) on Debian Wheezy, gdm3 does not finish loading

text: I recently enabled SELinux on my Debian Wheezy system, in permissive mode (I have confirmed that it is indeed operating in permissive mode). However, after the file labelling double-reboot, gdm3 doesn't seem to start properly. The SELinux setup details are in What's missing with my SELinux installation? (until there is a proper answer on that question, make sure to also check the comments on the question as they contain vital information). **Specifically,** gdm3 just sits spinning the doughnut "wait" mouse cursor. I can move the mouse around, but even several minutes (fifteen minutes and counting at the time of this writing), I don't get the login dialog box. Logging into a text-based shell and issuing `startx` with an old-school ~/.xsession does give me my usual desktop virtually instantly, so it's not a general problem with X, although it did give off a complaint about unable to start something that had to do with notifications. (That might be related simply to running multiple unrelated X client sessions on the same host.) I checked /var/log/messages and there's a small handful of selinux "denied" entries in there from during the boot, but nothing that seems related to either X or gdm3. I also don't see anything out of the ordinary in /var/log/X* or /var/log/gdm3/*. Considering that I'm running in permissive mode, SELinux shouldn't be getting in the way. **How do I figure out what's wrong? How do I fix it?** (I have no particular reason to use gdm3 other than that it's what was enabled by default on Wheezy; if the fix is "use some other display manager", I'm perfectly fine with that, but if so I appreciate specific steps to change that.) The question Debian 7 black screen after loading OS appears to be about a similar issue but indicates there is no mouse cursor either, but it has no answers, no comments, might have nothing at all to do with SELinux (which I feel is likely to be the culprit here, somehow), and hasn't seen any activity for half a year.


title: UNIX paste columns and insert zero's for all missing values

text: I would like to merge specific columns from two txt files containing varying number of rows, but same number of columns (as shown below):                 file1:       xyz   desc1   12       uvw   desc2   55       pqr   desc3   12            file2:       xyz   desc1   56       uvw   desc2   88                 Preferred output:       xyz   desc1   12  56       uvw   desc2   55  88       pqr   desc3   12   0      Currently I use the paste command using awk as:                 paste <(awk '{print $1}' file1) <(awk '{print $2}' file1) <(awk '{print $3}' file1) <(awk '{print $3}' file2)       But this seems to merge only columns that overlap. Is there a way in awk to insert zeros instead of omitting the row itself? I need to combine 100 files together such that my output file will contain 102 columns.