title: Display dialog from pam_exec environment at login?

text: I'm using `pam_exec` to do some root tasks. They take some time, and I'd like to tell the user to wait a moment. I'm doing the tasks there, and not later, because I need:   * Root permissions   * To rsync the home files from a server BEFORE _anything_ gets loaded on the desktop My problem is: I can't show a window displaying anything. i'm loading this script from `pam_exec` to test whether this is a `$DISPLAY` issue or a user issue:               #!/bin/bash          case "$PAM_TYPE" in              'open_session')              echo Plain exec &> /tmp/pamexec_output         yad &>> /tmp/pamexec_output         echo Set display &>> /tmp/pamexec_output         DISPLAY=:0 yad &>> /tmp/pamexec_output         echo Set user lightdm &>> /tmp/pamexec_output             sudo -u lightdm yad &>> /tmp/pamexec_output         echo Set user $PAM_USER &>> /tmp/pamexec_output             sudo -u $PAM_USER yad &>> /tmp/pamexec_output         echo Set user lightdm and display &>> /tmp/pamexec_output         DISPLAY=:0 sudo -u lightdm yad &>> /tmp/pamexec_output         echo Set user $PAM_USER and display &>> /tmp/pamexec_output         DISPLAY=:0 sudo -u $PAM_USER yad &>> /tmp/pamexec_output         echo PS AUX &>> /tmp/pamexec_output         ps aux &>> /tmp/pamexec_output              ;;          esac      I couldn't get my answer No windows are being shown, and the output:               Plain exec     No protocol specified     No protocol specified          (yad:25314): Gtk-WARNING **: cannot open display: :0     Set display     No protocol specified     No protocol specified          (yad:25317): Gtk-WARNING **: cannot open display: :0     Set user lightdm     No protocol specified     No protocol specified          (yad:25321): Gtk-WARNING **: cannot open display: :0     Set user jorge.suarez     No protocol specified     No protocol specified          (yad:25325): Gtk-WARNING **: cannot open display: :0     Set user lightdm and display     No protocol specified     No protocol specified          (yad:25328): Gtk-WARNING **: cannot open display: :0     Set user jorge.suarez and display     No protocol specified     No protocol specified          (yad:25331): Gtk-WARNING **: cannot open display: :0      As a bonus, here is the final output, from `ps aux`. Maybe that could help:               PS AUX     USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND     root         1  0.0  0.2  26684  2488 ?        Ss   Jan24   0:01 /sbin/init     root         2  0.0  0.0      0     0 ?        S    Jan24   0:00 [kthreadd]     root         3  0.0  0.0      0     0 ?        S    Jan24   0:00 [ksoftirqd/0]     root         5  0.0  0.0      0     0 ?        S    Jan24   0:00 [kworker/u:0]     root         6  0.0  0.0      0     0 ?        S    Jan24   0:00 [migration/0]     root         7  0.0  0.0      0     0 ?        S    Jan24   0:00 [watchdog/0]     root         8  0.0  0.0      0     0 ?        S<   Jan24   0:00 [cpuset]     root         9  0.0  0.0      0     0 ?        S<   Jan24   0:00 [khelper]     root        10  0.0  0.0      0     0 ?        S    Jan24   0:00 [kdevtmpfs]     root        11  0.0  0.0      0     0 ?        S<   Jan24   0:00 [netns]     root        12  0.0  0.0      0     0 ?        S    Jan24   0:00 [sync_supers]     root        13  0.0  0.0      0     0 ?        S    Jan24   0:00 [bdi-default]     root        14  0.0  0.0      0     0 ?        S<   Jan24   0:00 [kintegrityd]     root        15  0.0  0.0      0     0 ?        S<   Jan24   0:00 [kblockd]     root        16  0.0  0.0      0     0 ?        S<   Jan24   0:00 [ata_sff]     root        17  0.0  0.0      0     0 ?        S    Jan24   0:00 [khubd]     root        18  0.0  0.0      0     0 ?        S<   Jan24   0:00 [md]     root        21  0.0  0.0      0     0 ?        S    Jan24   0:00 [khungtaskd]     root        22  0.0  0.0      0     0 ?        S    Jan24   0:00 [kswapd0]     root        23  0.0  0.0      0     0 ?        SN   Jan24   0:00 [ksmd]     root        24  0.0  0.0      0     0 ?        SN   Jan24   0:00 [khugepaged]     root        25  0.0  0.0      0     0 ?        S    Jan24   0:00 [fsnotify_mark]     root        26  0.0  0.0      0     0 ?        S    Jan24   0:00 [ecryptfs-kthrea]     root        27  0.0  0.0      0     0 ?        S<   Jan24   0:00 [crypto]     root        35  0.0  0.0      0     0 ?        S<   Jan24   0:00 [kthrotld]     root        36  0.0  0.0      0     0 ?        S    Jan24   0:00 [scsi_eh_0]     root        37  0.0  0.0      0     0 ?        S    Jan24   0:08 [scsi_eh_1]     root        38  0.0  0.0      0     0 ?        S    Jan24   0:00 [kworker/u:2]     root        59  0.0  0.0      0     0 ?        S<   Jan24   0:00 [devfreq_wq]     root       206  0.0  0.0      0     0 ?        S    Jan24   0:02 [jbd2/vda5-8]     root       207  0.0  0.0      0     0 ?        S<   Jan24   0:00 [ext4-dio-unwrit]     root       227  0.0  0.1  30844  1256 ?        S    Jan24   0:00 mountall --daemon     root       302  0.0  0.0  17224   640 ?        S    Jan24   0:00 upstart-udev-bridge --daemon     root       305  0.0  0.2  24524  2172 ?        Ss   Jan24   0:00 /sbin/udevd --daemon     root       431  0.0  0.0      0     0 ?        S<   Jan24   0:00 [kpsmoused]     root       504  0.0  0.1  19192  1032 ?        Ss   Jan24   0:00 rpcbind -w     root       513  0.0  0.0      0     0 ?        S    Jan24   0:00 [jbd2/vda6-8]     root       514  0.0  0.0      0     0 ?        S<   Jan24   0:00 [ext4-dio-unwrit]     root       532  0.0  0.0  15180   404 ?        S    Jan24   0:00 upstart-socket-bridge --daemon     root       570  0.0  0.0      0     0 ?        S    Jan24   0:00 [jbd2/vda7-8]     root       573  0.0  0.0      0     0 ?        S<   Jan24   0:00 [ext4-dio-unwrit]     root       655  0.0  0.0      0     0 ?        S<   Jan24   0:00 [rpciod]     root       658  0.0  0.0      0     0 ?        S<   Jan24   0:00 [nfsiod]     root       669  0.0  0.2  49948  2716 ?        Ss   Jan24   0:00 /usr/sbin/sshd -D     102        679  0.0  0.2  27184  2536 ?        Ss   Jan24   0:17 dbus-daemon --system --fork --activation=upstart     root       709  0.0  0.3  79036  3096 ?        Ss   Jan24   0:00 /usr/sbin/modem-manager     root       717  0.0  0.1  21180  1692 ?        Ss   Jan24   0:00 /usr/sbin/bluetoothd     syslog     733  0.0  0.1 249464  1404 ?        Sl   Jan24   0:02 rsyslogd -c5     root       738  0.0  0.5 229848  5260 ?        Ssl  Jan24   0:05 NetworkManager     root       746  0.0  0.0      0     0 ?        S<   Jan24   0:00 [krfcommd]     root       756  0.0  0.6 188336  5844 ?        Sl   Jan24   0:23 /usr/lib/policykit-1/polkitd --no-debug     statd      773  0.0  0.1  21496  1312 ?        Ss   Jan24   0:00 rpc.statd -L     avahi      780  0.0  0.1  34396  1716 ?        S    Jan24   0:00 avahi-daemon: registering [ctdeskxyy.local]     avahi      781  0.0  0.0  34268   472 ?        S    Jan24   0:00 avahi-daemon: chroot helper     root       787  0.0  0.1   7256  1508 ?        S    Jan24   0:00 /sbin/dhclient -d -4 -sf /usr/lib/NetworkManager/nm-dhcp-client.action -pf /var/run/sendsigs.omit.d/network-manager.dhclient-eth0.pid -lf /var/lib/dhcp/dhclient-05584152-142d-425d-b5b9-1e63697e0637-eth0.lease -cf /var/run/nm-dhclient-eth0.conf eth0     colord     808  0.0  1.2 491876 11588 ?        Sl   Jan24   0:01 /usr/lib/x86_64-linux-gnu/colord/colord     root       938  0.0  0.0  19980   932 tty4     Ss+  Jan24   0:00 /sbin/getty -8 38400 tty4     root       948  0.0  0.0  19980   940 tty5     Ss+  Jan24   0:00 /sbin/getty -8 38400 tty5     root       961  0.0  0.2  69768  1904 tty3     Ss   Jan24   0:00 /bin/login --                  root       964  0.0  0.0  19980   936 tty6     Ss+  Jan24   0:00 /sbin/getty -8 38400 tty6     root       983  0.0  0.0   4452   812 ?        Ss   Jan24   0:00 acpid -c /etc/acpi/events -s /var/run/acpid.socket     root       984  0.0  0.1  19104  1024 ?        Ss   Jan24   0:00 cron     daemon     985  0.0  0.0  16900   372 ?        Ss   Jan24   0:00 atd     root       991  0.0  0.3 262560  3396 ?        Ssl  Jan24   0:01 lightdm     whoopsie   993  0.0  0.5 202176  5024 ?        Ssl  Jan24   0:01 whoopsie     nobody    1001  0.0  0.1  33016  1252 ?        S    Jan24   0:00 /usr/sbin/dnsmasq --no-resolv --keep-in-foreground --no-hosts --bind-interfaces --pid-file=/var/run/sendsigs.omit.d/network-manager.dnsmasq.pid --listen-address=127.0.0.1 --conf-file=/var/run/nm-dns-dnsmasq.conf --cache-size=0 --proxy-dnssec     root      1023  0.0  0.1 701376  1192 ?        Ssl  Jan24   0:00 /usr/sbin/nscd     nslcd     1111  0.0  0.2 443796  1916 ?        Ssl  Jan24   0:00 /usr/sbin/nslcd     root      1254  0.0  0.4 586496  4152 ?        Sl   Jan24   0:08 /usr/sbin/console-kit-daemon --no-daemon     root      1362  0.0  0.0      0     0 ?        S    Jan24   0:01 [flush-253:0]     root      1534  0.0  0.2  76052  2032 tty1     Ss   Jan24   0:00 /bin/login --                   root      1536  0.0  0.4 219940  4272 ?        Sl   Jan24   0:01 /usr/lib/upower/upowerd     rtkit     1567  0.0  0.1 160644  1136 ?        SNl  Jan24   0:00 /usr/lib/rtkit/rtkit-daemon     1000      1782  0.0  0.4  19556  4676 tty1     S    Jan24   0:00 -bash     root      1930  0.0  0.2  66712  1904 tty1     S    Jan24   0:00 sudo su     root      1931  0.0  0.1  66472  1816 tty1     S    Jan24   0:00 su     root      1941  0.0  0.2  17260  2324 tty1     S+   Jan24   0:01 bash     root      1965  0.0  0.0      0     0 ?        S    Jan24   0:00 [lockd]     root      2505  0.0  0.3 193524  3628 ?        Sl   Jan24   0:01 /usr/lib/udisks/udisks-daemon     root      2506  0.0  0.0  45512   804 ?        S    Jan24   0:00 udisks-daemon: not polling any devices     root      5436  0.0  0.4  98476  4256 ?        Ss   08:01   0:00 /usr/sbin/cupsd -F     root     11778  0.0  0.0      0     0 ?        S<   08:01   0:00 [xfs_mru_cache]     root     11779  0.0  0.0      0     0 ?        S<   08:01   0:00 [xfslogd]     root     11780  0.0  0.0      0     0 ?        S<   08:01   0:00 [xfsdatad]     root     11781  0.0  0.0      0     0 ?        S<   08:01   0:00 [xfsconvertd]     root     11784  0.0  0.0      0     0 ?        S    08:01   0:00 [jfsIO]     root     11785  0.0  0.0      0     0 ?        S    08:01   0:00 [jfsCommit]     root     11786  0.0  0.0      0     0 ?        S    08:01   0:00 [jfsSync]     root     13718  0.0  0.0      0     0 ?        Z    Jan24   0:00 [lightdm] <defunct>     root     14197  0.0  0.1  24520  1640 ?        S    08:03   0:00 /sbin/udevd --daemon     root     14198  0.0  0.0      0     0 ?        S<   08:03   0:00 [iprt]     root     16911  0.0  0.2  69768  1904 tty2     Ss   Jan24   0:00 /bin/login --                  root     18750  0.0  0.3 124052  3712 ?        Sl   09:12   0:00 /usr/lib/accountsservice/accounts-daemon     root     21715  0.0  0.0      0     0 ?        Z    09:20   0:00 [lightdm] <defunct>     4004     23593  0.0  0.3 207504  3592 ?        Sl   09:35   0:00 /usr/lib/deja-dup/deja-dup/deja-dup-monitor     root     24087  0.0  0.0      0     0 ?        S    09:42   0:00 [kworker/0:1]     root     24355  0.0  0.0      0     0 ?        S    09:47   0:00 [kworker/0:2]     root     24581  0.1  2.6 122056 24912 ?        SN   09:48   0:00 /usr/bin/python /usr/sbin/aptd     root     25026  0.1  0.0      0     0 ?        S    09:52   0:00 [kworker/0:0]     root     25134  1.8  2.6 148396 25280 tty7     Ss+  09:53   0:00 /usr/bin/X :0 -auth /var/run/lightdm/root/:0 -nolisten tcp vt7 -novtswitch     root     25226  0.0  0.3 155028  3136 ?        Sl   09:53   0:00 lightdm --session-child 12 385     lightdm  25258  0.1  0.5 344020  5200 ?        S<l  09:53   0:00 /usr/bin/pulseaudio --start --log-target=syslog     lightdm  25263  0.0  0.3  95984  3240 ?        S    09:53   0:00 /usr/lib/pulseaudio/pulse/gconf-helper     root     25313  0.0  0.1  16516  1376 ?        Ss   09:54   0:00 /bin/bash /usr/local/lib/puppet-files/gestion-sesiones.sh log=/tmp/cosaaaa     root     25334  0.0  0.1  14144  1020 ?        R    09:54   0:00 ps aux     4004     26833  0.0  0.5 362740  5676 ?        S<l  Jan24   0:01 /usr/bin/pulseaudio --start --log-target=syslog     4004     26836  0.0  0.3  95968  3256 ?        S    Jan24   0:00 /usr/lib/pulseaudio/pulse/gconf-helper     root     28396  0.0  0.0      0     0 ?        Z    Jan24   0:00 [lightdm] <defunct>     4004     29073  0.0  0.4  19536  4660 tty2     S+   Jan24   0:00 -bash     4004     29256  0.0  0.4  19488  4468 tty3     S+   Jan24   0:00 -bash      Another interesting finding. This script:               #!/bin/bash          case "$PAM_TYPE" in              'open_session')              (              sleep 5              yad &> /tmp/pam_output         ) &              ;;          esac      It works, but the window is being showed way after the desktop is loaded. So that won't help. It also works at logout, no problem there. Any ideas on how to solve this problem?


title: EDID Invalid on USB DisplayLink Device

text: I have a Sabrent USB to HDMI adapter which is a DisplayLink device. It's recognized by `udl` as being a DisplayLink device, yet seems to be rejected/disabled due to having an invalid EDID:               [32780.107963] usb 3-1: new high-speed USB device number 12 using xhci_hcd     [32785.130415] usb 3-1: device descriptor read/8, error -110     [32785.251408] usb 3-1: Invalid ep0 maxpacket: 242     [32785.362527] usb 3-1: new high-speed USB device number 13 using xhci_hcd     [32785.385812] usb 3-1: New USB device found, idVendor=17e9, idProduct=410d     [32785.385824] usb 3-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3     [32785.385831] usb 3-1: Product: Sabrent USB-HDMI     [32785.385836] usb 3-1: Manufacturer: DisplayLink     [32785.385840] usb 3-1: SerialNumber: 442631     [32785.388773] [drm] vendor descriptor length:27 data:27 5f 01 00 25 00 04 04 01 00 03     [32785.498175] Raw EDID:     [32785.498191]      00 00 00 00 00 00 ff 00 5a 63 2e 73 01 01 01 01     [32785.498196]      07 18 01 03 80 34 1d 78 2e 2c c5 a4 56 50 a1 28     [32785.498200]      0f 50 54 bf ef 80 b3 00 a9 40 a9 c0 95 00 90 40     [32785.498203]      81 80 81 40 81 00 02 3a 80 18 71 38 2d 40 58 2c     [32785.498206]      45 00 09 25 21 00 00 1e 00 00 00 ff 00 54 53 54     [32785.498210]      31 34 30 37 34 31 35 33 38 0a 00 00 00 fd 00 32     [32785.498213]      4b 18 52 11 00 0a 20 20 20 20 20 20 00 00 00 fc     [32785.498216]      00 56 41 32 34 34 36 20 53 45 52 49 45 53 00 76     [32785.498226] udl 3-1:1.0: DVI-I-7: EDID invalid.     [32785.499647] udl 3-1:1.0: fb2: udldrmfb frame buffer device     [32785.499656] [drm] Initialized udl 0.0.1 20120220 on minor 2      I'm running Ubuntu 12.04 LTS (Elementary Luna) with a 3.11.0 kerrnel:               $ uname -a     Linux hostname 3.11.0-19-generic #33~precise1-Ubuntu SMP Wed Mar 12 21:16:27 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux      I have installed `xserver-xorg-video-displaylink`, and it's clear that its running, as `udl` detects the DisplayLink device. I don't get a green screen, the monitor doesn't turn on. Digging around in kernel internals, the `EDID invalid` message occurs in drivers/gpu/drm/drm_edid.c:3000:               if (!drm_edid_is_valid(edid)) {         dev_warn(connector->dev->dev, "%s: EDID invalid.\n", drm_get_connector_name(connector));         return 0;     }      What exactly is going wrong here and how can I fix it? Does the returned EDID break the utilization of the device? Is there a way that I can either patch my kernel or set some other configuration to get the DisplayLink device to work properly?


title: Open list of files in vim to specific lines

text: I know about vins command line operator but I need a version that works on multiple files . For instance I have a stack trace file and would like it to open all of the files to the line in a different buffer


title: examine the exit code of processes launched in parallel from a script

text: Say I have the following bash script:               #!/usr/bin/env bash     process-1&     process-2&     process-3&      I have two questions:   1. how can I check at the end of my script that all processes exited with an exit code of 0 ?   2. how can my script "wait" until all launched processes have finished and then do a concluding `echo` (perhaps informing the user of the exit codes)?


title: wget - corrupted directories

text: I am using wget to create an HTML mirror of a php templated site on localhost. I am encountering a problem with some directories being mirrored as extensionless documents. What could be causing this problem? I am using this command:               $ wget -mk http://www.example.com/      ![A screenshot of corrupted directories.](http://i.stack.imgur.com/F2dCT.png)


title: Linux client that can communicate with NetMeeting

text: Are there any NetMeeting compatible softwares for Linux environments?


title: Vi: On startup, highlight tags and display tags in a preview window

text: I am using vi as a note-taking and outlining tool. I am constructing the "tags" file by myself. What I would like to do is that when I open my notes or outline file, vi reads the tags present in this file, highlights them and also displays the tag labels in a vertical preview window. I have no experience in vim scripting so I would appreciate some help. Currently I am using a bash script to generate a tag labels file "taglabels" in $PWD using cut and loading it in a separate vertical window My script looks like this               #! /bin/bash          cut -f1 $PWD/tags > $PWD/taglabels     vi -c ":30vsp $PWD/taglabels" $1      As is obvious, the script does not highlight the tags present in the file nor does it it show only the tags present in the file. On the contrary it shows all the tags present in $PWD/tags I looked into ctags and the taglist plugin but they seem to be more suited for code than for free form text. If anyone has any suggestions on how to improve on this scenario I would be grateful. Thanks.


title: How do you make a cross-process locking in Linux (C/C++)?

text: I need to make sure one process executes only in one instance at a time. On Windows you could use named mutex. But I have no idea what to use on Linux. I think I've seen an approach were app creates an exclusive file, but I can't find it anymore. Do you use regular file functions, busy-loop?


title: Does OpenSSH_5.9p1 support Chrooted SSH?

text: Lately i upgraded my SSH server with OpenSSH_5.9p1 and tried to setup chrooted SFTP/SSH. So far i managed to setup chrooted access only for SFTP using new feature of openssh5.9p1: ` Match User testuser ChrootDirectory /home/testuser X11Forwarding no AllowTcpForwarding no ForceCommand internal-sftp ` But i need to enable SSH access as well for the same user. I followed many articles,and with this one http://www.howtoforge.com/chroot_ssh_sftp_fedora7 i managed to connect via SSH. But chroot seems not working, i still can browse outside folders. Any suggestion please ? Thanks.


title: What is the point of Virtual replace mode in Vim?

text: The help says that virtual replace mode commands in Vim `gr` & `GR` replace characters in screen estate and not in file.               :help Virtual-Replace-mode      I am understanding this as something like changing the characters on the display but not in the buffer itself. Is that right? It seems incorrect. I can use an explanation and probably a scenario or an example where this feature is relevant.


title: How to get "current glob" in zsh

text: I want to do something like: `$ convert [a,b,c,d,e].png -resize 50% <current_match>_half.png` How can I do this? Is there some variable that stores the current match? I couldn't find anything in the docs but maybe I'm looking for the wrong keywords. I thought maybe I could do it with `xargs` but I couldn't work that out either.


title: AWK match string, not Regex

text: How do I match a string with AWK? Say I have the string `[(*.+` it should only match strings containing the string `[(*.+`. The string is entered by the user, so if you know a cli utility that can escape regexes it may work too. **Edit:** It should also match strings containing the string, such as `foo[(*.+bar`.


title: Getting data from matching list

text: list.txt                GETID_17049_knownids_1/2_Confidence_0.625_Length_2532      GETID_9248_knownids_6/10_Confidence_0.439_Length_2474      GETID_11084_knownids_3/3_Confidence_0.600_Length_1451      GETID_15916_knownids_10/11_Confidence_0.324_Length_1825      sample1.txt               >GETID_17049_knownids_1/2_Confidence_0.625_Length_2532     sampletextforsample1     sampletextforsample1     sampletextforsample1     >GETID_18457_knownids_1/2_Confidence_0.625_Length_2532     sample2textforsample1     sample2textforsample1     sample2textforsample1     sample2textforsample1      sample2.txt               >GETID_11084_knownids_3/3_Confidence_0.600_Length_1451     sampletextforsample2     sampletextforsample2     >GETID_67838_knownids_3/3_Confidence_0.600_Length_1451     sample2textforsample2     sample2textforsample2      sample3.txt               >GETID_17049_knownids_1/2_Confidence_0.625_Length_2532     sampletextforsample3     sampletextforsample3     sampletextforsample3     >GETID_15916_knownids_10/11_Confidence_0.324_Length_1825     sample2textforsample3     sample2textforsample3      output.txt               >GETID_17049_knownids_1/2_Confidence_0.625_Length_2532     sampletextforsample1     sampletextforsample1     sampletextforsample1     >GETID_17049_knownids_1/2_Confidence_0.625_Length_2532     sampletextforsample3     sampletextforsample3     sampletextforsample3     >GETID_11084_knownids_3/3_Confidence_0.600_Length_1451     sampletextforsample2     sampletextforsample2     >GETID_15916_knownids_10/11_Confidence_0.324_Length_1825     sample2textforsample3     sample2textforsample3      I want to read each line from list.txt (by capturing bracketed values (GETID_{17049} _knownids_ {1/2}_Confidence_1.0_Length_{2532}) and compare with sample1.txt, sample2.txt, sample3.txt has multiple line and print the contents (output.txt) from these files when it is matched with list.txt. The output should contain exact match to list.txt. Any help in awk/sed/perl is appreciated.


title: When was a file last opened?

text: How do I determine, when a file was last opened? I've looked at `man ls` (using GNU coreutils 8.22) and I don't see anything about this timestamp.


title: Changing firewall settings after installation of CentOS via kickstart

text: I was trying to install CentOS 6.3 via Windows Deployment Server. And to automate the installation process I used kickstart file in which i provided various details required during installation.Then i wanted that machine to serve as mysql server that can be only accessed via ssh or mysql process,so i wanted to give the firewall rules via iptables. I have verified that these are correct and tested on existing machine.So I gave these these rules in %post section of the kickstart file ....but i encounted the following error **“can’t initialize iptables ‘filter’: Table does not exist”** .I have also taken care of the chroot environment but still the problem persisted.


title: Linux Live CD cannot play video

text: I want to switch from windows to linux, but before the switch I would like to try them out in the Live CD. I downloaded the iso and created a multiboot usb stick ( by YUMI Multiboot USB Creator ). I can boot into Ubuntu Desktop 12.04 64 bit LTS and Linux Mint 13 Mate 64 bit. I can access the hard drive from there and I tried some video with the default player comes with them ( e.g: GNOME Player and VLC Player ). The player opened but the video didn't play. However, I can play the same video in Puppy Linux. ( Puppy Linux doesn't has a choice over 32-bit or 64-bit ) Maybe my CPU didn't support 64 bit? Here is a snap from CPUZ: CPU: AMD Phenom II X3 710 ![enter image description here](http://i.stack.imgur.com/UiN3X.png) **UPDATE:** Yesterday I tried to boot into Linux Mint and give it a second try. The video played without problem. Today I boot it again and it didn't work. No Video is able to play. Only the video player appeared with a black screen. No warning, no error message. I wonder if it is about the video card? I am using ATI Radeon HD 4830 video card. I've heard linux doesn't have good support for hardware. But how can I be sure of this? I can't install driver within the live cd linux ( or can I? ) before I really install them on my hard drive.


title: Compile newer software for outdated versions of the same distribution

text: I am using Fedora 17 and want to compile and use Geary. However, the required library versions are only available in Fedora 18. For various reasons I want (need!) to stick to F17 so, I was thinking of compiling in Fedora 18 (in Virtualbox) and then moving across to F17. However, I a presume once I do this and try to run on F17 it will complain about missing libraries. Is there a way to compile on F18 and it pull in all the required libraries into a folder that I can just copy across? Or is there a better way to do this?


title: Compile parameters for MIPS based codesourcery toolchain?

text: I installed codesourcery cross compile toolchain for mips32 architecture on my WIN 7 machince. I want to first compile a simple 'factorial' binary for my router which is based on MIPS32. From little search on the internet, I found it is based on MIPS32 big-endian.               #cat /proc/cpuinfo     system type             : 96338W2     processor               : 0     cpu model               : BCM6338 V1.0     BogoMIPS                : 239.20     wait instruction        : no     microsecond timers      : yes     tlb_entries             : 32     extra interrupt vector  : yes     hardware watchpoint     : no     unaligned access        : 1269919     VCED exceptions         : not available     VCEI exceptions         : not available          # cat /proc/version     Linux version 2.6.8.1 (root@WangHaiTao) (gcc version 3.4.2) #1 Wed Sep 2 10:13:53 CST 2009      The router's LIB dir contains: > ld-uClibc.so.0 libc.so.0 libcrypt.so.0 libcrypto.so.0.9.7 libdl.so.0 > libm.so.0 libnvram.so libpsi.so libpsixml.so libresolv.so.0 libssl.so.0.9.7 > libutil.so.0 libwlbcmcrypto.so libwlbcmshared.so libwlctl.so modules Toolchain info: (on the host WIN 7 system)               C:\code>mips-linux-gnu-gcc -v     Using built-in specs.     COLLECT_GCC=mips-linux-gnu-gcc     COLLECT_LTO_WRAPPER=f:/program files/codesourcery/sourcery_codebench_lite_for_mi     ps_gnu_linux/bin/../libexec/gcc/mips-linux-gnu/4.6.3/lto-wrapper.exe     Target: mips-linux-gnu     Configured with: /scratch/cmoore/2012.03-63-linux-lite/src/gcc-4.6-2012.03/confi     gure --build=i686-pc-linux-gnu --host=i686-mingw32 --target=mips-linux-gnu --ena     ble-threads --disable-libmudflap --disable-libssp --disable-libstdcxx-pch --with     -arch-32=mips32r2 --with-arch-64=mips64r2 --with-float=hard --with-mips-plt --en     able-extra-sgxxlite-multilibs --with-gnu-as --with-gnu-ld --with-specs='%{save-t     emps: -fverbose-asm} -D__CS_SOURCERYGXX_MAJ__=2012 -D__CS_SOURCERYGXX_MIN__=3 -D     __CS_SOURCERYGXX_REV__=63 %{O2:%{!fno-remove-local-statics: -fremove-local-stati     cs}} %{O*:%{O|O0|O1|O2|Os:;:%{!fno-remove-local-statics: -fremove-local-statics}     }}' --enable-languages=c,c++ --enable-shared --enable-lto --enable-symvers=gnu -     -enable-__cxa_atexit --with-pkgversion='Sourcery CodeBench Lite 2012.03-63' --wi     th-bugurl=https://support.codesourcery.com/GNUToolchain/ --disable-nls --prefix=     /opt/codesourcery --with-sysroot=/opt/codesourcery/mips-linux-gnu/libc --with-bu     ild-sysroot=/scratch/cmoore/2012.03-63-linux-lite/install/host-i686-mingw32/mips     -linux-gnu/libc --with-libiconv-prefix=/scratch/cmoore/2012.03-63-linux-lite/obj     /host-libs-2012.03-63-mips-linux-gnu-i686-mingw32/usr --with-gmp=/scratch/cmoore     /2012.03-63-linux-lite/obj/host-libs-2012.03-63-mips-linux-gnu-i686-mingw32/usr     --with-mpfr=/scratch/cmoore/2012.03-63-linux-lite/obj/host-libs-2012.03-63-mips-     linux-gnu-i686-mingw32/usr --with-mpc=/scratch/cmoore/2012.03-63-linux-lite/obj/     host-libs-2012.03-63-mips-linux-gnu-i686-mingw32/usr --with-ppl=/scratch/cmoore/     2012.03-63-linux-lite/obj/host-libs-2012.03-63-mips-linux-gnu-i686-mingw32/usr -     -with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm' --with     -cloog=/scratch/cmoore/2012.03-63-linux-lite/obj/host-libs-2012.03-63-mips-linux     -gnu-i686-mingw32/usr --with-libelf=/scratch/cmoore/2012.03-63-linux-lite/obj/ho     st-libs-2012.03-63-mips-linux-gnu-i686-mingw32/usr --disable-libgomp --enable-po     ison-system-directories --with-build-time-tools=/scratch/cmoore/2012.03-63-linux     -lite/obj/tools-i686-pc-linux-gnu-2012.03-63-mips-linux-gnu-i686-mingw32/mips-li     nux-gnu/bin --with-build-time-tools=/scratch/cmoore/2012.03-63-linux-lite/obj/to     ols-i686-pc-linux-gnu-2012.03-63-mips-linux-gnu-i686-mingw32/mips-linux-gnu/bin     Thread model: posix     gcc version 4.6.3 (Sourcery CodeBench Lite 2012.03-63)            I tried the following compile parameters:   1. `mips-linux-gnu-gcc -mips32 -muclibc -o factorial factorial.c` When I ran the output binary on the MIPS box, it just printed "can't load library 'libgcc_s.so.1' ".   1. `mips-linux-gnu-gcc -muclibc -mips32 -static-libgcc -s -o factorial factorial.c` When I run its output, it prints 'sigsegv'. What is wrong here? What compiler parameter should I enter? Please help me. **UPDATE** : Added more info.


title: How to connect to internet using `nmcli`?

text: According to this link `nmcli dev wifi con a52c60f5-c1af-4d39-8dc8-728bd770bffc password 12345678 name dlink_home` should establish the connection, but it outputs the following error when I try to connect: > Error: 'dev wifi' command 'con' is not valid. So, how I can connect to wireless internet/network using `network-manager` or `nmcli` in command-line mode? PS. The OS I am running is RHEL6 Server


title: Who should own files shared by a group and where should they go

text: I am configuring a Linux work station that will be used by a small number of users (20-30). These users will belong to a small set of groups (5-10) with each user belonging to at least one group and potentially multiple groups. On the work station there are files that should only be writeable by members of a particular group. Each file is only writeable by members of one group so standard Linux permissions should work just fine. I have two questions. Who should own the files that already exist? I was thinking either `root` or creating a set of dummy users corresponding to the groups. Is there a better choice that I am missing? It seems like this is unlikely a unique situation so I was hoping there was a standard convention. The second question is where should I put the files. If I made dummy users I could create subdirectories in `/home/`. If root owns the files do I go with `/srv/groups/` or maybe `/share/? Again is there a convention?


title: SELinux: chcon to a type, ls -Z shows another one

text: When I do               chcon -v -t httpd_sys_script_ro_t a_folder_at_home/      And then:               ls -dZ      I got:               DACs user grp unconfined_u:object_r:httpd_sys_content_t:s0 a_folder_at_home/      In case of error I would have expected something like:               chcon -v -t httpd_sys_ro_content_t a_folder_at_home/     chcon: failed to change context of `a_folter_at_home/' to `unconfined_u:object_r:httpd_sys_ro_content_t:s0': Invalid argument      Is this some kind of alias? I am using Scientific Linux 6


title: Ssh audio redirection

text: I have DVB-T USB dongle plugged into my Linux server (GUI-less). It works correctly, but I want to stream TV programs from server to my PC. For this I use Kaffeine that way:               ssh -X -p 666 -i /home/maciek/.ssh/id_rsa media@media env LANG=pl_PL.UTF-8 /usr/bin/kaffeine      As You can see, ssh works on port 666 and starts kaffeine on server but display results on my PC. Nice but the problem is audio redirection. Is any way to redirect audio together with video and keyboard/mouse?


title: Problem booting using Live USB on MAC

text: I have tried creating a bootable Linux USB that i want to use on _MacBook Pro 2013_.   1. I used 'MAC Linux USB Loader' to do that.   2. Linux distros I tried it with: Slack puppy and DSL (Damn small linux)   3. Flash Drive/USB: 512MB, 1024bytes FAT32 MBR formatted on windows, MAC doesn't do FAT32 for some reason. When I boot through MAC Alt/Option, it shows EIF drive, boots a bit and then I get this error:               Kernel path: /live/vmlinuz | ramdisc path: /live/initrd.lz      boot parameters:           Loading Linux kernel... done     unaligned pointer 0x2.      Aborted.      I get this same error when booting any of the above mentioned OS. I have tried literally _all_ other approaches of creating bootable Linux USB and none of them worked - Mac don't even show EIF drive on 'Alt' booting in these scenarios. I have tried many other tools listed here for MAC, but they don't detect my USB itself.


title: NetworkManager not storing passwords

text: Today I noticed that NetworkManager is not storing passwords for WPA2 networks. I enter the password on connecting, but when I go to the _Network Connections_ dialog the password field is blank and I get on the terminal:               ** (nm-connection-editor:23985): WARNING **: Invalid setting Wi-Fi Security: Invalid Wi-Fi security      Even as root this happens. In fact, network information is supposed to be in `/etc/NetworkManager/system-connections` but this directory is empty. For now I'm using wicd, even though it doesn't see much updating anymore. Any ideas? I'm running Fedora 18 and the NetworkManager-related packages I have are:               NetworkManager-vpnc-0.9.3.997-3.fc18.x86_64     NetworkManager-glib-0.9.8.1-3.git20130514.fc18.x86_64     NetworkManager-openvpn-0.9.3.997-3.fc18.x86_64     NetworkManager-0.9.8.1-3.git20130514.fc18.x86_64     NetworkManager-pptp-0.9.3.997-3.fc18.x86_64     NetworkManager-openconnect-0.9.7.0-1.git20120918.fc18.x86_64


title: How create a .conf file in a openvpn for run automatically on system startup?

text: I want run OpenVPN automatically on system startup. But How can I create a .conf file for my server after using scp in my client desktop? What do I have to put inside of this .conf file? In a HOWTO in openvpn nothing is written?


title: Make `locate` able to search files on external HDD

text: If I understand correctly, the database `locate` relies on is just for files on partitions of internal HDDs. I wonder if it is possible to use `locate` on external HDDs?


title: X randomly restarts

text: I am experiencing random logouts from KDE. While I am working, without doing something specific, LightDM's login screen appears and I have to login again. LightDM log shows:               [+265750.73s] DEBUG: Process 19254 terminated with signal 6      and `/var/log/syslog` shows around this time (+265750 == 23:43:27):               Jun  2 23:43:27 <HOSTNAME> acpid: client 19254[0:0] has disconnected     Jun  2 23:43:27 <HOSTNAME> acpid: client connected from 10644[0:0]     Jun  2 23:43:27 <HOSTNAME> acpid: 1 client rule loaded     Jun  2 23:43:27 <HOSTNAME> colord: Automatic remove of icc-da635535d334250298784eadb5080a5c from xrandr-GM2600-16843009     Jun  2 23:43:27 <HOSTNAME> colord: Profile removed: icc-da635535d334250298784eadb5080a5c     Jun  2 23:43:27 <HOSTNAME> colord: device removed: xrandr-GM2600-16843009      How can I pinpoint the problem?               KUbuntu 14.04 LTS,      Linux <hostname> 3.14.4-031404-generic #201405130853 SMP Tue May 13 12:54:33 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux


title: Find the PID of top CPU/MEM usage, save to a shell variable

text: Is there any way to get the PID of the top CPU/MEM usage, I need to use that in a script, top command doesn't seem to work for it.


title: modifying the zsh shell word split

text: I am using the word split style shell (select-word-style shell). I like it in general but would like to split at forward slashes also, so that when I go forward/backward a word, if the word doesn't contain any /s, it completely skips over the word but if it does contain one or more slashes, it stops at the first slash. Any ideas?


title: phpldapadmin with STARTTLS

text: I'm trying to configure OpenLDAP on Ubuntu using the the Ubuntu server guide. I have enabled Start TLS with a certificate generated using my own CA certificate (since it is for internal use). I enforced Start TLS on the database using `olcSecurity` (set to `tls=1`). LDAP clients in general have no problem connecting it the server once I set the `TLS_CACERT` to the path of my CA certificate in `/etc/ldap/ldap.conf`, except for phpLDAPadmin. I have enabled TLS in phpLDAPadmin confiuguration (`/etc/phpldapadmin/config.php`):               $servers->setValue('server','tls',true);      phpLDAPadmin throws a bunch of errors (culled from the post-login page, posted at the end). Does anyone know how to get phpLDAPadmin to play nice with Start TLS, or allow an exception to it? Errors:               Array     (         [class] => N/A         [function] => debug_dump         [file] => /usr/share/phpldapadmin/lib/functions.php         [line] => 700         [debug] => Array             (                 [Incoming MSG] => Array                     (                         [title] => Could not start TLS. (My LDAP Server)                         [body] => Error: Could not start TLS. Please check your LDAP server configuration.                         [type] => error                     )                      [existing] => Array                     (                         [0] => Array                             (                                 [title] => Could not start TLS. (My LDAP Server)                                 [body] => Error: Could not start TLS. Please check your LDAP server configuration.                                 [type] => error                             )                              [1] => Array                             (                                 [title] => Authenticate to server                                 [body] => Successfully logged into server.                                 [type] => info                             )                          )                  )     )          PHP Debug Backtrace     File    /usr/share/phpldapadmin/lib/functions.php (444)         Function    error (a:5:{i:0;s:22:"Redirect Loop Detected";i:1;s:4:"no...)     File    /usr/share/phpldapadmin/lib/functions.php (701)         Function    debug_dump_backtrace (a:2:{i:0;s:22:"Redirect Loop Detected";i:1;b:1;})     File    /usr/share/phpldapadmin/lib/ds_ldap.php (560)         Function    system_message (a:1:{i:0;a:3:{s:5:"title";s:37:"Could not start TL...)     File    /usr/share/phpldapadmin/lib/ds_ldap.php (186)         Function    startTLS (a:1:{i:0;i:0;})     File    /usr/share/phpldapadmin/lib/ds_ldap.php (354)         Function    connect (a:2:{i:0;s:4:"user";i:1;b:0;})     File    /usr/share/phpldapadmin/lib/ds_ldap.php (2104)         Function    query (a:2:{i:0;a:5:{s:4:"base";s:26:"dc=cse,dc=iitb,dc=a...)     File    /usr/share/phpldapadmin/lib/ds_ldap.php (2028)         Function    getDNAttrValues (a:3:{i:0;s:26:"dc=cse,dc=iitb,dc=ac,dc=in";i:1;N;i...)     File    /usr/share/phpldapadmin/lib/Tree.php (186)         Function    getDNAttrValue (a:2:{i:0;s:26:"dc=cse,dc=iitb,dc=ac,dc=in";i:1;s:1...)     File    /usr/share/phpldapadmin/lib/Tree.php (62)         Function    addEntry (a:1:{i:0;s:26:"dc=cse,dc=iitb,dc=ac,dc=in";})     File    /usr/share/phpldapadmin/lib/page.php (227)         Function    getInstance (a:1:{i:0;i:1;})     File    /usr/share/phpldapadmin/lib/page.php (418)         Function    tree (a:0:{})     File    /usr/share/phpldapadmin/htdocs/cmd.php (78)         Function    display (a:0:{})      This was originally posted on Ask Ubuntu, but didn't receive any answers, and I figure that this problem is not about Ubuntu _per se_ , so I am asking here.


title: Help inserting a new line of text after matching a line of text (sed)?

text: I need to insert a hidden HTML input tag into any form tag within a bunch of HTML files. I assume this is possible with sed, but need help forming the command. My idea is to search for any instance of               <form      and if found, insert a line below it that contains:               <input type="hidden" name="csrf_token" value="$csrf_token" />       What's the best way to tackle this? I'm close with               sed -e '/<form/a\<input type="hidden" name="csrf_token" value="$csrf_token"/>'


title: GRUB fails to install

text: For the past two days, I have been attempting to install Linux Mint 14 64-bit edition. Each time, the ubiquity installer has failed with this error:               Executing 'grub-install /dev/sda' failed.          This is a fatal error      At this point, a dialog box pops up asking me if I want to install the bootloader on a different drive or partition, continue without installing a bootloader or cancel the installation. I have three HDDs installed in my box-- one SSD disk with Windows 7 on it, and two for storage and this Linux installation--and I have tried to install the bootloader on each one with resulting in the same error. The rest of the installation is intact and I can see that the filesystem and structure is correctly installed. So, I googled a bit and turned up some people suggesting chroot into the installation and run grub-install from there. I did this and it returned an error message:               Path to `/boot/grub' is not readable by GRUB on boot. Installation is impossible. Aborting.      Help me solve this, please!


title: Kdevelop over SSHFS sometimes stutters last few lines on save?

text:
Sometimes, but not always, a certain file, when saved with Kdevelop over SSHFS to a remote server, will include the last n lines of the file repeated. N is variable from save to save. The file that gets committed is as if a user took a random selection from the bottom of the file, and pasted it again right afterwards. An example: This is what shows in the editor to the user (last 3 lines):

      This is what gets committed to the server on save:

- END Header -->
      It seems that if a given file, under given circumstances is a "stutter" file, it will almost always stutter that file when saved by that user from that client computer. But if a file is not a stutter file under given circumstances, it will not become one. For a given file on the same server, it may stutter save for one user but not for a different user. Does anyone know why this might be happening and how to prevent it.


title: Disable mouse scrolling in vim with tmux

text: I'm experiencing the same problem as in this Q&A titled: disabling mouse support in `vim` in a `gnome-terminal` environment, where it was found (in the comments for the top answer) the problem wasn't `vim`, it was the terminal emulator, specifically `gnome-terminal` in that case, as it worked fine in `xterm` for the OP. I use `tmux`, and am having the same problem. It works fine in `xterm`. So how do I make `vim` behave as expected in `tmux`?


title: Can't remove ImageMagick using yum remove

text: **I want to remove the ImageMagick,But I got this error**               [root@localhost ~]# cat /etc/redhat-release      CentOS release 6.4 (Final)          [root@localhost ~]# rpm -qa "ImageMagick*"     ImageMagick-devel-6.5.4.7-7.el6_5.x86_64     ImageMagick-6.5.4.7-7.el6_5.x86_64     ImageMagick-perl-6.5.4.7-7.el6_5.x86_64          [root@localhost ~]# yum --skip-broken remove ImageMagick     Loaded plugins: fastestmirror     Setting up Remove Process     Resolving Dependencies     --> Running transaction check     ---> Package ImageMagick.x86_64 0:6.5.4.7-7.el6_5 will be erased     --> Processing Dependency: libMagickCore.so.2()(64bit) for package: ImageMagick-perl-6.5.4.7-7.el6_5.x86_64     --> Processing Dependency: libMagickCore.so.2()(64bit) for package: ImageMagick-devel-6.5.4.7-7.el6_5.x86_64     --> Processing Dependency: libMagickWand.so.2()(64bit) for package: ImageMagick-perl-6.5.4.7-7.el6_5.x86_64     --> Processing Dependency: libMagickWand.so.2()(64bit) for package: ImageMagick-devel-6.5.4.7-7.el6_5.x86_64     --> Processing Dependency: ImageMagick = 6.5.4.7-7.el6_5 for package: ImageMagick-perl-6.5.4.7-7.el6_5.x86_64     --> Processing Dependency: ImageMagick = 6.5.4.7-7.el6_5 for package: ImageMagick-devel-6.5.4.7-7.el6_5.x86_64     --> Running transaction check     ---> Package ImageMagick-devel.x86_64 0:6.5.4.7-7.el6_5 will be erased     ---> Package ImageMagick-perl.x86_64 0:6.5.4.7-7.el6_5 will be erased     --> Finished Dependency Resolution     http://repos.fedorapeople.org/repos/peter/erlang/epel-6/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"     Trying other mirror.     Error: Cannot retrieve repository metadata (repomd.xml) for repository: epel-erlang. Please verify its path and try again      You could try running: rpm -Va --nofiles --nodigest


title: command: ls /etc | sort | grep d* is yielding no results but ls /etc | sort | grep p* lists entire directory

text: I am playing around with piping and grep tonight. I know that grep uses regex and that * means 0 or more occurrences of the preceding character. So the way I understand it is that if I do the following command, the entire directory should be listed... but nothing is listed. All that happens is the command line resets:               [root@LinuxAcademy etc]# ls /etc | sort | grep d*     [root@LinuxAcademy etc]#      However, if I do the command again and replace d with p, the entire directory is listed just as I would expect:               [root@LinuxAcademy ~]# ls /etc | sort | grep p*     ConsoleKit     DIR_COLORS     DIR_COLORS.256color     DIR_COLORS.lightbgcolor     NetworkManager     X11     ...........<<rest of listing not pasted in>>      Even though no error was given when i used the grep d*, I redirected stderr to a file just to check and nothing was printed. I then thought that grep may be interpreting the 'd' in 'grep d*' to be an option or command... but that doesn't seem to be the case either. Can anyone help me understand what is going on and why when i use the command with               grep d*      nothing is listed?


title: assign shortcut key to run a script

text: I've written a script to change the brightness of my screen. It's useful when I am working on text mode and shortcut keys of my keyboard to change brightness doesn't work. Is it possible to run this script, just by pressing some keys on the keyboard as shortcut, for example `Ctrl`+`Alt`+`F7`?


title: USB drive permissions when automounting

text: On Debian there is the common problem, that you try to plug an ntfs formatted USB harddrive and then can't write to it as a regular user to it because the directory belongs to root. A little time ago I read that that can be fixed with adding the `uid=1000,gid=1000` (or whatever your uid and gid are) options. This does solve the problem but seems a little bit nasty to me, because if you have a multiuser system the drive always belongs to the same user and not to the user who mounted it/is logged in. From my time with Ubuntu I remember that this wasn't a problem and you could mount NTFS drives (with GNOME) and they were writable by the user who mounted them. So it seems that GNOME is able to mount the drive with permissions given to the logged in user. However now I'm using KDE on Debian jessie and I'm wondering if I can configure my computer to mount the drives with the permissions of the user who has the active X-session.


title: Conditional dependencies for a Debian package

text: I am creating a package that needs to depend on a package if another is installed, but needs a different dependency if no such package is installed. Is that possible using just the `control` file of the `.deb`, or are other tools needed? This package is actually meant for Ubuntu, so any tools unavailable in Ubuntu repositories can't be used.


title: Holding left arrow triggers permanent Mode_switch

text: This is a weird one... I recently upgraded from Debian lenny to squeeze (following the upgrade instructions step by step). Everything went surprisingly well, except for one piece of strange new behavior I haven't encountered before. First, the left arrow key won't work at all (although right, up, and down do). Second, if I keep the left arrow key held down for a few seconds and then release it, I get trapped in Mode_switch mode. In other words, I have a `.Xmodmap` file with the following:               keycode 113 = Mode_switch     keycode 38 = a A aacute Aacute     keycode 26 = e E eacute Eacute     ...      After I've held down the left arrow key for a few seconds, every `a` or `e` character I type is accented, and the only way I can revert this is to log out and log back in to my Gnome session. I know something keyboard-related changed from lenny to squeeze, but I don't know how to troubleshoot something like this. Any ideas what's wrong?


title: Why use cpio for initramfs?

text: I am making my own initramfs following the Gentoo wiki. Instead of the familiar `tar` and `gzip`, the page is telling me to use `cpio` and `gzip`. Wikipedia says that `cpio` is used by the 2.6 kernel's initramfs, but does not explain why. Is this just a convention or is `cpio` better for initramfs? Can I still use `tar` and `gzip`?


title: How do I get rid of Cygwin's /cygdrive prefix in all paths?

text: I'm switching to Cygwin from the bash shell that ships with Git for Windows, and encountering a strange problem. Someone thought it would be a good idea to add `/cygdrive/` to all paths, while I think it's a horribly ugly idea. I've been able to determine that I can partially fix this by adding               mount --change-cygdrive-prefix /     export HOME=/c/Users/BZISAD0      in my .bashrc, but if I take a look at the PATH variable, everything still has /cygdrive/ in it. I suppose I could write a script to fix the PATH but that's even more kludgey than what I'm already doing. There's got to be a better way, and I'm pretty confident there is since Git's bash shell uses (AFAIK) an older version of Cygwin, and it's somehow configured to _not_ prepend `/cygdrive` everywhere. So, how can I turn the "Suck" knob to zero? ![Gary Larson comic](http://i.stack.imgur.com/ZwQKb.jpg)


title: yum - list configure flags/options used to compile package

text: How can I see a list of flags/options used to configure and compile a certain package in yum, without having to install it first? Say apache, for example.               $ yum list available httpd         Available Packages         httpd.x86_64           2.2.15-15.el6.centos.1          base      I'm running CentOS 6.3. **UPDATE** I followed @jsbillings answer, but first I had to add the CentOS Source repository, as it doesn't seem to be included by default. Added the following to **/etc/yum.repos.d/CentOS-Base.repo**               [base-source]     name=CentOS-$releasever - Base - Source     baseurl=http://vault.centos.org/6.3/os/Source


title: Is it possible for a CentOS system on EC2 to not have a bootloader?

text: I'm attempting to look for grub:               [root /]# find / -iname "*grub*"     /sbin/grubby     /usr/share/man/man8/grubby.8.gz     /usr/share/vim/vim70/syntax/grub.vim     /usr/share/vim/vim70/ftplugin/grub.vim     /usr/lib/pm-utils/sleep.d/01grub      Now I'm attempting to look for lilo:               [root /]# find / -iname "*lilo*"     /usr/share/doc/syslinux-3.11/keytab-lilo.doc     /usr/share/vim/vim70/syntax/lilo.vim     /usr/lib/syslinux/keytab-lilo.pl      I thought perhaps it was somehow being hidden with SELinux so I tried to turn that off (temporarily):               [root@ /]# setenforce 0     setenforce: SELinux is disabled      Hmm, look like it was already off. What about turning that on?               [root@ /]# setenforce 1     setenforce: SELinux is disabled      Ok, now I have no clue why I can't find any bootloader files. I re-run the `find` commands and get the same thing. Next I had read the bootloader section in the Linux Administration Handbook and it didn't mention not being able to find bootloader configuration files. This is an box on Amazon EC2: `CentOS release 5.4 final selinux` Is this normal to not have these files? I also don't seem to have any `/etc/sysconfig/selinux` or `/etc/selinux/config` files.... Hmmm.... ### Update - Why am I asking? This article (among others) mentions using boot flags to enable or disable selinux in the grub.conf file. Without a boot loader how do you specify boot flags?


title: Do I need ephemeral storage?

text: I was running a `small` instance on Amazon EC2. I'm trying to migrate it to a `micro` as it requires very minimal processing power. One thing I just learned though, is that micro instances do not come with `ephemeral storage` like the other instance sizes. Here is the `fstab` file from the small instance. I just added the `nobootwait` for the `/dev/sda3` line.               /dev/sda1  /         ext3    defaults                0 0     /dev/sdb   /mnt      ext3    defaults                0 0     /dev/sda3  swap      swap    defaults,nobootwait     0 0     none       /dev/pts  devpts  gid=5,mode=620          0 0     none       /dev/shm  tmpfs   defaults                0 0     none       /proc     proc    defaults                0 0     none       /sys      sysfs   defaults                0 0     /dev/sdf   /apps/    ext3    defaults,acl            1 1     /dev/sdg   /data/    ext3    defaults                1 1      Now when I launch this instance as a `micro` I get a warning:               Mounting local filesystems:  mount: special device /dev/sdb does not exist [FAILED]      It still boots up fine and things seem to be working great, but is there anything I'm missing that I would need the `ephemeral storage` for that I'm not seeing or thinking about?


title: GNU Screen: how to start a bash process and execute a command within it?

text: I'm trying to set up a screenrc file that opens a few windows, and in one of them I'd like to start a shell and start vim within it (rather than starting vim directly). I've tried things along the lines of               screen -t vim -ln 1 bash -c "vim"      but that seems to open vim directly (if I quit vim, the window is killed, whereas I'd like to simply return to the shell in that window). How can I set this up correctly?


title: Why does directory vanish when I do SSHFS? How to setup SSHFS share on Max OSX 10.9?

text: I'm running Max OSX 10.9.3 and I'm trying to setup an SSHFS file-share between my MacBook Pro and a remote file system. However, when I try to do it, it doesn't work. Strangely enough, it makes the target directory disappear. Has anyone else seen this happen? Is it a bug? First see that I can ssh normally into the target machine:               % ssh remoteuser@XXX.XXX.XXX.XXX            # <--- SSH to remote system works! See below.     remoteuser@XXX.XXX.XXX.XXX % ls -altr remoteDir     total 8     drwxr-xr-x 26 remoteuser remoteuser 4096 Jun 22 01:00 ..     drwxrwxrwx  2 remoteuser remoteuser 4096 Jun 22 01:08 .     remoteuser@XXX.XXX.XXX.XXX % exit     %                                           # <--- Logged out of remote system      Next, I create a directory locally and verify it was created:               % pwd     /mnt          % ls     total 0     drwxr-xr-x  31 root  admin  1122 Jun 18 18:34 ../     drwxr-xr-x   2 root  admin    68 Jun 23 08:11 ./          % sudo mkdir share1      % ls     drwxr-xr-x  31 root  admin  1122 Jun 18 18:34 ../     drwxr-xr-x   4 root  admin   136 Jun 23 08:50 ./     drwxr-xr-x   2 root  admin    68 Jun 23 08:50 share/      Now I try to setup the SSHFS share:               % sudo sshfs remoteuser@XXX.XXX.XXX.XXX:remoteDir /mnt/share1     remoteuser@XXX.XXX.XXX.XXX's password:     %      Ok. It seems to have worked. No errors. So let's see the share we created, shall we?               % ls     ls: share1: No such file or directory     total 0     drwxr-xr-x  31 root  admin  1122 Jun 18 18:34 ../     drwxr-xr-x   3 root  admin   102 Jun 23 08:12 ./      What? Not only is the File Sharing not working, but the share1 directory seems to have vanished! (Although the file system seems to know it is missing, which is weird). Where did /mnt/share1 go and how do I setup this SSHFS?


title: x11 connection established but magic-cookie value different?

text: From my local machine I `ssh` to a remote server along with authentication regarding X display. I know that in this process, `MIT-MAGIC-COOKIES` are used and the value in both server and client needs to be identical in order for the authentication process to be valid. However, when I login to a remote server and have confirmed that X display stuff are working well (e.g. executing `xclock` to see if the `xclock` application is popped up in my local machine), when I check the value of the cookies, the value in local machine and that in the remote server seems to be different. Here's the command lines: ### cookie value in remote server               chulhyun@chulhyun-Inspiron-3420:~$ ssh -X Black@$labcom     Last login: Wed Jun 25 10:02:25 2014 from           Black@Black-PC ~     $ xclock    ### xclock appears in local machine.          Black@Black-PC ~     $ xauth list     Black-PC/unix:10  MIT-MAGIC-COOKIE-1  708f623489b1ea129a77e98287d130ca      ### cookie value in local machine               chulhyun@chulhyun-Inspiron-3420:~$ xauth list     chulhyun-Inspiron-3420/unix:0  MIT-MAGIC-COOKIE-1  5ddd2ce92004eab53ceee8a64b7b88c0      As you can see the cookie value in two machines are different. Then shouldn't the X display not work? What am I missing here? P.S. I heard that `$XAUTHORITY` contains the path to the `xauthority` file and I've checked that path in local machine:               chulhyun@chulhyun-Inspiron-3420:~$ echo $XAUTHORITY     /var/run/gdm/auth-for-chulhyun-iZfH2u/database      When I take a look into the "database" file, the contents are unreadable because the contents are composed of weird characters.               ^A^@^@^Vchulhyun-Inspiron-3420^@^A0^@^RMIT-MAGIC-COOKIE-1^@^P]?,? ^D??<???      K{??      could this be related to the question? * * * # update **result of`xhost` and `$XAUTHORITY` in remote server**               Black@Black-PC ~     $ xhost     access control enabled, only authorized clients can connect     SI:localuser:chulhyun          Black@Black-PC ~     $ echo $XAUTHORITY      *as it turns out `$XAUTHORITY` is not defined... is this normal? **result of`xhost` in local machine**               chulhyun@chulhyun-Inspiron-3420:~$ xhost     access control enabled, only authorized clients can connect     SI:localuser:chulhyun


title: Reverse grep to get the last couple of occurrences in a file

text: Say I want to grab the last 5 mentions of cron in `/var/log/syslog.log` looking over the grep manual it seems like I can't get grep to search in reverse. I can however grab the most recent occurrences.               grep cron -m 5 /var/log/syslog      Is there a reverse grep command I can use? :)


title: Capture screen content for error parsing

text: I am a database administrator working with DB2 on AIX. (Please continue to read as this is related more to ksh than DB2, otherwise I would have posted this over on dba.stackexchange.com.) I am attempting to write up ksh scripts for several of our database deployment as well as database maintenance scripts. I am in the process of putting error handling in our scripts to know whether or not something requires a hard fail or just a warning message, or can be ignored. With most AIX/ksh related tasks I can check `$? = 0`, but not so with DB2. Unless the database engine fails, I will never get anything but a zero. DB2 will, however, pass back to the console its error/warning/info codes. Since I know I can get at those codes via the console, I have been trying to capture whatever is on the console for specific command to DB2. Once I have that, I have been sending that output to a function where I use `egrep` and regular expressions to determine if I need to fail (`exit 1`), or succeed (`exit 0`) within my script. I also tend to pipe all output from my script to `tee`, since several of my scripts are long and/or call into multiple other scripts. This way I have a record of the entire "job" that ran both for reference, as well as for troubleshooting my scripts. Recently, I learned I can `ksh blah.sh 2 > &1 | tee mylog` in order to make sure I capture syntax errors with my script. I am wondering, what is the best way to handling this kind of error parsing in ksh? I have tried to feed a command to DB2 with the -v option (which is supposed to play the command back to the screen as well as the results of the command) and put that in a variable, but then I actually don't get the command outputted to the screen. Example:               RESULT=$(db2 -v drop table blah)      I end up having to `cat ${RESULT}` in order to get my screen print for my above pipe to tee and then I still have to pass `RESULT` to my parsing function. Another thing I have tried is piping the result of my command to a file as well. Example:               db2 -v drop table blah | tee myResult      This will output to the screen for my high level tee, but now I have an extra file on the file system I have to worry about cleaning up afterwards (though I can `egrep` and `cat` it with no issues). And if my job ever crashes piping to `tee` in script and is itself being piped to `tee` results in some funky behavior (works fine if it succeeds without crashing). This leads me to believe that the double pipe to `tee` is not the best option. Someone has mentioned to me the `script` command, but I'm not sure if that will help or not? Any ideas or thoughts? I am assuming I'm not the only one looking to use "screen capture" of specific commands for error parsing while still piping everything to `tee` for an entire job run. Also I tend to invoke sub shells with my sub scripts instead of calling them as if in the same shell (ie, `ksh blah.sh` vs `. ./blah.sh`). It has seemed to work the best for my scripts. Not sure if that impacts any answers or not. Any direction based on experience would be appreciated.


title: Dots in path name

text: I am receiving an error from an application I am running. The error looks like this:               john@john-replacement:~/Desktop/yarbu-1.4.8/bin$ sudo yarbu-engine --VERBOSE     /usr/local/bin/yarbu-engine: line 996: cd: /usr/local/bin/../../etc/yarbu/conf/default: No such file or directory      What do the dots mean in `/usr/local/bin/../../etc/` ?


title: Suppress server message in rsync

text: When I `rsync` or `scp` from a particular server I get a rather long message telling me the rules of the server. However when I setup regular pulls, I'd like to be able to suppress those messages in my logs. Looking through the man page suggest that `-q` should work, but that only quiets messages from scp itself. How can I do this?


title: How can I create a function in zsh that calls an existing command with the same name?

text: How can I write a function in zsh that invokes an existing command with the same name as the function itself? For example, I've tried this to illustrate my question:               function ls      {         ls -l $1 $2 $3     }      But I see this when I execute it with `ls *`:               ls:1: maximum nested function level reached      I assume this is because the function is being called recursively. How I can avoid this? (this is a crude example, and in this case an alias would do the job, but I have a more complex example where an alias isn't suitable and so I need to write a function).


title: OpenWRT configuration when router is in bridged mode

text: I am planning on putting my Zyxel ADSL modem in bridged mode and use an OpenWRT router instead as the exit point from my local network. So, what protocol must have the **Wan** interface if the router is bridged mode? I have 3 options:   * Static   * DHCP Client   * Unmanaged  Since my ADSL has a dynamic IP, static surely isn't an option, so I guess DHCP should do it, but I am not 100% sure.


title: CPU Frequency changing every second

text: I just installed conky and recognized that my CPU-Frequency changes every second in steps of 10 to 100MHz and between 1000MHz - 2000MHz. Just wondered if this is normal behavior?


title: Replace string with another string in vi editor

text: I have a `template.php` file where I want to change every occurence of `apple` with `grape` throughout the file. At the moment,I am having to painstakingly edit the entire file to find where to change. Sometimes the name is like this in the file, `apple_button` and sometimes it is just `apple`. I am using `vi` to edit.


title: What is the relationship between root and kernel?

text: Based on part of the first answer of this questions: > read from a file (the kernel must check that the permissions allow you to > read from said file, and then the kernel carries out the actual instructions > to the disk to read the file) It requires to have root privilege to change permission to a file. With root privilege, user can access any files without worrying about permission. So, are the any relationships between root and kernel?


title: Cannot connect to X server :0.0 as superuser

text: When I am online, I get following error and the tool does not start:               [root@dhcppc9 lin64]# ./ise     No protocol specified     _pn: cannot connect to X server :0.0      But everything is OK when I am not a superuser. Why that? **Edit**               [root@dhcppc9 lin64]# export $(dbus-launch)     No protocol specified      any suggestion? **Also**               [root@dhcppc9 lin64]# xhost [+]     No protocol specified     xhost:  unable to open display ":0.0"


title: How to parse JSON with shell scripting in Linux?

text: I have a JSON output from which I need to extract a few parameters in Linux. This is the JSON output:               {             "OwnerId": "121456789127",             "ReservationId": "r-48465168",             "Groups": [],             "Instances": [                 {                     "Monitoring": {                         "State": "disabled"                     },                     "PublicDnsName": null,                     "RootDeviceType": "ebs",                     "State": {                         "Code": 16,                         "Name": "running"                     },                     "EbsOptimized": false,                     "LaunchTime": "2014-03-19T09:16:56.000Z",                     "PrivateIpAddress": "10.250.171.248",                     "ProductCodes": [                         {                             "ProductCodeId": "aacglxeowvn5hy8sznltowyqe",                             "ProductCodeType": "marketplace"                         }                     ],                     "VpcId": "vpc-86bab0e4",                     "StateTransitionReason": null,                     "InstanceId": "i-1234576",                     "ImageId": "ami-b7f6c5de",                     "PrivateDnsName": "ip-10-120-134-248.ec2.internal",                     "KeyName": "Test_Virginia",                     "SecurityGroups": [                         {                             "GroupName": "Test",                             "GroupId": "sg-12345b"                         }                     ],                     "ClientToken": "VYeFw1395220615808",                     "SubnetId": "subnet-12345314",                     "InstanceType": "t1.micro",                     "NetworkInterfaces": [                         {                             "Status": "in-use",                             "SourceDestCheck": true,                             "VpcId": "vpc-123456e4",                             "Description": "Primary network interface",                             "NetworkInterfaceId": "eni-3619f31d",                             "PrivateIpAddresses": [                                 {                                     "Primary": true,                                     "PrivateIpAddress": "10.120.134.248"                                 }                             ],                             "Attachment": {                                 "Status": "attached",                                 "DeviceIndex": 0,                                 "DeleteOnTermination": true,                                 "AttachmentId": "eni-attach-9210dee8",                                 "AttachTime": "2014-03-19T09:16:56.000Z"                             },                             "Groups": [                                 {                                     "GroupName": "Test",                                     "GroupId": "sg-123456cb"                                 }                             ],                             "SubnetId": "subnet-31236514",                             "OwnerId": "109030037527",                             "PrivateIpAddress": "10.120.134.248"                         }                     ],                     "SourceDestCheck": true,                     "Placement": {                         "Tenancy": "default",                         "GroupName": null,                         "AvailabilityZone": "us-east-1c"                     },                     "Hypervisor": "xen",                     "BlockDeviceMappings": [                         {                             "DeviceName": "/dev/sda",                             "Ebs": {                                 "Status": "attached",                                 "DeleteOnTermination": false,                                 "VolumeId": "vol-37ff097b",                                 "AttachTime": "2014-03-19T09:17:00.000Z"                             }                         }                     ],                     "Architecture": "x86_64",                     "KernelId": "aki-88aa75e1",                     "RootDeviceName": "/dev/sda1",                     "VirtualizationType": "paravirtual",                     "Tags": [                         {                             "Value": "Server for testing RDS feature in us-east-1c AZ",                             "Key": "Description"                         },                         {                             "Value": "RDS_Machine (us-east-1c)",                             "Key": "Name"                         },                         {                             "Value": "1234",                             "Key": "cost.centre",                           },                         {                             "Value": "Jyoti Bhanot",                             "Key": "Owner",                           }                     ],                     "AmiLaunchIndex": 0                 }             ]         }      I want to write a file that contains heading like instance id, tag like name, cost center, owner. and below that certain values from the JSON output. The output here given is just an example. How can I do that using `sed` and `awk`? **Expected output :**                Instance id         Name                           cost centre             Owner         i-1234576          RDS_Machine (us-east-1c)        1234                   Jyoti


title: How to setup GParted video mode in Oracle Virtualbox?

text: I'm trying to boot GParted live 0.14.1-6 within Oracle Virtualbox 4.2.6 r82870 (Extension Pack installed). The host OS is Windows 7, the physical graphic card is an AMD Radeon HD 6900. The physical CPU is an AMD Phenom II X6 1100T. I created a VM in order to test the latest ArchLinux release in Virtualbox with the following settings:   * 1024 MB RAM   * 8 GB Disk (VDI)   * EFI enabled   * Video Memory: 128 MB   * Monitor count: 1 I chose my GParted iso (gparted-live-0.14.1-6-amd64.iso) with the "Add virtual CD/DVD disk file" feature (attached to the virtual IDE controller). Gparted live CD/iso boot correctly, I select the default option "GParted live default settings" in the GRUB menu (GRUB 1.99-23.1), set the keyboard layout and preferred language. When it comes to the video mode choice, I tried all the following options:   1. Continue to start X to use GParted automatically   2. Run 'Force video' to config X manually: I tried this option with 1024x768 & 800x600 resolution, either with default vesa driver and ATI (24 bit color depth). All those choices lead to the same error, GParted gets stuck at this point:               Fatal server error:     no screens found          server terminated with error (1).     xinit: giving up     xinit: unable to connect to X server: Connection refused     xinit: server error     ...


title: Redirect hard return to other terminal

text: > **Possible Duplicate:**   >  Construct a command by putting a string into a tty Suppose I've run a command in a terminal ( `/dev/pts/1` ) and it starts to ask me for input ( "press y to confirm" ) and I want to write 'y --hard return --' 50 times to that terminal from another. How could I do this?


title: compat-drivers-3.9 crash video card driver

text: I try to install wireless driver on my linux with compat-drivers-3.9. After installing compat-drivers-3.9 linux , the video driver seems to be crashed. The resolution is not correct. How can I restore the previous video driver. My environment: Mint Linux Intel i5 CPU, Intel Integrated Graphics


title: grep how to suppress display of non-matched file?

text: I am trying to find files containing a specific word using `grep`. There are many files in the directory (> 500) ### Command I run               $ grep 'delete' *      ### Output               validate_data_stage1:0     validate_data_stage2:0     validate_data_stage3:0     validate_data_stage4:0     validate_data_stage5:0     validate_input_stage1:0     validate_input_stage2:0     validate_input_stage3:0     validate_input_stage4:0     .... and hundred of such lines      These are the files that don't contain the given match. I want to suppress those lines from displaying to stdout. I know of `-q` switch, but that would suppress the complete output, which I don't want. How do I do that?


title: Emacs Key-binding and the TERM variable

text: I changed the value of `TERM` to `screen-256color` from `xterm` and it effects the key-bindings in Emacs. Mainly the bindings that use the arrow keys now inserts `A`,`B`,`C`,`D` instead of running `backward-word` and `forward-word` ect. How should I set up 256 colors without affecting the key-bindings.


title: Linux: What is a tainted kernel?

text: Under certain conditions, the Linux kernel may become _tainted_. For example, loading a proprietary video driver into the kernel taints the kernel. This condition may be visible in system logs, kernel error messages (oops and panics), and through tools such as `lsmod`, and remains until the system is rebooted. What does this mean? Does it affect my ability to use the system, and how might it affect my support options?


title: Is it possible to source again .bashrc and .zshrc AND remove functions once inside them without restarting?

text: I had a function inside `.zshrc` that I removed. Now, when I try to source it, it indeed sources it, but doesn't remove the function that once was inside `.zshrc` from memory. Is there a way to remove the function (now I believe in memory, in zsh namespace or something like that) without restarting my machine?


title: Booting from a hard disk partition .. update-grub?

text: I am trying to install Debian by using a hard disk partition only. I want to install on `/dev/sda6` I used `dd` to copy a Debian ISO image to `/dev/sda5`, a newly formatted `ext4` partition. I ran `update-grub` hoping for it to find a kernel image on `/dev/sda5` but it did not. Is there any way that I can make `/dev/sda5` a boot option?


title: tomcat: symbolic link in a loop

text: linux-trra:/usr/local> $CATALINA_HOME     bash: /home/anisha/openGTS17Nov/apache-tomcat-7.0.32/: is a directory          linux-trra:/usr/local # ln -s $CATALINA_HOME tomcat          linux-trra:/usr/local # file tomcat      tomcat: symbolic link in a loop          linux-trra:/usr/local> ls     apr  bin  games  gts  include  jdk  lib  lib64  man  OpenGTS_2.4.5  sbin   share  src  tomcat      Why is that **tomcat** considered a symbolic link in this particular case, and what's the way to solve the issue?               anisha@linux-trra:~/openGTS17Nov/apache-tomcat-7.0.32> ls     bin  conf  lib  LICENSE  logs  NOTICE  RELEASE-NOTES  RUNNING.txt  temp  webapps  work          anisha@linux-trra:~/openGTS17Nov/apache-tomcat-7.0.32> file *     bin:           directory     conf:          directory     lib:           directory     LICENSE:       ASCII English text, with CRLF line terminators     logs:          directory     NOTICE:        ASCII English text, with CRLF line terminators     RELEASE-NOTES: ASCII English text, with CRLF line terminators     RUNNING.txt:   ASCII English text, with CRLF line terminators     temp:          directory     webapps:       directory     work:          directory     anisha@linux-trra:~/openGTS17Nov/apache-tomcat-7.0.32>


title: Grub rescue if Ubuntu USB not plugged in?

text: I have my Ubuntu installed on a USB drive, and to log into Windows I need to have it plugged while booting, or I get the Grub rescue prompt. When the USB drive is plugged in, I get the Grub menu from which I can choose Windows. Ubuntu 13.04 on the USB, Windows Vista on `:C`


title: Java/malloc memory corruption error when running SDK Android Manager

text: I want to install Android SDK, so I manually installed Java JDK 7u51, downloaded SDK ADT bundle for Linux x64, and tried to run it. When I run android, the SDK manager windows hangs halfway through the initial downloading process every time. Opening it with the terminal gives me > Error in `java': malloc(): memory corruption: 0x00007ffcd06de5b0 before it hangs. Any idea how to solve this? I am on Linux Mint x64 KDE.   What I did was:   1. Download Java SE JDK 7u51 (tar.gz format) from their site.    2. Extract content to `/usr/lib/jvm/`   3. Run `sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.7.0_51/jre/bin/java 1`   4. `cd /usr/bin`   5. `sudo ln -s /usr/lib/jvm/jdk1.6.0_XX/bin/javac`   6. `sudo ln -s /usr/lib/jvm/jdk1.6.0_XX/bin/jar`   7. `sudo ln -s /usr/lib/jvm/jdk1.6.0_XX/bin/javadoc`   8. Download SDK ADT bundle for Linux x64   9. Extract it under `/home/username/Android`   10. Run android in tools folder. _EDIT_   developer.android.com said I should run eclipse to setup the ADT bundle. When I did that in terminal, I got a different error: > Error in `/usr/bin/java': double free or corruption (!prev): > 0x00007fbb08816b30 There is sth wrong with my Java then? _EDIT2_   I've reinstalled linux, and ONLY ran sudo apt-get update && sudo apt-get dist- upgrade. Didn't install a new Java. It's using OpenJDK Java1.0.7_51 now, and when I run "android" it still give me the same error! > Error in `java': malloc(): memory corruption: 0x00007fd0d4797150 Although the code is slightly different. What gives?


title: Bash Script to Sort Files into Alphabetical Folders on ReadyNAS Duo v1

text: I have an old ReadyNAS Duo v1 (Sparc) running an unknown flavour of Linux. I have a folder structure with 1,000+ files I want to move into a folder structure based on the first letter of the file name (case insensitive). Ideally I'd like the file structure to look like this:               myfiles-+             +-A               + Apple.txt               + avocado.txt             +-B               + Banana.txt               + broccoli.txt     etc. etc.      I've had a Google but have only found GUI tools. Can this be done via the command line or a script?


title: What Linux distribution(s) contribute the most development to the GNOME project?

text: If I plan to contribute to the GNOME project, am I advised to use **THAT** distribution as my primary development platform or does my choice remain a simple matter of taste? **EDIT** : I'm a Linux user and my question concerns only Linux distributions.


title: How to build all of Debian

text: Let's assume:   * I have a mirror of the source repository locally.   * I only want to build for the architecture I'm running, which is i386 in my case.   * I'm not interested in customisation. In fact, I want the resulting binary packages to be as close to official ones as possible. From there on, I'll take care of how they are organised. I think I'll use reprepro.   * I want it to be as easy as possible.


I've installed Linux Mint and Manjaro Linux on my computer. I installed only the Linux mint on the MBR. For Manjaro, I created a `/boot/efi` partition, but I have not checked to install to MBR. So, I am controlling `grub` from mint. Now, when I try to boot Manjaro, it shows :               ERROR: resume: no device specified for hibernation: performing fsck on     dev/sda11  /dev/sda11: clean 1727/915712 files, .... blocks          WARNING: The root device is not configured to be mounted read-write!It     may be fsck'd again later          :mounting /dev/sda11 on real boot running cleanup hook [udev]          ERROR: Root device mounted successfully, but /sbin/init does not exist.          sh:can't access tty; job control turned off          [rootfs /]#      After the shell prompt, I can't write anything. It hangs, or sometimes it shows me messages continuously like :               usb 3-3: device not accepting address 2, error -62      and so on... I tried to add `init=/usr/lib/systemd/systemd` to grub, as I saw in google, but still the same. I must note that for the Manjaro installation I am using a separate partition for `/` and for `/usr` and for `/var`. This maybe have an influence? As I saw here . But the problem is that I can't write anything, it hangs. I also found a comment on a blog post here that states: > “If you keep /usr as a separate partition, you must adhere to the following > requirements: “ - Add the shutdown hook. The shutdown process will pivot to > a saved copy of the initramfs and allow for /usr (and root) to be properly > unmounted from the VFS. > > “ - Add the fsck hook, mark /usr with a passno of 0 in /etc/fstab. While > recommended for everyone, it is mandatory if you want your /usr partition to > be fsck’ed at boot-up. Without this hook, /usr will never be fsck’d. > > “ - Add the usr hook. This will mount the /usr partition after root is > mounted. Prior to 0.9.0, mounting of /usr would be automatic if it was found > in the real root’s /etc/fstab.” > > And never forget to run mkinitcpio -p linux every time after you make > changes to mkinitcpio.conf to actually create the new images and get them > the right place. That sounds promising since my `/usr` is indeed on a separate partition. What are these "hooks" and how do I add them? `parted -l`:               Model: ATA TOSHIBA MQ01ABD0 (scsi)     Disk /dev/sda: 750GB     Sector size (logical/physical): 512B/512B     Partition Table: gpt          Number  Start   End     Size    File system     Name                  Flags      1      1049kB  1075MB  1074MB  ntfs            Basic data partition  hidden, diag      2      1075MB  1347MB  273MB   fat32           Basic data partition  boot      3      1347MB  1482MB  134MB   ntfs            Basic data partition  msftres      4      1482MB  80,1GB  78,6GB  ntfs            Basic data partition  msftdata      5      80,1GB  80,4GB  262MB   ext4      6      80,4GB  90,4GB  10,0GB  ext4                                  msftdata      7      93,0GB  102GB   9000MB  ext4                                  msftdata      9      102GB   106GB   3999MB  linux-swap(v1)     10      106GB   106GB   250MB   fat32                                 boot     11      106GB   121GB   15,0GB  ext4                                  msftdata     12      121GB   151GB   30,0GB  ext4                                  msftdata     13      151GB   165GB   14,0GB  ext4                                  msftdata     14      165GB   206GB   40,9GB  ext4                                  msftdata      8      206GB   743GB   537GB   ext4                                  msftdata     15      743GB   747GB   4000MB  linux-swap(v1)                        msftdata      `grub`:               menuentry 'Linux Mint 17 Cinnamon 64-bit, 3.13.0-24-generic (/dev/sda5)' --class ubuntu --class gnu-linux --class gnu --class os {         recordfail         gfxmode $linux_gfx_mode         insmod gzio         insmod part_gpt         insmod ext2         set root='hd0,gpt5'         if [ x$feature_platform_search_hint = xy ]; then           search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt5 --hint-efi=hd0,gpt5 --hint-baremetal=ahci0,gpt5  19af2e09-8946-4ca2-9655-75921f3609a5         else           search --no-floppy --fs-uuid --set=root 19af2e09-8946-4ca2-9655-75921f3609a5         fi         linux   /vmlinuz-3.13.0-24-generic root=UUID=9356f543-f391-4ba5-9dcc-e8484d6935e0 ro   quiet splash $vt_handoff         initrd  /initrd.img-3.13.0-24-generic     }     menuentry 'Linux Mint 17 Cinnamon 64-bit, 3.13.0-24-generic (/dev/sda5) -- recovery mode' --class ubuntu --class gnu-linux --class gnu --class os {         recordfail         insmod gzio         insmod part_gpt         insmod ext2         set root='hd0,gpt5'         if [ x$feature_platform_search_hint = xy ]; then           search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt5 --hint-efi=hd0,gpt5 --hint-baremetal=ahci0,gpt5  19af2e09-8946-4ca2-9655-75921f3609a5         else           search --no-floppy --fs-uuid --set=root 19af2e09-8946-4ca2-9655-75921f3609a5         fi         echo    'Loading Linux 3.13.0-24-generic ...'         linux   /vmlinuz-3.13.0-24-generic root=UUID=9356f543-f391-4ba5-9dcc-e8484d6935e0 ro recovery nomodeset          echo    'Loading initial ramdisk ...'         initrd  /initrd.img-3.13.0-24-generic     }               menuentry 'Manjaro Linux (0.8.10) (on /dev/sda11)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-simple-95ed019d-9269-4869-9f99-a03f002a53c6' {         insmod part_gpt         insmod ext2         set root='hd0,gpt11'         if [ x$feature_platform_search_hint = xy ]; then           search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt11 --hint-efi=hd0,gpt11 --hint-baremetal=ahci0,gpt11  95ed019d-9269-4869-9f99-a03f002a53c6         else           search --no-floppy --fs-uuid --set=root 95ed019d-9269-4869-9f99-a03f002a53c6         fi         linux /boot/vmlinuz-312-x86_64 root=/dev/sda11         initrd /boot/initramfs-312-x86_64.img     }     submenu 'Advanced options for Manjaro Linux (0.8.10) (on /dev/sda11)' $menuentry_id_option 'osprober-gnulinux-advanced-95ed019d-9269-4869-9f99-a03f002a53c6' {         menuentry 'Manjaro Linux (0.8.10) (on /dev/sda11)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-312-x86_64--95ed019d-9269-4869-9f99-a03f002a53c6' {             insmod part_gpt             insmod ext2             set root='hd0,gpt11'             if [ x$feature_platform_search_hint = xy ]; then               search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt11 --hint-efi=hd0,gpt11 --hint-baremetal=ahci0,gpt11  95ed019d-9269-4869-9f99-a03f002a53c6             else               search --no-floppy --fs-uuid --set=root 95ed019d-9269-4869-9f99-a03f002a53c6             fi             linux /boot/vmlinuz-312-x86_64 root=/dev/sda11             initrd /boot/initramfs-312-x86_64.img         }     }


title: How to connect to OpenVPN with NetworkManager

text: I have installed an OpenVPN server on my OpenWrt 10.03 router [freshly flashed]: https://pastebin.com/raw.php?i=hRECWuf1               echo "nameserver 8.8.8.8" > /etc/resolv.conf; opkg update; opkg install luci-app-openvpn openvpn openssl-util openssh-sftp-server ntpd     vim /etc/ssl/openssl.cnf # modify a few lines     [ CA_default ]     dir             = /etc/openvpn     new_certs_dir   = $dir/certs     certificate = $dir/ca.crt     private_key = $dir/ca.key          touch /etc/openvpn/index.txt; touch /etc/openvpn/serial; echo 01 > /etc/openvpn/serial     openssl req -nodes -new -x509 -keyout /etc/openvpn/ca.key -out /etc/openvpn/ca.crt -days 3650 # give a common name, like: vpnserver     openvpn --genkey --secret /etc/openvpn/ta.key     openssl req -nodes -new -keyout /etc/openvpn/server.key -out /etc/openvpn/server.csr # give a common name, like: vpnserver     mkdir -p /etc/openvpn/certs; mkdir -p /etc/openvpn/private     openssl ca -out /etc/openvpn/server.crt -in /etc/openvpn/server.csr     time openssl dhparam -out /etc/openvpn/dh1024.pem 1024 # it could take 10 minutes!          # generate certs for clients [X = client number]     openssl req -nodes -new -keyout /etc/openvpn/clientX.key -out /etc/openvpn/clientX.csr # give a common name! it will be the user name     openssl ca -out /etc/openvpn/clientX.crt -in /etc/openvpn/clientX.csr     # e.g.:      openssl req -nodes -new -keyout /etc/openvpn/client1.key -out /etc/openvpn/client1.csr # give a common name! it will be the user name     openssl ca -out /etc/openvpn/client1.crt -in /etc/openvpn/client1.csr          vim /etc/config/openvpn     config 'openvpn' 'openvpn_server'             option 'enable' '1'             option 'port' '1194'             option 'proto' 'udp'             option 'dev' 'tap'             option 'ca' '/etc/openvpn/ca.crt'             option 'cert' '/etc/openvpn/server.crt'             option 'key' '/etc/openvpn/server.key'             option 'tls_auth' '/etc/openvpn/ta.key 0' # server: 0             option 'dh' '/etc/openvpn/dh1024.pem'             option 'comp_lzo' '1'             option 'server' '10.20.30.0 255.255.255.0'             option 'keepalive' '10 120'             option 'persist_key' '1'             option 'persist_tun' '1'             option 'mute' '20'             option 'verb' '3'             option 'client_to_client' '1'             list 'push' 'dhcp-option DNS 10.20.30.1'     /etc/init.d/openvpn enable     /etc/init.d/openvpn start     ifconfig -a | less     ping 10.20.30.1          # here comes the firewall part     vim /etc/config/firewall # modify it     config 'include'             option 'path' '/etc/firewall.user'          config 'redirect'             option 'src' 'wan'             option 'proto' 'udp'             option 'src_dport' '1194'             option 'dest_port' '1194'             option '_name' 'OpenVPN'          vim /etc/firewall.user # modify it     iptables -t nat -A prerouting_rule -i $WAN -p udp --dport 11194 -j ACCEPT     iptables -A input_rule -i $WAN -p udp --dport 11194 -j ACCEPT     iptables -A forwarding_rule -i tap+ -o br-lan -j ACCEPT     iptables -A forwarding_rule -i br-lan -o tap+ -j ACCEPT     iptables -A input_rule -i tap+ -j ACCEPT     iptables -A output_rule -o tap -j ACCEPT          /etc/init.d/firewall restart          # tar the files that goes to the client1     mkdir -p /root/client1     cp /etc/openvpn/ca.crt /root/client1/; cp /etc/openvpn/client1.crt /root/client1/; cp /etc/openvpn/client1.key /root/client1/; cp /etc/openvpn/ta.key /root/client1/     cd /root/; tar -cf client1.tar client1      It seems "ok". I connect my pc to the lan port of the router, and i want to try it out. I'm using Fedora 14 with GNOME. In the NetworkManager applet i set these things: this and this. Ok! I try to connect, but it fails. Here are the logs: https://pastebin.com/raw.php?i=gv2xChxW               Mar  7 15:42:43 ASDF NetworkManager[1458]: <info> Starting VPN service 'openvpn'...     Mar  7 15:42:43 ASDF NetworkManager[1458]: <info> VPN service 'openvpn' started (org.freedesktop.NetworkManager.openvpn), PID 23552     Mar  7 15:42:43 ASDF NetworkManager[1458]: <info> VPN service 'openvpn' appeared; activating connections     Mar  7 15:42:43 ASDF NetworkManager[1458]: <info> VPN plugin state changed: 1     Mar  7 15:42:43 ASDF NetworkManager[1458]: <info> VPN plugin state changed: 3     Mar  7 15:42:43 ASDF NetworkManager[1458]: <info> VPN connection 'elsovpn' (Connect) reply received.     Mar  7 15:42:43 ASDF nm-openvpn[23554]: OpenVPN 2.1.1 i686-redhat-linux-gnu [SSL] [LZO2] [EPOLL] [PKCS11] built on Jan  5 2010     Mar  7 15:42:43 ASDF nm-openvpn[23554]: WARNING: No server certificate verification method has been enabled.  See http://openvpn.net/howto.html#mitm for more info.     Mar  7 15:42:43 ASDF nm-openvpn[23554]: NOTE: the current --script-security setting may allow this configuration to call user-defined scripts     Mar  7 15:42:43 ASDF nm-openvpn[23554]: Cannot load certificate file /home/g/Desktop/client1/client1.crt: error:0200100D:system library:fopen:Permission denied: error:20074002:BIO routines:FILE_CTRL:system lib: error:140AD002:SSL routines:SSL_CTX_use_certificate_file:system lib     Mar  7 15:42:43 ASDF nm-openvpn[23554]: Exiting     Mar  7 15:42:43 ASDF kernel: [55630.235164] type=1400 audit(1299508963.340:23608): avc:  denied  { read } for  pid=23554 comm="openvpn" name="client1.crt" dev=dm-1 ino=3019385 scontext=system_u:system_r:openvpn_t:s0 tcontext=unconfined_u:object_r:user_home_t:s0 tclass=file     Mar  7 15:42:43 ASDF NetworkManager[1458]: <warn> VPN plugin failed: 1     Mar  7 15:42:43 ASDF NetworkManager[1458]: <info> VPN plugin state changed: 6     Mar  7 15:42:43 ASDF NetworkManager[1458]: <info> VPN plugin state change reason: 0     Mar  7 15:42:43 ASDF NetworkManager[1458]: <warn> error disconnecting VPN: Could not process the request because no VPN connection was active.     Mar  7 15:42:43 ASDF NetworkManager[1458]: <info> Policy set 'Auto Ethernet' (eth0) as default for IPv4 routing and DNS.     Mar  7 15:42:49 ASDF NetworkManager[1458]: <info> VPN service 'openvpn' disappeared      one important thing: my routers [the one with the openvpn server] ip address is 192.168.1.2, and i didn't had to write it nowhere. so how could the networkmanager applet know the ip address of my openvpn server? i think this is the problem, but i just can't find where to write 192.168.1.2 p.s.: yes, i tried to google for: "No server certificate verification method has been enabled." but i didn't find a thing, and i'm trying for hours now... :\ p.s.[again..]: yes, i tried to google for: "No server certificate verification method has been enabled." but i didn't find a thing, and i'm trying for hours now... :\ p.s.: If I do this on the router:               iptables -P INPUT ACCEPT     iptables -P FORWARD ACCEPT     iptables -P OUTPUT ACCEPT     iptables -t nat -P PREROUTING ACCEPT     iptables -t nat -P POSTROUTING ACCEPT     iptables -t nat -P OUTPUT ACCEPT     iptables -t mangle -P PREROUTING ACCEPT     iptables -t mangle -P OUTPUT ACCEPT      and stat tcpdump, and try to connect from my pc, nothing happens!.. so the bug is in the networkmanager applet!? again, p.s.: if I do this:               $ telnet 192.168.1.2 1197     Trying 192.168.1.2...     telnet: connect to address 192.168.1.2: Connection refused     $connbsp;      Are there any good howtos about setting this kind of openvpn [as in the pastebin link, on an openwrt router..]? Is it worth finding another openvpn client program? [other then the networkmanager applet]


title: Installing Audacity - Package Problems

text: Have CentOS 6.2. I'm trying to install Audacity, and I'm getting package problems. The Audacity webpage says I need the wxWidgets library, which I think I've installed correctly (./configure, make, and make install seemed to go through ok.) I also think I've installed the libsndfile library correctly. Questions:   1. Is wxWidgets the same as wxGTK?    2. Why does the Audacity install (using yum) still seem to think I need the packages, if the installs appear to have gone through correctly?   3. Is there a nicer way to do this? I want to do something like type "Install Audacity", and some package manager finds all required packages and installs them automatically. I do not want to have to hunt down a raft of packages to install a simple program!


title: How to change the volume name of a FAT32 filesystem?

text: I know I can set the volume name when I format the partition with the `-n` option of `mkfs.vfat`. But how to just change the name without formatting? I especially want to be able to use lower and uppercase letters. In worst case, I can use a windows tool, but windows by default transforms all letters to uppercase (but works fine with lowercase letters in volumes created with `mkfs.vfat`).


title: How to adjust numeric fields in a text file

text: Suppose I have the following `<Tab>` separated text file:               file name    size      owner         file1.txt    12.345    root     file2.txt    0.172222  user1     file3.txt    2.46e2    user2     file4.txt    12345     root     file5.txt    21        user3     file6.txt    246.0     user1     file name    owner     last modified    last accessed     text4.txt    root      12.73            13.53     text5.txt    user3     15.3333          34     file1.txt    root      23               31.0032      This file consists of several "tables", each of which starts with a header line and then contains some data lines. Some columns are numeric, but each table can have different number, as well as different types of columns. The types of columns are not known in advance and they can not be determined according to the table header. The numeric values in the table use various formats - there might be integers, as well as floating point decimal numbers or also numbers in scientific notation. My question is how to convert all the numeric fields in this table into the same format. For example, I might want to have every numeric field formatted with a `"%.2f"` printf format specifier. Naturally, the other, non-numeric fields must remain unchanged. Also, I would like to be able to arbitrarily adjust (e.g. add 42 and then multiply by 7) every numeric field contained in this file. The solution I am looking for should be field-based. It should scan the entire file and for each field it should determine whether it is numeric or not. If it is numeric, it should print its adjusted and formatted value. Otherwise, it should just print the original. I know that something like that can be done with `awk`. But if I remember correctly, `awk` uses `double` for internal representation of numbers and therefore it might have problems with precision and larger values. So, ideally, I would like to use something else, something which should correctly handle at least 64 bit integers. Is there any simple way to achieve this?


title: In zsh, difference between cat <(cat) vs cat | cat vs cat =(cat)?

text: As a zsh/process substitution noob, I expected `cat <(cat)` and `cat | cat` to do the same thing: copy lines from stdin to stdout. My understanding was that both would execute a `cat` in a subshell, redirect the subshell `cat`'s stdout to a temporary named pipe, and then execute another `cat` in the current shell with its stdin redirected to the pipe. Instead, `cat <(cat)` lets me type at my terminal, but none of the input lines get copied and `^D` fails to signal `EOF`; `cat | cat` works as expected though. As a further experiment, I checked if `cat =(cat)` has similar difficulties as `cat <(cat)`, but it works as I expected: all of stdin up to a `^D` gets copied to stdout in one go. Can anyone help me understand what zsh is doing under the hood?