title: Double GNOME UI elements with Xinerama

text: I have a Debian 7.0 system which I'm trying to set up with 3 monitors. I'm using a Quadro NVS 420 card with the latest NVidia drivers. I configured it using Xinerama and the nvidia-settings utility, and the three desktops appear just fine, but on the main one all of the GNOME UI elements are duplicated, e.g. the menu items at the top black bar all appear twice. Each menu of the duplicates is fully functional so it's not just a display issue. I don't even know where to look for what would cause this. Here is my xorg.conf:               # nvidia-settings: X configuration file generated by nvidia-settings     # nvidia-settings:  version 295.59  (buildmeister@swio-display-x86-rhel47-03.nvidia.com)  Wed Jun  6 22:23:02 PDT 2012          Section "ServerLayout"         Identifier     "Layout0"         Screen      0  "Screen0" 0 0         Screen      1  "Screen1" 3360 0         Screen      2  "Screen2" 1680 0         InputDevice    "Keyboard0" "CoreKeyboard"         InputDevice    "Mouse0" "CorePointer"         Option         "Xinerama" "1"     EndSection          Section "Files"     EndSection          Section "InputDevice"         # generated from default         Identifier     "Mouse0"         Driver         "mouse"         Option         "Protocol" "auto"         Option         "Device" "/dev/psaux"         Option         "Emulate3Buttons" "no"         Option         "ZAxisMapping" "4 5"     EndSection          Section "InputDevice"         # generated from default         Identifier     "Keyboard0"         Driver         "kbd"     EndSection          Section "Monitor"         # HorizSync source: edid, VertRefresh source: edid         Identifier     "Monitor0"         VendorName     "Unknown"         ModelName      "DELL 2009W"         HorizSync       30.0 - 83.0         VertRefresh     56.0 - 75.0         Option         "DPMS"     EndSection          Section "Monitor"         # HorizSync source: edid, VertRefresh source: edid         Identifier     "Monitor1"         VendorName     "Unknown"         ModelName      "DELL 2009W"         HorizSync       30.0 - 83.0         VertRefresh     56.0 - 75.0         Option         "DPMS"     EndSection          Section "Monitor"         # HorizSync source: edid, VertRefresh source: edid         Identifier     "Monitor2"         VendorName     "Unknown"         ModelName      "DELL 2009W"         HorizSync       30.0 - 83.0         VertRefresh     56.0 - 75.0         Option         "DPMS"     EndSection          Section "Device"         Identifier     "Device0"         Driver         "nvidia"         VendorName     "NVIDIA Corporation"         BoardName      "Quadro NVS 420"         BusID          "PCI:3:0:0"         Screen          0     EndSection          Section "Device"         Identifier     "Device1"         Driver         "nvidia"         VendorName     "NVIDIA Corporation"         BoardName      "Quadro NVS 420"         BusID          "PCI:4:0:0"     EndSection          Section "Device"         Identifier     "Device2"         Driver         "nvidia"         VendorName     "NVIDIA Corporation"         BoardName      "Quadro NVS 420"         BusID          "PCI:3:0:0"         Screen          1     EndSection          Section "Screen"         Identifier     "Screen0"         Device         "Device0"         Monitor        "Monitor0"         DefaultDepth    24         Option         "TwinView" "0"         Option         "TwinViewXineramaInfoOrder" "DFP-1"         Option         "metamodes" "DFP-0: nvidia-auto-select +0+0"         SubSection     "Display"             Depth       24         EndSubSection     EndSection          Section "Screen"         Identifier     "Screen1"         Device         "Device1"         Monitor        "Monitor1"         DefaultDepth    24         Option         "TwinView" "0"         Option         "TwinViewXineramaInfoOrder" "DFP-0"         Option         "metamodes" "nvidia-auto-select +0+0"         SubSection     "Display"             Depth       24         EndSubSection     EndSection          Section "Screen"         Identifier     "Screen2"         Device         "Device2"         Monitor        "Monitor2"         DefaultDepth    24         Option         "TwinView" "0"         Option         "TwinViewXineramaInfoOrder" "DFP-1"         Option         "metamodes" "DFP-1: nvidia-auto-select +0+0"         SubSection     "Display"             Depth       24         EndSubSection     EndSection          Section "Extensions"         Option         "Composite" "Disable"     EndSection


title: group option in fstab not working

text: I'm trying to take advantage of the "group" option for fstab entries and not having any success. From the `mount` man page: > Normally, only the superuser can mount filesystems. However, when fstab > contains the user option on a line, anybody can mount the corresponding > system. ... If any user should be able to unmount, then use users instead of > user in the fstab line. The owner option is similar to the user option, with > the restriction that the user must be the owner of the special file. This > may be useful e.g. for /dev/fd if a login script makes the console user > owner of this device. **The group option is similar, with the restriction > that the user must be member of the group of the special file.** I'm testing with a loopback mount using a 1GB file /blergh with an ext4 filesystem on it. That file is owned by root:disk with permissions 664. I have a mount point /media/blergh owned by root:disk with permissions 775. I have an fstab entry like so: `/blergh /media/blergh ext4 loop,rw,noauto,group 0 2` Running `mount /media/blergh` as `root` works fine. Running it as `myuser` gives the error: `mount: only root can mount /blergh on /media/blergh`. The output of `/usr/bin/groups` as `myuser` is `myuser disk` so the group membership is there. If I change `group` to `user` in the options, `myuser` can mount the filesystem. What am I doing wrong? Why isn't the `group` option working? (Note: for reasons I don't want to get into here, I do not want to solve the problem of enabling `myuser` to mount this filesystem by using `sudo`.) * * * **Edit 20-MAY-2013:** Additional testing with a real block device suggests the problem lies with `loop` rather than `group`. I created a new 1GB EBS volume attached as /dev/sdg, owned by root:disk, permissions 664. I created this fstab entry for it: `/dev/sdg /media/sdg ext4 rw,noauto,group 0 0` Same as before, just no `loop` since it does not apply here. I created a mount point for this filesystem at /media/blerg, owned by root:disk, permissions 775. As before `myuser` is a member of the `disk` group. Using this test setup `mount /media/sdg` as `myuser` works fine, as does `umount /media/sdg`.


title: Running a command on the remote host with interactive SSH (conditionally)

text: I would like to be able to automatically run a command on a remote host each time I log into that host, but within the current interactive SSH session. Something like               ssh user@remotehost [run do.sh]      where `do.sh` does a couple of housekeeping tasks and then reattaches to a `screen` session (currently I run `do.sh` manually after logging into the host). I don't want to add it to `.bashrc` because I login to this host from other machines and I don't want `do.sh` to run when I do login from there so I need it to be optional.


title: How to give ftp access to sub-directory only not to parent

text: I want to give SFTP access to user `tom` for directory `/var/www/html/my_project/`. while I don't want to give any SFTP access to directory `/var/www/html/`. currently `/var/www/html/my_project/` and `/var/www/html/` is owned by apache user.I need to give access only to `/var/www/html/my_project/` directory for both user tom as well as apache. Once access is given tom can access all the directories which are under /var/www/html/my_project/. Please help me I am struggling since a long time.


title: How do I build Lynx with SSL on Mac OS X?

text: I'd like to build and install Lynx on Mac OS X. I've found out that building is as simple as running `./configure`, but I'm having trouble building with SSL support. I've downloaded openSSL. How do I include it in my build?


title: SIOCSIFNETMASK: Invalid argument using OpenVPN on Ubuntu

text: Trying to configure OpenVPN client on my Ubuntu desktop. ### Conf file:               remote 192.168.11.103     #192.168.11.103     #85.249.45.106     #dev-node tap0     dev tap     port 5027     ifconfig 10.9.0.74 10.9.0.73     route 192.168.10.0 255.255.255.0 10.9.0.21     route 192.168.11.0 255.255.255.0 10.9.0.21     route 192.168.12.0 255.255.255.0 10.9.0.21     secret /home/k102/Documents/27-73-74_sergeev2.key     verb 4     tun-mtu 1400     mute 10     auth MD5     cipher DES-CBC     comp-lzo      ### Command:               sudo openvpn --config 27-73-74_sergeev2.ovpn      But I get this error:               Sun Feb 12 12:27:01 2012 us=30542 /sbin/ifconfig tap0 10.9.0.74 netmask 10.9.0.73 mtu 1400 broadcast 255.255.255.254     SIOCSIFNETMASK: Invalid argument     Sun Feb 12 12:27:01 2012 us=36280 Linux ifconfig failed: external program exited with error status: 1     Sun Feb 12 12:27:01 2012 us=36329 Exiting      I can't figure out what I have to do with it. How can I fix this?


title: Is linux.org still maintaining their OS? Who's using it?

text: There are many distributions of linux, so is linux.org still maintaining their orginal OS? If yes, then why use it when you can get Ubuntu, Debian, Centos, etc?


title: What are the different software packaging formats and which distributions support them as part of base install?

text: Which distros support RPMs? Which distros support DEB packages? What other distros and package formats exists? Here is what I think I know, but am interested in getting a more precise answer:   * RPM - Redhat, Fedora, CentOS, SUSE   * DEB - Debian, Ubuntu,    * Pacman - Arch   * tar.gz - all, depends on what is in the compressed file though Lots of others probably in the long tail. I know you can use 'alien' to convert RPM to DEB, but it isn't installed by default in new Ubuntu setup so not counting that.


title: Is it 'possible' to transfer a VM to the metal?

text: How can one take a VM and make it run on the machine?


title: httpd-devel requires outdated version of glibc-common on CentOS 6.3

text: httpd-devel requires an outdated version of glibc-common on CentOS 6.3 x86_64 and Apache/2.2.15. It wants 2.12-1.80.el6 and I have 2.12-1.80.el6_3.3.x86_64 installed (via CentOS @update repo) Here is the error when I run "yum install httpd-devel.x86_64" > Error: Package: glibc-2.12-1.80.el6.i686 (base):                  Requires: glibc-common = 2.12-1.80.el6        Installed: glibc-common-2.12-1.80.el6_3.3.x86_64 (@updates)            glibc-common = 2.12-1.80.el6_3.3        Available: glibc-common-2.12-1.80.el6.x86_64 (base)            glibc-common = 2.12-1.80.el6      with "yum install httpd-devel.x86_64 --skip-broken", I get: Packages skipped because of dependency problems:               > apr-1.3.9-3.el6_1.2.i686 from base apr-devel-1.3.9-3.el6_1.2.x86_64     > from base apr-util-devel-1.3.9-3.el6_0.1.x86_64 from base     > cyrus-sasl-devel-2.1.23-13.el6.x86_64 from base     > db4-cxx-4.7.25-17.el6.x86_64 from base db4-devel-4.7.25-17.el6.x86_64     > from base glibc-2.12-1.80.el6.i686 from base     > 1:httpd-devel-2.2.15-15.el6.vm.1.x86_64 from virtualmin     > libuuid-2.17.2-12.7.el6.i686 from base     > nss-softokn-freebl-3.12.9-11.el6.i686 from base     > openldap-devel-2.4.23-26.el6.x86_64 from base      Bottom line, **I can't get httpd-devel installed.** Could this be a priority problem?               priority = 1 [asl-3.0]     priority = 1 [base]     priority = 1 [virtualmin]     priority = 1 [virtualmin-universal]     priority = 50 [epel]          repo id | repo name | status     C6.0-base |  CentOS-6.0 - Base | disabled     C6.0-centosplus | CentOS-6.0 - CentOSPlus | disabled     C6.0-contrib | CentOS-6.0 - Contrib |  disabled     C6.0-extras |  CentOS-6.0 - Extras |  disabled     C6.0-updates | CentOS-6.0 - Updates |  disabled     C6.1-base |  CentOS-6.1 - Base | disabled     C6.1-centosplus | CentOS-6.1 - CentOSPlus | disabled     C6.1-contrib | CentOS-6.1 - Contrib |  disabled     C6.1-extras |  CentOS-6.1 - Extras |  disabled     C6.1-updates | CentOS-6.1 - Updates |  disabled     C6.2-base |  CentOS-6.2 - Base | disabled     C6.2-centosplus | CentOS-6.2 - CentOSPlus | disabled     C6.2-contrib | CentOS-6.2 - Contrib |  disabled     C6.2-extras |  CentOS-6.2 - Extras |  disabled     C6.2-updates | CentOS-6.2 - Updates |  disabled     asl-3.0 | Atomicorp - - Atomic Secured Linux 3.0 | enabled: | 623     asl-3.0-testing | Atomicorp - - Atomic Secured Linux 3.0 (TESTING) | disabled     base | CentOS-6 - Base | enabled: | 6,346     c6-media |  CentOS-6 - Media | disabled     centosplus |  CentOS-6 - Plus | disabled     contrib | CentOS-6 - Contrib | disabled     debug | CentOS-6 - Debuginfo |  disabled     epel | Extra Packages for Enterprise Linux 6 - x86_64 |  enabled: 7,627+125     epel-debuginfo | Extra Packages for Enterprise Linux 6 - x86_64 - Debug |  disabled     epel-source |  Extra Packages for Enterprise Linux 6 - x86_64 - Source | disabled     epel-testing | Extra Packages for Enterprise Linux 6 - Testing - x86_64 | disabled     epel-testing-debuginfo | Extra Packages for Enterprise Linux 6 - Testing - x86_64 - Debug | disabled     epel-testing-source |  Extra Packages for Enterprise Linux 6 - Testing - x86_64 - Source | disabled     extras | CentOS-6 - Extras | enabled: |  4     updates | CentOS-6 - Updates | enabled: | 0+523     virtualmin |  RHEL/CentOS/Scientific 6 - x86_64 - Virtualmin |  enabled: | 73     virtualmin-universal | Virtualmin Distribution Neutral Packages | enabled: | 187+1      Apache is from:               rpm -qi httpd     Name        : httpd                        Relocations: (not relocatable)     Version     : 2.2.15                            Vendor: (none)     Release     : 15.el6.vm.1                   Build Date: Thu 17 May 2012 03:35:08 AM UTC     Install Date: Thu 28 Jun 2012 05:13:47 AM UTC      Build Host: srv1.cloud.virtualmin.com     Group       : System Environment/Daemons    Source RPM: httpd-2.2.15-15.el6.vm.1.src.rpm     Size        : 3067984                          License: ASL 2.0     Signature   : DSA/SHA1, Thu 17 May 2012 03:09:42 PM UTC, Key ID e8dd3fa0a0bdbcf9     URL         : http://httpd.apache.org/     Summary     : Apache HTTP Server


title: Primary network interface in Linux

text: I have a server box with two interfaces. One of the interfaces is connected to the internal network, another - to external. I have assigned IP 192.168.1.200 to internal interface (eth0). I have some local daemons listening on this IP/interface (cups, nginx, pdns). External IP is 192.168.0.91 (eth1). Here I have only NAT masquerading. Strange things happens whenever I'm trying to access server box from itself. If I'm trying to open webpage, located on 192.168.1.200, server uses 192.168.0.91 address and I'm getting permission denied (webserver protected to serve content on internal network only). If I'm bring down eth1, server work OK and uses internal IP. But, as soon, as I will bring up eth1 it will immediately pick up it's IP as primary one and I will get permission denied again. How can I explicitly set main IP/interface to use? I'm running 64-bit version of Gentoo Linux. Both nic's drivers are compiled as modules. I'm using systemd as my init system. **EDIT:** Thanks for responses, but most interesting part is coming here:               atomic ~ # cat /etc/resolv.conf     domain local     search local     nameserver 192.168.1.200          atomic ~ # cat /etc/hosts     ...     192.168.1.200   atomic ns.atomic.local atomic.local     ...      Address resolving just OK:               atomic ~ # dig atomic.local 192.168.1.200          ; <<>> DiG 9.9.4 <<>> atomic.local     ;; global options: +cmd     ;; Got answer:     ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 38797     ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1          ;; OPT PSEUDOSECTION:     ; EDNS: version: 0, flags:; udp: 2800     ;; QUESTION SECTION:     ;atomic.local.          IN  A          ;; ANSWER SECTION:     atomic.local.       604800  IN  A   192.168.1.200          ;; Query time: 42 msec     ;; SERVER: 192.168.1.200#53(192.168.1.200)     ;; WHEN: Tue May 27 13:37:04 EEST 2014     ;; MSG SIZE  rcvd: 55      And Nginx logs of accessing via wget:               atomic ~ # wget atomic.fhn     --2014-05-27 13:45:58--  http://atomic.local/     Resolving atomic.local... 192.168.1.200     Connecting to atomic.local|192.168.1.200|:80... connected.     HTTP request sent, awaiting response... 200 OK     Length: unspecified [text/html]     Saving to: ‘index.html’          [ <=>                                              ] 0  --.-K/s   in 0s                2014-05-27 13:45:58 (0.00 B/s) - ‘index.html’ saved [0]          atomic ~ # tail -n 1 /var/log/nginx/access_log     192.168.0.91 - - [27/May/2014:13:45:58 +0300] "GET / HTTP/1.1" 200 5 "-" "Wget/1.14 (linux-gnu)"      I got 200/OK HTTP status, because I have disabled IP/network filtering while problem is not solved. Routing table:               192.168.0.0/30 dev wan  proto kernel  scope link  src 192.168.0.2      192.168.1.0/24 dev lan  proto kernel  scope link  src 192.168.1.200       **EDIT2:** Routing table with metric used:               192.168.0.0/30 dev wan  scope link  metric 20      192.168.1.0/24 dev lan  scope link  metric 10      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.0.0 dev wan  table local  proto kernel  scope link  src 192.168.0.2      local 192.168.0.2 dev wan  table local  proto kernel  scope host  src 192.168.0.2      broadcast 192.168.0.3 dev wan  table local  proto kernel  scope link  src 192.168.0.2      broadcast 192.168.1.0 dev lan  table local  proto kernel  scope link  src 192.168.1.200      local 192.168.1.200 dev lan  table local  proto kernel  scope host  src 192.168.1.200      broadcast 192.168.1.255 dev lan  table local  proto kernel  scope link  src 192.168.1.200


title: shell script to read from multiple files in parallel

text: I need to write a script that runs parallel and looks for a string in multiple files.   I tried a lot of options but they slow down the speed of my processor.


title: Script failing with "command not found: ^M"

text: When I try to run the following script in zsh, via the command `/bin/zsh ~/.set_color_scheme.sh` I get the following error:               command not found: ^M      The script has `u+x` permissions and it used to work on another machine that also had zsh. Any clues why? **Note:** This question is related to this other question (where I am trying to adapt the script for `tcsh`)               #!/bin/zsh     # Contents of set_color_scheme.sh          export LS_COLORS=$( \     ( grep '\w' | grep -v '^#' | sed 's/#.\+//' | perl -lane 'printf "%s=%s:", shift @F, join ";", @F;' ) <<< "          # HUMAN_FORMATTED_DATA     # list one per line          # these are basic filesystem items     no 00          # normal     fi 00          # file     di 01 34       # directory     ln 00 36       # link     pi 40 33       # pipe     so 00 35       #     bd 40 33 01     cd 40 33 01     or 01 05 37 41     mi 01 05 37 41     ex 00 91       # executable     ow 01 34       # other writables               *.cmd 00 32     *.exe 00 32          # archive, compressed things etc     *.gz  00 90     *.bz2 00 90     *.bz  00 90     *.tz  00 90     *.rpm 00 90     *.rar 00 90     *.zip 00 90     *.iso 00 90               *.cpio 00 31                    # perl & CODE     *.c      33     *.h      33     *.sh     33     *.t      33     *.pm     33     *.pl     33     *.cgi    33     *.pod    33     *.PL     33     *.js     33     *.php    33     #*.xs          # strikethrough     *.off 00 9     *.bak 00 9     *.old 00 9               # documents misc, html webstuff     # really TEXT     *.htm    94     *.html   94     *.txt    94     *.text   94     *.css    94               # MOVIE     *.avi    96     *.wmv    96     *.mpeg   96     *.mpg    96     *.mov    96     *.AVI    96     *.WMV    96     *.mkv    96          # images & pdf     *.jpg    96     *.jpeg   96     *.png    96     *.xcf    96     *.JPG    96     *.gif    96     *.svg    96     *.eps 00 96     *.pdf 00 96     *.PDF 00 96     *.ps  00 96          *.ai  00 91 # adobe ill     *.doc 00 91 # msword shit          # data, such as .db, .csv     *.csv    95     *.dsv    95     *.db     95     *.sql    95     *.meta   95     # CONFS     *.xml    95     *.yaml   95     *.yml    95     *.conf   95     # [a-z0-9]*rc     ")


title: How to run a command against all the files of particular types on a filesystem?

text: I've just recovered tons of files (distributed in a complex directory structure, having very long names, using Unicode symbols, spaces etc in names) from a damaged hard drive. Now I'd like to verify all files which contain verification information (like zip archives (including LibreOffice and other XML-in-ZIP kind documents), 7z and rar archives, self-extracting exe arcives etc.) How can I achieve this?


title: Shell script printing the most visited directories

text: Is there a way to write a bash script with the following functionalities?   1. Be launched when I press some key or key combination. (not so important requirement)   2. Identify the 7 most visited directories in last 3 hours.   3. Offer me the list of this 7 directories so I can cycle through them with tab and shift-tab (backward). Then press enter would mean cd to the selected directory. thank you


title: Hight iowait while the wMB/s is low

text: I was indexing a MySQL table. It makes a high load on that computer. It seems due to a high iowait. But it also shows that the wMB/s is only 2.87. Isn't even a common SATA HDD able to handle more than 2.87MB/s? Why is process so slow then? `iostat -x` reports:               avg-cpu:  %user   %nice %system %iowait  %steal   %idle                1.74    0.00    3.48   47.51    0.00   47.26          Device:         rrqm/s   wrqm/s     r/s     w/s    rMB/s    wMB/s avgrq-sz avgqu-sz   await  svctm  %util     sda               0.00   300.00    0.00  383.00     0.00     2.87    15.35   142.00  374.64   2.61  99.90     sdb               0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00   0.00   0.00     scd0              0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00   0.00   0.00     sdc               0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00   0.00   0.00     dm-0              0.00     0.00    0.00 2507.00     0.00     9.79     8.00   263.88  110.06   0.40  99.90     dm-1              0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00   0.00   0.00     dm-2              0.00     0.00    0.00    2.00     0.00     0.01     8.00     0.41  196.00 202.50  40.50     dm-3              0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00   0.00   0.00


title: Grep: Show all the file up to the match

text: `grep --before-context 5` shows 5 lines before the match. I want to show everything before the match.   Doing `grep --before-context 99999999` would work but it is not very... professional. How to show all the file up to the match?


title: How do I maintain a separate (newer) glibc / gcc / ... stack as non-root on Linux

text: Our computation cluster runs a very old version of CentOS, with an old Kernel (2.6.18) and, of course, old libs and binaries. Because updating the whole thing requires a lot of work on all the nodes, this is not an option. I am trying to compile and use a program that requires `C++11` and therefore newer versions of `gcc` (and/or `clang`). Because I do not want to mess around with the system at all, I want to do this as a non-root user in some local directory tree. The problem is, that `gcc` requires a newer `glibc` than the one that is present on the machine(s). Hence, I need to maintain a separate, newer version of `glibc` in my local `lib/` tree, probably as described here. Where I am lost is, how do I "hardcode" the paths of my local libs into all the required binaries, i.e., `gcc`, `g++` etc.? Setting LD_LIBRARY_PATH to my local `lib/` tree causes all system binaries not to work anymore (`ELF file OS ABI invalid`) because they want to use my new `libm.so`/`libc.so` against which they have not been compiled. So, to wrap it up: What is the proper way to maintain a newer, local development stack (containing `glibc`, `gcc` etc.) in parallel to an old system without messing around as root? As a side question: Setting LD_LIBRARY_PATH is posted as a solution all over SE when it comes to separate `glibc`. For me, it causes the errors above when I try to execute any system binary (like `ls`). How come? Did I do something wrong or is this the intended behaviour?


title: Adding wlan0 to xenbr0

text: I'm setting up xen on debian to do some testing and having problems with the bridge. I would like to use wlan0 as the bridge, but can't seem to get this working. Currently I have tried this:               # This file describes the network interfaces available on your system     # and how to activate them. For more information, see interfaces(5).          # The loopback network interface     auto lo     iface lo inet loopback          auto wlan0     iface wlan0 inet manual         wpa-ssid "myssid"         wpa-psk mypasscode          auto xenbr0     iface xenbr0 inet dhcp         bridge_ports wlan0      "But then it displays: can't add wlan0 to bridge xenbr0: Operation not supported" It this even possible?


title: How to interpret the output of 'lsusb' -- What are all these Linux Foundation root hubs?

text: I recently found out about the lsusb command while troubleshooting a headset issue.. My laptop runs debian and doesn't have anything plugged into USB currently, but when I run the "lsusb" command, I still get quite a bit of output:               root@t500:~# lsusb     Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub     Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub     Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub     Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub     Bus 004 Device 003: ID 0a5c:2145 Broadcom Corp. Bluetooth with Enhanced Data Rate II     Bus 004 Device 002: ID 08ff:2810 AuthenTec, Inc. AES2810     Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub     Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub     Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub     Bus 001 Device 002: ID 0781:b6d0 SanDisk Corp.      Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub      Could someone break down what this means in more detail? The SanDisk card is connected via PCMCIA, not USB. Are both PC cards and USB devices listed in lsusb? I don't have any external bluetooth connected, why would this display? Why are some root hubs 1.1, and some 2.0? Does that mean some of my USB ports are 2.0 and others aren't? What is a root hub exactly, just an empty USB port?


title: Do files change while passing from ext2 to ext3 to ext4?

text: If one creates a file on an ext2 (or ext3 or ext4) partition, then moves from one partition to another, each formatted differently, does any part of that file change? Once returned to the original file system, is the file exactly the same as it was initially?


title: What does the "f" in fdisk stand for?

text: `gdisk` stands for GPT fdisk. `cfdisk` stands for curses fdisk. And so on and so forth. However, what does the original "f" in `fdisk` stand for? The only things I can think of would be either "files" or "floppy", but neither of these make a ton of sense.


title: How to navigate the panel by keyboard to launch applications in XFce4?

text: In most applications, I can use TAB, TAB, to navigate from one button to the next, then ENTER to select it. I placed several launchers on the XFce4 panel. Is there any way to launch items located there by navigating with the keyboard using TAB and ENTER or similar keyboard shortcuts?


title: How to make partitions with in /home/user/ writable by user?

text: I have a partition scheme like this:               /     /home/     /home/user/files/      When logged in as `user`, I cannot save any files at `/home/user/files/`. The only solution I can find is to create a new subdirectory as root, e.g. `/home/user/files/files/`, then as root, change the ownership to `user`. That would allow me to put files into `/home/user/files/files/`. How can I create partitions within `/home/user/`, but which are still usable, as if they were simply folders, by the ordinary `user` account? Preferably, the user account should not have the ability to accidentally delete this partition.


title: Updating OpenSSL on a SLES11 server

text: We are concerned with the OpenSSL vulnerabilities and are running a SLES11SP1 server. unfortunately, due to admin reasons, our support expired, and so we are looking at manually upgdating OpenSSL and its required libraries manually. Is there a script, or recommended way to get the latest version of OpenSSL and make either an RPM or install the modules directly on the OS ?


title: Ubuntu hangs on boot

text: After installation mount manger software, upon restarting ubuntu won't boot up . It hangs on boot splash screen and doesn't move further. I have duel boot running in this computer so, I can boot and working from windows but ubuntu not working . Firstly I am beginner ubuntu user, so if you please help me to recover it out. I have used liveusb to check some data to show you ->   1. `cat /etc/fstab`              overlayfs / overlayfs rw 0 0     tmpfs /tmp tmpfs nosuid,nodev 0 0     /dev/sda7 swap swap defaults 0 0        2. `cat /proc/mounts`              rootfs /      rootfs rw 0 0          sysfs /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0          proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0          udev /dev devtmpfs rw,relatime,size=975124k,nr_inodes=215293,mode=755 0 0     devpts /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0          tmpfs /run tmpfs rw,nosuid,relatime,size=393104k,mode=755 0 0          /dev/sdb1 /cdrom vfat rw,relatime,fmask=0022,dmask=0022,codepage=cp437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro 0 0          /dev/loop0 /rofs squashfs ro,noatime 0 0     /dev/loop1 /cow ext2 rw,noatime,errors=continue 0 0     /cow / overlayfs rw,relatime,lowerdir=//filesystem.squashfs,upperdir=/cow 0 0     none /sys/fs/fuse/connections fusectl rw,relatime 0 0     none /sys/kernel/debug debugfs rw,relatime 0 0     none /sys/kernel/security securityfs rw,relatime 0 0     tmpfs /tmp tmpfs rw,nosuid,nodev,relatime 0 0     none /run/lock tmpfs rw,nosuid,nodev,noexec,relatime,size=5120k 0 0     none /run/shm tmpfs rw,nosuid,nodev,relatime 0 0     gvfs-fuse-daemon /home/ubuntu/.gvfs fuse.gvfs-fuse-daemon rw,nosuid,nodev,relatime,user_id=999,group_id=999 0 0          /dev/sda3 /media/Graphics fuseblk rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096 0 0        3. `blkid`              /dev/loop0: TYPE="squashfs"           /dev/loop1: UUID="f454a989-37c0-524b-9e0d-6872d19861f1" TYPE="ext2"           /dev/sda1: UUID="1864429A64427A90" TYPE="ntfs"           /dev/sda2: LABEL="Software" UUID="F8943AAB943A6BEE" TYPE="ntfs"           /dev/sda3: LABEL="Graphics" UUID="9E3A7A6A3A7A3EF9" TYPE="ntfs"           /dev/sda5: LABEL="Movies" UUID="66D2A583D2A557D7" TYPE="ntfs"           /dev/sda6: LABEL="Tutorial and Books" UUID="4E9CCE589CCE3A6B" TYPE="ntfs"           /dev/sda7: UUID="761629dd-18f7-4340-a208-46bef89e6b47" TYPE="swap"           /dev/sda8: UUID="ca3cbc99-30e2-405d-ba3a-29ae9bad8de6" TYPE="ext4"           /dev/sdb1: LABEL="WIN 7" UUID="146A-F8DB" TYPE="vfat"      ::::UPDATE::: I Just fixed this problem! In my question , what code i posted about `cat /etc/fstab` are about my live- usb boot **fstab** code and obviously wrong code for this problem. Which down me and fellow answerer @Graeme under confusion. I have boot my live-system again to backup somefiles then I noticed my problematic drive which is namely `31GB filesystem` for me. Then from terminal i used `gksudo nautilus` to browse that drive as administrator. I have found anohter **fstab** file in **/etc** folder. I opened that fstab file using gedit and contents of that file was -- > > `UUID=9E3A7A6A3A7A3EF9 /media/Graphics ntfs-3g users 0 0 > UUID=ca3cbc99-30e2-405d-ba3a-29ae9bad8de6 / ext4 users 0 1 > UUID=F8943AAB943A6BEE /media/Software ntfs-3g users 0 0 > UUID=761629dd-18f7-4340-a208-46bef89e6b47 swap swap sw 0 0` Then I just changed **users** to **defaults** and saved fstab file. After rebooting my system, it's working again like one day before!


title: FILE size limitation according to Robert Love's textbook

text: From Robert Love's _Linux System Programming_ (2007, O'Reilly), this is what is given in the first paragraph (Chapter 1, Page 10): > The file position’s maximum value is bounded only by the size of the C type > used to store it, which is 64-bits in contemporary Linux. But in the next paragraph he says: > A file may be empty (have a length of zero), and thus contain no valid > bytes. The maximum file length, as with the maximum file position, is > bounded only by limits on the sizes of the C types that the Linux kernel > uses to manage files. I know this might be very, very basic, but is he saying that the file size is limited by the _FILE_ data type or the _int_ data type?


title: Duplex printing options using lp or lpr

text: The default options for a Brother MFC-9340CDW printer, are reportedly (e.g. querried via `lpoptions -l`) set to:               PageSize/Media Size: *A4 Letter Legal Executive A5 A6 B5 JISB5 JISB6 EnvDL EnvC5 Env10 EnvMonarch Br3x5 FanFoldGermanLegal EnvPRC5Rotated Postcard EnvYou4 EnvChou3 210x270mm 195x270mm 184x260mm 197x273mm     BRDuplex/Two-Sided: DuplexTumble *DuplexNoTumble None     BRInputSlot/Paper Source: AutoSelect *Tray1 Manual     BRResolution/Print Quality: 600dpi *600x2400dpi     BRMonoColor/Color / Mono: Auto FullColor *Mono     BRMediaType/Media Type: *Plain Thin Thick Thicker BOND Env EnvThick EnvThin Recycled Label Glossy PostCard     BRColorMatching/Color Mode: *Normal Vivid None     BRGray/Improve Gray Color: OFF *ON     BREnhanceBlkPrt/Enhance Black Printing: OFF *ON     BRTonerSaveMode/Toner Save Mode: OFF *ON     BRImproveOutput/Improve Print Output: OFF *BRLessPaperCurl BRFixIntensity     BRSkipBlank/Skip Blank Page: *OFF ON     BRBrightness/Brightness: -20 -19 -18 -17 -16 -15 -14 -13 -12 -11 -10 -9 -8 -7 -6 -5 -4 -3 -2 -1 *0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20     BRContrast/Contrast: -20 -19 -18 -17 -16 -15 -14 -13 -12 -11 -10 -9 -8 -7 -6 -5 -4 -3 -2 -1 *0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20     BRRed/Red: -20 -19 -18 -17 -16 -15 -14 -13 -12 -11 -10 -9 -8 -7 -6 -5 -4 -3 -2 -1 *0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20     BRGreen/Green: -20 -19 -18 -17 -16 -15 -14 -13 -12 -11 -10 -9 -8 -7 -6 -5 -4 -3 -2 -1 *0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20     BRBlue/Blue: -20 -19 -18 -17 -16 -15 -14 -13 -12 -11 -10 -9 -8 -7 -6 -5 -4 -3 -2 -1 *0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20     BRSaturation/Saturation: -20 -19 -18 -17 -16 -15 -14 -13 -12 -11 -10 -9 -8 -7 -6 -5 -4 -3 -2 -1 *0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20      Though a simple `lp`(`r`) command should make use of the default options, duplex printing does not work as expected, e.g., the option `*DuplexNoTumble` should result in a double sided print of the document so as to turn the paper along its long edge. The result, however, for a PDF document, is a `DuplexTumble` one! Even manually setting the options of interest in the command line directly does not complete as expected, e.g.               lp -o PageSize=A4 -o BRDuplex=DuplexNoTumble -o BRInputSlot=Tray1 -o BRResolution=600dpi -o BRMonoColor=Auto -o BRMediaType=Plain -o BRColorMatching=Normal -o BRTonerSaveMode=ON -o BRImproveOutput=BRLessPaperCurl SomeDocument.pdf      prints a Short-Edge binded print-out. Strangely, setting the `BRDuplex` to `None`, gives the same Short-Edge Binding. There must be some configuration option set to "Short-Edge Binding" somwhere that overrides the `lpoptions`. **Where (else) are Duplex printing related options set?** * * * Details   * Printer: Model Name Brother **MFC-9340CDW** , Main Firmware Version **K** , Sub1 Firmware Version **1.02** , Sub2 Firmware Version **F1309271100**   * OS: Funtoo   * Printer Driver Installed via https://github.com/NikosAlexandris/brother-overlay   * The `http://localhost:631/printers/Brother_MFC-9340CDW` reports, however:      * Driver: Brother MFC-9340CDW CUPS (color, 2-sided printing)     * Connection: lpd://192.168.10.6/BINARY_P1     * Defaults: job-sheets=none, none media=iso_a4_210x297mm sides=one-sided   * Section of interest in the file `Brother_MFC-9340CDW.ppd`: > >     *%=== BRDuplex ================================ >     *OpenUI *BRDuplex/Two-Sided: PickOne >     *OrderDependency: 25 AnySetup *BRDuplex >     *DefaultBRDuplex: DuplexNoTumble >     *BRDuplex DuplexTumble/Short-Edge Binding: "          " >     *BRDuplex DuplexNoTumble/Long-Edge Binding: "          " >     *BRDuplex None/Off: "          " >     *CloseUI: *BRDuplex >


title: should I reduce /dev/shm size?

text: I have a server wity 8 GB RAM Mem:   Total 8031464   Used 5146344   Free 2885120 If I execute               # df      it always returns this               tmpfs            4015732         0   4015732   0% /dev/shm      What does it means , I have 4GB unused RAM (0% used all day) ? And some other doubts related to /dev/shm , please ; If I see 0% usage all day should I reduce /dev/shm size , for example from 4GB to 1GB ? If yes, HOW to reduce /dev/shm size ? May I use this memory location /dev/shm to symlink some folder with heavy IOwait (disk usage) ? Thanks


title: LibreOffice Writer Go to page

text: Is there a `go to page` feature in LibreOffice writer so one can type a page number to go to that page? There similar feature in MS Word.


title: CPUFreq Kernel module

text: I would like to try the CPUFreq module on my board (Marvell Soc based on ARMv7 running a v3.15 linux kernel). My architecture is obviously not supported by the default source code (located in the `linux/driver/cpufreq/` if I'm right). Could someone indicate me what are the steps to make it work on my platform? I don't even know where to select this module in the buildroot system. [Edit] As a matter of fact, my target (marvell armada 370) appears to be supported by the v2.16 version. Now I just need to updgrade it.


title: Sed? Stripping all formatting, i.e line breaks and whitespaces, from a report text file, while masking out certain pieces

text: I am working on a project in which I need to remove all formatting from a text file including whitespaces and line breaks, then replace any colons with pipes. I've made some headway but I cannot find a way to mask out the parts that need to be ignored. I am new to sed and am only at novice level with Bash scripting, and am, in fact, not entirely sure sed is the right tool for the job (maybe vi? I typically use Nano). The file that I am trying to format is similar to this == LUN mysql05-dbdat02 ==                 LUNName:                        mysql05-dbdat02       CollectionStartTime:            2012-09-20T15:43:03-04:00       CollectionEndTime:              2012-09-20T15:43:34-04:00       Capacity         CurrentCapacity:              512       IOOperations         Reads:                        100         Writes:                       0         ReadsPerSecond:               0.000000         WritesPerSecond:              0.000000         ReadMBPerSecond:              0.000         WriteMBPerSecond:             0.000         TotalMBPerSecond:             0.000         NonOptimizedIOPerSecond:      0.000000         CacheHitPercentage:           0.000       PerformanceMetrics         TotalIOsPerSecond:            0.000         ReadIOsPerSecond:             0.000         WriteIOsPerSecond:            0.000         TotalMBPerSecond:             0.000         ReadMBPerSecond:              0.000         WriteMBPerSecond:             0.000       Performance      == LUN mysql05-dbdat02 ==                 LUNName:                        mysql05-dbdat02       CollectionStartTime:            2012-09-20T15:43:03-04:00       CollectionEndTime:              2012-09-20T15:43:34-04:00       Capacity         CurrentCapacity:              512       IOOperations         Reads:                        100         Writes:                       0         ReadsPerSecond:               0.000000         WritesPerSecond:              0.000000         ReadMBPerSecond:              0.000         WriteMBPerSecond:             0.000         TotalMBPerSecond:             0.000         NonOptimizedIOPerSecond:      0.000000         CacheHitPercentage:           0.000       PerformanceMetrics         TotalIOsPerSecond:            0.000         ReadIOsPerSecond:             0.000         WriteIOsPerSecond:            0.000         TotalMBPerSecond:             0.000         ReadMBPerSecond:              0.000         WriteMBPerSecond:             0.000       Performance      and the output needs to be something like this,               cm-data-unity01|LUNNam=cm-data-unity01|CollectionStartTim=2012-09-20T15:43:03-04:00|CollectionEndTim=2012-09-20T15:43:34-04:00|Capacity|CurrentCapacit=2048|IOOperations|Read=10|Write=90|ReadsPerSecon=8.000000|WritesPerSecon=76.000000|ReadMBPerSecon=0.430|WriteMBPerSecon=0.542|TotalMBPerSecon=0.973|NonOptimizedIOPerSecon=85.000000|CacheHitPercentag=0.000|PerformanceMetrics|TotalIOsPerSecon=84.000|ReadIOsPerSecon=8.000|WriteIOsPerSecon=76.000|TotalMBPerSecon=0.973|ReadMBPerSecon=0.430|WriteMBPerSecon=0.542|Performance|      or, all on one line. I have written a very simple Bash script to format it, like thus               # Author Christopher George Bollinger     # Comments: This script will modify the snippet.txt file.       # This script is meant to, first, take a specific bit of unformatted data and  remove all line breaks and non-printable characters.          # Following this, the script is to replace any appropriate colons (those being used as delimiters) and replace them with the equals (=) character.     #!/bin/bash          echo "This script will remove line breaks, remove non-printable characters, and will replace colons used as field delimiters with the equals '(=)' character."     cp snippet.txt snippetwork.txt          RmLB ()     {     tr -d '\n' < snippetwork.txt > snippetwork1.txt          }          RmNonPrint ()     {     tr -cd "[:print:]" < snippetwork1.txt > snippetwork2.txt          }          RplcW ()     {     sed 's/: /=/g' snippetwork2.txt > snippetwork3.txt          }          RmWtSpc ()     {     tr -s ' ' '|' < snippetwork3.txt > snippetgood.txt     sed 'd/(?:[a-z]=) /'     }          QuChek ()     {     cat snippetgood.txt     read -p "Is this satisfactory? (Y/n)" Choice     case $Choice in         Y|y)         mv snippetgood.txt snippet.txt         rm -f snippetwork*         rm -f snippetgood.txt         ;;         N|n)         exit         ;;         *)         echo "Invalid Input."         ;;     esac     }          read -p "Would you like to begin? (Y/n)" YorN          case $YorN in         Y|y)         RmLB         RmNonPrint         RplcW         RmWtSpc         QuChek         ;;         N|n)         exit         ;;         *)         echo "Invalid Selection"         ;;     esac      Which functions except the output is not quite right, it gives:               ==|LUN|mysql05-dbdat02|==|LUNName=|mysql05-dbdat02|CollectionStartTime=|2012-09-20T15:43:03-04:00|CollectionEndTime=|2012-09-20T15:43:34-04:00|Capacity|CurrentCapacity=|512|IOOperations|Reads=|100|Writes=|0|ReadsPerSecond=|0.000000|WritesPerSecond=|0.000000|ReadMBPerSecond=|0.000|WriteMBPerSecond=|0.000|TotalMBPerSecond=|0.000|NonOptimizedIOPerSecond=|0.000000|CacheHitPercentage=|0.000|PerformanceMetrics|TotalIOsPerSecond=|0.000|ReadIOsPerSecond=|0.000|WriteIOsPerSecond=|0.000|TotalMBPerSecond=|0.000|ReadMBPerSecond=|0.000|WriteMBPerSecond=|0.000|Performance|==|LUN|mysql05-dbdat02|==|LUNName=|mysql05-dbdat02|CollectionStartTime=|2012-09-20T15:43:03-04:00|CollectionEndTime=|2012-09-20T15:43:34-04:00|Capacity|CurrentCapacity=|512|IOOperations|Reads=|100|Writes=|0|ReadsPerSecond=|0.000000|WritesPerSecond=|0.000000|ReadMBPerSecond=|0.000|WriteMBPerSecond=|0.000|TotalMBPerSecond=|0.000|NonOptimizedIOPerSecond=|0.000000|CacheHitPercentage=|0.000|PerformanceMetrics|TotalIOsPerSecond=|0.000|ReadIOsPerSecond=|0.000|WriteIOsPerSecond=|0.000|TotalMBPerSecond=|0.000|ReadMBPerSecond=|0.000|WriteMBPerSecond=|0.000|Performance|      the problem being the pipes appearing following the equals signs. If anyone could point me in the right direction on getting this right, or even to an online resource for some clarification, I would be immensely grateful. Funny thing is the end game for this is that, while the immediate request is to format like the above example, to feed this into a Unix cli graphing tool (my guess is gnuplot). From what I understand, gnuplot requires the formatting to be in columns. As mentioned, this is new territory for me and I would greatly appreciate any advice given.


title: Take a sum based upon particular columns

text: I am having a huge pile of data around 30 to 40 Million data. We need to process these files and send to another interface team. Below is my file format which we recevie               c1  c2  c3  c4  c5  c6     A   B   C   D   5   s     A   B   C   D   4   s     A   B   E   F   5   s     A   B   E   F   8   S     C   D   E   F   9   S      I need to print in my out file all the columns. Since this is releated to GPRS usage we need to group by c1 - c4 and then if everything is matching we need to sum up the c5 and print everything in the output file. Below is the sample out file.               c1  c2  c3  c4  c5  c6     A   B   C   D   9   s     A   B   E   F   13  s     C   D   E   F   9   s      I do not have much know Unix or perl resources in my team or outside team. Kindly to help me in this. I also heard that this work flow works a lot faster in perl than in Unix scripting. If there is any other better way or method also please do suggest me.


title: xargs how to put result {} into $(cmd {})?

text: for example: `find /usr/lib -maxdepth 1 -type l -iname "*libblas*"|xargs -I{} echo "{} =>" $(realpath {})` I would like it to output:               /usr/lib/libblas.so.3gf=>/usr/lib/libblas/libblas.so.3gf.0     /usr/lib/libblas.so=>/usr/lib/libblas/libblas.so.3gf.0     /usr/lib/libblas.a=>/usr/lib/libblas/libblas.a      This will not work because the value in `$()` is expanded before the script actual running. Is there any way I can achieve this result? without loop in bash?


title: Is there any issue to put / as a home directory of root user from security point of view?

text: Is there any issue to put / as a home directory of root user from security point of view instead of /root


title: openldap: add auxiliary class

text: I want to add an auxiliary class to OpenLDAP. What exactly do I have to do? I'm using Apache Directory Studio as editor. I've added a new core schema with olcObjectClasses "testclass" and an olcAttribute "company". This worked fine. But when I add this auxiliary class to an inetOrgPerson Object and add the new attribute defined in my class, the Apache Directory Studio says that this attribute wasn't allowed. Nevertheless I can add it. Are some auxiliary classes restricted by the inetOrgPerson or is there any dependency between classes? Is it sufficient to define a new schema, a testclass and an olcAttribute? I defined them similar to the inetOrgPerson entries. Are there any "meta-entries" where new entries have to be defined? Those questions are probably quite stupid, but I'm not an LDAP expert :-) Thank you in advance. If there's any forum that is more suitable just point me to it.


title: Execute shell script from php, as root user?

text: Need to execute the following line from PHP: > $res = shell_exec('sudo sh /home/nicklas/cronjobs/make_account.sh username > password'); The problem is nothing happens on execution. If i try to echo $res it comes out blank. I've tried using system() also, same result. I'm guessing it doesn't work because i need to run the scrip with root access, and the www- data user doesn't have that by default. I added the following line to /etc/sudoers in hope of getting access: > www-data ALL=(ALL:ALL) NOPASSWD: /home/nicklas/cronjobs/make_account.sh But no success. I've tried restarting apache inbetween, doesn't change anything. Am i missing something?


title: Social website about shell commands

text: I remember seeing an entire social website devoted to the question What are your favorite command line features or tricks?, where you can post shell commands, tag them, comment on them, and rate and/or favorite them. Unfortunately, I've forgotten what this site was called and can't seem to muster up enough google-fu to find it. Anyone know of such a site (for which you can actually find a URL)?


title: bash nested case syntax and ;; terminators

text: Have I got enough (or perhaps too many) `;;` terminators in this bash script containing nested `case`'s?               case "$1" in     OK)         # Nothing needs done         echo -n "OK:1" ;;          CRITICAL)              case "$2" in         SOFT)             case "$3" in             1|2)                  soft_reset_pool.sh ;;             esac ;;              HARD)             case "$3" in             1|2)                 hard_reset_pool.sh ;;                  3|4)                 hard_reset_service ;;                  esac ;;         esac ;;           esac      It's been a few years since I did any bash in anger.


title: RAID5 Arrary disappeard with no HW or SW changes made

text: I have a R-Pi running XBMC (Linux CaribNAS 3.10.24 #2 PREEMPT Mon Dec 23 05:18:12 UTC 2013 armv6l GNU/Linux) with a 3 disk raid 5 array that has been working up till yesterday when is stopped running overnight and now will now not start, I have a lot of data that is not backed up so would like to recover without data loss if poss. I have noticed that mdadm --examine --scan shows two /dev/md/0 arrays, only the second one is correct, but I cant get rid of the first, but I don't think this is the cause but would like to tidy things up.                dmesg |grep md:      md: md0 stopped.      md: sdc1 does not have a valid v1.2 superblock, not importing!      md: md_import_device returned -22      md: sdd1 does not have a valid v1.2 superblock, not importing!      md: md_import_device returned -22      md: sdb1 does not have a valid v1.2 superblock, not importing!      md: md_import_device returned -22                mdadm -D /dev/md0      mdadm: md device /dev/md0 does not appear to be active.                mdadm --examine --scan      ARRAY /dev/md/0 metadata=1.2 UUID=c20f8d11:b81ae9b6:1b318343:ed35987e name=raspbmc:0      ARRAY /dev/md/0 metadata=1.2 UUID=8ec7d307:b5609dfd:caea7099:a9d8201c name=CaribNAS:0                cat /etc/mdadm/mdadm.conf      DEVICE partitions      HOMEHOST CaribNAS      MAILADDR CaribNAS@gmail.com      ARRAY /dev/md0 metadata=1.2 Name=CaribNAS:0 UUID=8ec7d307:b5609dfd:caea7099:a9d8201c           cat /etc/fstab      proc /proc proc defaults 0 0      devpts /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620 0 0      /dev/sda1 / ext4 defaults 0 0      /dev/sda2 /temp ext4 defaults 0 0      /dev/mmcblk0p1 /boot vfat defaults,noatime 0 0      #/dev/mmcblk0p2 / f2fs defaults,noatime 0 0      /dev/md0 /RAID5 auto defaults 0 3                cat /proc/mdstat      Personalities :      unused devices: <none>           mdadm --stop /dev/md0      mdadm: stopped /dev/md0           mdadm --assemble --scan -v      mdadm: looking for devices for /dev/md0      mdadm: /dev/sdd has wrong uuid.      mdadm: /dev/sdc has wrong uuid.      mdadm: /dev/sdb has wrong uuid.      mdadm: no RAID superblock on /dev/sda2      mdadm: no RAID superblock on /dev/sda1      mdadm: no RAID superblock on /dev/sda      mdadm: no RAID superblock on /dev/mmcblk0p2      mdadm: no RAID superblock on /dev/mmcblk0p1      mdadm: no RAID superblock on /dev/mmcblk0      mdadm: /dev/sdd1 is identified as a member of /dev/md0, slot 2.      mdadm: /dev/sdc1 is identified as a member of /dev/md0, slot 1.      mdadm: /dev/sdb1 is identified as a member of /dev/md0, slot 0.      mdadm: failed to add /dev/sdc1 to /dev/md0: Invalid argument      mdadm: failed to add /dev/sdd1 to /dev/md0: Invalid argument      mdadm: failed to add /dev/sdb1 to /dev/md0: Invalid argument      mdadm: failed to RUN_ARRAY /dev/md0: Invalid argument           mdadm --examine /dev/sd[bcd]1      mdadm --examine /dev/sd[bcd]1      /dev/sdb1:      Magic : a92b4efc      Version : 1.2      Feature Map : 0x0      Array UUID : 8ec7d307:b5609dfd:caea7099:a9d8201c      Name : CaribNAS:0 (local to host CaribNAS)      Creation Time : Thu Jan 16 02:44:56 2014      Raid Level : raid5      Raid Devices : 3           Avail Dev Size : 1953260975 (931.39 GiB 1000.07 GB)      Array Size : 1953260544 (1862.77 GiB 2000.14 GB)      Used Dev Size : 1953260544 (931.39 GiB 1000.07 GB)      Data Offset : 262144 sectors      Super Offset : 8 sectors      State : clean      Device UUID : 8d6ee8dc:1d62a673:74189894:14192b98           Update Time : Sat Mar 15 15:46:41 2014      Checksum : 2cd2a9ae - correct      Events : 345           Layout : left-symmetric      Chunk Size : 512K           Device Role : Active device 0      Array State : AAA ('A' == active, '.' == missing)      /dev/sdc1:      Magic : a92b4efc      Version : 1.2      Feature Map : 0x0      Array UUID : 8ec7d307:b5609dfd:caea7099:a9d8201c      Name : CaribNAS:0 (local to host CaribNAS)      Creation Time : Thu Jan 16 02:44:56 2014      Raid Level : raid5      Raid Devices : 3           Avail Dev Size : 1953260975 (931.39 GiB 1000.07 GB)      Array Size : 1953260544 (1862.77 GiB 2000.14 GB)      Used Dev Size : 1953260544 (931.39 GiB 1000.07 GB)      Data Offset : 262144 sectors      Super Offset : 8 sectors      State : clean      Device UUID : 2f8065d8:ff3a060d:4883c25f:12f543f7           Update Time : Sat Mar 15 15:46:41 2014      Checksum : ebf2db04 - correct      Events : 345           Layout : left-symmetric      Chunk Size : 512K           Device Role : Active device 1      Array State : AAA ('A' == active, '.' == missing)      /dev/sdd1:      Magic : a92b4efc      Version : 1.2      Feature Map : 0x0      Array UUID : 8ec7d307:b5609dfd:caea7099:a9d8201c      Name : CaribNAS:0 (local to host CaribNAS)      Creation Time : Thu Jan 16 02:44:56 2014      Raid Level : raid5      Raid Devices : 3           Avail Dev Size : 1953260975 (931.39 GiB 1000.07 GB)      Array Size : 1953260544 (1862.77 GiB 2000.14 GB)      Used Dev Size : 1953260544 (931.39 GiB 1000.07 GB)      Data Offset : 262144 sectors      Super Offset : 8 sectors      State : clean      Device UUID : 38c6ce39:0ad01a8c:d188672b:4b06661f           Update Time : Sat Mar 15 15:46:41 2014      Checksum : c037ccdb - correct      Events : 345           Layout : left-symmetric      Chunk Size : 512K           Device Role : Active device 2      Array State : AAA ('A' == active, '.' == missing)


title: Test FTP Username and Password

text: I'm working on a program that involves uploading some files via FTP. However, I'd like to abort the process if the username and password given by the user are incorrect. Is there any way to "test" if the pair is correct? Is a utility like _ftp_ or _curl_ able to do that, or should I use some feature (apparently hidden at my eyes) from _libcurl_? Any ideas are really appreciated. Maybe this sound like a question coming from a dummy programmer, but indeed I've never dealt with FTP (or any other protocol) directly. Please consider writing "you didn't get the point" or "you're crazy" if needed.


title: Find and move directories based on file type and date

text: I have a directory "New Movies" containing 200+ subdirectories "Movie Name (year)". The subdirectories "Movie Name (year)" contains a single video file (avi/mkv) and several related jpg/xml files. I need to move all directories containing a video file that is at least 180 days old to another directory. For example: New Movies/Movie A (year) would contain movie.mkv, folder.jpg & movie.xml and I want to move them to a subdirectory of the same name elsewhere with all files present and intact. After looking elsewhere on this site I have tried:               cd "/mnt/user/New Movies/"     find -type f \( -name "*.avi" -or -name ".*mkv" \) -mtime +180 -exec sh -c 'mv "${0%/*}" /mnt/user/Movies' {} \;      The command successfully moves the first subdirectory and all files to their new home, however every single operation after this one returns the error               find: './Movie B (year)': No such file or directory     find: './Movie C (year)': No such file or directory      and so on through all directories contained under "New Movies" whether they were due to be moved or not.


title: Using a file input as stdin for a shell script does not work

text: I have the following script code: **test.sh**               echo "BEGIN"     while read CMD <&1; do         [ -z "$CMD" ] && continue         case "$CMD" in         start)                 echo "get_start"                 ;;         stop)                 echo "get_stop"                 ;;         *)                 echo "get_uknown_command"                 ;;         esac         echo "END";     done      When I run it with:               $./test.sh <input.txt      I get my script locked **input.txt**               start     stop     sthh      Why my script is locked? How I can fix that? BTW: If I enter the data manually then the script will not lock.


title: Why yum's download speed is too slow

text: My yum download speed in fedora is in average less than 5KB/s and goes to less than 1KB/s but my normal download speed is around 140KB/s. I tried installing `yum-fastestmirrors` but didn't help. Any suggestions?


title: Shells in tabbed windows in a terminal

text: I want to do tabbed terminal stuff without having actual tab windows in my terminal application. Is there any good way to do this within bash? It would come in very handy with SSH if I could avoid signing in twice.


title: Bashrc disable-ing all but a given command for a given user

text: Is it possible to have `bashrc` grab every single command the user types, save for those containing a given word? Like the way you can use aliases to change what the user meant, you can alias for instance 'cd' to nothing. that way the user can't apply that command anymore. Maybe that way you can have a given user only able to apply one command?


title: Gentoo and Systemd: Can openrc be uninstalled without breaking other packages?

text: I switched my Gentoo system from openrc to systemd, and everything seems to run fine as long as both are installed. Nevertheless, after `emerge --depclean`, which removes openrc, the gentoolkit program revdep-rebuild does not work any more (it misses /etc/init.d/functions.sh and the einfo command). Now the question is, can I get rid of openrc (and sysvinit) without breaking packages, and if yes, how? Should I wait with further steps until bug 373219 is fixed?


title: why isn't xargs parsing my input correctly?

text: Ive been trying to write a shell script that will interface with cmus and then notify me of the track info using notify-send. Right now it is not working mainly because xargs does not seem to pass 2 arguments to notify-send. It only sends one and I cannot figure out why. I've done everything I can think of with sed to get the right output but it doesn't work. Also, if I use notify- send with two arguments, it works so I don't think it's a problem with notify- send. The output of cmus-remote -Q is:               status paused     file /home/dennis/music/Coheed And Cambria/GOODAP~1/05 Crossing the Frame.mp3     duration 207     position 120     tag artist Coheed & Cambria     tag album Good Apollo I'm Burning Star IV Volume One: From Fear Through the Eyes of Madness     tag title Crossing the Frame     tag date 2005     tag genre Rock     tag tracknumber 5     tag albumartist Coheed & Cambria     set aaa_mode all     set continue true     set play_library true     set play_sorted false     set replaygain disabled     set replaygain_limit true     set replaygain_preamp 6.000000     set repeat false     set repeat_current false     set shuffle true     set softvol false     set vol_left 100     set vol_right 100      My code is terrible. I'm just starting to learn shell scripting so sorry about that.               #!/bin/sh     #     # notify of song playing          info="$(cmus-remote -Q)"          title="`echo "$info" | grep 'tag title' | sed "s/'//g" | sed 's/tag title \(.*\)/'\''\1'\''/g'`"          artist="`echo "$info" | grep 'tag artist' | sed "s/'//g" | sed 's/tag artist \(.*\)/ '\''\1/g'`"     album="`echo "$info" | grep 'tag album ' | sed "s/'//g" | sed 's/tag album \(.*\)/ \1'\''/g'`"          stupid="${title}${artist}$album"     echo "$stupid" | xargs notify-send


title: How to hide the . and .. from ls

text: When I run `ls -l` on a directory, I see an entry titled '.' How can I remove the row containing '.' from the output?               ls -latr /foo | tail -n5      -rw-rw-r--  1 guest bar      59169 Aug 20 12:22 foobar     -rw-rw-r--  1 guest bar      59169 Aug 20 12:23 bar1     -rw-rw-r--  1 guest bar      59169 Aug 20 12:24 foobar42     -rw-rw-r--  1 guest bar      59169 Aug 20 12:25 foo     drwxrws---  8 guest bar    102400 Aug 20 12:26 .      I'm thinking cut should work, but I can't find the right syntax.               ls -latr |tail -n5|cut -d'.'       ls -latr |tail -n5|cut -d.


title: How to Navigate within bash's Reverse Search?

text: Bash offers the functionality to reverse search via `Ctrl` + `R`. Then one can type in a part of a command it will show a fitting entry from the history. Assume this is my history:               vim foo1     vim foo2 # I want to go here     vim foo3 # this is where I land, how to go back?      I search for `foo`. Hitting `Ctrl` + `R` again shows the next fitting search entry. Often it happens to me, that I am too fast and navigate past my intended result and `vim foo3` is shown and now I want to go back to `vim foo2`. Hence my question is: How do I navigate within the reverse search?


title: Supress startup messages on stdout?

text: I'm using `tcsh`, and have to source a group `.cshrc` file. This file echoes some messages, which is fine for normal shells, but causes problems with programs like `scp` and `rsync`. I can see the solution taking one of a few forms, but am unable to implement any of them. ### Only execute echos when appropriate I've scoured the `rsync` and `tcsh` man pages, but I can't find any variables that are guaranteed to be set or unset when it is called from ssh/rsync/whatever. `$PROMPT` is the same as normal, `$shlvl` is 1, and nothing else looks promising. ### Redirect to stderr rsync/scp/etc don't seem to care about what comes over stderr, so if I could, I would               echo $MSG >&2      But this doesn't even work from the shell. Instead, it writes `$MSG` to a file named `2`. When I look through the history, it seems that something (xterm? readline? tcsh?) is inserting spaces, so what was actually run was               echo $MSG > & 2      So the observed behavior makes sense given the actual input to tcsh. ### Redirect to /dev/stderr I've also tried               echo $MSG > /dev/stderr      Which works for `ssh`, but for `scp` and `rsync`, I get the message '`/dev/stderr: Permission denied.`' and the key difference seems to be where the file is symlinked. Adding `ls -l /dev/stderr /proc/self/fd/2` to the cshrc file shows               # For ssh     lrwxrwxrwx 1 root root    15 Apr 11 09:58 /dev/stderr -> /proc/self/fd/2     lrwx------ 1 <me> <mygrp> 64 May 24 14:34 /proc/self/fd/2 -> /dev/pts/6          # For scp     lrwxrwxrwx 1 root root    15 Apr 11 09:58 /dev/stderr -> /proc/self/fd/2     l-wx------ 1 <me> <mygrp> 64 May 24 15:07 /proc/self/fd/2 -> pipe:[378204842]      However, since the permission denied message comes across on stderr, the scp/rsync process is able to do its thing, so I can live with this solution, but would rather not get this spurious error message.


title: Change the timezone in a terminal

text: I connect my web server via SSH Terminal on Mac.               cat /var/www/vhosts/example.com/statistics/logs/error_log       The Date of my server and local computer differs so output of error_logs is not efficient for me. Is it possible to change date output to my local time without modifying settings in server computer? The server date settings should stay same because another user is connecting from another part of world. I want to handle this automatically by Mac terminal if possible and just for me.


title: How do I ad an if statement (regarding punctuation in a word) to this bash script

text: I have this bash script               #!/bin/bash     cat $@ | while read line     do         for word in $line         do             echo $word | circling-the-square             # here's where i need to add the if statement:             #if the word contains one of the four [!?.,],             #then also echo that punctuation mark         done     done      circling-the-square is a Python script based on Norvig's spelling corrector. That script rids its input of punctuation               def words(text): return re.findall('[a-z]+', text.lower())       so I need `bash` to notice this. I guess `sed` or `awk` might be useful but I still don't know how to write that regex or put it in an if statement, so I'm asking this here. As is, passing the file               alec@ROOROO:~/oddi-o/newton-fluxions$ cat 199      advertisement lately publijtid by the author, the british hemisphere, or a map of a new contrivance, proper for initiating young minds in the firft rudiments of geography, and the ufe of the globes.      gives               alec@ROOROO:~/oddi-o/newton-fluxions$ ./hmmb 199     advertisement     lately     publijtid          by     the     author     the     british     hemisphere     or     a     map     of     a     new     contrivance     proper     for     initiating     young     minds     in     the     first     rudiments     of     geography     and     the     few     of     the     globes.      Which isn't perfect but still useful. _FYI_ , I have edited the file in question to contain only `\w` and the punctuation `[!?.,]`. The file does not contain characters like : or ;, so I _just need it to echo these four punctuation marks_ if they are included as part of a word, viz.:               alec@ROOROO:~/oddi-o/newton-fluxions/finforno$ ./hmmb 199     advertisement     lately     publijtid     by     the     author,     the     british     hemisphere,     or     a     map     of     a     new     contrivance,     proper     for     initiating     young     minds     in     the     firft     rudiments     of     geography,     and     the     ufe     of     the     globes.


title: Expect script + automated telnet process between three Linux machines

text: Is it possible to do the following by expect script? I have Linux server that connected to **linux_machine1** and **linux_machine1** connected to **linux_machine2** My Linux server have access only to **linux_machine1** ( linux server can telnet to **linux_machine1** but can’t telnet to **linux_machine2** ) But from **linux_machine1** I have access VIA telnet to **linux_machine2** So my question is: I need to develop expect script that perform telnet from the Linux server to **linux_machine1** then expect will perform telnet to **linux_machine2** from **linux_machine1** and will copy the **/etc/hosts** file from **linux_machine2** to my Linux server Is this scenario can be implemented by expect script? Short example that descript the process:                 ( run expect from Linux server ) --> linux_machine1 --> linux_machine2        Linux server          <--   /etc/hosts    from linux_machine2 <--        * remark - expect script need to be activate from the linux server


title: Where can I find the wireless driver for BCM4311 for OpenIndiana 148?

text: I know that OpenIndiana 148 doesn't have the network driver (BCM4311) for the laptop. I wonder if anyone out there can help, or point the way to me where I can get the driver?


title: Changing color depth in linux mint

text: How can I alter color depth settings in Linux Mint 13 maya? I tried to find the `xorg.conf` in               /etc/X11/      But I could not find the file.


title: SSH on my local network - problem with login

text: I'm having problem with logging into my local-network-linux (server) ssh with Putty (and with Linux terminal, too) When my server shows me request to insert username, I insert "root" and I do press enter. I am waiting about seven seconds before it requests my password! I also looked at this question and tried accepted answer, also with command               /etc/init.d/ssh restart      It didn't work. My friend told me that I should have to use another SSH deamon, but I don't know which. What could I do now? my current /etc/ssh/ssh_config config:               # configuration file, and defaults at the end.          # Site-wide defaults for some commonly used options.  For a comprehensive     # list of available options, their meanings and defaults, please see the     # ssh_config(5) man page.          Host *     #   ForwardAgent no     #   ForwardX11 no     #   ForwardX11Trusted yes     #   RhostsRSAAuthentication no     #   RSAAuthentication yes     #   PasswordAuthentication yes     #   HostbasedAuthentication no       GSSAPIAuthentication no        GSSAPIDelegateCredentials no        GSSAPIKeyExchange no     #   GSSAPITrustDNS no     #   BatchMode no     #   CheckHostIP yes     #   AddressFamily any     #   ConnectTimeout 0     #   StrictHostKeyChecking ask     #   IdentityFile ~/.ssh/identity     #   IdentityFile ~/.ssh/id_rsa     #   IdentityFile ~/.ssh/id_dsa     #   Port 22     #   Protocol 2,1     #   Cipher 3des     #   Ciphers aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc     #   MACs hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160     #   EscapeChar ~     #   Tunnel no     #   TunnelDevice any:any     #   PermitLocalCommand no     #   VisualHostKey no     #   ProxyCommand ssh -q -W %h:%p gateway.example.com         SendEnv LANG LC_*         HashKnownHosts yes


title: Changing linux distro remotely while preserving data

text: I have a headless Fedora 15 (without GUI) box. With the following partition structure:               $ df -T -h     Filesystem    Type    Size  Used Avail Use% Mounted on     rootfs      rootfs     49G  2.8G   46G   6% /     udev      devtmpfs    1.7G  4.0K  1.7G   1% /dev     tmpfs        tmpfs    1.7G     0  1.7G   0% /dev/shm     tmpfs        tmpfs    1.7G  604K  1.7G   1% /run     /dev/sda1     ext4     49G  2.8G   46G   6% /     tmpfs        tmpfs    1.7G     0  1.7G   0% /sys/fs/cgroup     tmpfs        tmpfs    1.7G     0  1.7G   0% /media     /dev/sda5     ext4    388G   35G  334G  10% /var     /dev/sda2     ext4     28G  1.7G   25G   7% /home      I am tired of Fedora Project's policy of 12-14 month support cycle (they may have their reasons) and intend to migrate to something more stable like Scientific Linux or CentOS. Most of my data is in `/var` (MySQL, Redis & Apache Docroot) and `/home`. Is it possible that I can migrate from fedora to other RH family distro by preserving the directories `/var` and `/home` and do so remotely? (Under dire circumstances I am willing to carry a monitor and keyboard to it.) If yes, then what are the steps for the same?


title: Remove slashes/parent paths from filenames inside CSS and Javascript content

text: I need to go through all my css and js files and if there is a filename referenced that has any slashes (/) at all then the slash should be removed. What I want is:   * if any files referenced are named `/file.jpg` then remove the leading slash leaving just `file.jpg`.  For example, in a CSS file change: `@import url("/base.css");` to `@import url("base.css");`   * if the file referenced is named `/files/file.jpg` then the leading slashes and folder name should be removed leaving just `file.jpg`.  I started to write it but then couldn't think about how to deal with the slashes.               grep -o -h -E '[A-Za-z0-9:./_-]+\.(png|jpg|gif|tif|css)' `find     ${new_directory} -name '*.css' -or -name '*.js'`      Any idea how to do this? I am doing this using a `.sh` shell script.


title: anyway to fail/delay a cp process?

text: This is a hypothetical scenario. Say that I have a particular folder that is being synchronized by a process which is receiving a files/folders via the internet. Now while this operation is in progress, for the synchronizer's sake, there should be no cp operations to its directory. Anyway this can be acheived?


title: rc.local - not all commands are executed

text: I have following lines in my rc.local               #!/bin/sh -e     #     # rc.local     #     # This script is executed at the end of each multiuser runlevel.     # Make sure that the script will "exit 0" on success or any other     # value on error.     #     # In order to enable or disable this script just change the execution     # bits.     #     # By default this script does nothing.          if [ -f /resize ]     then     if [ -f /resize2 ]     then     sh /resize2     else     sh /resize     fi     fi          /etc/rc --foreground     /sbin/iptables-restore /etc/iptables     mkdir /tmp/cooks     mkdir /tmp/cook     chmod 777 /tmp/cook     chmod 777 /tmp/cooks     mkdir /tmp/xhprof     chmod 777 /tmp/xhprof          exit 0      but neither `/tmp/cooks` nor `/tmp/cook` nor `/tmp/xhprof` dir was not created (on system startup). I'm using `Debian GNU/Linux 6.0 squeeze (VPS)`


title: Why am I getting an AttributeError when I try to use Pyjamas desktop on Fedora 15?

text: I am trying to run `pyjamas-desktop` on my _Fedora 15_. All packages were installed, I have adjusted `PYTHONPATH` to include `/usr/share/pyjamas/library`, but when I try to run a simple example:               from pyjamas.ui.Button import Button     from pyjamas.ui.RootPanel import RootPanel     from pyjamas.ui.HTML import HTML     from pyjamas import Window          def greet(sender):         Window.alert("Hello, AJAX!")          if __name__ == '__main__':         b = Button("Click me", greet)             RootPanel().add(b)         hw = HTML("Hello <b>World</b>")         RootPanel().add(hw)      I get information:               Traceback (most recent call last):       File "pyjstest.py", line 10, in <module>         b = Button("Click me", greet)       File "/usr/share/pyjamas/library/pyjamas/ui/Button.py", line 36, in __init__         element = DOM.createButton()       File "/usr/share/pyjamas/library/pyjamas/DOM.py", line 190, in createButton         return createElement("button")       File "/usr/share/pyjamas/library/pyjamas/DOM.py", line 202, in createElement         return doc().createElement(tag)       File "/usr/share/pyjamas/library/__pyjamas__.py", line 45, in doc         return main_frame.getDomDocument()      AttributeError: 'NoneType' object has no attribute 'getDomDocument'      Do I need to adjust something here? For Ubuntu I have found information on pyjamas-dev, that it needs to be built from source and bootstrapped. Nothing was required of me, when I installed it from package in Fedora. What may I be doing wrong?


title: In-place substitution for lines matching some pattern in a given set of files

text: Following on from my previous question: > Remove slashes/parent paths from filenames inside CSS and Javascript content I arrived at the following command which replaces any filenames in these files with just the basename:               grep -o -h -E '[A-Za-z0-9:./_-]+\.(png|jpg|gif|tif|css)' |\       sed "s:[a-zA-z0-9]*/::" `find . -name '*.css' -or -name '*.js'`       How do I save the output of this command back to the source file for each file processed?


title: How to background a command chain?

text: I want to background a command chain like `cp a b && mv b c && rm a`. I have tried doing `cp a b && mv b c && rm a &` but this only backgrounds the last process. How do I background a command chain?


title: Why does "ls *" take so much longer than "ls"?

text: I have a couple of files in a directory:               $ ls | wc -l     9376      Can anybody explain why there is such a huge time difference in using `ls *` and `ls`?               $ time ls > /dev/null     real    0m0.118s     user    0m0.106s     sys     0m0.011s      and               $ time ls * > /dev/null     real    1m32.602s     user    0m0.233s     sys     0m0.438s      okay, this is a drastic example and maybe enhanced because the directory is on a general parallel file system (GPFS). But I can also see a significant slowdown on a local file system. **EDIT:**               $ time ls -l > /dev/null     real    0m58.772s     user    0m0.113s     sys     0m0.452s     $ time ls -l * > /dev/null     real    1m19.538s     user    0m0.252s     sys     0m0.461s      and I should add that in my example there are no sub directories:               $ diff <(ls) <(ls *)     $


title: Configure courier to forward certain mails to external addresses

text: I have a debian 6.0 server with courier/courier-mta set up and some local domains. Now I want to create some forwards for some email address that should go directly to external addresses as there are no local users for those addresses. Eg. I have an address "peter@example.com" (its an example, I use a different address) and I want it to be redirected to "peter@test.test" and also some other addresses from "example.com" but to different target domains. I tried to configure courier with the webadmin interface and registered "example.com" as a local domain. Then under the aliases section i added the full "peter@example.com" address (as there is no local account) and set "peter@test.test" as recipient - but it didn't work. When I sent to the user I get: > The error that the other server returned was: 550 User unknown Then I read something about courier aliases and created a new file "example.com" under the couriercfgdir/aliases and added some email addresses and targets (e.g.: "peter@example.com: peter@test.test") and run the "makealiases" command but it didn't change anything. I still receive the same 550 error when sending mail to peter@example.com. I'm not really the mail or linux guru but have some basic understanding. I thought maybe aliases is ignored as long as I don't use maildrop, so I changed the courier delivery options to use "maildrop" (and installed the courier- maildrop package), restarted the courier server but still no change. And I also don't know where to find some sort of log file. /var/log/mail.log was last updated in june but I have received emails since then and I don't see any other logfile for courier. Somehow it looks as if my aliases are ignored but I don't get why. Does anyone have an idea why?


title: timeout without killing process in bash

text: I have a main script that I'm running, and from it I have a second "slow process" I want to kick off, and "do something" in the main script if it doesn't complete in the time limit -- depending on if it completed or not. N.B. If the "slow process" finishes before my time limit, I don't want to have to wait an entire time limit. I want the "slow process" to keep going so I can gather stats and forensics about it's performance. I've looked into using timeout, however it will kill my script when finished. Suppose this simplified example. **main.sh**               result=`timeout 3 ./slowprocess.sh`     if [ "$result" = "Complete" ]     then      echo "Cool it completed, do stuff..."     else      echo "It didn't complete, do something else..."     fi      **slowprocess.sh**               #!/bin/bash     start=`date +%s`     sleep 5     end=`date +%s`     total=`expr $end - $start`     echo $total >> /tmp/performance.log     echo "Complete"      Here, it uses timeout -- so the script dies, so nothing winds up in `/tmp/performance.log` -- I want `slowprocess.sh` to complete, but, I want `main.sh` to go onto its next step even if it doesn't finish in the 3 seconds.


title: Manjaro Linux - Cable unplugged even if plugged

text: I have just installed the system (Manjaro) and I have one, major, problem: it says that my network cable is unplugged, even if it's plugged. I have a Realtek RTL-8110SC/8169SC Gigabit Ethernet and with Windows it works with no problem. If I do **_ifconfig_** in the terminal, I get:               enp7s1: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500         ether 14:da:e9:21:fd:bf  txqueuelen 1000  (Ethernet)         RX packets 0  bytes 0 (0.0 B)         RX errors 0  dropped 0  overruns 0  frame 0         TX packets 0  bytes 0 (0.0 B)         TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0          lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536         inet 127.0.0.1  netmask 255.0.0.0         inet6 ::1  prefixlen 128  scopeid 0x10<host>         loop  txqueuelen 0  (Local Loopback)         RX packets 384  bytes 30176 (29.4 KiB)         RX errors 0  dropped 0  overruns 0  frame 0         TX packets 384  bytes 30176 (29.4 KiB)         TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0      The "enp7s1" should be my card (I recognise the MAC), but usually isn't it "eth **X** " ? Also, here is the output for **_lsmod_** command:               Module                  Size  Used by     rfcomm                 51153  4      fuse                   74541  3      raid1                  27772  1      bnep                   11037  2      usblp                  12722  0      bluetooth             308366  10 bnep,rfcomm     rfkill                 15666  3 bluetooth     iTCO_wdt                5407  0      iTCO_vendor_support     1929  1 iTCO_wdt     mxm_wmi                 1467  0      evdev                   9880  5      joydev                  9663  0      hid_generic             1153  0      md_mod                105782  1 raid1     coretemp                6038  0      kvm_intel             128977  0      kvm                   376330  1 kvm_intel     snd_hda_codec_hdmi     29733  1      microcode              13172  0      psmouse                85132  0      serio_raw               5041  0      snd_hda_codec_realtek    35645  1      r8169                  57640  0     lpc_ich                12849  0      mii                     4027  1 r8169     i2c_i801               11237  0      snd_hda_intel          35309  5      snd_hda_codec         147506  3 snd_hda_codec_realtek,snd_hda_codec_hdmi,snd_hda_intel     snd_hwdep               6332  1 snd_hda_codec     snd_pcm                77765  3 snd_hda_codec_hdmi,snd_hda_codec,snd_hda_intel     snd_page_alloc          7202  2 snd_pcm,snd_hda_intel     snd_timer              18718  1 snd_pcm     snd                    58950  17 snd_hda_codec_realtek,snd_hwdep,snd_timer,snd_hda_codec_hdmi,snd_pcm,snd_hda_codec,snd_hda_intel     acpi_cpufreq           10502  0      soundcore               5418  1 snd     mperf                   1203  1 acpi_cpufreq     i7core_edac            17669  0      edac_core              44137  2 i7core_edac     asus_atk0110           12000  0      wmi                     8283  1 mxm_wmi     processor              27755  1 acpi_cpufreq     button                  4669  0      nfs                   145074  0      lockd                  76805  1 nfs     sunrpc                221055  2 nfs,lockd     fscache                44575  1 nfs     ext4                  456475  1      crc16                   1359  2 ext4,bluetooth     mbcache                 5866  1 ext4     jbd2                   81946  1 ext4     hid_logitech_dj        10567  0      usbhid                 41466  0      hid                    88502  3 hid_generic,usbhid,hid_logitech_dj     sr_mod                 14898  0      sd_mod                 30730  4      cdrom                  34848  1 sr_mod     ata_generic             3370  0      pata_acpi               3387  0      crc32c_intel           14185  0      firewire_ohci          31837  0      firewire_core          51955  1 firewire_ohci     ahci                   22792  5      uhci_hcd               24531  0      ehci_pci                4120  0      libahci                21169  1 ahci     crc_itu_t               1363  1 firewire_core     xhci_hcd               89423  0      ehci_hcd               47672  1 ehci_pci     libata                171016  4 ahci,pata_acpi,libahci,ata_generic     usbcore               177151  6 usblp,uhci_hcd,ehci_hcd,ehci_pci,usbhid,xhci_hcd     scsi_mod              127772  3 libata,sd_mod,sr_mod     usb_common              1648  1 usbcore     radeon                807573  2      i2c_algo_bit            5391  1 radeon     drm_kms_helper         35438  1 radeon     ttm                    65324  1 radeon     drm                   231136  4 ttm,drm_kms_helper,radeon     i2c_core               23720  5 drm,i2c_i801,drm_kms_helper,i2c_algo_bit,radeon      I already tried to change the interface from "down" to "up", but it remains down without displaying any errors. I have the kernel 3.10.1-1-MANJARO (linux310) How can I solve this? P.S: Excuse me for my english, of course.


title: How to install a shared library in Linux

text: As part of my research work I have to study a rootkit. So I downloaded ncom rootkit and tried installing. It didnt have any installion files. Please help me in installing it.


title: ranger: open many files with mplayer

text: I use the file explorer called ranger and I wonder if it is possible to open many files in different directory with mplayer? What I can already do is to select all the files (pressing `v`) from one directory and then press `Enter`. Mplayer is launched and all the files in that directory are played one after the other. But what if I want to play a list of files that are in different directories? EDIT: To be more general, I'd like to know how to run a command that takes files from different directories as arguments.


title: Byobu with tmux, how to use F-Keys

text: I'm accessing a linux box with Byobu enabled (with `tmux`) and I don't seem to be able to use some F-Keys without being binded to Byobu. For example using `F6` to sort on `htop`. I followed this advice, but it doesn't seem to work for me. I press `Shift`-`F2` and then `F6` but nothing happens. If it helps, I'm connecting through PuTTY.


title: I accidentally removed /var/www/ on my Linux server

text: I ran `rm -drf` on my web server and accidentally removed everything inside `/var/www/`. Of course, it had everything for our website in it. How can I undo this? Or is it possible to restore it to a previous version?


title: How to make EDID

text: I read the post here and I tried to make do with what I understood from the post but here are some questions:   1. Where is the `/lib/firmware` located in for example `/usr/src/linux/lib/firmware` or `/usr/lib/firmware` or elsewhere?   2. Could I use a pre-build EDID in that address the post gave and tweak it with an editor like Gvim and pass it to kernel using the info below? The resolution I am trying to set is 1600x900@60:                1: [H PIXELS RND]  :  1600.000000       2: [V LINES RND]  :  450.000000       3: [V FIELD RATE RQD]  :  120.000000       4: [TOP MARGIN (LINES)]  :  8.000000       5: [BOT MARGIN (LINES)]  :  8.000000       6: [INTERLACE]  :  0.500000       7: [H PERIOD EST]  :  16.648841       8: [V SYNC+BP]  :  33.000000       9: [V BACK PORCH]  :  30.000000       10: [TOTAL V LINES]  :  500.500000       11: [V FIELD RATE EST]  :  120.008471       12: [H PERIOD]  :  16.650017       13: [V FIELD RATE]  :  120.000000       14: [V FRAME RATE]  :  60.000000       15: [LEFT MARGIN (PIXELS)]  :  32.000000       16: [RIGHT MARGIN (PIXELS)]  :  32.000000       17: [TOTAL ACTIVE PIXELS]  :  1664.000000       18: [IDEAL DUTY CYCLE]  :  25.004995       19: [H BLANK (PIXELS)]  :  560.000000       20: [TOTAL PIXELS]  :  2224.000000       21: [PIXEL FREQ]  :  133.573440       22: [H FREQ]  :  60.060000       17: [H SYNC (PIXELS)]  :  176.000000       18: [H FRONT PORCH (PIXELS)]  :  104.000000       36: [V ODD FRONT PORCH(LINES)]  :  1.500000 If yes where could I get an `edid.bin` file?   3. Or should I build an EDID file from scratch; if yes how could I make an EDID file?


title: BC - no "\\n" at the end + start with zeros?

text: This is a `bc` output, e.g.: Input:               echo "scale=10; BLA-BLA-HERE-NOT-IMPORTANT" | bc      Output:               .3708446283953709207058828124021300754352578903651372655882743141882\     77124645102027246581819139527644919407424570060822470537797066353573\     96635.8038454068 days      Two Questions:   * can the output be rounded to something like "0.3708..."?   * can I remove the "\n"-s from the end? I can't find any max width option in `bc`.


title: Cinnamon 2.2 How to add custom shortuct: move workspace up

text: I'm quite aware this must have been asked many times, but I cannot seem to find the right search terms to get an answer. I would like to have `Ctrl`+`Shift`+`Up` move my workspace up, and similarly `Ctrl`+`Shift`+`Down` to move down. Currently when I use these shortcuts cinnamon shows all the available workspaces or goes into expo mode. How do I change this?


title: Adding priority to the task permanently on Linux machine

text: How do I increase the priority for a task in Debian Linux system? After a little research I found that I can increase the priority to a task using `nice` command and if I want to increase the priority for an existing task then I can use the `renice` command.   1. In some tutorials its mentioned that, nice values vary from 0 to 99, But in some tutorials states that nice values vary from -20 to 19. Which one is correct?   2. How do I increase the nice value for an GUI task? If I am doing a copy using a terminal then I can increase its priority using `nice` command, but how do I increase the priority of a task done using GUI (for example: copying files from USB to System through GUI)   3. Is it possible to set the priority of a task every time it is run? I want to set highest priority for copying files via the GUI permanently.


title: ext4, why 70k file takes 88 blocks

text: [root@xx]# cat -n create_extents.sh           1  #!/bin/bash          2          3  if [ $# -ne 2 ]          4  then          5          echo "$0 [filename] [size in kb]"          6          exit 1          7  fi          8          9  filename=$1         10  size=$2         11  i=0         12         13  while [ $i -lt $size ]         14  do         15          i=`expr $i + 7`         16          echo -n "$i" | dd of=$1 bs=1024 seek=$i         17  done      so I did               sudo ./create_extents.sh  /device3/test70 70      Then, I use debugfs "stat" command to check it, Inode: 13 Type: regular Mode: 0644 Flags: 0x80000               Generation: 2638566511    Version: 0x00000000:00000001     User:     0   Group:     0   Size: 71682     File ACL: 0    Directory ACL: 0     Links: 1   Blockcount: 88     Fragment:  Address: 0    Number: 0    Size: 0      ctime: 0x53292990:042e685c -- Wed Mar 19 01:22:24 2014      atime: 0x5329298f:edd4dc60 -- Wed Mar 19 01:22:23 2014      mtime: 0x53292990:042e685c -- Wed Mar 19 01:22:24 2014     crtime: 0x5329298f:edd4dc60 -- Wed Mar 19 01:22:23 2014     Size of extra inode fields: 28     EXTENTS:     (ETB0):33803, (1):33825, (3):33827, (5):33829, (7-8):33831-33832, (10):33834, (12):33836, (14-15):33838-33839, (17):33841     (END)      Why it takes so many blocks? and the place is so scattered..? My block size is 4k. I know that ext4 tries hard to keep locality for one file. thanks


title: Bash: interactive remote prompt

text: I have a script which connects to a remote server and check if some package is installed:               ssh root@server 'bash -s' < myscript.sh      myscript.sh:               OUT=`rpm -qa | grep ntpdate`     if [ "$OUT" != "" ] ; then         echo "ntpdate already installed"     else         yum install $1     fi      This example could be simplified. Here is `myscript2.sh` which has same problem:               read -p "Package is not installed. Do you want to install it (y/n)?" choise      My problem is that bash can not read my answers interactively. Is there a way to execute local script remotely without losing ability to prompt user?


title: Greyhole permission problems

text: I'm setting up a homeserver using Greyhole and Samba. _excerpt_ > Greyhole - An application that uses Samba to create a storage pool of all > your available hard drives (whatever their size, however they're connected), > and allows you to create redundant copies of the files you store, in order > to prevent data loss when part of your hardware fails. The harddrive is mounted into `/mnt/hdd0`, `/mnt/hdd0/gh` is added into the pool and `/mnt/hdd0/shares` contains the Samba shares. I'm able to connect to the server and create files and folders. However, after Greyhole created the symlink and copied them into the pool, I can neither edit nor delete files. Windows just throws "Permission denied."   * The symlinks have full permissions and are owned by `root:root`.   * The files, they are referring to, are owned by the user, who created them and have `rwxr--r--` permissions.   * The subfolders of "gh" and "shares" have `rwx.rwx---` This is the `smb.conf`:               [global]        workgroup = WORKGROUP        server string = Samba Server        security = user        encrypt passwords = true        log file = /var/log/samba/%m.log          [TV]        path = /mnt/hdd0/shares/TV        comment = Recorded TV Shows        available = yes        browseable = yes        writeable = yes        dfree command = /usr/bin/greyhole-dfree        vfs objects = greyhole      What do I need to change, to get write-access to the files? And how do I change the group of the created files to i.e. `sambashare` (a group all my samba users are in)? **Edit:** if i stop greyhole and create a new file, i can edit it. I suppose, GH is the problem.


title: Using the system date / time in a Cron Script

text: I'm setting up a Cronjob that will backup a MySQL database I have in my server, but I don't want it to keep overwriting the same file over and over again. Instead, I want to have an array of backups to choose from, done automatically. For example:               ## Cronjob, run May 21st, 2011:     mysqldump -u username -ppasword database > /path/to/file/21-03-2011.sql          ## SAME Conjob, run May 28th, 2011:     mysqldump -u username -ppasword database > /path/to/file/28-03-2011.sql      And so on. Is there any way that I can use the system date and/or time as some kind of variable in my Cronjob? If not, what are your suggestions to accomplish the same?


title: What's the best way to partition your drive?

text: I usually install Linux on a single partition since I only use it as a personal desktop. However every now and then I reinstall the box and what I simply do is to move my files around with an external hard disk. So, how could I prevent that when reinstalling my box (e.g. switching to another distro)?


title: What is 'keyring' in Google Chrome

text: Every time i run Chrome, it ask for the keyring password for Default. If I fill my password in, it disappears and I can continue, and when I press cancel it has the same effect. So, what does the keyring do and what's the difference with unlocking and canceling?


title: How to set the CPU freq. in Linux?

text: I'm using this ARM9 SAM9G25 embedded system, that when switched on, is only online for a few seconds and because I want to speed up the whole process, I'd like to check the CPU frequency, and set it to max. speed. The Linux 2.6.39 kernel is generated here with Buildroot 2013.10. When googeling around it in the end always leads to the "CPU frequency _scaling_ " option, but that's not what I'm looking for. I believe there has to be some kind of a statically value for the CPU, so that e.g.: the kernel tells a 1 GHz CPU to operate at max. 100 MHz. Can anyone point me in the right direction? Thanks for the support.