Is it correct to set the $TERM variable manually?

I set the `$TERM` variable adding the line `XTerm*termName: xterm-256color` to my `.Xresources` file. When I did it I didn't know what exactly that meant (I was following an online guide to change the look of `xterm`), but now I have read a little more and am concerned if what I did was wrong. Specifically I want to know there is something bad in setting the `$TERM` variable manually, and in case it is, how can I revert my mistake. In case you need, I'm running Fedora 20 with `xterm`.


Make a failed SSH forward a fatal error

I have a script which connects to a remote host to replicate some files via SSH. I must connect to an rsync daemon listening on port 873. To accomplish this I have a ssh configuration like this.               Host blah         LocalForward 10873 127.0.0.1:873         Hostname 10.2.4.1      Unfortunately because of the timing of this script, there is a small chance that on occasion when it attempts to establish the SSH session another similar script will have the port open to a different host. If I connect while another ssh session is open I get the obvious message **Address already in use**.               me@local:~$ ssh blah     bind: Address already in use     channel_setup_fwd_listener: cannot listen to port: 10873     Could not request local forwarding.     Linux remote 2.6.26-2-amd64 #1 SMP Tue Jan 25 05:59:43 UTC 2011 x86_64     motd...     remote:~$       What I want to have happen is to have the SSH client immediately exit with a exit code so I can put some logic into my script to report a failure instead of trying to run any commands against the port forwarded to the incorrect host.


Cannot rotate screen in Debian Squeeze

I have 2 monitors which can rotate physically. They are working fine right now as non-mirrored, dual monitors. I went to System -> Preference -> Monitors and tried to rotate the screens. As soon as I click Apply, I appear at the log in screen as if I just logged out. Does anybody know what might be going on? Here are some lines that might be relevant in `/var/log/Xorg.0.log`.               (--) PCI:*(0:1:0:0) 1002:9552:1458:21ac ATI Technologies Inc M92 LP [Mobility Radeon HD 4300 Series] rev 0, Mem @ 0xd0000000/268435456, 0xfe9f0000/65536, I/O @ 0x0000c000/256, BIOS @ 0x????????/131072     ...     (--) RADEON(0): Chipset: "ATI Mobility Radeon 4300 Series" (ChipID = 0x9552)     ...     (II) RADEON(0): RandR 1.2 enabled, ignore the following RandR disabled message.     (--) RandR disabled      There's also the `gdm3` service running if that helps.


Xorg key clicks?

I've currently got Fedora 9 on my home PC (yes, I know its quite old - but hell I only reboot it every 6 months - nevermind upgrading!) . My only niggle is that keyboard I've got has quite a different feel / lyaout to the one I use everyday in work. To make life a bit simpler, I tried to enable the audio feedback. I first tried the setting in KDE (4.2) System settings - to no avail. I also tried 'xset c 100' but still nothing. The ALSA inerface seems to have no problems producing audio output from mplayer, xine, amarok.... and kmixer works as expected. Looking at the Xorg man pages there's nothing obviously jumping out here. Any ideas?


Accessing VirtualBox guest via VPN

I've searched and tried a few suggestions but I haven't been able to get this to work, yet... My host is running Ubuntu. I installed VirtualBox, created a host-only adapter, set the host IP to 192.168.15.1, and I switched off the adapter's DHCP server. Then I created the guest (Win XP), and set the IP to 192.168.15.101/24 and set the DG to 192.168.15.1 I can ping from the Host to the Guest and vice versa. Then I installed OpenVPN on the host. Created my own CA, server certs/key and client cert/key. Set the OpenVPN server conf to PUSH the 192.168.15.0/24 route to any VPN clients. I set my router to forward UDP 1194 to the OpenVPN server and tested the connection. The OpenVPN client is Debian running on another laptop. Once the VPN tunnel is established the VPN Client (10.8.0.6) can ping the VPN Host (10.8.0.1) and vice versa. The Client can also ping the Hosts 'host-only' IP at 192.168.15.1 with no issues. My problem is getting the Open VPN Client (10.8.0.6) talking to the VM Guest (192.168.15.101). I don't think the VM Guest (XP) is aware that the VPN Client exists, it has no way to route traffic/responses to 10.8.0.6. Can you 1) tell me what step(s) I'm missing and 2) how to fix this? Thanks. IPTABLES output from the OpenVPN server / VirtualBox host...               root@xxxxxxxxxxxx:~# iptables -L -nv     Chain INPUT (policy ACCEPT 48 packets, 53304 bytes)      pkts bytes target     prot opt in     out     source               destination                   Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)      pkts bytes target     prot opt in     out     source               destination                   Chain OUTPUT (policy ACCEPT 35 packets, 2992 bytes)      pkts bytes target     prot opt in     out     source               destination      **SOLUTION** The missing piece was ip forwarding. I needed to edit /etc/sysctl.conf and change this:               # Uncomment the next line to enable packet forwarding for IPv4     #net.ipv4.ip_forward=1      to this               # Uncomment the next line to enable packet forwarding for IPv4     net.ipv4.ip_forward=1      Thanks Hauke Laging!


Execute a script as root at boot on Fedora 15/16

I try to run a script (tpfand) at startup, and it asked to be root to execute it. This is a script to control the fans on Thinkpad computers. Despite several attempts, I could not get ...


How to get nano to work properly under mutt?

I have set nano as the default editor in mutt; mutt launches nano normally enough, but when I try to send the message (ie. save and quit, separately) mutt says the message has been aborted. Any idea on how to fix this?


Removing apostrophe from all file names

I tried to remove apostrophe from all files' names in the directory.               for i in *; do mv $i `echo $i | tr -d "'"`; done      After executing this command nothing is renamed. Do you know what's wrong here?


File name encoding wrong in KDE, but correct in GTK/tty1/

I'm on a new Linux (installed yesterday). When I access files from old partitions their file names have incorrect encoding (Ã¤ instead of ä, same for other umlauts) inside KDE apps like dolphin and konsole. All characters look correct when I display them in tty and GTK apps. (And they obviously also did so on the old system.) How can I make KDE4 show the file names correctly? * * * Edit: So now I «fixed» this by re-installing the system. No idea what the problem was. **To get the keyboard right** everywhere (tty, KDM login screen, KDE) I had to run               dpkg-reconfigure locales       # Kept only (de_CH|en_US|ru_RU).UTF-8                                    # Selected de_CH.UTF-8 as default     dpkg-reconfigure console-data  # Selected German (Switzerland)      dpkg-reconfigure keyboard-configuration                                     # Selected my 105-key Cherry CyMotion Xpert                                     # AltGr on right Alt, no Compose key      Running keyboard-configuration first does not work since those settings are specific to the default keyboard selected in locales; for en_* e.g. there is no AltGr and no compose key. (Debian based system.)


build-dep firefox not working on Linux Mint

I'm on the latest Linux Mint 12. In order to compile Firefox I need to do a               sudo apt-get build-dep firefox      which isn't working and showing the following error:               $ sudo apt-get build-dep firefox     [sudo] password for michael:     Reading package lists...     Done Building dependency tree     Reading state information... Done     E: You must put some 'source' URIs in your sources.list      I remember that this worked out of the box in Ubuntu. Which URL do I need to specify in sources.list? Am I doing something else wrong?


Solaris "clean" group files (or for that matter any text file)

I am looking to find a way to script a cleaning operation on the /etc/group file on a large number of servers. Looking for users in a particular group more than once. i.e. somegroup::100000:userA, userB, userC, foo, bar, snafu, userB, userB Obviously for a small group this is easy and can be done manually, but I have some group files with large numbers of groups and entries. I thought about writing it up in java since it should be pretty easy, but I would prefer finding something in perl or shell. Thanks! Sean


Unable to load module: Disagrees about version of symbol module_layout

Following this tutorial to write my first driver. The Makefile is:               # Makefile – makefile of our first driver          # if KERNELRELEASE is defined, we've been invoked from the     # kernel build system and can use its language.     ifneq (${KERNELRELEASE},)         obj-m := ofd.o     # Otherwise we were called directly from the command line.     # Invoke the kernel build system.     else         KERNEL_SOURCE := /usr/src/linux 3.8         PWD := $(shell pwd)     default:         ${MAKE} -C ${KERNEL_SOURCE} SUBDIRS=${PWD} modules          clean:         ${MAKE} -C ${KERNEL_SOURCE} SUBDIRS=${PWD} clean     endif      And the driver code is :               * ofd.c – Our First Driver code */     #include <linux/module.h>     #include <linux/version.h>     #include <linux/kernel.h>          static int __init ofd_init(void) /* Constructor */     {         printk(KERN_INFO "Namaskar: ofd registered");         return 0;     }          static void __exit ofd_exit(void) /* Destructor */     {         printk(KERN_INFO "Alvida: ofd unregistered");     }          module_init(ofd_init);     module_exit(ofd_exit);          MODULE_LICENSE("GPL");     MODULE_AUTHOR("Anil Kumar Pugalia <email_at_sarika-pugs_dot_com>");     MODULE_DESCRIPTION("Our First Driver");      There is no error during make. But when I use `insmod ofd.ko` I'm unable to load it. In `dmesg` it says: > disagrees about version of symbol module_layout   * `uname -r` returns '3.8.0-38-generic' and the kernel source also 3.8.   * `modprobe -f ofd.ko` also fails  Also:               #56~precise1-Ubuntu SMP Thu Mar 13 16:23:47 UTC 2014     $ lsb_release -a     No LSB modules are available.     Distributor ID: Ubuntu     Description:    Ubuntu 12.04.4 LTS     Release:    12.04     Codename:   precise      What is happening?


Is it possible to mount an NFS partition with a label?

I export 3 directories via NFS (pisces:/media/music, pisces:/media/video, pisces:/media/photo) that I mount individually. Currently, they all appear on my (Ubuntu) Gnome desktop as 'pisces', which is less than useful. The doc seems to indicate that the `-LABEL` switch isn't supported for NFS `mount`; is there some other way of labeling the mounts? The directories are mounted using `/etc/fstab` (unfortunately I don't have access to that machine right now, and can't remember the options; it is pretty close to the defaults though). ta, \-- peter


What file systems support taking snapshot backups from a live system?

What file systems allows me to take a full snapshot of a full live partition, while active, in a state where all files have the same state as when the backup/snapshot process start ? I want to be able to make full backups of live database by copying the files, and the files are constantly being modified, and a simple copy `cp -rf` to all files always leave different files in inconsistent state.


Hugin 2012 build fail on Gentoo

My system is Gentoo amd64, up to date.               [I] dev-libs/boost      Available versions:  1.49.0-r2 (~)1.52.0-r6(0/1.52) (~)1.53.0(0/1.53) [M](~)1.54.0(0/1.54) {debug doc icu mpi +nls python static-libs +threads tools PYTHON_TARGETS="python2_5 python2_6 python2_7 python3_1 python3_2 python3_3"}      Installed versions:  1.53.0(10:17:32 PM 08/19/2013)(icu nls python threads -debug -doc -mpi -static-libs -tools PYTHON_TARGETS="python2_7 python3_2 -python2_5 -python2_6 -python3_1 -python3_3")      Homepage:            http://www.boost.org/      Description:         Boost Libraries for C++      My `boost` is already compiled with `threads` USE flag. But I still got this error when compiling `Hugin`.               ../hugin_base/libhuginbase.so.0.0: undefined reference to `boost::thread::join()'     ../hugin_base/libhuginbase.so.0.0: undefined reference to  boost::thread::start_thread()'     collect2: error: ld returned 1 exit status      Some people suggests downgrade `boost` to 1.47...but it is no longer in the portage.


How to display lines 2-4 after each grep result?

I'm parsing a mailbox file that stores e-mail server reports for unsuccessfully delivered e-mail. I wish to extract bad e-mail addresses, so that I remove them from the system. The log file looks like this:               ...some content...                        The mail system          <slavicatomic118@hotmail.com>: host mx1.hotmail.com[65.54.188.94] said: 550         Requested action not taken: mailbox unavailable (in reply to RCPT TO         command)          ...some content...                        The mail system          <oki88@optimumpro.net>: host viking.optimumpro.net[79.101.51.82] said: 550         Unknown user (in reply to RCPT TO command)          ...some content...                        The mail system          <sigirna_luka@yahoo.com>: host mta5.am0.yahoodns.net[74.6.140.64] said: 554         delivery error: dd This user doesn't have a yahoo.com account         (sigirna_luka@yahoo.com) [0] - mta1172.mail.sk1.yahoo.com (in reply to end         of DATA command)          ...etc.      E-mail address comes 2 lines after a line with "The mail system". Using grep like this gives me the "The mail system" line and the next two lines:               grep -A 2 "The mail system" mbox_file      However, I don't know how to remove the "The mail system" line and the second empty line from this output. I guess I could write PHP/Perl/Python script to do it, but I wonder if this is possible with grep or some other standard tool. I tried to give negative offset to -B parameter:               grep -A 2 -B -2 "The mail system" mbox_file      But grep complains:               grep: -2: invalid context length argument      Is there a way to do this with grep?


How/Why does cat write a bootable ISO to a device

I recently discovered that I can create a bootable USB key from an ISO file by simply using `cat` (or `dd`). I can't find any information on how this works. Why would:               cat my.iso > /dev/sdb && sync      take that file and write all the files it contains, in bootable format, to a device?


transfer permissions user -> group/other

How do I transfer write/execute and execute permissions from _owner_ to _group_ and _other_ , respectively? I have some libraries I want to move to _opt_ and set ownership of to _root_. Unfortunately, permissions are a bit messed up for _group_ and _other_ , and that creates a problem as _group_ and _other_ cannot use the libraries, call the executables and read the files. I want to recursively set the permissions of write/execute and execute to _group_ and _other_ respectively. For example, I want this:               -rw-r--r--.   1 root root    4464 Jan 11 23:58 CPackSourceConfig.cmake     -rwxr--r--.   9 root root   28672 Jan 11 23:58 executable     drwxr--r--.   9 root root   28672 Jan 11 23:58 Source      to be this:               -rw-rw-r--.   1 root root    4464 Jan 11 23:58 CPackSourceConfig.cmake     -rwxrwxr-x.   9 root root   28672 Jan 11 23:58 executable     drwxrwxr-x.   9 root root   28672 Jan 11 23:58 Source      How do I best go about doing this, considering there are quite a number of files/folders (recursive)?


ERROR: Failed to build gem native extension on Arch (postgresql)

I can't install `gem pg` on Arch due to the error:               Gem::Ext::BuildError: ERROR: Failed to build gem native extension.              /home/alex/.rvm/rubies/ruby-2.1.1/bin/ruby extconf.rb      checking for pg_config... no     No pg_config... trying anyway. If building fails, please try again with      --with-pg-config=/path/to/pg_config     checking for libpq-fe.h... no     Can't find the 'libpq-fe.h header     *** extconf.rb failed ***     Could not create Makefile due to some reason, probably lack of necessary     libraries and/or headers.  Check the mkmf.log file for more details.  You may     need configuration options.          Provided configuration options:         --with-opt-dir         --without-opt-dir         --with-opt-include         --without-opt-include=${opt-dir}/include         --with-opt-lib         --without-opt-lib=${opt-dir}/lib         --with-make-prog         --without-make-prog         --srcdir=.         --curdir         --ruby=/home/alex/.rvm/rubies/ruby-2.1.1/bin/ruby         --with-pg         --without-pg         --with-pg-config         --without-pg-config         --with-pg_config         --without-pg_config         --with-pg-dir         --without-pg-dir         --with-pg-include         --without-pg-include=${pg-dir}/include         --with-pg-lib         --without-pg-lib=${pg-dir}/lib          extconf failed, exit code 1          Gem files will remain installed in /home/alex/.rvm/gems/ruby-2.1.1/gems/pg-0.17.1 for inspection.     Results logged to /home/alex/.rvm/gems/ruby-2.1.1/extensions/x86_64-linux/2.1.0/pg-0.17.1/gem_make.out      even so I've installed `sudo pacman -S libmariadbclient`. I've had this error on Ubuntu, but there I was able to solve it by install pgdev (I don't remember exactly) library. The fact is, this library doesn't exist for arch in its repository or it's called differently.


Tri-booting Windows, Ubuntu, and SUSE

I have just bought a new laptop (Packard Bell EasyNote TM 87) which has Windows 7 preinstalled. There are already two partitions labelled PQSERVICE, SYSTEM RESERVED and Packard Bell C:. I cannot remove this Windows installation because I don't have a copy of the Windows-only recovery DVDs. I want to tri-boot Windows, Ubuntu, and SUSE. First, I created an extended partition using `gparted` with two partitions and was left with some unallocated space. I installed Ubuntu in the extended partition by creating `/` and `/home` logical partitions. Now I want to install SUSE in the unallocated space. The SUSE 11.3 live CD does not list that unallocated space. What should I do?


IFS null is not the same as unset IFS?

I read a great question on here called Understanding IFS. I was surprised because the answers and comments quote POSIX which states that IFS= is not the same as unsetting IFS. If you unset IFS, apparently the default value is used. If you make IFS null instead, there is no splitter. I knew I had seen a different take on that, and I found this in my bookmarks: Bourne Shell Programming > $IFS > > The very first statement in your script should be > > IFS= > > which resets the input field separator to its default value. Otherwise, you > inherit $IFS from the user, who may have set it to some bizarre value in > order to make sh parse strings differently from the way you expect, and > induce weird behavior. So was that true some time ago or is the author just wrong?


Local disks detected as multipath device

My local partitions are detected as multipath device               $multipath -l          mpathb (360014380125d90420000a000003e0000) dm-9 HP,HSV450     size=200G features='1 queue_if_no_path' hwhandler='0' wp=rw     `-+- policy='round-robin 0' prio=0 status=active     `- 3:0:0:1 sdb 8:16 active undef running     mpatha (3600508b1001c02143bc59c6862d97353) dm-0 HP,LOGICAL VOLUME     size=137G features='1 queue_if_no_path' hwhandler='0' wp=rw     `-+- policy='round-robin 0' prio=0 status=active     `- 0:0:0:1 sda 8:0  active undef running      I added the following lines in multipath.conf so that local partitions are not detected as multipath device               blacklist {        wwid 3600508b1001c02143bc59c6862d97353     }      Executed the following commands after that .               #service multipathd reload          # multipath -F     Oct 22 12:10:42 | mpathb: map in use     Oct 22 12:10:42 | mpatha: map in use      Is reboot of the server will resolve the issue ? It is a production server , so I have to take downtime before going ahead with reboot.


less follow mode - clear screen

I use `less` follow mode (Shift-F) to follow a log as it is updated. Sometimes it would be useful to do some actions on my system, and then only see log output related to that action. Basically I would need some way to clear the buffer so I'm not distracted by old stuff. I can't find anything about it on the man page, but maybe there is some trick?


Concatenate a folder's Java files, with a header for each file

I have an obligation to provide a document which just contains every source code file, with the file's name before each file. Example:               =============================     src/com/example/Factory.java     =============================          public class Factory {     ...     }          =============================     src/com/example/Worker.java     =============================          public class Worker {     ...     }      It must contain all *.java files in the current folder, recursively. How to easily generate such a file, using commonly available commands or a small script?


What tool can I use to sniff HTTP/HTTPS traffic?

I'm looking for a command line tool that can intercept HTTP/HTTPS requests, extract information such as: (content, destination, etc.), perform various analysis tasks, and finally determine if the request should be dropped or not. Legal requests must than be forwarded to the application. A tool that is similar in nature to `tcpdump`, Wireshark, or Snort, but operates at the HTTP level. ### References   * Intercept HTTP requests on Linux


cp all files and subdirectories in a directory ksh

How can I do a `cp` to copy all files including all sub-directories in the current directory. I looked at the man page, but I can't figure out how to do it.


Receiving Syslog messages with a systemd Arch Linux

I'm feeling like I've overlooked the obvious, but I can't figure out how to get my Arch Linux server, which uses `systemd`, to receive and log `syslog` messages from a remote system. I have a Cisco 678 DSL modem, and it can be configured to send syslog-format messages to some other machine. I'd like that machine to be my Arch Linux server. I've googled around, and all I find is that "systemd replaces syslog", or that I no longer need to run `syslog` or something equally irrellevant to my question. **UPDATE** I have asked on the Arch forums (http://bbs.archlinux.org) and gotten no relevant answers. I've installed `syslog-ng` just to listen on UDP port 514. `syslog-ng` writes messages from my Cisco 678, and a DD-WRT WAP I've got. Unfortunately, the messages don't end up in `systemd`'s journal, but rather in flat files. So, no exact solution, but something of a workaround. I'd rather have the syslog messages in the journal, not in flat files.


Recover Linux ext4 partition formatted to hfs+

I have a Linux partition formatted to ext4 and I accidentally formatted it with Mac OS X Disk Utility to HFS+ (Mac OS X Extended Journaled). I tried to recover it with http://www.r-studio.com/ on Windows but I can't get any files except few from trash or temporary browser files. Now I'm trying another software on OS X: http://www.stellarinfo.com/mac-data- recovery.htm, however it takes some time to scan partitions. Any ideas how to recover that partition? Should I recover it on Linux or Mac?


rpmbuild library register for 'requires'

Big Picture: I am building an in-house rpm for a customized php. I build an rpm which works, but generate library requirements that I can't seem to meet without using 'nodeps', which I want to avoid to ensure other requirements _are_ met in future usage. The cause of This Problem: (As usual in linux it comes down to proprietary software)... is the Oracle client library. The RPM I built for it is not registering its 'provide' correctly so that RPM understands that it provides this library capability.               %prep     %setup -q -n %{shortname}-%{version}          %build          %install     mkdir -p %{buildroot}/%{prefix}     mkdir -p %{buildroot}/%{_sysconfdir}/profile.d     mkdir -p %{buildroot}%{_sysconfdir}/ld.so.conf.d          cp -a %{_builddir}/%{shortname}-%{version} %{buildroot}/%{prefix}/          %{__install} -m 644 -p %{SOURCE1} \        $RPM_BUILD_ROOT%{_sysconfdir}/profile.d/oracle-instantclient.sh     echo %{prefix}/%{shortname}-%{version}>%{buildroot}%{_sysconfdir}/ld.so.conf.d/%{name}.conf     rm -fv /opt/%{shortname}-%{version} /opt/%{shortname} /thisDir/%{shortname}-%{version} /thisDir/%{shortname}     ln -sv %{prefix}/%{shortname}-%{version} /opt/     ln -sv /opt/%{shortname}-%{version} /opt/%{shortname}     ln -sv %{prefix}/%{shortname}-%{version} /thisDir/     ln -sv /thisDir/%{shortname}-%{version} /thisDir/%{shortname}     chown -h user:user /opt/%{shortname}-%{version} /opt/%{shortname} /thisDir/%{shortname}-%{version} /thisDir/%{shortname}          %clean     rm -rf %{buildroot}          %files     ###%defattr(-,root,root,0755)     %{prefix}/%{shortname}-%{version}     /%{_sysconfdir}/profile.d/%{name}.sh     /%{_sysconfdir}/ld.so.conf.d/%{name}.conf          %post -p /sbin/ldconfig          %postun     rm -f /%{_sysconfdir}/profile.d/%{name}.sh /%{_sysconfdir}/ld.so.conf.d/%{name}.conf     rm -rfv /opt/%{shortname}-%{version} /opt/%{shortname} /thisDir/%{shortname}-%{version} /thisDir/%{shortname} %{_sysconfdir}/profile.d/%{source1}     ldconfig     rm -rf %{prefix}/%{shortname}-%{version}     rm -fv /opt/%{shortname}-%{version}     rm -fv /opt/%{shortname}     rm -fv /thisDir/%{shortname}-%{version}     rm -fv /thisDir/%{shortname}     rm -fv %{_sysconfdir}/profile.d/%{name}.sh     /sbin/ldconfig      Most of this is just script providing symlinks we use for standard locations across our environment; the functional part is the ldconfig. What am I doing wrong to ensure that rpmbuild picks up the 'provides'? I'm having a very hard time finding documentation on how this works in contemporary rpmbuild in Cent6.


How can I tell why a process is waiting?

I'm trying to run a command on OSX Mavericks and it seems to be hanging. I found out that `Control + T` is a Unix command to show the status of a foreground job. Pressing it several times over the course of **several minutes** gives me:               $ bin/rake                                                                                load: 3.68  cmd: ruby 55761 waiting 0.12u 0.02s     load: 3.47  cmd: ruby 55761 waiting 0.12u 0.02s     load: 3.47  cmd: ruby 55761 waiting 0.12u 0.02s     load: 3.09  cmd: ruby 55761 waiting 0.12u 0.02s     load: 2.41  cmd: ruby 55761 waiting 0.12u 0.02s     load: 4.38  cmd: ruby 55761 waiting 0.12u 0.02s      I understand this to mean that the status is "waiting", it has spent .12 seconds of user time and only 0.02 seconds of CPU time executing. I want to find out why it's stuck waiting. **How can I determine why a process is waiting**?


Shell script to execute a command with iteration

This is a script which looks for `.tab` files in a folder an should imports them with `ogr2ogr`, but I fail with the correct bracing.               for i in $( ls *.tab )     do       echo item: $i            ogr2ogr -f PostgreSQL -s_srs EPSG:21781 -t_srs EPSG:4326 -overwrite \               -nln $TBL_NAME PG:'"host=localhost user='$DBUSER' dbname='$DBNAME'"' $i     done      And I need a command line to execute the `ogr2ogr` section in this way:               ogr2ogr -f "PostgreSQL" -s_srs "EPSG:21781" -t_srs "EPSG:4326" -overwrite \             -nln "geom_tour" PG:"host=localhost user=postgres dbname=gis" DMC_34093.tab


Does input redirection (<) append a newline character?

I was originally of the impression that               $ ./myprog     moo[CTRL-D]      is exactly the same as               $ echo moo > cow     $ ./myprog < cow      But I found that `myprog` always counts one more `\n` in the second version than in the first. Why is this? Turns out `wc` does the same thing...               $ wc -l     moo[CTRL-D]0      (Apparently zero lines is possible?)               $ echo moo > cow     $ wc -l < cow     1      Can anyone explain this to me?


How can I get the tac command on OS X?

I like to use `tac` to reverse the output of `cat`. However, it's not available in the Mavericks terminal. I tried to find it on MacPorts and again it's not available. Can anyone please show me how to get `tac`? It's very helpful for reading log files.


Can I use scrypt to hash for LUKS?

Can scrypt be used as the hashing algorithm for LUKS? Can I tune its parameters? How can I do this?


squid 3.1.11-1 - POST issues

I have an issue with my squid on the website : http://www.draw.io I have one schema and I am not able to export it as a PNG (I got a white page on the web browser like the website didn't answer.) Without using squid export is working fine. I look at the logs and here is what I found : When not working I got : 1376985774.106 0 127.0.0.1 TCP_DENIED/407 4366 POST http://exp.draw.io/ImageExport2/export \- NONE/- text/html When I delete some stuff on my design it works : TCP_MISS/200 76269 POST http://exp.draw.io/ImageExport2/export hugo @domain.LOCAL DIRECT/199.38.86.62 application/x-unknown For me it seems related to the post size. Should I modify something in my squid configuration ? (which is pretty basic).


How to use find command to search for multiple extensions

I can get all `jpg` images by using:               find . -name "*.jpg"        But how can I add `png` files to the results as well?


How do font managers work in Fedora?

I am looking to do some font management on my Fedora system. I have installed both Font Manager and Fontmatrix. My goal was to be able to have more fonts installed than I wanted displayed, and to be able to enable/disable fonts (or groups thereof) whenever I wanted to. Both programs claim to enable or disable fonts. I can't seem to get Fontmatrix to do anything other than be a comprehensive font information source (glyphs, etc.) The enable/disable doesn't appear to work, and the documentation is less than helpful. I am able to disable/enable fonts in Font Manager. I had to recreate my Gnome settings, though, because I accidentally disabled all fonts, and even re- enabling them did not fix my panel fonts. There wasn't anything I could do, short of removing my local configuration and logging out/in, that would get those fonts back. So. What exactly do these programs **do** when they disable a font? And what trashed my panel fonts? I know Monospace was still installed/enabled, and nothing I could do would change the panel information. Thanks in advance!


Preemptive kernel and Physical Address Extension

Is there anyone that can tell me why, on a preemptive kernel, PAE would not work? This question is an exam question, however I haven't got a clue why it would not work.


Putty-like "Session Log" for gnome-terminal?

Is there a log feature for `gnome-terminal` like the "session log" in Putty? I want to log whatever I have typed in the gnome-terminal. I don't want to use `pterm` under Linux, I just want a `gnome-terminal`. See an example log here.


How come I suddenly don't have any audio?

Just a few minutes ago my sound was working, and then it stopped! I suspect it was caused by me checking out some video editors. How do I go about troubleshooting this? What I've so far tried:   * I ran `lsof | grep audio` and `lsof | grep delete` to see if there's any process locking the audio path(?), but nothing looks suspect.   * VLC and MPlayer are affected, while Quod Libet (GStreamer) isn't. [ **update** ] Strange one. I don't know if it has anything to do with Quod Libet, but I noticed that after closing (and reopening) it, the problem seemed to disappear. Note that I haven't logged out yet.


What's the difference between e2fsck and fsck and which one I should use?

I got this error message when running dmesg               EXT3-fs (sdd1): using internal journal     EXT3-fs (sdd1): mounted filesystem with ordered data mode     EXT4-fs (sda1): warning: mounting fs with errors, running e2fsck is recommended     EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts:     EXT4-fs (sdb1): warning: maximal mount count reached, running e2fsck is recommended     EXT4-fs (sdb1): mounted filesystem with ordered data mode. Opts:     EXT4-fs (sdc1): warning: maximal mount count reached, running e2fsck is recommended     EXT4-fs (sdc1): mounted filesystem with ordered data mode. Opts:     Adding 4194296k swap on /dev/sdd2.  Priority:-1 extents:1 across:4194296k SSD     kjournald starting.  Commit interval 5 seconds     EXT3-fs (loop0): warning: maximal mount count reached, running e2fsck is recommended     EXT3-fs (loop0): using internal journal      sdd seems to be running fine. That's the main partition. sda to sdc doesn't work. Should I umount and fo fsck? But which fsck I should use? e2fsck? e4fsck? Which one? I am using ext4 here. I have no idea what loop0 is. Looks like the system is pretty badly set up. EXT3-fs (loop0): mounted filesystem with ordered data mode I've heard I can do shutdown -rf . Someone have done that. The system is back online but I still got this message. What gives?


Pointers in Learning Linux 0.01 Source code

I am trying to learn some real programming in C and the concepts of Linux. So i thought i will try by looking at the Linux kernel 0.01 version source. In my understanding, I could find the scratch level implementation of many things, but the comments are very few. For example :               void rs_init(void)     {         set_intr_gate(0x24,rs1_interrupt);         set_intr_gate(0x23,rs2_interrupt);         init(tty_table[1].read_q.data);         init(tty_table[2].read_q.data);         outb(inb_p(0x21)&0xE7,0x21);     }      There seems to be no comments about the registers or the function.   I know the implementation will provide some idea, but I would like to know, if I should keep some reference so that the values and the names give me a better meaning and understanding. Please offer some pointers.


recovering /home folder from faulty drive

I was going to try ddrescue to recover data from a faulty (beeping) laptop drive and a primary ext4 partition. Reducing the number of reads from the disk should reduce the recovery time and increase the chances of successful recovery, so I would like to only recover /home, and exclude all the non-critical subfolders, like /tmp or /home/guest/Downloads. I can`t find any option to only recover subfolders in the ddrescue manual, though. Maybe there are other better suited tools for selective data recovery which could maybe display the file system structure, and let me check/uncheck what to recover before starting? I had used a similar tool in the MSDOS era, so I`m not sure about the best tool for ext4 nowadays. Open source tools for Linux would be preferred, if possible.


how to write a startup dependency on Internet availability?

Some of the services on my Raspberry Pi (~ Debian) depend on the availability of Internet (especially `ntpd`, for cryptic reasons). Specifically, the availability of a network device or a link being up is not enough. When looking at `/etc/init.d/ntp` I see               ### BEGIN INIT INFO     # Provides:        ntp     # Required-Start:  $network $remote_fs $syslog     # Required-Stop:   $network $remote_fs $syslog     # Default-Start:   2 3 4 5     # Default-Stop:     # Short-Description: Start NTP daemon     ### END INIT INFO      which I believe means that `ntp` depends on `$network` to be able to start. I found a reference in `/etc/insserv.conf` but it does not say much about what is actually required to set it up:               #     # Low level networking (ethernet card)     #     $network        +networking +ifupdown      **Q1:** How exactly is `$network` defined via the `+networking +ifupdown` elements? (so that I can modify it and try to reach an actual host before declaring the network as 'up') **Q2:** If the network prerequisite is not met will the `ntp` start be delayed or will it fail?


How do I find seconds since midnight?

Using the `date` program, how can I calculate the number of seconds since midnight?


Disabling lid-closure sleep while on battery in Debian Squeeze

How do you disable lid-closure sleep at the GDM screen (not logged in) on Squeeze?


How to monitor incoming http requests

How can I monitor incoming `HTTP` requests to port `80`? I have set up web hosting on my local machine using `DynDNS` and `Nginx`. **I wanted to know how many request are made on my server every day.** Currently I'm using this command:               netstat -an | grep 80


Repeat the nth last command in vim

I've noticed vim can be pretty intuitive, but I'm having trouble finding a way to repeat the second-to-last command (or third-to-last, fourth-to-last, etc.). By typing `.` in normal mode it will repeat the last command. Pressing `3.` will repeat the last command three times. Let's say I type `oHello<Esc>` then `A, World!<Esc>`. I now get               Hello, World!      on the screen. Now, say I want to get               Hello, World!     Hello     Hello     Hello      without typing Hello. Does vim store the history beyond one command, so I could type something like `3,2.` (i.e. repeat the second-to-last command three times)?


How to use the pipe command to open a directory after find?

Is there a way to opend found directories (via `find`) all in one command? One of the things I tried to study several times and never been able to really get, is the effective use of pipe: is it maybe useful for this? I tried things like:               find . -type d -name ".dir-name" | open      but it doesn't work. `open` is the OSX command to open a file in the associated application (Finder for directories).


Move huge number of files into date structured directory order

I have about 1 million files in this directory: `/home/username/images/` Each of the files are called something like: `012345678910(Place)_0_20120414185957_28841.jpg` with the timestamp part of the filename changing on each picture. The code below contains code to sort/move the files into this date structure: `/home/username/sorted/2012/04/14/18/name_of_file.jpg` For a small sample of files it works fine, but for the huge directory my putty terminal gets disconnected after outputting               Directory $newdir does not exist.  Creating same.      I had other code which always died with the error code `argument list too long`. Here is the code:               #!/bin/bash     ALLFILES=(images/*)     for ((i=0; i<${#ALLFILES[*]}; i+=30000));     do         set $(echo "${ALLFILES[@]:i:30000}" | awk -F_ '{print $1, $2, $3, $4, $5}')         fullyear=$3         year=$(echo $fullyear |cut -c1-4)         month=$(echo $fullyear |cut -c5-6)         day=$(echo $fullyear |cut -c7-8)         hour=$(echo $fullyear |cut -c9-10)         newdir=$(echo /home/username/sorted/$year/$month/$day/$hour/)         if ! [ -d $newdir ]; then             echo Directory $newdir does not exist.  Creating same.             mkdir -p $newdir;         fi         mv "${ALLFILES[@]:i:30000}" $newdir;     done      Any ideas why the connection will not hold while performing the large loop?


Saxon rpm build fails due to "ant: command not found"

Hopefully this is a question I can ask this community. I'm currently working on building zookeeper-3.4.5-13 for a CentOS 5 environment. During this process I've been going down a long list of required packages ( mockito -> objenesis -> maven -> maven2 -> classworlds -> dom4j -> jtidy-> ant -> jakarata-common- net -> saxon ) and I'm running into an issue building saxon-6.5.5-3.3. When I build, I get to the %build section of the process and end up erring out with the following:               DEBUG: + exit 0     DEBUG: Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.mUxwgM     DEBUG: + umask 022     DEBUG: + cd /builddir/build/BUILD     DEBUG: + cd saxon-6.5.5     DEBUG: + LANG=C     DEBUG: + export LANG     DEBUG: + unset DISPLAY     DEBUG: + export CLASSPATH=     DEBUG: + CLASSPATH=     DEBUG: + ant -Dj2se.javadoc=/usr/share/javadoc/java -Djdom.javadoc=/usr/share/javadoc/jdom     DEBUG: /var/tmp/rpm-tmp.mUxwgM: line 32: ant: command not found     DEBUG: error: Bad exit status from /var/tmp/rpm-tmp.mUxwgM (%build)     DEBUG: RPM build errors:     DEBUG:     Bad exit status from /var/tmp/rpm-tmp.mUxwgM (%build)     DEBUG: Child returncode was: 1      The first to check is that ant was installed, and sure enough, it was:               DEBUG: ================================================================================     DEBUG:  Package                      Arch     Version                     Repository     DEBUG:                                                                            Size     DEBUG: ================================================================================     DEBUG: Installing:     DEBUG:  ant                          i386     1.6.5-2jpp.2                core   2.0 M     DEBUG:  java-1.6.0-openjdk-javadoc   i386     1:1.6.0.0-1.21.b17.el5      core    20 M     DEBUG:  jdom                         i386     1.0-4jpp.1                  core   328 k     DEBUG:  jdom-javadoc                 i386     1.0-4jpp.1                  core   305 k     DEBUG:  jpackage-utils               noarch   1.7.5-3.8.iot5              core    63 k     DEBUG:  xml-commons-apis      Any other information I can provide as needed, but if anyone could tell me why ant isn't found it would be appreciated. For more insight, this is being done with mock and going into the mock shell does show that any is missing from any locations that would be considered normal to run from.


Installing PCRE 32bit on RHEL 5 - resolving dependency for apache 2.4 install

I need to install Apache 2.4 32bit version on RHEL 5. I am not installing 64bit apache because the application running on the RHEL5 machine needs apache 32bit (or that's what I thinks because of the past behavior). I receive "could not read symbols" while `make` which is probably due to pcre libs are of ELF 64bit when the installation expects it to be of ELF 32bit               **/usr/local/lib/libpcre.so: could not read symbols: File in wrong format**     collect2: ld returned 1 exit status     make[1]: *** [httpd] Error 1     make[1]: Leaving directory `/opt/myapp/httpd-2.4.7'     make: *** [all-recursive] Error 1      The configure for Apache 2.4 is run as:               CFLAGS="-m32"; export CFLAGS     LDFLAGS="-m32"; export LDFLAGS     "./configure" \     "--prefix=/opt/myapp/apache2.4" \     "--with-mpm=worker" \     "--enable-static-support" \     "--enable-ssl=static" \     "--enable-modules=most" \     "--disable-authndbd" \     "--disable-authn-dbm" \     "--disable-dbd" \     "--enable-static-logresolve" \     "--enable-static-rotatelogs" \     "--enable-proxy=static" \     "--enable-proxyconnect=static" \     "--enable-proxy-ftp=static" \     "--enable-proxy-http=static" \     "--enable-rewrite=static" \     "--enable-so=static" \     "--with-ssl=/opt/myapp/apache2.4/openssl" \     "--host=x86_32-unknown-linux-gnu" \     "host_alias=x86_32-unknown-linux-gnu" \     "CFLAGS=-m32" \     "LDFLAGS=-m32" \     "--with-included-apr" \     "--with-pcre=/usr/local" \     "$@"      I have installed PCRE without any error using:               ./configure --prefix=/usr/local --enable-pcre32      When I do pcretest it get this (Compiled with 8-bit support?):               $ /usr/local/bin/pcretest -C     PCRE version 8.33 2013-05-28     Compiled with       8-bit support       No UTF-8 support       No Unicode properties support       No just-in-time compiler support       Newline sequence is LF       \R matches all Unicode newlines       Internal link size = 2       POSIX malloc threshold = 10       Default match limit = 10000000       Default recursion depth limit = 10000000       Match recursion uses stack      But when I check the libs created (which are supposed to support 32bit apps) I get ELF 64bit.               $ file libpcre32.so.0.0.1     libpcre32.so.0.0.1: **ELF 64-bit** LSB shared object, AMD x86-64, version 1 (SYSV), not stripped


Erlang install on Freebsd 10 on Amazon ec2

I installed Erlang on amazon ec2 - on FreeBSD 10 with               fetch http://www.erlang.org/download/otp_src_17.0.tar.gz     gunzip -c otp_src_17.0.tar.gz | tar xf -     cd otp_src_17.0     ./configure --disable-hipe     gmake     gmake install      and I get this error:               configure: error: Perl is required to generate v2 to v1 mib converter script     configure: error: /bin/sh '/usr/home/ec2-user/otp_src_17.0/lib/snmp/./configure' failed for snmp/.     configure: error: /bin/sh '/usr/home/ec2-user/otp_src_17.0/lib/configure' failed for lib      How can I install Erlang on FreeBSD 10?


ex4 to btrfs conversion: If I accidentally lose power to the system during the conversion, will I lose the data?

I want to convert the 3TB 80% full ext4 block device into btrfs and I want to estimate the risks involved in the process. If I accidentally lose power to the system during the conversion, will I lose the data? > In my two-year experience with btrfs, the filesystem proved only to be > moderately safe during the power loss accidents - it destroyed some of my > data, if the power was lost two or more times in the row.


What filesystem metadata operations are actually journaled in ext4 & xfs?

I can't find a simple, straight answer about which filesystem metadata operations are actually persisted to the ext4 & xfs filesystem journals. Note that I am **not** inquiring about what POSIX declares to be "atomic". I'm more concerned about what subset of atomic filesystem operations are _effectively_ durable by virtue of running with a journal enabled without having to bend over backwards and `fsync(2)` all the time. Operations I'm fairly certain count:   * `creat(2)`   * `link(2)`   * `unlink(2)`   * `rename(2)`   * `mkdir(2)`   * `rmdir(2)` Operations I'm not entirely sure about:   * `symlink(2)` The `symlink(2)` case is the most troubling, since there does not seem to be any straightforward way to `fsync(2)` or `fdatasync(2)` the underlying datablocks that store the content of a symlink. Knowing that the journal takes care of this for me would be a relief.


Run series of command independent of each other

If I have a file with               cmd1          cmd2          cmd3 And I want to run them independent of each other, and independent whether it outputs an exit status or not (that means do not expect to end, just keep starting processes, which can fail or not. I know that `;` would run the next command, but that's not the case, because it waits until the previous command either fails or succeeds. I want to start all the commands at once. It is like something like `sleep 60m`; and then play music, sound a bell, run the browser, but obviously, there is not way to wait until the music plays to sound a bell, then after that run the browser. It has to happen at once. ADDED: how to, for example, read lines from file, open a terminal for each line and run it?


How to install, missing Intel Graphic Drivers

I have intel graphics card on my system (Scientific Linux 6.0), but the graphics is so poor as no drivers are installed.   So I have installed : > xorg-x11-drv-intel-2.21.2-1.el6.elrepo.x86_64   >  xorg-x11-drv-intel-devel-2.21.2-1.el6.elrepo.x86_64 And Updated for dependencies: > xorg-x11-drv-synaptics-1.6.2-13.el6.x86_64   >  xorg-x11-server-common-1.13.0-23.sl6.x86_64   >  xorg-x11-server-Xorg-1.13.0-23.sl6.x86_64   >  pixman-0.26.2-5.1.el6_5.x86_64   >  mtdev-1.1.2-5.el6.x86_64 But now my system graphics is not starting. It is perfectly working in `init 3`.   I have also changed the kernel parameters while booting: Added `nomodeset` and `i915.modeset=0`, but the problem remains same. **Update 1:** As per suggestion of @slm, the output of `lshw` is as below:               [root@localhost ~]# lshw -c video       *-display UNCLAIMED                 description: VGA compatible controller            product: Sandy Bridge Integrated Graphics Controller            vendor: Intel Corporation            physical id: 2            bus info: pci@0000:00:02.0            version: 09            width: 64 bits            clock: 33MHz            capabilities: msi pm vga_controller bus_master cap_list            configuration: latency=0            resources: memory:fe000000-fe3fffff memory:d0000000-dfffffff(prefetchable) ioport:f000(size=64)     [root@localhost ~]#          The configuration part only contains `configuration: latency=0`, that means the driver part is missing, what I need to do?


Specifying full range of printable ASCII characters in a glob pattern

I want to use a globbing pattern to match only printable (including space) ASCII characters `0x20` through to `0x7e`. This is being used inside a `super` `super.tab` database. I've arrived at the pattern: `[[ -~]]` This appears to work and does indeed restrict non-printing characters from being passed as arguments. Have I over looked anything, or is this the correct way to specify this range of characters? **Edit:** Based on _mikeserv_ 's suggestion to use `[[:print:]]`, I tried and it doesn't seem to work. Here's what the entry in my `super.tab` looks like:               dosuperthing  /system/dosuperthing.pl $Users  uid=0 arg1="[[:print:]]"      If I try `[[:print:]]`, `[:print:]` or `:print:` as globbing patterns for `arg1` it results in (respectively) the following being logged by `super` where I pass `abcdef` as my first argument: > `super: (admin) Your argument #1 <abcdef> must match pattern <[[:print:]]>` > > `super: (admin) Your argument #1 <abcdef> must match pattern <[:print:]>` > > `super: (admin) Your argument #1 <abcdef> must match pattern <:print:>` This is old legacy production code and I'm not able to tinker with it beyond tuning the acceptable `arg1-99` patterns inside `super.tab`.


linux + how to ignore (filter) file with space

Sometimes a file name is created from a couple of names and space between each name as the following:                  $ touch  "A B C"        $ ls        A B C      <-- one file but has three words !                                file1        file2        file3      How can I ignore (filter) the file that actually created from couple of names as "A B C"? Expected output                    $ ls <filter>          file1          file2          file3


Why isn't Linux embraced as the official GNU kernel?

While I knew for quite some time the existence of Hurd, and its mission as the official GNU Operating System kernel, **I was wondering how come Linux is not embraced as the official GNU kernel over the years, seeing as it is in a much better state than the Hurd?** Linux has been, more or less, serving this role 20+ years so far, however one can see that the GNU Project is keeping its distance when it comes to Linux. Why is this happening? Is it because of a dream that Hurd will (at some point in the future) be in a production quality level? Is it because the GNU project doesn't see its mission reflected as much as it wants in Linux? Is it for other political reasons?


How to get better desktop performance in linux?

Normally I do not care much about desktop - performance, since my servers do not run any gui. But at home I run some older hardware (Pentium) which gets sometimes very sluggish (mouse-movements in KDE). I observe that this is the case where there is some disk-io background activity going on. How can I set that disk-priority lower, so that my gui gets more attention? I already tried to set the disk-scheduler for my sata-drive from cfq to as - but that did not help. I remember that I had - long time ago - a similar problem on OpenSuSE - there I set a different general scheduler tick-rate (shorter as default, as far as I remember). But I do not remember what that was exactly, neither how to set that on my current Linux (CentOS 5, 32-Bit). Any hints are welcome.


I reset my password and now I can login, but without nautilus or program menu

I recently powered on some old notebook with Linux Mint 11 (Katya) installed, and I thought I remembered my user password, but turns out I didn't. So I reset that password using the instructions here. After doing that, I could login successfully with my new password, but right after that I got a series of error messages and was left with the plain Mint desktop: no program menu, no nautilus, no context menu; all I could do was restart or shutdown. Here are the errors, in order of appearance: > Could not update ICEAuthority file /home/my_user/.ICEauthority > > There is a problem with the configuration server. > (/usr/lib/libgconf2-4/gconf-sanity-check-2 exited with code 256) > > The panel encountered a problem while loading "OAFIID:GNOME_mintMenu". Do > you want to delete the applet from your configuration? Of course, I always answered "Don't delete". > Nautilus could not create the following required folders: > /home/my_user/Desktop, /home/my_user/.nautilus. Before running Nautilus, > please create these folders or set permissiones such that Nautilus can > create them. When I restarted, I selected recovery mode from the GRUB menu and managed to login into a terminal and navigate to my home folder. When I ran `ls` there, all my files were gone, and in their place were a `.desktop` file and a README. It seems Mint realized I changed my password and took it as an attempt to hack into the system, so it encrypted the files in my home folder... Kudos to Linux security schemes, but... what can I do now? Don't wanna reinstall, I need those old files. **UPDATE** : I tried running `ecryptfs-mount-private` like the README suggests, but it asked me for a passphrase, and the new one doesn't work. Figures, it needs the old one.


How to install DivFix++ under Scientific-linux 6.1?

I installed DivFix++ from http://sourceforge.net/projects/divfixpp/files/DivFix%2B%2B/v0.34/ DivFix++-0.34-2.1.x86_64.rpm               $ env LC_MESSAGES=C DivFix++     Fatal Error: Mismatch between the program and library build versions detected.     The library used 2.8 (no debug,Unicode,compiler with C++ ABI 1002,wx containers,compatible with 2.4,compatible with 2.6),     and your program used 2.8 (no debug,Unicode,compiler with C++ ABI 1002,wx containers,compatible with 2.6).     Abgebrochen     $ uname -a     Linux a 2.6.32-220.13.1.el6.x86_64 #1 SMP Tue Apr 17 15:16:22 CDT 2012 x86_64 x86_64 x86_64 GNU/Linux     $ rpm -qa | grep -i divfix     DivFix++-0.34-2.1.x86_64     $       **Question** : how can I get DivFix++ to work under Scientific-Linux 6.1? UPDATE#1 (I tried to install from source)               [USERNAME@MACHINE ~/Desktop/D/DivFix++_v0.34] ls     contrib  debian  DivFix++.cbp  DivFix++.fbp  docs  locale  makefile  resources  src  wx_pch.h     [USERNAME@MACHINE ~/Desktop/D/DivFix++_v0.34] make     `wx-config --cxx` `wx-config --cxxflags` -c src/DivFix++App.cpp -o src/DivFix++App.o     `wx-config --cxx` `wx-config --cxxflags` -c src/DivFix++.cpp -o src/DivFix++.o     `wx-config --cxx` `wx-config --cxxflags` -c src/DivFix++Core.cpp -o src/DivFix++Core.o     `wx-config --cxx` `wx-config --cxxflags` -c src/DivFix++Gui.cpp -o src/DivFix++Gui.o     `wx-config --cxx` src/DivFix++App.o src/DivFix++.o src/DivFix++Core.o src/DivFix++Gui.o `wx-config --libs` -o DivFix++     [USERNAME@MACHINE ~/Desktop/D/DivFix++_v0.34] DivFix++     Fatal Error: Mismatch between the program and library build versions detected.     The library used 2.8 (no debug,Unicode,compiler with C++ ABI 1002,wx containers,compatible with 2.4,compatible with 2.6),     and your program used 2.8 (no debug,Unicode,compiler with C++ ABI 1002,wx containers,compatible with 2.6).     Abgebrochen     [USERNAME@MACHINE ~/Desktop/D/DivFix++_v0.34]       Searching for wxwidgets:               [USERNAME@MACHINE ~]# rpm -qa | grep -i wx     wxGTK-2.8.12-1.el6.rf.x86_64     wxGTK-devel-2.8.12-1.el6.rf.x86_64     [USERNAME@MACHINE ~]#


How to track/fix a memory-related issue in a large C/C++ code on *nix systems

What strategy you use while tracking a memory-related issue? What tools do you use (open source as well as proprietary) to identify memory leaks, memory corruption etc? How would you track memory leaks if only gdb/dbx available on a system? For me, fixing memory leaks with only a debugger is very hard.


What's the "OBEY" Tux logo all about?

There's a variant on the Tux logo I keep seeing; recognizably Tux's head sat above a red "OBEY" text. Examples. It's striking, but what the heck does it actually _mean_ ? I've seen it mentioned as being based on the "Obama 'hope' poster" (given even more credence by some of the results in the above link); and to me it seems vaguely reminiscent of RedHat's old "Shadowman" logo. I'd be interested to know where this iconography first appeared and what it's about. (I mean, why "OBEY" rather than something more obviously aligned with FOSS-ey values; is it supposed to be ironic, or a reference to rabid zealotry ? I'm in the UK so I'm guessing there's some crucial cultural context I'm missing).


Arch Linux with Xfce-Desktop no longer starts

I run Arch Linux with XFCE. Recently, I decided to switch to PCmanfm as my file manager. I removed Thunar with: `pacman -Rc thunar` and rebooted. Now when I try to log in, my XFCE4 desktop flashes for a second, then returns to my login manager (Slim). Reinstalling thunar does not help. How can I get my desktop working again? It's okay if it's with thunar for now, I just need a working setup, PCmanfm will come later.


Error when installing Google Chrome on CentOS

I downloaded the 32 bit .rpm (For Fedora/openSUSE) to my CentOS machine. when installing it, I got the following error.               $ rpm -ivh google-chrome-stable_current_i386.rpm     warning: google-chrome-stable_current_i386.rpm: Header V4 DSA signature: NOKEY, key ID 7fac5991     error: Failed dependencies:             lsb >= 3.2 is needed by google-chrome-stable-12.0.742.124-92024.i386             libcurl.so.4 is needed by google-chrome-stable-12.0.742.124-92024.i386             xdg-utils is needed by google-chrome-stable-12.0.742.124-92024.i386      This much is clear (I guess), that I need the package `lsb` version greater than or equal to 3.2, `libcurl.so.4` and `xdg-utils`. But where will I get these from. I think installing the three above packages should resolve the installation error. _Addendum: Progress was made by installing the packages`lsb` and `xdg-utils` using the command `yum install <pkg_name>`. But I still have the `libcurl.so.4` library file as a missing dependancy. Any ideas as to how this can be resolved._


How to split a new window and run a command in this new window using tmux?

I have tried               tmux -c "shell command" split-window      but it does not seem to work. Using `tmux split-window`, one can split a new window. **UPDATE** : Using `tmux split-window 'exec ping g.cn'` can run the ping command , but when stoped the new window will be closed.


How to disable the beep sound system-wide

If I want to disable beep sounds from stuff like **`bash`** , I add this line to " **/etc/inputrc** ":               set bell-style none      Sadly, this doesn't work for some other events like GDM start-up and shut down. I thought that adding this line to " **/etc/modprobe.d/blacklist.conf** " would help:               blacklist pcspkr      That makes me wonder and doubt where the sound actually comes from.


Why is piped input okay to zenity, but <file malfunctions?

My question is as simple as what the `zenity --text` args say in the example... but what is causing this 100% CPU grab by the redirection?   ...(and by the way, is this particular usage of `<` actually called `redirection`. It seems like it is creating a direction, rather than _re_ -directing )..               echo "Peacocks talking of the colour grey."> test     cat test | zenity --text='This does NOT hog the CPU'   --list --column='#' --width=450      <test      zenity --text='This hogs 100% of CPU usage' --list --column='#' --width=450            I'm quite happy to use `cat test |` (because it isn't useless in this case; it works and < and `|` are somehow different, but I haven't been able to track it down again... To be clear: `<test` and `cat test |` both work. The zenity dialog appears and is fully functional in both cases, but for as long as the `<test` version of the dialog is kept open, it uses 100% CPU (of one core)... 94% on the single "core" VMs...


Best way to follow a log and execute a command when some text appears in the log

I have a server log that outputs a specific line of text into its log file when the server is up. I want to execute a command once the server is up, and hence do something like the following:               tail -f /path/to/serverLog | grep "server is up" ...(now, e.g., wget on server)?      What is the best way to do this?


Arch Linux on Virtualbox Internet Connection Issue on VirtualBox

I have successfully installed Arch Linux on VirtualBox but the internet is not working in it. There was no issue with the internet connection during the installation but when I boot from the virtual hard drive (using syslinux bootloader) I'm unable to connect to the internet. When I boot from the installation CD and mount the root partition and then use installed system from `# arch-chroot` internet works well without doing anything at all and `# ip link` shows two interfaces `lo` and `eth0` When I try to use `# systemctl enable dhcpcd@enp3s0.service` command, it gives an error 'Operation failed: No such file or directory however `# ip link` says there are two interfaces `lo` and `enp3s0`. I want to know why there are two different names for the same ethernet port? and more important how do I solve this problem?


Idiomatic location for file based sockets on Debian systems

I am writing a daemon process for a Debian system in `C` that uses a Unix Domain Socket. _If the deamon process's working directory is the root directory, is there an idiomatic directory to place the socket on the file system?_


How to prevent Windows partition to access(read) Linux partition files?

How to prevent Windows partition to access(read) Linux partition files within one physical hard disc? Right now a couple of programs can do that. E.g. Linux Reader I want to prevent that? What are my possibilities? I am currently running Windows 7 and would like to install as a dual boot Linux Mint 15.


Regex and piped commands with sed

I'm finding really hard to use `sed` command, plus I can't seem to find well written tutorials. Let me say that I worked with regular expression in other languages (Python, JavaScript, Java), so that _shouldn't_ be the problem. So, here are my questions (a "theoretical" one and a more practical one):   1. are regular expressions used in `sed` exactly the same as the ones used by Python/JS/Java? I read about BREs and EREs, but how much are they different? Shouldn't ERE be an _extension_ of BRE?   2. if I want to, say, just extract something from a piped output, what's the `sed` syntax to do that? Details about the second question: say I have the output of `uptime` piped with sed:               uptime | sed ...      Given an example output from `uptime`: `18:13 up 5:12, 2 users, load averages: 0,45 0,37 0,40`, I want to parse the single uptime in the form of two separated numbers (hours and minutes), and then I want to display them in the form of `xxhyym` (`xx` are the hours, `yy` the minutes). And to finish, here's what I'd do in Python:               hh, mm = re.match(r'\s+ up \s+(\d{1,2}):(\d{1,2})').groups()     print '%sh%sm' % (hh, mm)


When and why is /etc/init/failsafe.conf invoked on Ubuntu Server 12.04?

Could someone please tell me when during the boot process and why /etc/init/failsafe.conf is invoked? If possible, please point me towards a resource (keyword or link) where I could read more about the bootup process.


Can't drag and drop in Qt Creator

I recently installed the system upgrades for my Ubuntu distro (12.10). Since the upgrades, I can't drag and drop items in Qt Creator. I found a solution that requires editing of `xorg.conf`. My system has no `/etc/X11/xorg.conf` file. I tried on a previous install to copy-paste a sample `xorg.conf` and add the required edits, but this prevented me from even booting into a terminal. I now have a fresh install. How would I go about performing these edits without breaking my system? Alternatively, is there any other way to get the Qt Creator functionality back? **edit** I'm currently using Gnome Shell so the answer presented here does not help.


Can I name my own LFS distro?

The question is... about LFS (Linux From Scratch), if I would build a Linux system, with LFS, is it 100% mine? Could I say I made all this from scratch?


Sort lines based on a variable-width number at a fixed position

I'm trying to sort a file using the Sort command but its not working: The file contains lines like:               photo1     photo11     photo12     photo13     photo17     photo18     photo19     photo2     photo22     photo23     photo25     photo26     photo27      I'm using the command, `sort -k6 Photos` so that it start sorting after the string "photo", can someone tell where I'm going wrong??


Can I avoid screen from creating inner screens?

I just started using screen and "screen inception" makes learning screen even more confusing. Can I avoid screen from creating screens when I'm already inside a screen? ![enter image description here](http://i.stack.imgur.com/hvfXo.png) I'm using fish as my shell if that matters.


How to access ubuntu wubi installation

I installed ubuntu/wubi nearly a year ago on my windows 8 pc. It has been sitting on a separate partition untouched since then. I am trying to access it again as I'd like to use Ubuntu now. I cannot figure out how to boot to Ubuntu. When I go to "msconfig" -> "boot". I only see an option for Windows. The Ubuntu file hierarchy looks like this:               D:\ -> ubuntu -> disks, install, winboot      The disk file root.disk is about 18gb. Any help is greatly appreciated.


How to decrypt LUKS with the known master key?

From: https://code.google.com/p/cryptsetup/wiki/FrequentlyAskedQuestions               CLONING/IMAGING: If you clone or image a LUKS container, you make a copy      of the LUKS header and the master key will stay the same! That means that if      you distribute an image to several machines, the same master key will be used      on all of them, regardless of whether you change the passphrases. Do NOT do this!      If you do, a root-user on any of the machines with a mapped (decrypted) container      or a passphrase on that machine can decrypt all other copies, breaking security.      See also Item 6.15.       So: I have a notebook "A" (a Linux Desktop installed with LUKS & and I have root access to it) and I clone the whole disk of it to notebook "B", and the notebook "B" had it's LUKS password changed. **My question** : How can I mount/decrypt notebook "B" LUKS partition with **ONLY** the known master key from "A"?* (and I know the cipher type too) *UPDATE: What are the exact commands to mount the B's HDD on A?


Is service stop synchronous or asynchronous?

I did `sudo service ... stop` before shutting down the machine remotely, over SSH, but then I realized I didn't know if `stop` is synchronous or not and I wondered if I was not too fast to shut down the Ubuntu machine. So are my fears based on a wrong hunch or not ? Edit: My service is a personal one, it receives listens to stuff from a port and writes things now and then to a database. I fear that things don't have the time to be flushed if the service is stopped abruptly. `stop` takes care of flushing things but given the time it could take...


Is it possible to install RHEV on el6 clustered computer

Is it possible to use Linux (el6) clustered computer can be used as a hypervisor for RHEV 3.3/Ovirt 3.3?   * Cause, we can not combine RAM/CPU from two or more hypervisores to be considered as a one source of resource while creating a huge guest on RHEV. I know it support Baloonig and 150% for server and 200% for Desktop RAM aloocation but if I want to allocate RAM even more than that just to a one guest then? Any input for such situation!


regex suggestion

echo "223255/12345678                    " | grep '[0-9a-zA-Z/\-\?:\(\)\.,"\+]{1,34}'      According to the regex, it can have any of `0-9 a-z A-Z / - ? : ( ) . , " +` of upto 34 chars in any order. Am I right? In that case, why is it not printing the echoed value?


No panels in Ubuntu? libcanberra-tk cannot open shared object file

I booted up Ubuntu and have a background but no panels. Everything else seems to work fine, I can get into terminal and run Firefox for instance. I can create folders on my desktop, etc. I'm new to Linux so was kind of just guessing to figure out what to do, I tried launching gnome-panel:               $ sudo gnome-panel     gnome-panel: error while loading shared libraries: libcanberra-gtk.so.0: cannot open shared object file: Input/output error      Reinstalling gnome-panel doesn't help. I noticed I get the same error on anything I do:               $ gksudo firefox         Gtk-Message: Failed to load module "canberra-gtk-module": libcanberra-gtk.so.0: cannot open shared object file: Input/output error      Yet Firefox loads. Any ideas? I'm assuming "panel" is the correct word, what I'm talking about is the bar at the top where you can launch applications from.


How can I get a HASH of the LUKS master key?

From: https://code.google.com/p/cryptsetup/wiki/FrequentlyAskedQuestions > 6.15 Can I clone a LUKS container? > > You can, but it breaks security, because the cloned container has the same > header and hence the same master key. You cannot change the master key on a > LUKS container, even if you change the passphrase(s), the master key stays > the same. That means whoever has access to one of the clones can decrypt > them all, completely bypassing the passphrases. > > The right way to do this is to first luksFormat the target container, then > to clone the contents of the source container, with both containers mapped, > i.e. decrypted. You can clone the decrypted contents of a LUKS container in > binary mode, although you may run into secondary issues with GUIDs in > filesystems, partition tables, RAID-components and the like. These are just > the normal problems binary cloning causes. > > Note that if you need to ship (e.g.) cloned LUKS containers with a default > passphrase, that is fine as long as each container was individually created > (and hence has its own master key). In this case, changing the default > passphrase will make it secure again. I have two notebooks with root access installed with LUKS. I don't know if originally they where CLONED or not. **My question** : How can I create a HASH (ex.: sha512) from the LUKS master keys, so that I can compare the two, that if they are the same or not?


How do I bind to Shift+{Left,Right} in tmux?

I'm looking at `tmux` from `screen`, and have hit a bump while configuring the (highly configurable!) `tmux` key bindings. Problem is, in my `.screenrc` I have               bindkey ^[[d prev     bindkey ^[[c next     bindkey ^[[a title     bindkey ^[[b screen 1      and the bindings work (they originally came from `rxvt-tabbedex`). But in `tmux` there's apparently no way to bind commands to `Shift``Left`/`Right` combinations. Please prove me wrong.


How can nfs service in the kernel be disabled? As far as I can see there are no userland utils               # find / -name nfs* -print     /sys/kernel/slab/nfs_page     /sys/kernel/slab/nfs_inode_cache     /sys/kernel/slab/nfs_read_data     /sys/kernel/slab/nfs_write_data     /sys/kernel/slab/nfs_direct_cache     /sys/module/nfs     /sys/module/nfs/parameters/nfs4_disable_idmapping     /var/lib/pacman/sync/core/nfsidmap-0.23-3     /var/lib/pacman/sync/core/nfs-utils-1.2.2-3     /usr/include/rpcsvc/nfs_prot.x     /usr/include/rpcsvc/nfs_prot.h     /usr/include/nfs     /usr/include/nfs/nfs.h     /usr/include/linux/nfsd     /usr/include/linux/nfsd/nfsfh.h     /usr/include/linux/nfs2.h     /usr/include/linux/nfs.h     /usr/include/linux/nfs4.h     /usr/include/linux/nfsacl.h     /usr/include/linux/nfs3.h     /usr/include/linux/nfs_mount.h     /usr/include/linux/nfs_fs.h     /usr/include/linux/nfs4_mount.h     /usr/include/linux/nfs_idmap.h     /usr/share/man/man2/nfsservctl.2.gz     /proc/sys/fs/nfs     /proc/sys/fs/nfs/nfs_callback_tcpport     /proc/sys/fs/nfs/nfs_mountpoint_timeout     /proc/sys/fs/nfs/nfs_congestion_kb     /proc/sys/sunrpc/nfs_debug     /proc/sys/sunrpc/nfsd_debug     /proc/fs/nfs     /proc/fs/nfsfs     /proc/fs/nfsd     /proc/1/net/rpc/nfsd.fh     /proc/1/net/rpc/nfsd.export     /proc/1/net/rpc/nfsd     /proc/1/net/rpc/nfs     /proc/2/net/rpc/nfsd.fh     /proc/2/net/rpc/nfsd.export     /proc/2/net/rpc/nfsd     /proc/2/net/rpc/nfs     /proc/3/net/rpc/nfsd.fh     /proc/3/net/rpc/nfsd.export     /proc/3/net/rpc/nfsd     /proc/3/net/rpc/nfs     /proc/4/net/rpc/nfsd.fh     /proc/4/net/rpc/nfsd.export     /proc/4/net/rpc/nfsd     /proc/4/net/rpc/nfs     /proc/5/net/rpc/nfsd.fh     /proc/5/net/rpc/nfsd.export     /proc/5/net/rpc/nfsd     /proc/5/net/rpc/nfs     /proc/6/net/rpc/nfsd.fh     /proc/6/net/rpc/nfsd.export     /proc/6/net/rpc/nfsd     /proc/6/net/rpc/nfs     /proc/7/net/rpc/nfsd.fh     /proc/7/net/rpc/nfsd.export     /proc/7/net/rpc/nfsd     /proc/7/net/rpc/nfs     /proc/8/net/rpc/nfsd.fh     /proc/8/net/rpc/nfsd.export     /proc/8/net/rpc/nfsd     /proc/8/net/rpc/nfs     /proc/9/net/rpc/nfsd.fh     /proc/9/net/rpc/nfsd.export     /proc/9/net/rpc/nfsd     /proc/9/net/rpc/nfs     /proc/10/net/rpc/nfsd.fh     /proc/10/net/rpc/nfsd.export     /proc/10/net/rpc/nfsd     /proc/10/net/rpc/nfs     /proc/11/net/rpc/nfsd.fh     /proc/11/net/rpc/nfsd.export     /proc/11/net/rpc/nfsd     /proc/11/net/rpc/nfs     /proc/12/net/rpc/nfsd.fh     /proc/12/net/rpc/nfsd.export     /proc/12/net/rpc/nfsd     /proc/12/net/rpc/nfs     /proc/13/net/rpc/nfsd.fh     /proc/13/net/rpc/nfsd.export     /proc/13/net/rpc/nfsd     /proc/13/net/rpc/nfs     /proc/14/net/rpc/nfsd.fh     /proc/14/net/rpc/nfsd.export     /proc/14/net/rpc/nfsd     /proc/14/net/rpc/nfs     /proc/15/net/rpc/nfsd.fh     /proc/15/net/rpc/nfsd.export     /proc/15/net/rpc/nfsd     /proc/15/net/rpc/nfs     /proc/16/net/rpc/nfsd.fh     /proc/16/net/rpc/nfsd.export     /proc/16/net/rpc/nfsd     /proc/16/net/rpc/nfs     /proc/17/net/rpc/nfsd.fh     /proc/17/net/rpc/nfsd.export     /proc/17/net/rpc/nfsd     /proc/17/net/rpc/nfs     /proc/20/net/rpc/nfsd.fh     /proc/20/net/rpc/nfsd.export     /proc/20/net/rpc/nfsd     /proc/20/net/rpc/nfs     /proc/23/net/rpc/nfsd.fh     /proc/23/net/rpc/nfsd.export     /proc/23/net/rpc/nfsd     /proc/23/net/rpc/nfs     /proc/24/net/rpc/nfsd.fh     /proc/24/net/rpc/nfsd.export     /proc/24/net/rpc/nfsd     /proc/24/net/rpc/nfs     /proc/220/net/rpc/nfsd.fh     /proc/220/net/rpc/nfsd.export     /proc/220/net/rpc/nfsd     /proc/220/net/rpc/nfs     /proc/222/net/rpc/nfsd.fh     /proc/222/net/rpc/nfsd.export     /proc/222/net/rpc/nfsd     /proc/222/net/rpc/nfs     /proc/224/net/rpc/nfsd.fh     /proc/224/net/rpc/nfsd.export     /proc/224/net/rpc/nfsd     /proc/224/net/rpc/nfs     /proc/234/net/rpc/nfsd.fh     /proc/234/net/rpc/nfsd.export     /proc/234/net/rpc/nfsd     /proc/234/net/rpc/nfs     /proc/238/net/rpc/nfsd.fh     /proc/238/net/rpc/nfsd.export     /proc/238/net/rpc/nfsd     /proc/238/net/rpc/nfs     /proc/248/net/rpc/nfsd.fh     /proc/248/net/rpc/nfsd.export     /proc/248/net/rpc/nfsd     /proc/248/net/rpc/nfs     /proc/257/net/rpc/nfsd.fh     /proc/257/net/rpc/nfsd.export     /proc/257/net/rpc/nfsd     /proc/257/net/rpc/nfs     /proc/258/net/rpc/nfsd.fh     /proc/258/net/rpc/nfsd.export     /proc/258/net/rpc/nfsd     /proc/258/net/rpc/nfs     /proc/343/net/rpc/nfsd.fh     /proc/343/net/rpc/nfsd.export     /proc/343/net/rpc/nfsd     /proc/343/net/rpc/nfs     /proc/344/net/rpc/nfsd.fh     /proc/344/net/rpc/nfsd.export     /proc/344/net/rpc/nfsd     /proc/344/net/rpc/nfs     /proc/387/net/rpc/nfsd.fh     /proc/387/net/rpc/nfsd.export     /proc/387/net/rpc/nfsd     /proc/387/net/rpc/nfs     /proc/456/net/rpc/nfsd.fh     /proc/456/net/rpc/nfsd.export     /proc/456/net/rpc/nfsd     /proc/456/net/rpc/nfs     /proc/485/net/rpc/nfsd.fh     /proc/485/net/rpc/nfsd.export     /proc/485/net/rpc/nfsd     /proc/485/net/rpc/nfs     /proc/487/net/rpc/nfsd.fh     /proc/487/net/rpc/nfsd.export     /proc/487/net/rpc/nfsd     /proc/487/net/rpc/nfs     /proc/499/net/rpc/nfsd.fh     /proc/499/net/rpc/nfsd.export     /proc/499/net/rpc/nfsd     /proc/499/net/rpc/nfs     /proc/500/net/rpc/nfsd.fh     /proc/500/net/rpc/nfsd.export     /proc/500/net/rpc/nfsd     /proc/500/net/rpc/nfs     /proc/501/net/rpc/nfsd.fh     /proc/501/net/rpc/nfsd.export     /proc/501/net/rpc/nfsd     /proc/501/net/rpc/nfs     /proc/502/net/rpc/nfsd.fh     /proc/502/net/rpc/nfsd.export     /proc/502/net/rpc/nfsd     /proc/502/net/rpc/nfs     /proc/503/net/rpc/nfsd.fh     /proc/503/net/rpc/nfsd.export     /proc/503/net/rpc/nfsd     /proc/503/net/rpc/nfs     /proc/504/net/rpc/nfsd.fh     /proc/504/net/rpc/nfsd.export     /proc/504/net/rpc/nfsd     /proc/504/net/rpc/nfs     /proc/513/net/rpc/nfsd.fh     /proc/513/net/rpc/nfsd.export     /proc/513/net/rpc/nfsd     /proc/513/net/rpc/nfs     /proc/514/net/rpc/nfsd.fh     /proc/514/net/rpc/nfsd.export     /proc/514/net/rpc/nfsd     /proc/514/net/rpc/nfs     /proc/515/net/rpc/nfsd.fh     /proc/515/net/rpc/nfsd.export     /proc/515/net/rpc/nfsd     /proc/515/net/rpc/nfs     /proc/516/net/rpc/nfsd.fh     /proc/516/net/rpc/nfsd.export     /proc/516/net/rpc/nfsd     /proc/516/net/rpc/nfs     /proc/517/net/rpc/nfsd.fh     /proc/517/net/rpc/nfsd.export     /proc/517/net/rpc/nfsd     /proc/517/net/rpc/nfs     /proc/518/net/rpc/nfsd.fh     /proc/518/net/rpc/nfsd.export     /proc/518/net/rpc/nfsd     /proc/518/net/rpc/nfs     /proc/523/net/rpc/nfsd.fh     /proc/523/net/rpc/nfsd.export     /proc/523/net/rpc/nfsd     /proc/523/net/rpc/nfs     /proc/525/net/rpc/nfsd.fh     /proc/525/net/rpc/nfsd.export     /proc/525/net/rpc/nfsd     /proc/525/net/rpc/nfs     /proc/1056/net/rpc/nfsd.fh     /proc/1056/net/rpc/nfsd.export     /proc/1056/net/rpc/nfsd     /proc/1056/net/rpc/nfs     /proc/1145/net/rpc/nfsd.fh     /proc/1145/net/rpc/nfsd.export     /proc/1145/net/rpc/nfsd     /proc/1145/net/rpc/nfs     /proc/1188/net/rpc/nfsd.fh     /proc/1188/net/rpc/nfsd.export     /proc/1188/net/rpc/nfsd     /proc/1188/net/rpc/nfs     /proc/1191/net/rpc/nfsd.fh     /proc/1191/net/rpc/nfsd.export     /proc/1191/net/rpc/nfsd     /proc/1191/net/rpc/nfs     /proc/1219/net/rpc/nfsd.fh     /proc/1219/net/rpc/nfsd.export     /proc/1219/net/rpc/nfsd     /proc/1219/net/rpc/nfs     /proc/1284/net/rpc/nfsd.fh     /proc/1284/net/rpc/nfsd.export     /proc/1284/net/rpc/nfsd     /proc/1284/net/rpc/nfs     /proc/1289/net/rpc/nfsd.fh     /proc/1289/net/rpc/nfsd.export     /proc/1289/net/rpc/nfsd     /proc/1289/net/rpc/nfs     /proc/1379/net/rpc/nfsd.fh     /proc/1379/net/rpc/nfsd.export     /proc/1379/net/rpc/nfsd     /proc/1379/net/rpc/nfs     /proc/1380/net/rpc/nfsd.fh     /proc/1380/net/rpc/nfsd.export     /proc/1380/net/rpc/nfsd     /proc/1380/net/rpc/nfs     /proc/1412/net/rpc/nfsd.fh     /proc/1412/net/rpc/nfsd.export     /proc/1412/net/rpc/nfsd     /proc/1412/net/rpc/nfs     /proc/1421/net/rpc/nfsd.fh     /proc/1421/net/rpc/nfsd.export     /proc/1421/net/rpc/nfsd     /proc/1421/net/rpc/nfs     /proc/1432/net/rpc/nfsd.fh     /proc/1432/net/rpc/nfsd.export     /proc/1432/net/rpc/nfsd     /proc/1432/net/rpc/nfs     /proc/1444/net/rpc/nfsd.fh     /proc/1444/net/rpc/nfsd.export     /proc/1444/net/rpc/nfsd     /proc/1444/net/rpc/nfs     /proc/1445/net/rpc/nfsd.fh     /proc/1445/net/rpc/nfsd.export     /proc/1445/net/rpc/nfsd     /proc/1445/net/rpc/nfs     /proc/1446/net/rpc/nfsd.fh     /proc/1446/net/rpc/nfsd.export     /proc/1446/net/rpc/nfsd     /proc/1446/net/rpc/nfs     /proc/1448/net/rpc/nfsd.fh     /proc/1448/net/rpc/nfsd.export     /proc/1448/net/rpc/nfsd     /proc/1448/net/rpc/nfs     /proc/1473/net/rpc/nfsd.fh     /proc/1473/net/rpc/nfsd.export     /proc/1473/net/rpc/nfsd     /proc/1473/net/rpc/nfs     /proc/1499/net/rpc/nfsd.fh     /proc/1499/net/rpc/nfsd.export     /proc/1499/net/rpc/nfsd     /proc/1499/net/rpc/nfs


Get all images from website

I'm trying to wget all the images pictures from a website. I thought I knew how to use it, but I guess I don't. The images I'm trying to get come from here. The command I'm using is:               wget -prA.png http://gameinfo.euw.leagueoflegends.com/en/game-info/champions/      But I only get a index.html back? Could somebody explain this?


Unable to find headers in GCC

I am trying to compile a program using GCC in SCO, and I am unable to find the `ctype.h` file. I have managed to find the other files that were missing when compiling, like `string.h` etc. I was getting this returned **before** I found where most of the other files were:               In file included from test.c:76:     strutil.c:2: string.h: No such file or directory     strutil.c:3: stdio.h: No such file or directory     In file included from test.c:77:     pcutils.h:3: ctype.h: No such file or directory     In file included from test.c:78:     pcutils.c:2: string.h: No such file or directory     pcutils.c:3: stdio.h: No such file or directory     test.c:79: time.h: No such file or directory     test.c:81: stdio.h: No such file or directory      Most of those files are in `/opt/K/SKUNK99/Gcc/2.95.2pl1/usr/local/lib/gcc- lib/i386-pc-sco3.2v5.0.5/2.95.2/include/oldstyle` **Now it is showing this:**               In file included from test.c:77:     pcutils.h:3: ctype.h: No such file or directory      **Therefore my question is:**   * Where can I find the `ctype.h` file? This question is related to .profile in SCO


How do I get to use .local hostnames with Arch Linux?

If I'm using Ubuntu or Linux Mint (the only two flavours I've tried and know work for sure), I can run something like this:               wayne@myhost$ ssh wayne@otherhost.local      And the name is automagically resolved to whatever the IP of otherhost is on my local network. I've decided to start branching out into other distros, and I've got Arch running on my laptop - but if I try using the previous command I get `Could not resolve hostname otherhost.local: Name or service not known` What does it take to get this sort of automatic name resolution(?) to take place?


Ubuntu 11.04 Startup Applicatation vs /etc/init.d

**Is there any difference between these two methods for application to start on boot?** I need an application to start _before_ a logon occurs and am questioning whether or not Ubuntu's Startup Application menu will accomplish this for me. Otherwise, I can put a startup script in the init.d but then have to find some way of remebering thats where I stuck it (not be confused with /etc/rc.local which does not seem to work in Ubuntu 11.04) I have no other way of verifying that in fact the program is running without logging in at this time. Thanks.


Is there a way to sum up the size of files listed?

This is the command I am using to list some files:               find . -name \*.extract.sys -size +1000000c -exec ls -lrt {} \;     -rw-r--r--   1 qa1wrk15   test       1265190 Sep 29 01:14 ./var/can/projs/ar/rep/extract/Sep/29/ar.ARAB-PI_7.20110929.extract.sys     -rw-r--r--   1 qa1wrk15   test       1345554 Sep 29 01:14 ./var/can/projs/ar/rep/extract/Sep/29/ar.ARAB-PI_2.20110929.extract.sys     -rw-r--r--   1 qa1wrk15   test       1370532 Sep 29 01:14 ./var/can/projs/ar/rep/extract/Sep/29/ar.ARAB-PI_3.20110929.extract.sys     -rw-r--r--   1 qa1wrk15   test       1399854 Sep 29 01:14 ./var/can/projs/ar/rep/extract/Sep/29/ar.ARAB-PI_8.20110929.extract.sys      and so on. Now I want to calculate the total size of these files by summing up the 5th column. I thought of using `awk`, to do this so I tested the following in a particular directory               >ls -lrt | awk `{ print $1 }`     ksh: syntax error at line 1 : `{' unmatched      I don't understand what is the problem, why this **syntax error**. I am thinking to try               ls -lrt | awk `BEGIN {total = 0} {for(i=0;i<NR;i++){total+=$5}} END {printf "%d",total}       this also, but a simple `awk` script is not working. Please suggest or correct me if I am wrong, or if there is a workaround for this.


is it possible to trigger `ssh-add <key>` only when I ssh into a box? (from Cygwin)

I've got my `.bash_profile` set up to `eval $(ssh-agent)` so I can quickly connect to servers. If I add `ssh-add ~/.ssh/id_rsa_my_key` to my `.bash_profile` as well, I'll have to type the ssh key passphrase in every terminal window, even if I didn't intend to use that terminal window for logging into a server. I could create an alias to make it trivially easy to type the `ssh-add ~/.ssh/id_rsa_my_key` line (so I don't have to stop my train of thought about what I'm trying to accomplish and think instead about how I named my key) but I still have to remember to do that before I ssh into a box. I'm used to working in OS X, where all this is handled almost transparently by the Keychain, and I just `ssh` away without having to think about access. I'd rather not have to change my mental habits, even though I'm now primarily working from a Windows box. In Windows the ssh-agent dies as soon as I I'd also rather not do this with aliases or functions for ssh, if it can be avoided. I think that creating aliases and functions that replace normal commands and programs is a somewhat fragile and risky solution: if _another_ problem comes up in the future for which the only solution is to replace `ssh` then my alias or (more likely) function becomes yet more complex and brittle. Increasingly so the third time, etc. etc. Nonetheless, this _may_ be the only solution. Furthermore, to be useful, the function would have to somehow first check whether the key had already been added, otherwise I'd be adding it every time I logged in, which would accomplish nothing. Does `ssh` have some setting to do this automatically? Is there some better solution than adding `ssh-add ~/.ssh/id_rsa_my_key` to my `.bash_profile`?


Linux CentOS 5 SSH User Permission Denied

Today when I try to SSH into my server, I get a permission denied message (same for `sftp`). It used to work well before, I didn't change any server settings, except I was trying to modify a few folders `chown` permission. Root user can `ssh`/`sftp` without problem. (For root user, there is no `.ssh/authorized_keys` file, only a `.ssh/known_hosts` file. For normal user home folder does not have a `.ssh` folder).


Finding all large files in the root filesystem

I have a linux server, which currently has below space usage:               /dev/sda3              20G   15G  4.2G  78% /     /dev/sda6              68G   42G   23G  65% /u01     /dev/sda2              30G  7.4G   21G  27% /opt     /dev/sda1              99M   19M   76M  20% /boot     tmpfs                  48G  8.2G   39G  18% /dev/shm      As you can see. `/` is at 78%. I want to check, which files or folders are consuming space. I tried this:               find . -type d -size +100M      Which shows result like this:               ./u01/app/june01.dbf     ./u01/app/temp01.dbf     ./u01/app/smprd501.dbf     ./home/abhishek/centos.iso     ./home/abhishek/filegroup128.jar      Now this is my issue. I only want the name of those files located in folders that are consuming space at `/` and not at `/u01` or `/home`. Since `/` is base of everything, it is showing me every file of my server. Is is possible to get big files that is contributing to 78% of `/` ?


permission error with php/nginx and not using www-data

-edit- whats even more curious is if i `chmod 777 /var/run/php-fastcgi/php-fastcgi.socket` this works... if its not www-data, php-www (nor root) then what user is trying to access the socket :| -edit2- i added `chown www-data:$FASTCGI_GROUP $SOCKET` to the end of the script below (which is right after `spawn-fcgi`) and that solves the problem... but wtf, www-data is in the php-www group. why must it be owner. I didnt change FASTCGI_USER back to www-data bc it would defeat the purpose (it would allow the php files to access all my files as www-data which i dont want) Essentially what i wanted to do is have the php process not be www-data so if it gets compromised its damage is limited to the very few php sites i have. What i did was create the user php-www and add its group to www-data. When i log in as www-data i can access everything ih php-www however php-www cant access anything but my php sites. perfect. I got php+nginx running. But how changing it gives me a problem. I see www- data mention in a init.d script which changes the ownership of a folder. Its fine and i changed it to php-www. Thats not a problem. What is the problem is the spawn script.               #!/bin/bash          FASTCGI_USER=php-www     FASTCGI_GROUP=php-www     SOCKET=/var/run/php-fastcgi/php-fastcgi.socket     PIDFILE=/var/run/php-fastcgi/php-fastcgi.pid     CHILDREN=6     PHP5=/usr/bin/php5-cgi          /usr/bin/spawn-fcgi -s $SOCKET -P $PIDFILE -C $CHILDREN -u $FASTCGI_USER -g $FASTCGI_GROUP -f $PHP5      the user/group lines use to say www-data but now i changed them to php-www I started php-fastcgi and nginx. When i visit my site i get a 502 bad gateway error. When i look in nginx logs i see this line               connect() to unix:/var/run/php-fastcgi/php-fastcgi.socket failed (13: Permission denied) while connecting to upstream      Permission denied!?! why!?! www-data does have the group php-www and `stat` that folder and socket shows owner and group php-www. I can access the php file with bot php-www and www-data. Why am i get a permission error? and what am i doing wrong? in case you want to see my process               # ps aux | egrep "php|www"      shows               www-data   548  0.0  0.1   1908   492 ?        Ss   18:08   0:00 /usr/sbin/fcgiwrap     www-data   586  0.0  0.1   1908   488 ?        Ss   18:08   0:00 /usr/sbin/fcgiwrap     php-www   1611  0.0  1.9  19312  5020 ?        Ss   18:20   0:00 /usr/bin/php5-cgi     php-www   1612  0.0  0.7  19312  1856 ?        S    18:20   0:00 /usr/bin/php5-cgi     php-www   1613  0.0  0.7  19312  1856 ?        S    18:20   0:00 /usr/bin/php5-cgi     php-www   1614  0.0  0.7  19312  1856 ?        S    18:20   0:00 /usr/bin/php5-cgi     php-www   1615  0.0  0.7  19312  1856 ?        S    18:20   0:00 /usr/bin/php5-cgi     php-www   1616  0.0  0.7  19312  1856 ?        S    18:20   0:00 /usr/bin/php5-cgi     php-www   1617  0.0  0.7  19312  1856 ?        S    18:20   0:00 /usr/bin/php5-cgi     www-data  1776  0.0  0.6   5428  1684 ?        S    18:27   0:00 nginx: worker process     php-www   1967  0.0  1.9  19312  5020 ?        Ss   18:40   0:00 /usr/bin/php5-cgi     php-www   1968  0.0  0.7  19312  1856 ?        S    18:40   0:00 /usr/bin/php5-cgi     php-www   1969  0.0  0.7  19312  1856 ?        S    18:40   0:00 /usr/bin/php5-cgi     php-www   1970  0.0  0.7  19312  1856 ?        S    18:40   0:00 /usr/bin/php5-cgi     php-www   1971  0.0  0.7  19312  1856 ?        S    18:40   0:00 /usr/bin/php5-cgi     php-www   1972  0.0  0.7  19312  1856 ?        S    18:40   0:00 /usr/bin/php5-cgi     php-www   1973  0.0  0.7  19312  1856 ?        S    18:40   0:00 /usr/bin/php5-cgi     root      2110  0.0  0.2   3300   736 pts/1    S+   18:55   0:00 egrep php|www


Search MP3/Ogg files by tags/parameters from the command line

Is there any utility to search MP3/Ogg files by tags (or other characteristics) from the command line? (e.g. finding all audio files longer than 10 minutes with genre set to 'Rock'). I found this, which suggests using `mp3info`, but it's only for MP3 files and the proposed solution isn't the most elegant thing. Any other suggestions?


restore duplicity backup from amazon s3 in debian

I have applied the script provided here to backup my stuff in debian etch and it works, I tried to reverse the `SOURCE` and `DEST`, but I can't do the restoration. What happened?


Steam / Dota2 with Bumblebee

I'm trying to run Dota2 with Bumblebee and therefore I installed everything like mentioned here: https://wiki.archlinux.org/index.php/bumblebee. If I test my bumblebee install with:               optirun glxspheres64      Or               glxspheres32      Everything works fine. If I start steam without `optirun`, therefore on my internal Intel graphics card, everything works fine, no errors. If I try to start steam by:               optirun steam      And the try to launch `dota2`, the screen flickers for a moment and then dota2 is closed again. I piped the output into a file to provide you with the information you might need:   * http://pastebin.com/gmn9gGLk As far as I know I have all the necessary 32-bit libraries installed, but maybe I'm wrong? If you need additional output let me know, I'd be happy to oblige.


How to change the hash-spec and iter-time of an existing dm-crypt LUKS device?

How can I change the hash-spec and iter-time of an **existing** dm-crypt LUKS device? Clearly I can pass the options if I create a _new_ device, for example something like this:                sudo cryptsetup luksFormat --cipher aes-cbc-essiv:sha256 --key-size 256 --iter-time 2100 --hash sha512 /dev/loop0      But if the device already exists, how can I change for example `sha256` to `sha1` or change the iteration time without "destroying" the device. (Clearly you would have to retype your password since a new hash will be generated.)


Where to drop libraries according Filesystem Hierarchy Standard

I do operate a Linux-based build system. The build system itself is based on Jenkins, Nexus, Maven, Ant and Shell scripting. Some projects need some special tools and libraries for building. Especially we have some Ant-Tasks that are only needed by two projects. And we don't want to drop this tasks into the ant-folder. Whats your recommendation to place this ant-tasks into right location according to FHS? Moreover we have some general purpose xlt-templates, that we need to transform various XMLs in our development projects. The transformation sheets are needed by different but not all projects. Where to put all this XLTs?


ELF interpreter error - Can't install on my CentOS

I don't know if I'm permitted to ask about zPanel here, but I'll go ahead and try and hope for the best. Stackexchange has helped me a lot in different areas... I was following the instructions to install zPanel on my freshly installed CentOS 6.4 x64 VPS, but I'm facing this error which wont let me finish step 5 from this guide: http://www.zvps.co.uk/zpanelcp/centos-6 So, this is how I'm doing it:               [root@img ~]# ./installer-10-1-0-centos-64.sh.x     -bash: ./installer-10-1-0-centos-64.sh.x: /lib64/ld-linux-x86-64.so.2: bad ELF interpreter: No such file or directory      I've read through all online solutions and tried running these commands: `yum install glibc.i686` and `yum install glibc.i386` For the first package, it said it was installed. The second one wasn't found in my system. I've also ran this as the guide instructed:               yum install ld-linux.so.2 curl      But nothing happened. What do I do in order to proceed?


I am reading a 550MB file into /dev/null and I am getting               dd: writing '/dev/null': No space left on device      I was surprised. I thought /dev/null is a black hole where you can send as much as you want ( because its a virtual fs). Yes my disk is almost full when I get this error. What can I do other than deleting content from the disk?                ls -l /dev/null      -rw-r--r--    1 root     root             0 July 7 21:58 /dev/null      Instead of                crw-rw-rw-    1 root     root        1,   3 July 7 02:58 /dev/null      Command I am using:               time sh -c "dd if=$filename of=/dev/null"


Should I run fsck on boot for an amazon ec2 image?

I have an Ubuntu micro instance running on amazon EC2. Recently after logging in I was alerted:               *** /dev/xvda1 will be checked for errors at next reboot ***      I've rebooted a couple times using `init 6`, however when I log on I am still getting the same notice, so apparently `fsck` is not running at startup. I read this blog post which mentions that if the /etc/fstab `<pass>` column is set to `0` then a disk check will be skipped during reboot. Here is my `fstab` file:               <file system>           <mount point><type><options><dump><pass>     LABEL=cloudimg-rootfs   /            ext4  defaults 0     0     /dev/xvdh               /vol         xfs   noatime  0     0      This is the default configuration for an ec2 image from`ubuntu`.   * Is it normal for `<pass`> to be set to `0` here?   * Why would it be set to `0`?   * What is the best way to run `fsck` \- should I change this value or only run it manually when alerted?


Why would Ctrl-C behave differently than kill -2

I have a program which is supposed to handle SIGINT and gracefully shut down. When I run this program from a terminal without backgrounding it I can shut it down just fine using Ctrl-C. Inspecting the logs shows that everything worked as expected. When I open a separate terminal and call `kill -2 [pid]` or `kill -s INT [pid]` it does nothing. I see nothing in the logs and the program continues to run as usual until I hit Ctrl-C in the terminal I launched it from. Are there any differences between how Ctrl-C sends the signal and how kill does? **Additional Details:** The program in question is a Java application launched by a bash shell script which sets up some environment variables (namely `CLASSPATH`) and then calls `java [main class]`. Hitting Ctrl-Z and then running `ps` results in the following:               $ ps -f     UID        PID  PPID  C STIME TTY          TIME CMD     mdeck    10251 10250  0 11:48 pts/2    00:00:00 -bash     mdeck    13405 10251  0 18:12 pts/2    00:00:00 /bin/bash /usr/local/bin/myapp.sh     mdeck    13509 13405 25 18:12 pts/2    00:00:03 java com.company.MyApp     mdeck    13526 10251  0 18:13 pts/2    00:00:00 ps -f      The output of stty as requested by Gilles is below:               $ stty -a </dev/pts/2     speed 38400 baud; rows 40; columns 203; line = 0;     intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>; eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;     -parenb -parodd cs8 -hupcl -cstopb cread -clocal -crtscts     -ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff -iuclc -ixany -imaxbel -iutf8     opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0     isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke