title: stdin : is not in tty

text: I am trying to make backup from server1 to server2 by using below command in ssh               [user1@server1 ~]$ mysqldump -u dbuser -p"dbpwd" --opt  dbname        \                           | gzip -c                                       \                           | ssh  -o StrictHostKeyChecking=no              \                                  -o UserKnownHostsFile=/...../known_hosts \                                  -l deploy                                \                                  -i  /...../id_rsa                        \                                  -v  user2@server2                        \                                  "/bin/cat > /.../test.sql.gz" \                           2>&1       I got the error as below               debug1: Sending command: /bin/cat > -t user2@server2:/..../test.sql.gz     stdin: is not a tty     /bin/cat: user20@server2:/..../test.sql.gz     debug1: client_input_channel_req: channel 0 rtype exit-status reply 0     debug1: client_input_channel_req: channel 0 rtype eow@openssh.com reply 0     : No such file or directory     debug1: channel 0: free: client-session, nchannels 1     debug1: fd 0 clearing O_NONBLOCK     Transferred: sent 265040, received 2552 bytes, in 0.0 seconds     Bytes per second: sent 6736670.0, received 64865.6     debug1: Exit status 1     mysqldump: Got errno 32 on write      can any one resolve this issue? **Updation** I removed 'user2@server2' and 'deploy -i' from backup command and run it. It gives me below messages               debug1: Sending env LANG = en_US.UTF-8     debug1: Sending command: /bin/cat > -t /....../test.sql.gz     stdin: is not a tty     debug1: client_input_channel_req: channel 0 rtype exit-status reply 0     debug1: client_input_channel_req: channel 0 rtype eow@openssh.com reply 0     /bin/cat: /......./test.sql.gz: No such file or directory     debug1: channel 0: free: client-session, nchannels 1     debug1: fd 0 clearing O_NONBLOCK     Transferred: sent 248608, received 2536 bytes, in 0.1 seconds     Bytes per second: sent 4628197.5, received 47211.3     debug1: Exit status 1     mysqldump: Got errno 32 on write


title: What is the best way to restraint/secure a workstation?

text: I want to prevent users to copy on usb devices and some others actions. I was thinking of using polkit. Do you think it is a good solution or does someone know some alternatives ? EDIT: I also need to disable cd/dvd writing. How could I achieve this ? Polkit doesn't to be shipped with this kind of policy. I was thinking of disabling cdrecord for users. Thanks


title: How to create a function based on commands not defined yet?

text: I have some scripts (that are out of my control) that loads some environment settings to my session. So whenever I want to load I have to execute a series of commands:               export SOME_VAR=/path/to/main/folder     source $SOME_VAR/loading/stuff.sh --quiet     loadApp1     loadApp2     loadApp3     loadApp4      I want to do this with a single command, so I created a function (pretty much the lines above), but it doesn't work. I think it's because the loadApps are aliases, loaded in the `stuff.sh` so at time Bash parses my functions it doesn't know the aliases yet. How could I do this with a single command without losing portability? PS: I do not want to copy the alias to my `$HOME/.bashrc` because they can be changed elsewhere and I won't see it.


title: Restrictions of /etc/profile in Gnome

text: I have an issue which bugs me for a long time. I'm using the Intel C++ compiler which includes shell scripts to set up environment variables for library paths, include paths and more. _Sourcing_ these scripts in `.bashrc` works like a charm for the terminal. Unfortunately, I need the environment variables in _Mathematica_ and _NetBeans C++_ too, which brings me to the question, how to source the Intel scripts so that they are known by the GUI programs I start. I searched the net carefully and I think I have tracked the issue down, although I don't have an explanation. One way of setting environment variables for Gnome seems to be to be to create an `*.sh` script in `/etc/profile.d/` which is then executed by `/etc/profile`. Although, regarding to this information the `/etc/profile` is not recommended, please note that I have a shell script which needs to be sourced and not only some `export VAR=blub` settings. If I do this with the e.g. `mklvars.sh` script, it seems that not the complete file is sourced. Let me give a snip from the file to show what I mean               #! /bin/sh     #     # Copyright (C)      # ...lot of boring stuff          CPRO_PATH=/opt/intel/composer_xe_2013_sp1.0.080     export MKLROOT=${CPRO_PATH}/mkl          SCRIPT_NAME=$0     MOD_NAME=mod          # .... some more code here ...          if [ -z "${MKL_TARGET_ARCH}" ] ; then              echo         echo "ERROR: architecture is not defined. Accepted values: ia32, intel64, mic"         mkl_help              else              if [ -n "${LD_LIBRARY_PATH}" ] ; then OLD_LD_LIBRARY_PATH=":${LD_LIBRARY_PATH}"; fi         export LD_LIBRARY_PATH="${CPRO_PATH}/compiler/lib/${MKL_TARGET_ARCH}: #.....      When I now logout/login again, the `MKLROOT` variable is defined but `LD_LIBRARY_PATH` was not adjusted. It seems anything which is a bit more complex than a simple `export VAR` is skipped when sourcing the `.profile`. * * * **Question:** Is there a convenient way of sourcing the compiler-variable scripts for an X-Session (in my case Gnome)? Does someone know what goes wrong here? * * * The obvious hack around this issue is to use the final variable definitions after sourcing the scripts manually and put them in the global `profile`. This has the disadvantage that I do this over and over again with every new update of the compiler. # Step-by-Step Let me give a step-by-step showcase so that you see that I'm not completely nuts. For this I put the Math Kernel Library Script on pastebin and I start with the following situation:   * I have not sourced the script in any `bashrc`, `profile` or other file.   * I have logged out and logged in again For the test we look at the `$MKLROOT` and `$LD_LIBRARY_PATH` which both should be changed by the script. Currently, they are not set when I check their values by               echo $LD_LIBRARY_PATH     echo $MKLROOT      When I source the file manually, I get:               source /opt/intel/composer_xe_2013_sp1.0.080/mkl/bin/mklvars.sh intel64     echo $MKLROOT     echo $LD_LIBRARY_PATH          # Output:     # /opt/intel/composer_xe_2013_sp1.0.080/mkl     # opt/intel/composer_xe_2013_sp1.0.080/compiler/lib/intel64:/opt/intel/composer_xe_2013_sp1.0.080/mkl/lib/intel64      When I put the `source` line into my `~/.bashrc` and open a new terminal, both variables are set correctly as shown above. Now, I remove the `source` line from `~/.bashrc` and put it into `/etc/profile.d/intelCC.sh`, save it and log off/on. After the login, none of the variables are set, but I have an error message in my `~/.xsession-errors` saying:               /usr/sbin/lightdm-session: 1: /etc/profile.d/intelCC.sh: source: not found      Now I replace `source` by a simple `.` so that `/etc/profile.d/intelCC.sh` contains now               . /opt/intel/composer_xe_2013_sp1.0.080/mkl/bin/mklvars.sh intel64      Same again: Save, log off and log on. Now there seem to be no errors in `.xsession-errors` related to this and finally:               echo $MKLROOT     # /opt/intel/composer_xe_2013_sp1.0.080/mkl          echo $LD_LIBRARY_PATH     # empty


title: Vim syntax highlight length-delimited fields

text: I'm trying to write a vim syntax file for SVN dump files. The part I can't figure out is the section like this:               Fooprop: Val1     Text-content-length: 20     Barprop: Val2                                            <- Blank line     abcdefghi     abcdefghi          Next-item-prop: Val3      How do I set up a syntax rule that says "N characters after the first blank line following 'Text-content-length: N' where N is a number"?


title: what does the "a" in chattr +ia do?

text: what does the `a` in `chattr +ia <filename>` do? and why would you add the `a` in combination with the `i`? _note: I know the`i` is for immutable_


title: How do I view the IO priority of a process?

text: How can I view the IO priority of a process? like to see for example if something has been `ionice`-ed.


title: Service not starting at boot

text: Im on Ubuntu 12.10. I have a service that runs well when I do `sudo service myservice start/stop` at installation, I did `sudo update-rc.d myservice defaults` and I see that there are in rc*.d some symlinks S93myservice and K93... pointing to /etc/init.d/myservice But... after doing reboot I can see that my service is not running (`status`). Why ?


title: Delay when iptables icmp rules take effect

text: I have setup my iptables to disable all incoming connection, i.e.               :INPUT DROP [0:65535]      When the iptables has been started, I run the following command to enable ping:               /usr/sbin/iptables -A INPUT -m icmp --icmp-state 8 -j ACCEPT     /usr/sbin/iptables -A INPUT -m icmp --icmp-state 0 -j ACCEPT      I saw the iptables rules are added from `/etc/init.d/iptables status`. I can ping the device from both Windows and Linux PC. Now I run the following command to remove them:               /usr/sbin/iptables -D INPUT -m icmp --icmp-state 8 -j ACCEPT     /usr/sbin/iptables -D INPUT -m icmp --icmp-state 0 -j ACCEPT      I saw the iptables rules are removed from `/etc/init.d/iptables status`. I cannot ping the device from Linux PC which is expected. However, I can ping the device from Windows PC for 1-2 minutes and then I cannot ping it afterwards. I do not ping the device indefinitely (i.e. without -t) from my Windows XP PC but why do I get this results?


title: How to install FTP server on Red Hat VM?

text: I have a windows machine and I need to transfer files from my machine to another Linux virtual machine which I have created. How do I install a FTP server on those VM's to transfer files via FTP protocol? I'd appreciate it if anyone can direct me to a link which gives a clear idea regarding what all FTP is all about?


title: Static IP address shifting to 192.168.1.251

text: I have a system with a static IP address of 192.168.1.150. I configured `/etc/network/interfaces` manually (i.e. without using NetworkManager.) It is a web server hosting three sites. I am having several issues, the root of all of them being DNS resolution (I think). For some reason I cannot understand, the server thinks its IP address resolves to 192.168.1.251. I've read about dnsmasq possibly causing this issue: I have searched running processes and don't see it running. I shut dhcp off (I thought) and I don't see it under running processes either. I have diligently researched each individual issue, and they all seem to point to a server misconfiguration of some sort--but I am stumped as to what to change. I would appreciate any help you can provide to fix the problem, or short of that, help me learn more so I can troubleshoot it more effectively. I am maddened by the tedium of having to track down an annoying and debilitating problem with a system that was functioning very well just two days ago. I cannot be sure, but since I changed nothing, but downloaded several security updates from Ubuntu, I am of course suspicious that one of the things I downloaded upset things. /etc/network/interfaces:               auto lo eth0     iface lo inet loopback          iface eth0 inet static         address 192.168.1.150         netmask 255.255.255.0         broadcast 192.168.1.255         network 192.168.1.0         gateway 192.168.1.1         dns-nameservers 8.8.8.8 68.87.69.150      /etc/resolv.conf:                   # Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)         #     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN         nameserver 8.8.8.8         nameserver 68.87.69.150      /etc/hosts:                   127.0.0.1   localhost.localdomain localhost                      127.0.1.1   nimue         192.168.1.150   babaluis.com         192.168.1.150   coyote.homeip.net         192.168.1.150   hamiltonpdx.com               # The following lines are desirable for IPv6 capable hosts         ::1     localhost ip6-localhost ip6-loopback         fe00::0 ip6-localnet         ff00::0 ip6-mcastprefix         ff02::1 ip6-allnodes         ff02::2 ip6-allrouters         ff02::3 ip6-allhosts      /etc/nsswitch.conf:                   # /etc/nsswitch.conf         #         # Example configuration of GNU Name Service Switch functionality.         # If you have the `glibc-doc-reference' and `info' packages installed,         try:         # `info libc "Name Service Switch"' for information about this file.              passwd:         compat         group:          compat         shadow:         compat              hosts:          dns files mdns4_minimal [NOTFOUND=return] mdns4         networks:       files              protocols:      db files         services:       db files         ethers:         db files         rpc:            db files              netgroup:       nis      `route -n`:                   Kernel IP routing table         Destination     Gateway         Genmask         Flags Metric Ref    Use         Iface         0.0.0.0         192.168.1.1     0.0.0.0         UG    100    0        0         eth0         169.254.0.0     0.0.0.0         255.255.0.0     U     1000   0        0         eth0         192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0         eth0      `nmap -sV nimue`:                   Starting Nmap 5.21 ( http://nmap.org ) at 2012-12-05 22:39 PST         Nmap scan report for nimue (192.168.1.251)         Host is up (0.00075s latency).         Not shown: 998 closed ports         PORT   STATE SERVICE VERSION         53/tcp open  domain  dnsmasq 2.41         80/tcp open  http    lighttpd 1.4.18         MAC Address: E0:46:9A:24:F2:D4 (Unknown)              Service detection performed. Please report any incorrect results at http://nmap.org/submit/ .         Nmap done: 1 IP address (1 host up) scanned in 19.20 seconds      If there is other information you need in order to help, please ask. **UPDATE** Output of `dig +trace nimue`:               ; <<>> DiG 9.8.1-P1 <<>> +trace nimue     ;; global options: +cmd     .           21088   IN  NS  a.root-servers.net.     .           21088   IN  NS  b.root-servers.net.     .           21088   IN  NS  c.root-servers.net.     .           21088   IN  NS  d.root-servers.net.     .           21088   IN  NS  e.root-servers.net.     .           21088   IN  NS  f.root-servers.net.     .           21088   IN  NS  g.root-servers.net.     .           21088   IN  NS  h.root-servers.net.     .           21088   IN  NS  i.root-servers.net.     .           21088   IN  NS  j.root-servers.net.     .           21088   IN  NS  k.root-servers.net.     .           21088   IN  NS  l.root-servers.net.     .           21088   IN  NS  m.root-servers.net.     ;; Received 228 bytes from 8.8.8.8#53(8.8.8.8) in 29 ms          ;; Received 23 bytes from 192.168.1.251#53(192.168.1.251) in 62 ms      The output of netstat -tlpen is:               Active Internet connections (only servers)          Proto Recv-Q Send-Q Local Address           Foreign Address         State       User       Inode       PID/Program name     tcp        0      0 0.0.0.0:10000           0.0.0.0:*               LISTEN      0          13295       2823/perl            tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      0          14864       2721/apache2         tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      0          569634      8196/sshd            tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN      0          9609        957/cupsd            tcp        0      0 0.0.0.0:25              0.0.0.0:*               LISTEN      0          12833       2656/master          tcp        0      0 0.0.0.0:538             0.0.0.0:*               LISTEN      0          12696       2540/gdomap          tcp        0      0 0.0.0.0:993             0.0.0.0:*               LISTEN      0          11088       1018/dovecot         tcp        0      0 0.0.0.0:9571            0.0.0.0:*               LISTEN      0          12710       2558/inetd           tcp        0      0 0.0.0.0:995             0.0.0.0:*               LISTEN      0          11078       1018/dovecot         tcp        0      0 127.0.0.1:10024         0.0.0.0:*               LISTEN      123        9127        1216/amavisd (maste     tcp        0      0 127.0.0.1:10025         0.0.0.0:*               LISTEN      0          14818       2656/master          tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN      116        11120       1051/mysqld          tcp        0      0 0.0.0.0:110             0.0.0.0:*               LISTEN      0          11076       1018/dovecot         tcp        0      0 0.0.0.0:143             0.0.0.0:*               LISTEN      0          11086       1018/dovecot         tcp        0      0 127.0.0.1:783           0.0.0.0:*               LISTEN      0          10252       1241/spamd.pid       tcp6       0      0 :::22                   :::*                    LISTEN      0          569636      8196/sshd            tcp6       0      0 ::1:631                 :::*                    LISTEN      0          9608        957/cupsd            tcp6       0      0 :::25                   :::*                    LISTEN      0          12834       2656/master          tcp6       0      0 :::993                  :::*                    LISTEN      0          11089       1018/dovecot         tcp6       0      0 :::995                  :::*                    LISTEN      0          11079       1018/dovecot         tcp6       0      0 :::110                  :::*                    LISTEN      0          11077       1018/dovecot         tcp6       0      0 :::143                  :::*                    LISTEN      0          11087       1018/dovecot          NetworkManager is running (from ps -aux):               root       944  0.0  0.0 163016  5760 ?        Ssl  Dec05   0:00 NetworkManager     root       957  0.0  0.0 104104  3596 ?        Ss   Dec05   0:00 /usr/sbin/cupsd -F     root       972  0.0  0.0  19984   936 tty4     Ss+  Dec05   0:00 /sbin/getty -8 38400 tty4      I do not think nscd is running; I don't see it in ps -aux anywhere. There is no socket for /var/run/nscd/socket. There is not a LOCALDOMAIN env var. The output of env -i /usr/bin/getent hosts nimue is:               192.168.1.251   nimue      I moved dns to the beginning of the list in /etc/nsswitch.conf based on reading a post somewhere that said it should precede the other options. It had no effect on the problem. **ANOTHER UPDATE** I shut down Network Manager so that it no longer runs when the system is booted. I also removed the DHCP server. Nonetheless, nmap continues to report that the server's IP address is 192.168.1.251.


title: How to find a file in Linux with its path?

text: I am trying to find `settings.xml` file in my Ubuntu machine. I have no clue where it is, and which directory it is in. I tried using this -               ls -R | grep settings.xml      But it doesn't show me the full path where it is.. Is there any other command which I need to try that can give me the full path?


title: Can't mount samba share

text: I'm trying to mount a samba host located at 192.168.2.5. I can ping the host, I can open the share on Ubuntu and windows (with the credentials). When I try to manually connect:                   pi@raspberrypi-web-server ~ $ smbclient -L 192.168.2.5         Enter pi's password:         Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.6.6]              Sharename       Type      Comment         ---------       ----      -------         IPC$            IPC       IPC Service (raspberrypi-media server)         Media Folder    Disk      Media Folder         print$          Disk      Printer Drivers         Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.6.6]              Server               Comment         ---------            -------         RASPBERRYPI-MEDI     raspberrypi-media server              Workgroup            Master         ---------            -------         WORKGROUP      I have this line in /etc/fstab: `//192.168.2.5/ /mnt/smb cifs user=maikel,pass=PASSWORD,_netdev 0 0` But whenever I do: `sudo mount -a` I get the following error: > Retrying with upper case share name mount error(6): No such device or > address Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) Why doesn't my mount work? I've tried `host raspberrypi-media` but I got the same error?


title: Display words in color

text: I am looking for a tool which takes a file in input and a word to search. It should display the file with color the words if it corresponds to the search. Like `grep --colors` but displays all the file. Is there something already exists ? Example : `cat /etc/passwd | colors root` Display all /etc/passwd file and color the words "root" If I can change the color easily it would be great !


title: Script matching literal pattern over multiple lines?

text: I have a multi-line string in the variable `$PAT`. `$PAT` must be searched for within the file `$FILE`. If `$PAT` is in `$FILE`, it needs to print the file with `$PAT` removed. If `$PAT` is not found, then print nothing. It is unknown if `$PAT` contains any special characters, and it must matched literally. For example, if `$PAT` is `//\/\\\|*` then that exact same 8-character string should be searched for in `$FILE`. The real world use for this is for installing and removing text within already existing files/scripts. If you want to append `$PAT` in `$FILE`, you want to know if it has already been appended previously. If `$PAT` is already in `$FILE`, then the output without `$PAT` allows you to easily uninstall it. The systems I'm needing such a script for (Android devices) only have BusyBox on them. No Perl or other scripting languages.


title: Dual monitors with 2 videos driver with xrandr 1.4

text: I'm trying to dual-screen with 2 differents video card drivers (i915 & nvidia) but as you can see xrandr is only listing nvidia provider.               [x@epoch ~]$ xrandr --listproviders     Providers: number : 1     Provider 0: id: 0x279 cap: 0x1, Source Output crtcs: 4 outputs: 6 associated providers: 0 name:NVIDIA-0          [x@epoch /etc/X11]$ sudo lshw -numeric -c video     *-display                           description: VGA compatible controller            product: GK104 [GeForce GTX 770] [10DE:1184]            vendor: NVIDIA Corporation [10DE]            physical id: 0            bus info: pci@0000:01:00.0            version: a1            width: 64 bits            clock: 33MHz            capabilities: pm msi pciexpress vga_controller bus_master cap_list rom            configuration: driver=nvidia latency=0            resources: irq:48 memory:f6000000-f6ffffff memory:e0000000-e7ffffff memory:e8000000-e9ffffff ioport:e000(size=128) memory:f7000000-f707ffff       *-display            description: Display controller            product: Xeon E3-1200 v2/3rd Gen Core processor Graphics Controller [8086:162]            vendor: Intel Corporation [8086]            physical id: 2            bus info: pci@0000:00:02.0            version: 09            width: 64 bits            clock: 33MHz            capabilities: msi pm bus_master cap_list            configuration: driver=i915 latency=0            resources: irq:47 memory:f7400000-f77fffff memory:d0000000-dfffffff ioport:f000(size=64)      Is there any reason why it can't see the i915 one ?


title: Building kernel module

text: I have a 3rd party device driver which I am trying to cross-compile. When I build the driver everything goes smooth but I don't see any driver.ko file, however driver.o file is generated fine and I don't see any error during the build process. I have also tried with the option V=1 and I see following error               echo;      echo "  ERROR: Kernel configuration is invalid.";     echo "         include/generated/autoconf.h or include/config/auto.conf are         missing.";     echo "         Run 'make oldconfig && make prepare' on kernel src to fix  it.";     echo;      But my kernel configuration is correct and I have tried a simple hello world module with this configuration, in that case I can build my module but still see this error message. Also I can see both the files `include/generated/autoconf.h` and `include/config/auto.conf` in the kernel sources. Still why I am unable to build my driver module. I am cross-compiling the driver for ARM platform so /lib/modules will not be good in this environment. Secondly here is the output of the build.               LD [M]  /home/farshad/Work/CSP/boards/imx6q/ar6k3/ar6003_3.1_RC_Linux_release_[posted_2011_8_19_olca3.1RC_553/imx6build/host/os/linux/ar6000.o                                                               Building modules, stage 2.     MODPOST 0 modules     make[2]: Leaving directory  `/home/farshad/Work/CSP/projects/phase_1/farshad/cspbox/platform/imx6/mel5/fs/workspace/linux-2.6.38-imx6'      As you can see above ar6000.o is built properly without any error, but why ar6000.ko is not being built otherwise it should report "MODPOST 1 modules". Since ar6000.ko is not being built at the end of the complete build process I also get the following error               cp: cannot stat `/home/farshad/Work/CSP/boards/imx6q/ar6k3/ar6003_3.1_RC_Linux_release_[posted_2011_8_19_olca3.1RC_553/imx6build/host/os/linux/ar6000.ko': No such file or directory     2404 make[1]: *** [install] Error 1      Which is obvious. My problem is why I am not getting a ar6000.ko in the first place. Searching over google someone also faced this issue and mentioned that running make with sudo resolved it but it brought no luck for me! I am wandering is there any problem in my kernel configuration (i.e the driver is looking for some configuration setting which I haven't enabled in my kernel, but in that case it should give compiler error looking for required #define), the other point can be that there is a problem with the driver build system, which I am trying to figure out. My cross-compile environment is good as I am seeing exactly the same issue while building the same driver for my (Ubuntu x86) machine! # Update # 1 Its a 3rd party driver package which also build other utilities along with the driver module. Here is the output of the driver module build process               make CT_BUILD_TYPE=MX6Q_ARM CT_OS_TYPE=linux CT_OS_SUB_TYPE=  CT_LINUXPATH=~/Work/CSP/projects/phase_1/farshad/cspbox/platform/imx6/mel5/fs/workspace/linu x-2.6.38-imx6 CT_BUILD_TYPE=MX6Q_ARM CT_CROSS_COM      PILE_TYPE=~/bin/mgc/CodeSourcery/Sourcery_CodeBench_for_ARM_GNU_Linux/bin/arm-none-linux- gnueabi- CT_ARCH_CPU_TYPE=arm CT_HC_DRIVERS=pci_std/ CT_MAKE_INCLUDE_OVERRIDE=  CT_BUILD_OUTPUT_OVERRIDE=/home/far      shad/Work/CSP/boards/imx6q/ar6k3/ar6003_3.1_RC_Linux_release_[posted_2011_8_19_olca3.1RC_553 /imx6build/host/.output/MX6Q_ARM-SDIO/image  -C   /home/farshad/Work/CSP/boards/imx6q/ar6k3/ar6003_3.1_RC_Linux      _release_[posted_2011_8_19_olca3.1RC_553/imx6build/host/sdiostack/src default     make[3]: Entering directory  `/home/farshad/Work/CSP/boards/imx6q/ar6k3/ar6003_3.1_RC_Linux_release_[posted_2011_8_19_olc a3.1RC_553/imx6build/host/sdiostack/src'     make  -C ~/Work/CSP/projects/phase_1/farshad/cspbox/platform/imx6/mel5/fs/workspace/linux-2.6.38-imx6 SUBDIRS=/home/farshad/Work/CSP/boards/imx6q/ar6k3/ar6003_3.1_RC_Linux_release_[posted_2011_8_19_olca     3.1RC_553/imx6build/host/sdiostack/src ARCH=arm CROSS_COMPILE=~/bin/mgc/CodeSourcery/Sourcery_CodeBench_for_ARM_GNU_Linux/bin/arm-none-linux-gnueabi- EXTRA_CFLAGS="-DLINUX -I/home/farshad/Work/CSP/board     s/imx6q/ar6k3/ar6003_3.1_RC_Linux_release_[posted_2011_8_19_olca3.1RC_553/imx6build/host/sdiostack/src/include  -DDEBUG" modules     make[4]: Entering directory `/home/farshad/Work/CSP/projects/phase_1/farshad/cspbox/platform/imx6/mel5/fs/workspace/linux-2.6.38-imx6'         Building modules, stage 2.         MODPOST 0 modules     make[4]: Leaving directory  `/home/farshad/Work/CSP/projects/phase_1/farshad/cspbox/platform/imx6/mel5/fs/workspace/linu x-2.6.38-imx6'      Here is the Makefile of the driver module.               ifdef CT_MAKE_INCLUDE_OVERRIDE     -include $(CT_MAKE_INCLUDE_OVERRIDE)     else     -include localmake.$(CT_OS_TYPE).inc     -include localmake.$(CT_OS_TYPE).private.inc     endif          export CT_OS_TYPE     export CT_OS_SUB_TYPE     export CT_OS_TOP_LEVEL_RULE      export CT_PASS_CFLAGS     export CT_SRC_BASE     export CT_BUILD_SUB_PROJ          # this makefile can only be invoked from the /EMSDIO/src base     CT_SRC_BASE :=$(shell pwd)          # export flags for which HCDs to build. Set the hcd driver name in hcd/ in your     localmake.*.inc file.     export CT_HC_DRIVERS     export PDK_BUILD     export HDK_BUILD     export ALL_BUILD     export ATHRAW_FD_BUILD     export BUS_BUILD          # For Linux     ifeq ($(CT_OS_TYPE),linux)           #make a copy for linux 2.4     EXTRA_CFLAGS += -DLINUX -I$(CT_SRC_BASE)/include      ifneq ($(CT_RELEASE),1)     EXTRA_CFLAGS += -DDEBUG     endif       export EXTRA_CFLAGS           CT_SRC_OUTPUT :=$(CT_SRC_BASE)/../output          ifdef CT_BUILD_OUTPUT_OVERRIDE     _CT_COMPILED_OBJECTS_PATH :=$(CT_BUILD_OUTPUT_OVERRIDE)     _MAKE_OUTPUT_DIR :=     _CLEAN_OUTPUT_DIR :=     else     _CT_COMPILED_OBJECTS_PATH := $(CT_SRC_OUTPUT)/$(CT_BUILD_TYPE)     _MAKE_OUTPUT_DIR := mkdir --parents $(_CT_COMPILED_OBJECTS_PATH)     _CLEAN_OUTPUT_DIR := rm -R -f $(CT_SRC_OUTPUT)     endif          ifeq ($(CT_OS_SUB_TYPE),linux_2_4)          CT_PASS_CFLAGS := $(EXTRA_CFLAGS)     _CT_MOD_EXTENSION :=o     ifeq ($(ALL_BUILD),1)     subdir-m += busdriver/ lib/ hcd/ function/        else      ifeq ($(BUS_BUILD),1)     subdir-m += busdriver/ lib/ hcd/     else     ifeq ($(PDK_BUILD),1)     subdir-m += function/     else     ifeq ($(HDK_BUILD),1)     subdir-m += hcd/ function/      endif     endif     endif     endif          # add in rules to make modules     CT_OS_TOP_LEVEL_RULE :=$(CT_LINUXPATH)/Rules.make     include $(CT_OS_TOP_LEVEL_RULE)     else     #2.6+     _CT_MOD_EXTENSION :=ko     ifeq ($(ALL_BUILD),1)     obj-m += busdriver/ lib/ hcd/ function/       else      ifeq ($(BUS_BUILD),1)     obj-m += busdriver/ lib/ hcd/     else      ifeq ($(PDK_BUILD),1)     obj-m += function/     else     ifeq ($(HDK_BUILD),1)     obj-m += hcd/ function/      endif     endif     endif     endif          endif          ifdef CT_BUILD_SUB_PROJ     _CT_SUBDIRS=$(CT_BUILD_SUB_PROJ)     else     _CT_SUBDIRS=$(CT_SRC_BASE)     endif          ifdef CT_CROSS_COMPILE_TYPE      CT_MAKE_COMMAND_LINE=$(CT_OUTPUT_FLAGS) -C $(CT_LINUXPATH) SUBDIRS=$(_CT_SUBDIRS)     ARCH=$(CT_ARCH_CPU_TYPE) CROSS_COMPILE=$(CT_CROSS_COMPILE_TYPE)     else        CT_MAKE_COMMAND_LINE=$(CT_OUTPUT_FLAGS) -C $(CT_LINUXPATH) SUBDIRS=$(_CT_SUBDIRS)     endif          makeoutputdirs:     $(_MAKE_OUTPUT_DIR)          default: makeoutputdirs     echo " ************ BUILDING MODULE ************** "     $(MAKE) $(CT_MAKE_COMMAND_LINE) EXTRA_CFLAGS="$(EXTRA_CFLAGS)" modules     echo " *** MODULE EXTENSION = $(_CT_MOD_EXTENSION)"     $(CT_SRC_BASE)/../scripts/getobjects.scr $(CT_SRC_BASE) $(_CT_COMPILED_OBJECTS_PATH)     $(_CT_MOD_EXTENSION)          ifeq ($(CT_OS_SUB_TYPE),linux_2_4)     # on 2.4 we can't invoke the linux clean with SUBDIRS, it will just clean out the kernel     clean:     find $(_CT_SUBDIRS) \( -name '*.[oas]' -o -name core -o -name '.*.flags' -o -name   '.ko' -o -name '.*.cmd' \) -type f -print \         | grep -v lxdialog/ | xargs rm -f     $(_CLEAN_OUTPUT_DIR)     else      clean:     $(MAKE) $(CT_MAKE_COMMAND_LINE) clean     find $(_CT_SUBDIRS) \( -name '*.[oas]' -o -name core -o -name '.*.flags' \) -type f  -print \         | grep -v lxdialog/ | xargs rm -f     $(_CLEAN_OUTPUT_DIR)     endif     endif           # For QNX     ifeq ($(CT_OS_TYPE),qnx)       LIST=VARIANT     EARLY_DIRS=lib     ##ifndef QRECURSE     QRECURSE=./recurse.mk     ##ifdef QCONFIG     ###QRDIR=$(dir $(QCONFIG))     ##endif     ##endif     include $(QRDIR)$(QRECURSE)          endif


title: How do I resume a tar command which was killed

text: I was doing a : `tar -cvf` and I had to killed it with `ctrl-C`. I know I should have done a `Ctrl-Z` and then bring back the task to foreground... but it's not the story. Can I resume from the point I stopped the task ?


title: chrt(): "failed to set pid XXX's policy" on one machine, but not others

text: I have several Linux machines, all of them running the same kernel (Ubuntu 12.04, `3.5.0-45-generic`). On one of them, I am unable to use `chrt` at all. If I attempt to use it on a new process, I get the following error:               $ sudo chrt -f 1 ls     chrt: failed to set pid 0's policy: Operation not permitted      If I attempt to use it on an existing process, I get a similar error:               $ stress -c 1 &     [1] 3929     $ sudo chrt -f -p 1 3929     chrt: failed to set pid 3929's policy: Operation not permitted      I'm operating as super-user so I should have `CAP_SYS_NICE`, and I am indeed able to `nice` or `renice` a process; I just can't adjust its real-time properties. This behavior is unique to this one machine; the behavior persists through reboot and launching a new shell in a stripped environment (`env -i bash --noprofile --norc`). If I attempt to run this command on any of the other machines (all the same distribution, but some with different hardware) it succeeds as expected. The closest to an explanation I found was this Google groups posting in which someone asserted that the same problem was because of the use of cpuset. I was unable to find any elaboration. I have previously done some work on this machine with thread affinities (`pthread_setaffinity_np()`), taskset, cpusets, isolcpus, etc. However, I don't know how any of those could still be causing this behavior, since I'm not explicitly setting any priorities, and e.g. `taskset -p $$` shows the full set of CPUs (as expected). Also, I've double- checked that I'm not still running with any CPUs isolated (`cat /proc/cmdline`). Is there any configuration I'm overlooking? Any suggestions would be greatly appreciated **EDIT** As per @bersch's suggestion, I'm including excerpts from running `strace`. On a working machine setting to priority 13:               sched_setscheduler(2475, SCHED_FIFO, { 13 }) = 0 # PID 2475     sched_setscheduler(0, SCHED_FIFO, { 13 }) = 0 # ls       The same on the broken machine:               sched_setscheduler(6248, SCHED_FIFO, { 13 }) = -1 EPERM (Operation not permitted) # PID 6248     sched_setscheduler(0, SCHED_FIFO, { 13 }) = -1 EPERM (Operation not permitted) # ls      This is exactly what I would expect from the error messages.


title: Shell script use ssh forwarding to send a file to a second system

text: I have ssh forwarding enabled and ssh to server A. On server A I want to run a script as root and take advantage of the ssh key being forwarded for USER to send a file to system B. I'm getting a permission denied when trying to run the following.               # runuser -l USER -c "scp filename.tgz serverB:~/"


title: How to autoplay ogg stream at startup of Debian

text: I am programming a Rasberry to Pi to become a radio player. It is meant to be used to play the local college radio in the student union hangout. INPUT:   * Power is turn on. OUTPUT:   * Audio is played through the 3,5 mm jack. PROCESS:   1. Device boot Raspdebian   2. ...   3. Start playing an ogg stream (/radiocampus_local.m3u) How can I do this?


title: Example xfreerdp usage with clipboard plugin

text: FreeRDP 1.0.2 has an updated their parameter syntax for "better interoperability with Windows." I had a problem using the old syntax where the clipboard plugin only worked the first time I pasted, and subsequently stopped:               xfreerdp --plugin cliprdr -g 1920x1060 -u Administrator -p xxx x.x.x.x      So I decided to try the new syntax, but I can't seem to get it right. The following:               xfreerdp /a:cliprdr +clipboard /size:1920x1060 /u:Administrator /p:xxx /v:x.x.x.x      Gives an error:               Warning xf_GetWindowProperty (140): Property 385 does not exist     transport_connect: getaddrinfo (Name or service not known)     Error: protocol security negotiation failure      Any advice?


title: ocaml seems to be broken

text: I tried to compile Opa web framework from source on Sabayon, because their main server has a hardware failure. However, when I tried to use configure I got: "Your ocaml installation seems broken, please fix it" message. I tried to reinstall ocaml, but it changed nothing.               $ equo install nodejs openssl mongodb ocaml git ocaml-autoconf     $ git clone https://github.com/MLstate/opalang               $ ./configure -ocamlfind `which ocamlfind` --prefix=/home/mictadlo/apps/     which: no ocamlfind in (/home/mictadlo/apps/Sublime Text 2:/home/mictadlo/apps/WebStorm/bin:/home/mictadlo/apps/netbeans/bin:/home/mictadlo/apps/pymodules/bin:/home/mictadlo/apps/bin:/bin:/home/mictadlo/apps/go_packages/bin:/home/mictadlo/apps/liteide/bin/:/home/mictadlo/apps/snap:/home/mictadlo/apps/node_modules/bin:/usr/local/bin:/usr/bin:/bin:/opt/bin:/usr/x86_64-pc-linux-gnu/gcc-bin/4.7.3:/usr/games/bin)     Checking your OS... Linux     Checking your architecture... x86_64     Checking ocamlopt... /usr/bin/ocamlopt.opt     Checking ocamlbuild... /usr/bin/ocamlbuild     Checking ocamldir... /usr/lib64/ocaml     Checking ocaml version... 4.01.0     Checking your ocaml setup... could not compile     ----------             /usr/lib64/ocaml/libasmrun.a: could not read symbols: Bad value             collect2: error: ld returned 1 exit status             File "caml_startup", line 1:             Error: Error during linking             Command exited with code 2.     ----------     Your ocaml installation seems broken, please fix it      How is it possible to fix the problem?


title: Emacs defaulting to emacs.d as a file

text: No matter where I am or how I open emacs, I get this message:               File exists: /home/{user}/.emacs.d/      I then have to `C-x C-f` to get to the file I was trying to edit. What is going on here, and how do I fix it? ![enter image description here](http://i.stack.imgur.com/VrmHl.gif)


title: measure amount of data read from /dev/random

text: **background** I have written a collection of bash scripts (most of them in German only yet but if you are interested; download the archive not the single scripts) which help users create high-quality OpenPGP keys. These scripts are typically used in a "secure" environment (Linux live CD/DVD). This leads to the problem that these systems have hardly any entropy. For obvious reasons `gpg` reads a lot of data from `/dev/random` which means that my poor users (at worst those with a SSD) have to type a lot on the keyboard in order to create the required entropy. I have written a simple script which shows the users the current size of the entropy pool (which changes quickly between 0 and 64 while `gpg` reads data). I would like to also show a kind of progress bar so that the users can see that they have generated e.g. about 50% of the needed entropy. The required amount should always be (nearly) the same (until I change the key size). **question** So the question is: How can I (easily) measure the amount of data which has been read from `/dev/random` (by a certain process or the whole system)? The only idea I had up to now is attaching `strace` to `gpg` and trace the `read()`s from the respective file descriptor. But maybe there is a much better solution.


title: What is the bash syntax for extracting the values from multiple instances of the same argument?

text: I want to use multiple instances of command line paramater such as the `-d` option used by `PHP` for passing `PHP` options. I am currently using the `getopts` command in `bash`. With PHP invocation it would look like this:               php -f aPHPscript.php -d memory_limit=120M -d apc=1 -d max_execution_time=120      How would the multiple instances of the parameter be extracted in a bash script? Is there a bash command for doing that?


title: Why user and root passwords cannot be empty on Linux?

text: I don't know about every Linux distribution but Kubuntu and all other distributions that I tried always require you to set non-empty password during installation. This password is required when you want to do any task that requires root privileges. I've mainly used Windows before and user passwords can be empty there, this is convenient if you trust all the people who have access to your computer. If any program requires administrator privileges (analog of root) then Windows just shows popup and you can allow or disallow this program to get these privileges. Why is the same not possible on Linux? For me, it looks like you are supposed to use Linux in some hostile environment where all your neighbors are trying to get access to your computer. I always use simple one-digit password to not forget it. **Edit:** Everyone and everywhere say that having no password on Linux is very bad idea, it is unsecure, etc. But Windows users generally don't have passwords. I'm using Windows for many years and it never caused any problems for me. I just want to understand why this is not the same on Linux. If there would be no password on Linux then I will still need to use sudo and click _Yes_ when any program asks for root privileges. This way no program will get root privileges without my permission. This doesn't seem less secure for me. It only would be unsecure if there are some evil people around you who have access to your computer and want to damage your system, but this is usually not the case. Please don't downvote, I'm not trying to start flame war about Linux vs. Windows or something. I just want to understand why things are made this way.


title: uniq and sed, delete lines with pattern similar in multiple files

text: I need delete lines with pattern similar, in multiple files (2500 .in files). example I have an input file -- "transmission-gtk.in" -- whose content is something like, but it is variable, I do not know:               #!/bin/sh     Popcon=18013     Section=main     Name='Transmission'     Comment='Download and share files over BitTorrent'     Name='Start Transmission with All Torrents Paused'     Name='Start Transmission Minimized'     Comment3=' '     License=' '     Screenshot=' '      **In the above case "transmission-gtk.in" I need automatic delete:**               Name='Start Transmission with All Torrents Paused'     Name='Start Transmission Minimized'      **I have tried this, but it doesn't work in my case:**               cd $HOME/My_files_in          PATH_WITH_SLASH=`sort *.in | uniq -D -w 10`      for i in $PATH_WITH_SLASH; do sed -i "\|$PATH_WITH_SLASH|d" $i ; done          The result said: "The argument list is too long"


title: Bash: Fastest way of determining dimensions of image from URL

text: I'm trying to figure out a really fast method in bash of determining an images dimensions. I know I could wget the image and then use imagemagick to determine the height and width of the image. I'm concerned that this may not be the fastest way of doing it. I'm also concerned with having to install imagemagick when I only need a very small subset of functionality. I'm on an embedded system that has very limited resources (CPU, RAM, storage). Any ideas?


title: Rsync over ssh tunnel - using gateway server

text: Environment:     ----------         ----------              /|             ------------     |  Work  |         | Gateway|             | |             | cluster   |     |Station |--------------------------------| |-------------|           |     |        |         |        |          Firewall A         |           |     ----------         ----------             | |             ------------                                               |/        * Users need to transfer DATA from their workstation to the cluster. (rsync / scp)   * Firewall A ONLY allows connections (ssh) from gateway & specific internal subnets   * All users have accounts on gateway server to reach cluster from outside allowed subnets How can users use rsync / scp to transfer data from home (or outside allowed subnets) by using the gateway server as a tunnel? For example I for remote terminals, a user must "ssh user@gateway" and then "ssh user@cluster" to receive a terminal on the cluster. If a user only performed "ssh user@cluster", the firewall would block the connection. Thanks


title: How to install PHP 5.2.4 in CentOS release 6.5 (Final)?

text: Folks I need to install PHP 5.2.4 in CentOS release 6.5 (Final). My souces list are:               # CentOS-Base.repo     #     # The mirror system uses the connecting IP address of the client and the     # update status of each mirror to pick mirrors that are updated to and     # geographically close to the client.  You should use this for CentOS updates     # unless you are manually picking other mirrors.     #     # If the mirrorlist= does not work for you, as a fall back you can try the      # remarked out baseurl= line instead.     #     #          [base]     name=CentOS-$releasever - Base     mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os     #baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/     gpgcheck=1     gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6          #released updates      [updates]     name=CentOS-$releasever - Updates     mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates     #baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/     gpgcheck=1     gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6          #additional packages that may be useful     [extras]     name=CentOS-$releasever - Extras     mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras     #baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/     gpgcheck=1     gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6          #additional packages that extend functionality of existing packages     [centosplus]     name=CentOS-$releasever - Plus     mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus     #baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/     gpgcheck=1     enabled=0     gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6          #contrib - packages by Centos Users     [contrib]     name=CentOS-$releasever - Contrib     mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib     #baseurl=http://mirror.centos.org/centos/$releasever/contrib/$basearch/     gpgcheck=1     enabled=0     gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6               # CentOS-Vault.repo     #     # CentOS Vault holds packages from previous releases within the same CentOS Version     # these are packages obsoleted by the current release and should usually not      # be used in production     #-----------------          [C6.0-base]     name=CentOS-6.0 - Base     baseurl=http://vault.centos.org/6.0/os/$basearch/     gpgcheck=1     gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6     enabled=0          [C6.0-updates]     name=CentOS-6.0 - Updates     baseurl=http://vault.centos.org/6.0/updates/$basearch/     gpgcheck=1     gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6     enabled=0          [C6.0-extras]     name=CentOS-6.0 - Extras     baseurl=http://vault.centos.org/6.0/extras/$basearch/     gpgcheck=1     gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6     enabled=0          [C6.0-contrib]     name=CentOS-6.0 - Contrib     baseurl=http://vault.centos.org/6.0/contrib/$basearch/     gpgcheck=1     gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6     enabled=0          [C6.0-centosplus]     name=CentOS-6.0 - CentOSPlus     baseurl=http://vault.centos.org/6.0/centosplus/$basearch/     gpgcheck=1     gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6     enabled=0     #-----------------          [C6.1-base]     name=CentOS-6.1 - Base     baseurl=http://vault.centos.org/6.1/os/$basearch/     gpgcheck=1     gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6     enabled=0          [C6.1-updates]     name=CentOS-6.1 - Updates     baseurl=http://vault.centos.org/6.1/updates/$basearch/     gpgcheck=1     gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6     enabled=0          [C6.1-extras]     name=CentOS-6.1 - Extras     baseurl=http://vault.centos.org/6.1/extras/$basearch/     gpgcheck=1     gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6     enabled=0          [C6.1-contrib]     name=CentOS-6.1 - Contrib     baseurl=http://vault.centos.org/6.1/contrib/$basearch/     gpgcheck=1     gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6     enabled=0          [C6.1-centosplus]     name=CentOS-6.1 - CentOSPlus     baseurl=http://vault.centos.org/6.1/centosplus/$basearch/     gpgcheck=1     gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6     enabled=0     #-----------------          [C6.2-base]     name=CentOS-6.2 - Base     baseurl=http://vault.centos.org/6.2/os/$basearch/     gpgcheck=1     gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6     enabled=0          [C6.2-updates]     name=CentOS-6.2 - Updates     baseurl=http://vault.centos.org/6.2/updates/$basearch/     gpgcheck=1     gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6     enabled=0          [C6.2-extras]     name=CentOS-6.2 - Extras     baseurl=http://vault.centos.org/6.2/extras/$basearch/     gpgcheck=1     gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6     enabled=0          [C6.2-contrib]     name=CentOS-6.2 - Contrib     baseurl=http://vault.centos.org/6.2/contrib/$basearch/     gpgcheck=1     gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6     enabled=0          [C6.2-centosplus]     name=CentOS-6.2 - CentOSPlus     baseurl=http://vault.centos.org/6.2/centosplus/$basearch/     gpgcheck=1     gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6     enabled=0     #-----------------          [C6.3-base]     name=CentOS-6.3 - Base     baseurl=http://vault.centos.org/6.3/os/$basearch/     gpgcheck=1     gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6     enabled=0          [C6.3-updates]     name=CentOS-6.3 - Updates     baseurl=http://vault.centos.org/6.3/updates/$basearch/     gpgcheck=1     gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6     enabled=0          [C6.3-extras]     name=CentOS-6.3 - Extras     baseurl=http://vault.centos.org/6.3/extras/$basearch/     gpgcheck=1     gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6     enabled=0          [C6.3-contrib]     name=CentOS-6.3 - Contrib     baseurl=http://vault.centos.org/6.3/contrib/$basearch/     gpgcheck=1     gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6     enabled=0          [C6.3-centosplus]     name=CentOS-6.3 - CentOSPlus     baseurl=http://vault.centos.org/6.3/centosplus/$basearch/     gpgcheck=1     gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6     enabled=0     #-----------------          [C6.4-base]     name=CentOS-6.4 - Base     baseurl=http://vault.centos.org/6.4/os/$basearch/     gpgcheck=1     gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6     enabled=0          [C6.4-updates]     name=CentOS-6.4 - Updates     baseurl=http://vault.centos.org/6.4/updates/$basearch/     gpgcheck=1     gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6     enabled=0          [C6.4-extras]     name=CentOS-6.4 - Extras     baseurl=http://vault.centos.org/6.4/extras/$basearch/     gpgcheck=1     gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6     enabled=0          [C6.4-contrib]     name=CentOS-6.4 - Contrib     baseurl=http://vault.centos.org/6.4/contrib/$basearch/     gpgcheck=1     gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6     enabled=0          [C6.4-centosplus]     name=CentOS-6.4 - CentOSPlus     baseurl=http://vault.centos.org/6.4/centosplus/$basearch/     gpgcheck=1     gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6     enabled=0      I've tried the following procedures: http://gaganonthenet.com/2012/07/17/downgrade-package-using-yum/ http://www.curvve.com/blog/servers/2013/safely-downgrade-php-5-4-5-3-centos- linux-plesk-nucleus/#.UqYSaVUnd4Y With no luck! What am I missing? I cannot find the package version I need.


title: Backspace Acting like Enter in Bash

text: Whenever I type a mistake into my SCO machine, using `bash`, I press `backspace` and it is like pressing `enter`, but doesn't execute the command. e.g.               bash-3.1$ ifcomfig "(backspace)"     bask-3.1$       But if I pressed `enter`, then it would be like this:               bash-3.1$ ifcomfig "(enter)"     bash: ifcomfig: command not found        * **Why is it doing this?**   * **And how can I fix this?** Thank you **Update** Here is the output of `stty -a`:               speed 38400 baud;   ispeed 38400 baud;   ospeed 38400 baud;   line = 0(tty);     rows = 100; columns = 92; ypixels = 0; xpixels = 0;     intr = DEL; quit = ^\; erase = DEL; kill = ^U; eof = ^D; eol = ^@;     swtch = <undef>; susp = <undef>; start = ^Q; stop = ^S;     -parenb -parodd cs8 -cstopb hupcl cread -clocal -loblk     -ortsfl -ctsflow -rtsflow     -ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl -iuclc     -ixon -ixany -ixoff     isig icanon -xcase echo -echoe -echok -echonl -noflsh     -iexten -tostop -xclude     opost -olcuc onlcr -ocrnl -onocr -onlret -ofill -ofdel     -isscancode     -autoe -ed_emacs -ed_vi -ed_history


title: Easiest way to mount Google Cloud Storage in CentOS

text: we use centos for some hosting projects, but nut very expertise with systems. We pretend to use a main CentOS box to mount an "unlimited" Google Cloud Drive and then share it via NFS to the rest of computers on the VPN. We already have gsutil installed on our Centos 6.5 and just want to know how to install and configure a local mount of google storage to share later in the private network. Thanks !


title: Unable to mount root fs after new kernel compile in VMware

text: So, I'm attempting to compile and use the 3.6.2 kernel on my Debian 6 VM (running under Windows 7 in VMware Workstation 9). I've already had several hick ups, but I am slowly getting through them but still not there, yet. So, I'm running the following (after extracting the file into `/usr/src` and running the commands via `su`)               make defconfig     make -j8     make install     make modules_install     update-initramfs -c -k 3.6.2     update-grub      I forgot to do the `initramfs` step, which I found from this link here but I still got the error, which resulted in me finding this link. After this, this part of the error below stopped occurring, but the rest was there:               W: devtmpfs not available, falling back to tmpfs for /dev       Upon the GRUB menu, I edited the root UUID to `/dev/sda1` but it still doesn't find it. I finally followed this link, but still no luck. Any ideas?


title: List of installed repositories (yum)

text: In centos how can I get a list of installed repositories?


title: Why is my /etc/hosts.deny file being ignored?

text: I am using a small embedded linux setup generated by `buildroot` to run on a x86 device. It was generated to use `busybox` init system and also runs dropbear so I can ssh into the device. I wanted to block the `ssh` access so I went to edit the `/etc/hosts.deny' file. It did not exist so I created it with the following content               ALL : ALL      and rebooted. I expected it to block any attempts to ssh into it but to my surprise I found that I could still do so. I have tried to find further details about this but I have come to the conclusion that the `buildroot` system is not configured to use this file. My question is about what applications on a linux system actually read the contents of `/etc/hosts.deny` and act upon it. I have read the man pages but I cannot find anything that tells me this. Is it possible that this is just incompatible approach to the `buildroot` generated system?? Or is there something wrong with the content of the file?


title: Linux support on 2012 MacBooks

text: I want to buy a 2012 MacBook with the Retina Display. Does it work well with Linux?


title: Problem with permissions when sharing a mounted filesystem

text: I am setting up a linux to act as a fileserver, using CentOS 6.3. Since I want to have disk quotas and can't install LVM (it is a 32 bit machine), I am using an LVM volume with ext4 mounted as `/samba/seg` I have created `/samba/seg`, assigned a domain group, changed FS permissions to 770, executed:   * `semanage fcontext -a -t samba_share_t /samba/seg`   * `restorecon -R -v /samba/seg` My config (from `testparm`):               [seg]            comment = Remote unit            path = /samba/seg            valid users = @DOMAIN\GROUP            read only = No            create mask = 0660            force create mode =  0660            directory mask = 0770            force directory mode = 0770            hide unreadable = Yes            access based share enum = Yes      When I try to connect from a Windows box (logged as domain user) I get a message stating that I have no access rights to the share. I have to make `setenforce Permissive` in order to access the share. The domain configuration seems ok. I can login with a domain user, check users of domain groups and so on. In the other hand, I just did create a directory (not a filesystem) in `/samba/test` and replied the steps with it; it worked without problem so the issue seems to be when sharing a mounted filesystem. Any suggestions? I am fairly new to managing Linux, so don't overlook noob issues.


title: Is there a way to search a menu bar in Gnome?

text: I want to search my menu bar, to easily find obscure menu items. I know that the HUD (Heads Up Display) in Unity has this feature, however I am running Gnome 3 on Debian 7. Is there a way to do this on my system?


title: Largest collaborative project in history

text: Is Linux the largest collaborative project in history? Now, "large" can be defined in various ways. Let's take it to mean the number of total person-hours spent writing code, debugging, maintaining and all other tasks in relation to building a working piece of software. This excludes things like marketing or support for instance. By history, I mean the recorded history, roughly 5000 BC onwards. If you think there are more sensible definitions, I will happily update the question.


title: How to mount a cryptsetup container just with `mount`?

text: I created an encrypted container via               #!/bin/bash     dd if=/dev/zero of=$1 bs=1 count=0 seek=$2     MAPPER=$(mktemp -up /dev/mapper)     LOOPDEV=$(losetup --find --show $1)     cryptsetup luksFormat $LOOPDEV     cryptsetup luksOpen $LOOPDEV $(basename $MAPPER)     mkfs.ext3 $MAPPER     cryptsetup luksClose $MAPPER     losetup -d $LOOPDEV      i.e. a file e.g. `container` specified to this script will contain a ext3 filesystem encrypted via `cryptsetup luksFormat`. To mount it, I currently use another script, say `dm.mount container /mnt/decrypted`:               #!/bin/bash     set -e     MAPPER=$(mktemp -up /dev/mapper)     LOOPDEV=$(losetup --find --show $1)     cryptsetup luksOpen $LOOPDEV $(basename $MAPPER) || losetup -d $LOOPDEV     mount $MAPPER $2 || (       cryptsetup luksClose $MAPPER       losetup -d $LOOPDEV     )      and to unmount it `dm.umount /mnt/decrypted`:               #!/bin/bash     set -e     MAPPER=$(basename $(mount | grep $1 | gawk ' { print $1 } '))     LOOPDEV=$(cryptsetup status $MAPPER | grep device | gawk ' { print $2 } ')     umount $1     cryptsetup luksClose $MAPPER     losetup -d $LOOPDEV      There's a lot of redundancy and manually grabbing a loop device and mapper both of which could remain anonymous. Is there a way to simply do something like `mount -o luks ~/container /mnt/decrypted` (prompting for the passphrase) and `umount /mnt/decrypted` the easy way instead? * * * **edit** Basically I am happy with my scripts above (although the error checking could be improved...), so > How can a mount option `-o luks=~/container` be implemented similar to `-o > loop ~/loopfile` using the scripts I wrote? Can this be achieved without rewriting `mount`? Or alternatively, could `-t luks -o loop ~/container` be implemented?


title: Print content of file from desired character and end also to desired character

text: I have this file with content written below. I want output of my file stating with `".SUBCKT C032_THS_COMPARATOR" and end with ".ENDS"`:               .SUBCKT C032_THS_DPDNPROT_cdm_tdpdnw TOPROTECT VPLUS     .SUBCKT C032_THS_DPDNPROT_cdm_tdndsx TOPROTECT VMINUS     *     ************************************************************************     * Library Name: DUMMY     * Cell Name:         * View Name:    schematic          .SUBCKT C032_THS_COMPARATOR  DGND DVDD Icomp PDANAN      + VOUT VP     *.PININFO CH:I CHN:I Icomp:I PDANA:I PDBANA:I VN:I VP:I VOUT:O AGND:B AVDD:B      *.PININFO DGND:B DVDD:B     MP9 net11 CHN D1 AVDD egpfet m=1 w=2.5u l=0.2u nf=1.0 pccrit=0 plorient=1      + ngcon=1 p_la=0 ptwell=0 swacc=0 swrg=-1 swrsub=-1 nqs=0 mismatch=1     MP3 net044 net029 DVDD DVDD egpfet m=1 w=4u l=0.15u nf=1.0 pccrit=0 plorient=1      + ngcon=1 p_la=0 ptwell=0 swacc=0 swrg=-1 swrsub=-1 nqs=0 mismatch=1     MP1 V V V V egpfet m=2 w=3u l=0.5u nf=1.0 pccrit=0 plorient=1 ngcon=1      + p_la=0 ptwell=0 swacc=0 swrg=-1 swrsub=-1 nqs=0 mismatch=1     MP0 net11 D1 AVDD AVDD egpfet m=1 w=3u l=2u nf=1.0 pccrit=0 plorient=1 ngcon=1      + p_la=0 ptwell=0 swacc=0 swrg=-1 swrsub=-1 nqs=0 mismatch=1     MP2 net7 D1 AVDD AVDD egpfet m=1 w=3u l=2u nf=1.0 pccrit=0 plorient=1 ngcon=1      + p_la     1      + ngcon=1 p_la=0 ptwell=0 swacc=0 swrg=-1 swrsub=-1 nqs=0 mismatch=1     MN4 net7 c TAIL AGND egnfet m=2 w=8u l=1u nf=1.0 pccrit=0 plorient=1 ngcon=1      + p_la=0 ptwell=0 swacc=0 swrg=-1 swrsub=-1 nqs=0 mismatch=1     .ENDS


title: Partition table is corrupted after using TestDisk

text: So, I have Linux Mint installed on my computer and then attempted to install WindowsXP on another primary partition. After the installation finished, I found my data partition `sda9` (which is a logical one) had been deleted. I think I didn't delete it by mistake so I guess it's caused by Windows XP installer. I tried to use TestDisk to analyze the disk and fix the partition table, and I am now able to access to my data partition from both Mint and Windows XP. The problem is, when I use parted to show partitions on my disk, it shows an error like this: > Error: Can't have a partition outside the disk! However, `fdisk -l` shows all the partitions correctly               Disk /dev/sda: 500.1 GB, 500107862016 bytes     255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x0006a436             Device Boot      Start         End      Blocks   Id  System     /dev/sda1   *        2048    61442047    30720000   83  Linux     /dev/sda2        61442048   106498047    22528000    7  HPFS/NTFS/exFAT     /dev/sda3       106498048   204802047    49152000    7  HPFS/NTFS/exFAT     /dev/sda4       204802101   976784129   385991014+   f  W95 Ext'd (LBA)     /dev/sda5       204804096   214566895     4881400   82  Linux swap / Solaris     /dev/sda6       225279495   286712054    30716280    7  HPFS/NTFS/exFAT     /dev/sda7       286712118   327661739    20474811    1  FAT12     /dev/sda8       360454144   417796095    28670976   83  Linux     /dev/sda9       417798144   976773119   279487488    7  HPFS/NTFS/exFAT          Disk /dev/sdb: 16.0 GB, 16008609792 bytes     255 heads, 63 sectors/track, 1946 cylinders, total 31266816 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x0004f355             Device Boot      Start         End      Blocks   Id  System     /dev/sdb1   *        2048    31266815    15632384    c  W95 FAT32 (LBA)      `sda9` was the data partition that was somehow deleted, `sda6` and 7 are 2 unknown partitions that TestDisk wrote to my partition table. Other than that, all the partitions are correct. How should I fix my partition table now?


title: zathura: How do I add a keybind for exec?

text: `zathura` is my default PDF reader. Some files cause it trouble though, and in such cases I run               :exec acroread $FILE      which automatically opens the same file with Acrobat Reader. How do I add a key shortcut to the zathura configuration file (`~/.config/zathura/zathurarc`) to do that?


title: Split text file into short lines for reading?

text: Is there a program that can take a plain-text file with long lines, and add a newline after a certain number of characters, only splitting at words, to make it readable? For example, take this:               Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam vel lectus ac enim venenatis porttitor in et est. Curabitur ut eros quis risus consequat dictum a a lectus. Integer ut risus quis augue lobortis molestie vel id nibh. Aliquam sit amet mattis lorem, vel ornare felis. Donec pulvinar tempus lorem, at porta sem pretium ut. Cras ut lorem tincidunt, scelerisque nunc vitae, posuere augue. Vestibulum iaculis libero id congue ultrices. Nullam mauris ipsum, aliquet eget nisl non, venenatis euismod enim. Phasellus a eleifend velit. Aenean molestie venenatis turpis, consectetur convallis velit fringilla non.      And turn it into this:               Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam vel     lectus ac enim venenatis porttitor in et est. Curabitur ut eros quis     risus consequat dictum a a lectus. Integer ut risus quis augue lobortis     molestie vel id nibh. Aliquam sit amet mattis lorem, vel ornare felis.     Donec pulvinar tempus lorem, at porta sem pretium ut. Cras ut lorem     tincidunt, scelerisque nunc vitae, posuere augue. Vestibulum iaculis     libero id congue ultrices. Nullam mauris ipsum, aliquet eget nisl non,     venenatis euismod enim. Phasellus a eleifend velit. Aenean molestie     venenatis turpis, consectetur convallis velit fringilla non.


title: Need help to configure my NIC in Redhat

text: I am trying to set a larger buffer size in my NIC card. I am following the instruction provide by Intel link, but i think it didn't made any changes.               [root@redhat-enterprise-test01 admin]# rmmod e1000;modprobe e1000     [root@redhat-enterprise-test01 admin]# modprobe e1000 TxDescriptors=4096     [root@redhat-enterprise-test01 admin]# ethtool -g p1p1     Ring parameters for p1p1:     Pre-set maximums:     RX:     4096     RX Mini:    0     RX Jumbo:   0     TX:     4096     Current hardware settings:     RX:     256     RX Mini:    0     RX Jumbo:   0     TX:     256     [root@redhat-enterprise-test01 admin]# ethtool -i p1p1     driver: igb     version: 3.2.10-k     firmware-version: 1.5-1     bus-info: 0000:01:00.0


title: Getting size of directories and exclude some folders

text: I have an directory structure like this:   1. application1   2. application1_edit   3. application2   4. application2_edit Is there any way to get the total size for every folder (including sub- directories) and exclude all folders with `_edit` in name? I have tried `du -s` on the root folder, but it lists all sub-directories.


title: How to handle user permission issue?

text: We have created an asset management application web app using `php`. This app allows users to browse, upload, rename, replace assets (binary files like images and 3d models) We developed in windows environment and every thing works fine but when we hosted in linux server (joyent) we are running with permission issues in some scenarios. Below is environment setup Our public web root folder is located in `home/jill/web/public` (webroot) . All assets are located under `home/jill/web/public/assets` (assets root) and in sub folders as well Below are the use cases the way we handling the asset management -   1. Bulk upload all assets using ftp program with ftp user (ftpuser)   2. Bulk upload all assets using webadmin user (jill), who is owner of `home/jill/web/public`   3. Upload assets using the web app (default web user is www) In all above use cases, we also overwrite assets with latest modified files. Now there is a flash application (game) hosted in the webroot which access all those assets and loads in the app. Now we get permission errors when we try to overwrite/update file using a user id different from which is originally created by a different user. **Example:** Try to overwrite a file using web app which was initially uploaded using ftp user and vice-verse What is the way we can handle this scenario so any file or directory created under webroot\assets by any user can be modified by any user ? I am a developer not familiar with unix/linux but I think it is something to do with handling groups and group permission but I am not sure how to set ?


title: How to make cd arguments case INsensitive?

text: Sometimes while accessing the various directories it happens most of the times that I remember the names or at least part of the names of a directory under our Linux system. But some of the directories are named starting with first character caps or one of the characters in the middle of the name Upper case. Can anyone suggest how can I make the arguments following `cd` command case INSENSITIVE, such that if I perform `cd BackupDirectory` or `cd backupdirectory` it could enter the directory name BackupDirectory. Of course I don't want to screw the things for other users so if the above is possible, is that possible that the change could be applied just to the session I am using and do not effect other users? Ok, I tried `set completion-ignore-case` on but this just doesn't work. It just helps in that if I type `cd b` and `Tab` or `Esc` `Esc` it fills the directory name ignoring the case. But, what I need is if I do a `cd backupdirectory`, it just ignores the case and enters `BackupDirectory` on its own.


title: linux/solaris + verify duplicate valid IP address from file

text: what the best way to find duplicate IP from file ( I have ksh script in this script I need to write function that check for duplicate IP ) for example if IP - 192.1926.23.52 exists twice in file - config_IP.txt then need to print "duplicate IP - xxx.xxx.xxx.xxx"   * solution can be with ksh or perl one liner , sed ,awk etc the format of the file should be as the following: more config_IP.txt                # NETWORK adminstration                192.192.23.150 192.192.23.120      192.192.23.152 192.192.23.52            192.192.23.153 192.192.23.53            192.192.23.154 192.192.23.54                      #NETWORK private           192.192.23.170  192.192.23.122               192.192.23.172  192.192.23.126        192.192.23.174  192.192.23.123           192.192.23.177  192.192.23.121                      # NETWORK oracle internal               152.3.4.12 152.3.4.12      152.3.4.14 152.3.4.16                # NETWORK oracle ext          152.3.4.10 152.3.4.19


title: Asus G53S keyboard backlight

text: I have troubles enabling keyboard backlight in Asus G53SW-XR1 (2.6.39-2 kernel) with modules:               $ lsmod | grep asus      asus_nb_wmi            12393  0      asus_wmi               18488  1 asus_nb_wmi     sparse_keymap          12760  1 asus_wmi     pci_hotplug            30807  1 asus_wmi     wmi                    13202  1 asus_wmi     rfkill                 19014  5 asus_wmi,bluetooth,cfg80211      The lights light up just after turning on the laptop (even before grub) but then go dark. When I press the button I get log messages:               Nov 18 16:14:36 grendl kernel: [  383.513969] keyboard: can't emulate rawmode for keycode 240     Nov 18 16:14:36 grendl kernel: [  383.513992] keyboard: can't emulate rawmode for keycode 240     Nov 18 16:14:36 grendl kernel: [  383.514002] asus_wmi: Unknown key b7 pressed


title: tar files only, no directories

text: I can probably write a shell script to find files only, then pass the list to tar, but I am wondering whether there already is a built-in feature in tar that allows doing just that, in a single command line? For example, I found the `\--no-recursion` switch, but when I do:               tar --no-recursion -cvf mydir.tar mydir      It only archives the names of the entries in the directory (including subdirectories!), but it doesn't archive any files. I also tried:                tar --no-recursion -cvf mydir.tar mydir/*      But while it archives files only, it also archives the **names** of the subdirectories. Is there a way to tell tar files only, no directories?


title: NFS Shared Folders - Is it transitive?

text: If I have Computer-A, and share a folder to be accessed by Computer-B, can I take that same shared folder and share it with Computer-C? Computer-B has two itnerface cards, eth0, and eth1. eth0 is connected on the same network as Computer-A, and eth1 is connected on an alternate network that Computer C. Computer-B is on both networks. ## Computer-A <--> Computer B <--> Computer C Platform: Ubuntu 10.04 Thanks -Manny


title: Search string in many files on HP-UX

text: I need to find which files (they can have space in the filename) of a directory contains a string using only sh and system's commands (Perl is **not** an option). For a few files, this command works fine:               # grep -l word *     file 1     file1      But if I have 270k file, I obtain the following error:               #  grep -l word *     sh: /usr/bin/grep: The parameter list is too long.      In HP-UX, the `xargs` command doesn't have the `-0` option, so I can't use this:               # find . -print0 |xargs -0 grep -l     xargs: unknown option: -0      Do you know which command I can use?


title: Remove copyright symbol

text: I'm trying to parse a RSS feed on the command line. The code works so far but the feed contains a copyright symbol which I try to remove (it is latin1 encoded). How do I remove the copyright symbol (`\xA9`) using maybe `sed`?


title: install g++ on RHEL 6

text: I'm trying to install g++ (with `gcc` already installed) on my Red Hat Enterprise Linux 6. I've tried the following:               $ yum install g++     $ yum install c++     $ yum install gcc-g++     $ yum install gcc-c++      and nothing gets installed. I've also tried:               $ yum search g++     $ yum search c++      No hits. What's up?


title: Setup SFTP in Ubuntu AMI

text: I want to setup SFTP on Amazon Ubuntu AMI. I can connect to the instance with PuTTY and access my project file through normal FTP (using Filezilla). For FTP access `proftp` is installed in Webmin. Can someone please explain how to setup SFTP to make my connections to my instance more secure?


title: compare two columns of different files and print if it matches

text: I am using solaris 10 and Grep options involving -f doesnt work . I have two pipe separated files: file1:               abc|123|BNY|apple|     cab|234|cyx|orange|     def|kumar|pki|bird|      file 2 :               abc|123|     kumar|pki|     cab|234      I would like to compare the first two columns of file2 with file1 (search through the entire contents of file1 in first two columns) if they match print the matched line of file1. Then search for the second line of file 2 and so on. Expected Output :               abc|123|BNY|apple|     cab|234|cyx|orange|      The files I have are huge, containing about 400,000 lines. So I would like to make the execution fast.


title: How to Create a Encrypted Password

text: I want to know how can I create a encrypted password in Ubuntu 14.04 TLS. Tried this:               makepasswd --crypt-md5 password_here      Did not worked for me throwing this Error               sysadmin@localhost:~$ makepasswd --crypt-md5 admin123          makepasswd:  Non-argument options specified:  admin123     makepasswd:  For more information, type:  makepasswd --help      I want to add those encrypted password in one of the installation so I need the way of doing it.


title: Deactivate key events from mouse side-buttons

text: I'm having a similar problem to this question - I run Linux with an Apple Mouse connected which has these horrible side buttons which I press accidentally all the time. Among other things, it has revealed a bug in Thunderbird that caused it to completely wipe my IMAP inbox. So I have to deactivate that button. The answer given in the linked question unfortunately does not fully work, because I am seeing another key event being emitted (as shown by running `xev`):               ButtonPress event, serial 36, synthetic NO, window 0x3200001,         root 0x283, subw 0x3200002, time 150944932, (37,43), root:(39,148),         state 0x0, button 8, same_screen YES          EnterNotify event, serial 36, synthetic NO, window 0x3200001,         root 0x283, subw 0x0, time 150944840, (37,43), root:(39,148),         mode NotifyGrab, detail NotifyInferior, same_screen YES,         focus YES, state 0          KeymapNotify event, serial 36, synthetic NO, window 0x0,         keys:  4294967171 0   0   0   0   0   0   0   0   0   0   0   0   0   0   0                   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0             ButtonRelease event, serial 36, synthetic NO, window 0x3200001,         root 0x283, subw 0x3200002, time 150945092, (37,43), root:(39,148),         state 0x0, button 8, same_screen YES          LeaveNotify event, serial 36, synthetic NO, window 0x3200001,         root 0x283, subw 0x0, time 150944975, (37,43), root:(39,148),         mode NotifyUngrab, detail NotifyInferior, same_screen YES,         focus YES, state 0      Using the following entries in `~/.Xmodmap` gets rid of the button-press events:               ! Disable buttons 8 and 9     pointer = 1 2 3 4 5 6 7 0 0      But the key event is different. I don't see a key code, instead this enumeration of numbers under `keys`. The first number is hex 0xffffff83 or understood as 32-bit signed integer -125. * * * **How do I deactivate the emission of the above mentioned key event (`KeymapNotify`)?**


title: Separate traffic between two tun+ devices with openvpn

text: I'm running two OpenVPN clients, so I have two `tun` interfaces configured. Each of the `tun` interfaces has a different subnet. One of the interfaces, let's say `tun1` has a default route, so most of my traffic goes through there. My `tun0` interface however, does not have a default route, so only packets to it's subnet are routed through this interface. The problem is that packets that are supposed to go through `tun0` => `eth0`, are going through `tun0` => `tun1` => `eth0`. This does make sense, because `tun1` is used as a default device. How can I prevent packets in my private network from being routed through both VPNs and make them routed only through one of the VPNs? Update: Here is my current routing table:               0.0.0.0/1 via 10.4.102.81 dev tun1      default via 192.168.10.1 dev eth0  proto static      10.4.0.1 via 10.4.102.81 dev tun1      10.4.102.81 dev tun1  proto kernel  scope link  src 10.4.102.82      10.176.128.0/18 via 172.29.2.77 dev tun0      10.177.0.0/18 via 172.29.2.77 dev tun0      10.177.128.0/18 via 172.29.2.77 dev tun0      10.178.0.0/16 via 172.29.2.77 dev tun0      10.179.0.0/16 via 172.29.2.77 dev tun0      10.180.0.0/16 via 172.29.2.77 dev tun0      10.181.0.0/16 via 172.29.2.77 dev tun0      10.183.0.0/16 via 172.29.2.77 dev tun0      46.165.208.65 via 192.168.10.1 dev eth0      128.0.0.0/1 via 10.4.102.81 dev tun1      172.29.0.0/22 via 172.29.2.77 dev tun0      172.29.2.77 dev tun0  proto kernel  scope link  src 172.29.2.78      172.31.0.0/22 via 172.29.2.77 dev tun0      192.168.10.0/24 dev eth0  proto kernel  scope link  src 192.168.10.76  metric 1


title: Trinity Desktop Environment on Linux Mint

text: Is it possible / does anybody have experience with installing the Trinity Desktop Environment (TDE) on a preexisting Linux Mint 17 Qiana installation? The TDE developers have a Wiki entry for installing it on Ubuntu. Maybe this can be recycled? PS: I use the Xfce edition.


title: tcpdump and https

text: Why following command doesnt grab the packets to faceebook site               sudo tcpdump host facebook.com and dst port 443      but next grabs               sudo tcpdump host java.com


title: Pasting with spaces added into heads of lines (analogy to comment-chars)?

text: Please, consider a situation, where you find a nice example and want to copy it to your existing code to see, how it works. The indentation is almost never right right away. If there are several lines, line-by-line editing can be tedious. On another question, there were hints on how to add spaces into a block of lines and on another, how to use :paste- option, which is used to control comment-characters when pasting. (Is this right?) Can you use :paste or somehow in other way tell that when pasting, add, say 4 spaces into the front of every pasted line? Late addition: I use "+gP quite often to paste a block of lines. Thus the :paste below sounds very promising.


title: Hard Drive Crash / Gparted Error or Something Else

text: Well, I had my hard drive crashed some weeks ago. My Ubuntu (14.04) automagically froze and after the moment I pressed the restart button, and it prompted me with busybox prompt. I tried booting with the Live Ubuntu CD, but could not mount my drive (root partition). I continued booting with my Live USB of Mint 17 (cursing Ubuntu, of course) with some persistence space. After some days, the drive stopped appearing (in the BIOS too). Just before writing this question, it suddenly appeared, (first in my board's boot menu). I tried running Gparted to format the drive (so that i could install Mint), but gparted aborted with an error. Details Here!  . And eventually it stopped appearing. Could anyone tell me what's wrong with my drive by seeing the gparted error details? Thanks in advance Gparted Error Details:               GParted 0.18.0 --enable-libparted-dmraid --enable-online-resize          Libparted 2.3     Format /dev/sda5 as ext4  00:06:35    ( ERROR )          calibrate /dev/sda5  00:00:00    ( SUCCESS )          path: /dev/sda5     start: 4001792     end: 625141759     size: 621139968 (296.18 GiB)     clear old file system signatures in /dev/sda5  00:00:00    ( SUCCESS )          write 68.00 KiB of zeros at byte offset 0  00:00:00    ( SUCCESS )     write 4.00 KiB of zeros at byte offset 67108864  00:00:00    ( SUCCESS )     write 4.00 KiB of zeros at byte offset 274877906944  00:00:00    ( SUCCESS )     write 4.00 KiB of zeros at byte offset 318023659520  00:00:00    ( SUCCESS )     flush operating system cache of /dev/sda  00:00:00    ( SUCCESS )     set partition type on /dev/sda5  00:00:00    ( SUCCESS )          new partition type: ext4     create new ext4 file system  00:06:35    ( ERROR )          mkfs.ext4 -L "" /dev/sda5          Filesystem label=     OS type: Linux     Block size=4096 (log=2)     Fragment size=4096 (log=2)     Stride=0 blocks, Stripe width=0 blocks     19415040 inodes, 77642496 blocks     3882124 blocks (5.00%) reserved for the super user     First data block=0     Maximum filesystem blocks=4294967296     2370 block groups     32768 blocks per group, 32768 fragments per group     8192 inodes per group     Superblock backups stored on blocks:     32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,     4096000, 7962624, 11239424, 20480000, 23887872, 71663616          Allocating group tables: done     Writing inode tables: done     Creating journal (32768 blocks): done     Writing superblocks and filesystem accounting information: 2/2370     mke2fs 1.42.9 (4-Feb-2014)          Warning, had trouble writing out superblocks.          ========================================


title: Configure Wacom Intuos Graphics Pad in Linux Mint 15

text: I purchased a Wacom Intuos graphics pad recently (specifically, Create Pen & Touch Tablet, which I think is the rebranding of the Intuos 4), and I am trying to configure it on my Linux Mint 15 system. I followed these instructions regarding the configuration on The Linux Wacom Project's wiki Here are some pertinent specs about my computer w.r.t. the installation:               $ uname -r     3.8.0-33-generic          /etc/X11/xorg.conf.d $ ls     10-evdev.conf             50-synaptics.conf  51-synaptics-quirks.conf     11-evdev-quirks.conf      50-vmmouse.conf     11-evdev-trackpoint.conf  50-wacom.conf      (Note that the wacom configuration is there.)               /etc/X11/xorg.conf.d $ X -version          X.Org X Server 1.13.3     Release Date: 2013-03-07     X Protocol Version 11, Revision 0      When I ran all of the configurations and make commands it all (eventually) worked out OK as per feedback in those commands. But still nothing... the device cannot be found when I type a command like:               /etc/X11/xorg.conf.d $ xinput list     ⎡ Virtual core pointer                      id=2    [master pointer  (3)]     ⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]     ⎜   ↳ Logitech USB Optical Mouse                id=11   [slave  pointer  (2)]     ⎣ Virtual core keyboard                     id=3    [master keyboard (2)]         ↳ Virtual core XTEST keyboard               id=5    [slave  keyboard (3)]         ↳ Power Button                              id=6    [slave  keyboard (3)]         ↳ Video Bus                                 id=7    [slave  keyboard (3)]         ↳ Power Button                              id=8    [slave  keyboard (3)]         ↳ Logitech USB Keyboard                     id=9    [slave  keyboard (3)]         ↳ Logitech USB Keyboard                     id=10   [slave  keyboard (3)]      It is not recognizing the wacom tablet at all. I have looked at the wacom config files, and they all seem to be correct (as best as I can tell). I am using the "hotplugging" method, as recommended (note the directory `xorg.conf.d`). I'm at a loss what to try next. I know the problem is configuration, because we also have a Mac at home, and I can get it to work on the Mac. I've used GIMP and similar drawing applications with the tablet on it and it works quite nicely. I should also mention: when I plug it in, the lights turn on showing it is getting power, and when I click on the buttons, they work, but the tablet pad itself will not work at all... with the pen or by touch.


title: Installing R 3.1.1 (programming language) on debian wheezy

text: I want to learn and use R, and so I need to install it. Unfortunately, Wheezy got only 2.15 version, while I need 3.1.1. I followed these instructions:   http://cran.r-project.org/bin/linux/debian/   and added gpg keys, but after               apt-get update     apt-get install r-base r-base-dev      Debian is still installing 2.15. I wonder what I did wrong. I have used my country server (Poland).   Is there a way to install 3.1.1 on Wheezy other than from source?


title: Join two files with different number of columns and rows

text: I have two files. file_1.txt looks like this:               R1     C1     C2     C3     C4     C5     R2     C1     C2     C3     C4     C5     R3     C1     C2     C3     C4     C5     R4     C1     C2     C3     C4     C5     R5     C1     C2     C3     C4     C5     R6     C1     C2     C3     C4     C5     R7     C1     C2     C3     C4     C5     R8     C1     C2     C3     C4     C5     R9     C1     C2     C3     C4     C5     R10    C1     C2     C3     C4     C5      file_2.txt looks like this:               R4 C4 C5     R6 C4 C5     R7 C4 C5     R9 C4 C5      I would like to replace the C4 and C5 values in file_1.txt by those that correspond to them from file_2.txt, while keeping the C1, C2, and C3 values in file_1.txt unchanged. So the resulting file_3.txt should look like this:               R1     C1     C2     C3     C4     C5     R2     C1     C2     C3     C4     C5     R3     C1     C2     C3     C4     C5     R4     C1     C2     C3     C4_new C5_new     R5     C1     C2     C3     C4     C5     R6     C1     C2     C3     C4_new C5_new     R7     C1     C2     C3     C4_new C5_new     R8     C1     C2     C3     C4     C5     R9     C1     C2     C3     C4_new C5_new     R10    C1     C2     C3     C4     C5      All values are numbers. The first columns in file_1.txt and file_2.txt are key fields and are sorted in ascending numerical order. Is this something that join alone can do?


title: Best file system for removable media

text: Recently I had a SD card destroyed ( software wise ) on me. Basically as well as I can figure it out, all the metadata was wiped (ext4 card). This happened when I was working and suddenly had to write a check. I yanked the card I was working on, put in my "accounting card" wrote the checks, scanned them. pulled the "accounting card" put in the working card. As I start to work I see that my working card is labeled the same as my "accounting card". What I figure is that I forgot to unmount ( or thought I did, but it failed ) the "accounting card" replaced it, a random call to sync then overwrote my working card's metadata. This was a minor annoyance, but it got me to thinking about recovering data. If all the data about which sectors constitute a file is in the metadata. and the metadata is wiped then the file is gone. But if the file contains references to the blocks it uses then that file is not lost. This might not be practical on a hard drive though. For the most part the use cases on an SD card are much different from the use cases of a hard drive. Where on the hard drive you are often modifying files, on an SD card you tend to read files, write entire files and delete entire files. On occasion you modify files, but more rarely then you do on regular HDs. At least that is my usage. Also corruption modes of HD's and SD cards are different. HD's are corrupted when you have some sort of system crash, or when you have some sort of abrupt power off. SD cards are corrupted when you fail to unmount. If the file stores all it's own sector information, then it is less important if the metadata gets flushed. So is there a filesystem for SD cards where recovery is virtually gauranteed, and has reasonable overall performance?


title: Media server RAID difficulties (on FreeNAS)

text: _Disclaimer: I've never used FreeNAS or any type of RAID before, so this is a first._ I've decided to build a media server in my new apartment. I'm going to be going with a total 10TB of space (6x2TB discs in a RAID 5, unless I get recommendations to use another RAID). I've also decided to go with FreeNAS on a recommendation of a friend. Here are some of my issues regarding this setup:   * Seeing as buying 6 2TB drives is quite a bit of money, I was wondering how hard it would be to say start with 3 discs, wait until they are full, then add another disc to the array. Is this even possible with RAID5?   * My media is currently on 3 1TB drives (non-RAIDed). How straightforward is it to use FreeNAS to transfer files over? I assume I would have to set up my RAID first, then transfer the old files into it one hard drive at a time, right? Also, how would the above differ if I was using RAIDZ (I'm not quite sure how easy it is to set up)


title: Create tar archive of a directory, except for hidden files?

text: Here's a newb question. I'm wanting to create a tar archive of a specific directory (with its subdirectories of course). But when I do it, using the tar command, I get a list of files that were included, for example: > a calendar_final/._style.css > > a calendar_final/style.css As you can see, there are two versions of the same file. This goes for every file, and there are many. How do I exclude the temporary files, with the ._ prefix, from the tar archive?


title: How do you configure .inputrc so ALT+UP has the effect of cd

text: It should be possible to do that by having ALT+UP generate consecutive keyboard input equivalent to `c``d``space``.``.``ENTER` by means of a macro definition. But can't figure out how exactly to do it.


title: GIF screencasting; the UNIX way

text: To take a _static screenshot_ of a selected part of my screen, I often use `scrot` with `-s shot.png`. This is great for adding illustrations to StackExchange posts. I even found this script to automatically upload such a screenshot to _Imgur.com_ and put a link in my X clipboard! Let's turn this up to _twelve_: **How do I _similarly_ create a GIF screencast?** There _are_ programs like `recordmydesktop`, `byzanz` & co as discussed on Ask Ubuntu that aim to be "user friendly", but in my experience are buggy, inefficient, mostly unscriptable and unsuited for little one-off things like this. I just want to select an area and record a GIF, with a console command I can understand, not some arcane unscriptable GUI monstrosity. How can I do this?


title: How can I keep processes running on a remote server even after turning off the terminal machine?

text: ..and then still be able to return to the same session/screen after restarting the terminal machine. I've tried screen but once I restarted my computer screen -d showed no sessions. Nohup seems to be what I want, but then I lose the ability to see the output later on, other than by saving it to a file. Cannot I pretend more?


title: Archlinux bluetile failed to install "glade"

text: When I try to install bluetile in archlinux, I get the following error:                Building glade-0.12.1...      Preprocessing library glade-0.12.1...      gtk2hsC2hs: UName: root name supply used after saving      cabal: Error: some packages failed to install:      bluetile-0.6 depends on glade-0.12.1 which failed to install.      glade-0.12.1 failed during the building phase. The exception was:      ExitFailure 1      I'm using the ArchLinux Wiki install instructions.


title: How to set default printer settings without driver

text: I am not at all an expert Linux user, but I do network and applications support for an office technology company. One of our clients is a pharmacy which prints prescription labels through software called `RX30`. This software sits on a Linux server, and after a recent firmware update on the Konica Minolta bizhub printer which we service for them, the machine began counting the black and white RX labels as color. Unfortunately, we are not able to downgrade the firmware. I spoke with the support team at RX30, and they told me that they print via raw data dump over port 9100, and do not even use a driver. My question is this: is there a place in the Linux OS where I can set a "default" for this hardware **without** installing a driver?


title: Can I set up system mail to use an external SMTP server?

text: Is it possible to set up system mail on a linux box to be sent via a different smtp server - maybe even with authentication? If so, how do I do this? If that's unclear, let give an example. If I'm at the command line and type:               cat body.txt | mail -s "just a test" myfriend@hisdomain.com      is it possible to have that be sent via an external SMTP server, like G-mail ? I'm not looking for "a way to send mail from gmail from the command line" but rather an option to configure the entire system to use a specific SMTP server, or possibly one account on an SMTP server (maybe overriding the from address).


title: How can I generate email statistics from mutt header cache?

text: When configured accordingly (`set header_cache=`) mutt saves the mail headers in a cache file. That could be used to generate mail statistics. Does anybody know something about the file format? Are there any tools available to extract the information contained? (Besides `strings`, `grep`, `awk` and the like)


title: ndiswrapper wireless driver does not connect to detected Wifi network

text: I am running Slacko Puppy v5.3.1 and am trying to use my Wifi dongle with it. I have a Windows `.inf` file for the driver for my USB dongle. I used the Puppy network wizard to load the driver using `ndiswrapper`. It all seemed to be going well until I tried to configure my wireless network. The network is detected but I cannot connect. I cannot figure out why. Any suggestions? _Note_ : the installation CD came with code for Linux but I am having trouble trying this option, too.


title: Debian "sid"/Gnome: bash + browser cursor blink

text: I'm struggling to make the cursor in bash stop blinking. Also, the cursor in Iceweasel has started blinking again, but, for some reason, a lot slower than in bash :) I got those problems since I upgraded to sid, so probably some configuration files were overwritten. I tried everything in How to stop cursor from blinking - nothing worked, probably because that was about tty, not bash. This did not work (that is, setting the flags worked, just didn't do anything to the cursors):               gconftool --search-key cursor_blink      /desktop/gnome/interface/cursor_blink = false      /schemas/desktop/gnome/interface/cursor_blink = false      This did work, but only to make the cursor visible and invisible, it didn't stop the blink:               tput cvvis      This did not work:               echo -n -e '\e[?17;14;224c'     printf '\033[?12l'      My PS1 looks like this (added `\033[?17;0;127c`):               PS1="\033[?17;0;127c\\[$(tput setaf 3)\\]\u \\[$(tput setaf 4)\\]\w: \\[$(tput sgr0)\\]"      This is already set to zero:               /sys/class/graphics/fbcon/cursor_blink      Any more ideas?


title: Fresh Arch Install, no install issues, freezes at random points on the initial boot

text: I just finished installing Arch on my laptop to a second hard drive, had no issues at all during the install, but when I went to actually reboot into Arch it freezes at different points. The first time it froze at Starting Bluetooth, the next time it froze at Kernel Device Manager and the third time it froze at asus backlight modules. I've left it sitting there for over an hour and still got nothing from it. Any ideas on what could be causing this? I've got no clue where to even begin diagnosing this problem because of the fact it freezes at random places. The laptop in question is an ASUS G75VW with Arch on the HDD formatted as GPT with the correct EFI partitions, etc.