title: Can't delete system email

text: While running Postfix on an Ubuntu, I have acquired a number of test email in an account `usr1`, and now I want to delete them before starting other testing. However, every time I try to delete using both `d #` and 'delete #`, nothing happens. Example:               usr1@usr1:~$ mail       "/var/mail/usr1": 5 messages 5 unread       >U   1 usr2              Tue Apr 30 15:54  19/478   Testing local mail       U   2 Mail Delivery Syst Tue Apr 30 15:54  78/2433  Undelivered Mail Returned to Sender     U   3 usr2               Tue Apr 30 15:55  19/614   Re: Testing local mail     U   4 usr2               Tue Apr 30 15:55  19/604   Re: Testing local mail     U   5 Mail Delivery Syst Tue Apr 30 15:55  73/2219  Undelivered Mail Returned to Sender     ? d 1-5     ? x          usr1@usr1:~$ mail     "/var/mail/usr1": 5 messages 5 unread     >U   1 usr2              Tue Apr 30 15:54  19/478   Testing local mail     U   2 Mail Delivery Syst Tue Apr 30 15:54  78/2433  Undelivered Mail Returned to Sender     U   3 usr2               Tue Apr 30 15:55  19/614   Re: Testing local mail     U   4 usr2               Tue Apr 30 15:55  19/604   Re: Testing local mail     U   5 Mail Delivery Syst Tue Apr 30 15:55  73/2219  Undelivered Mail Returned to Sender     ? x      Can anyone explain why this is? Another Unix SE post talks about using the command as I'd expect it to work (granted, in Solaris), but I don't understand why those mails refuse to delete.


title: Is it possible to change the clock frequency of Wifi chip?

text: Is it possible under Linux to change the frequency of Wifi chips e.g. using Intel driver iwlwifi like we do for CPUs?


title: Proper way of changing username in Ubuntu or any linux

text: I am using Ubuntu 12.04 and made some customization. I will also make it a new iso which is customized ubuntu. What I want to ask is how can I change my username. There are plenty much configuration in my current home folder. So I don't want to mess up with changing username. So is there any best practice or workflow to do that?


title: Find directories without music files

text: My `~/Music/` directory is actually full of "empty" directories I want to clean. I say "empty" because this directories actually contain files, some contain old cover image files or `Thumbs.db files`. I want to recursively delete all of these directories that **don't contain any music files inside or other directories inside.** For example ~/Music/Audioslave/ contains a lot of directories with album names and no music files, but I don't want to delete it because inside there are the music files. I want though to delete ~/Music/Audioslave/oldalbum/ if the oldalbum directory doesn't have nor music files nor other directories inside.


title: What kernel for ARM architechture, Linux or BSD?

text: I'm a computer sciences student and recently started a project with the engineering department that involves an onboard ARM processor, the question is what sort of operating system, kernel and filesystem, is recommended for such case. I'm sure that the best idea would be to develop our own system, so we can save the processor and memory resources, but this is mainly for testing and establishing the system needs and capabilities, so for that purpose, what operating system is recommended and why? Thank you for you help, Colin.


title: Mirror for Fedora core 4 still available?

text: I'm trying to rebuild ELDK 4.0, which uses Fedora Core 4 as its base. Can anyone direct me to a mirror that still hosts the files?


title: determining path to sourced shell script

text: Is there a way for a _sourced_ shell script to find out the path to itself? I'm mainly concerned with bash, though I have some coworkers who use tcsh. I'm guessing I may not have a ton of luck here, since sourcing causes commands to be executed in the current shell, so `$0` is still the current shell's invocation, not the sourced script. My best thought currently is to do `source $script $script`, so that the first positional parameter contains the necessary information. Anyone have a better way? To be clear, I am _sourcing_ the script, not running it:               source foo.bash


title: protocol version mismatch (client 8, server 6) when trying to upgrade

text: I'm trying to upgrade to a newer version (that has a bug fix) than my current 1.6. I am on Ubuntu and recently upgraded to Ubuntu 13.04. Ideally I want to use tmux version 1.8 or even 1.9. I've downloaded newer versions but can't get them working. I downloaded 1.9a but when I try and run it, it just hangs. I tried this download: http://sourceforge.net/p/tmux/tmux- code/ci/master/tree/README#l26 and did the               $ sh autogen.sh     $ ./configure && make      but I get               $ ./tmux     $ protocol version mismatch (client 8, server 6)      I tried to download and use a 1.8.4 version but the download didn't seem to have files I could use.


title: Exit the bash function, not the terminal

text: I have a bash script as below which installs zookeeper but only if not installed already.               ##zookeper     installZook(){                  ZOOK_VERSION="3.4.5"             ZOOK_TOOL="zookeeper-${ZOOK_VERSION}"             ZOOK_DOWNLOAD_URL="http://www.us.apache.org/dist/zookeeper/${ZOOK_TOOL}/${ZOOK_TOOL}.tar.gz"                  if [ -e $DEFAULT_INSTALLATION_DEST/${ZOOK_TOOL} ]; then                     echo "${ZOOK_TOOL} alreay installed";                     exit 1;      # <<<< here             elif [ ! -e $DEFAULT_SOURCE_ROOT/${ZOOK_TOOL}.tar.gz ]; then                     wgetIt $ZOOK_DOWNLOAD_URL             else                     echo "[info] : $DEFAULT_SOURCE_ROOT/$ZOOK_TOOL already exists"             fi                  sudo mkdir -p /var/lib/zookeeper             sudo mkdir -p /var/log/zookeeper                  tarIt "$DEFAULT_SOURCE_ROOT/$ZOOK_TOOL.tar.gz"             sudo chmod 777 -R $DEFAULT_INSTALLATION_DEST/$ZOOK_TOOL             cp $DEFAULT_INSTALLATION_DEST/$ZOOK_TOOL/conf/zoo_sample.cfg $DEFAULT_INSTALLATION_DEST/$ZOOK_TOOL/conf/zoo.cfg     cat >> ~/.bash_profile <<'EOF'            ###############################       ########### ZOOK ###############       ###############################       ZOOK_HOME=/usr/local/zookeper-3.4.5       export ZOOK_HOME       export PATH=$PATH:$ZOOK_HOME/bin          EOF     }      At the line marked `<<<< here`, if zookeeper is already installed, what I want is to exit the script below it. But using `exit` exits the terminal itself.


title: Why can't I su when if I am in the wheel group in OpenBSD?

text: Using a               OpenBSD 5.4 (GENERIC) #37: Tue Jul 30 15:24:05 MDT 2013      **I created a new user named "bela" and added it to the wheel group** :               # adduser     Use option ``-silent'' if you don't want to see all warnings and questions.          Reading /etc/shells     Check /etc/master.passwd     Check /etc/group          Ok, let's go.     Don't worry about mistakes. There will be a chance later to correct any input.     Enter username []: bela     Enter full name []:      Enter shell csh ksh nologin sh [ksh]:      Uid [1000]:      Login group bela [bela]:      Login group is ``bela''. Invite bela into other groups: guest no      [no]:      Login class authpf bgpd daemon default staff [default]:      Enter password []:      Enter password again []:           Name:        bela     Password:    ****     Fullname:    bela     Uid:         1000     Gid:         1000 (bela)     Groups:      bela      Login Class: default     HOME:        /home/bela     Shell:       /bin/ksh     OK? (y/n) [y]: y     Added user ``bela''     Copy files from /etc/skel to /home/bela     Add another user? (y/n) [y]: n     Goodbye!     # id bela     uid=1000(bela) gid=1000(bela) groups=1000(bela)     # vi /etc/group       # grep bela /etc/group                                                                                wheel:*:0:root,bela     bela:*:1000:     # id bela     uid=1000(bela) gid=1000(bela) groups=1000(bela), 0(wheel)     # exit      The 127.0.0.1 is used because of running the OpenBSD in a Virtual machine:               ssh bela@127.0.0.1 -p 2222     bela@127.0.0.1's password:      $ id     uid=1000(bela) gid=1000(bela) groups=1000(bela), 0(wheel)     $ su     Password:     Sorry     $ echo $?     1     $ exit     Connection to 127.0.0.1 closed.     ssh root@127.0.0.1 -p 2222     root@127.0.0.1's password:      Last login: Mon Jan 13 07:46:26 2014 from 10.0.2.2     # cd /var/log                                                                                # cat authlog      Jan 13 07:44:03 a sshd[28057]: Server listening on 0.0.0.0 port 22.     Jan 13 07:44:03 a sshd[28057]: Server listening on :: port 22.     Jan 13 07:44:43 a login: ROOT LOGIN (root) ON ttyC0     Jan 13 07:46:15 a sshd[7284]: Did not receive identification string from 10.0.2.2     Jan 13 07:46:26 a sshd[11416]: Accepted password for root from 10.0.2.2 port 50734 ssh2     Jan 13 07:50:13 a sshd[11416]: Received disconnect from 10.0.2.2: 11: disconnected by user     Jan 13 07:50:24 a sshd[3083]: Connection closed by 10.0.2.2 [preauth]     Jan 13 07:50:28 a sshd[20344]: Accepted password for bela from 10.0.2.2 port 50751 ssh2     Jan 13 07:50:38 a su: **BAD SU** bela to root on /dev/ttyp0     Jan 13 07:50:46 a sshd[12615]: Received disconnect from 10.0.2.2: 11: disconnected by user     Jan 13 07:50:51 a sshd[3046]: Accepted password for root from 10.0.2.2 port 50753 ssh2     #       **My question:** Why can't I su to root with the "bela" user? The password for the user is simple, can't mess up.


title: With a file with 750 permission, which group has "5" permission?

text: The bits 750 invoke the `-rwxr-x---` permissions, on a given file, to the user who owns the file and "the" group. My query regards the group. Which group on the system would receive these permissions? Am I right in assuming that they would be awarded to the group that the owner belongs to? If so, is this **always** the case?


title: How does this find command using "find ... -exec sh -c '...' sh {} +" work?

text: @StephaneChazelas posted the following solution to this Q&A: Having some trouble using “find -exec {} +”.               $ find . -iname "*.extension" -exec sh -c '       exec <command> "$@" <additional parameters>' sh {} +      What exactly is going on here? Specifically what does the last `sh {}` do? It seems as though it's just there to pacify find's `-exec` command so that it has something to do, a NOOP. I could just as easily put `echo {}` there and it appears to work just fine.


title: rkhunter warn me about root.rules

text: I run :               :~$ sudo rkhunter --checkall --report-warnings-only      One of the warnings I've got :               Warning: Suspicious file types found in /dev:              /dev/.udev/rules.d/root.rules: ASCII text      and the `root.rules` contains :               SUBSYSTEM=="block", ENV{MAJOR}=="8", ENV{MINOR}=="1", SYMLINK+="root"      I would like ti understand the meaning and role of those variables `SUBSYSTEM`, `ENV{MAJOR}` and `SYMLINK+` .


title: Using a perl compatible regex with GNU grep -P

text: I'm using this regex `(?<=\\[')[^,]*` on a file containing the following line `disk = ['OVS/sdasd/asdasd/asdasd/something.img, w']` I want that to return `OVS/sdasd/asdasd/asdasd/something.img` How do I use `grep` to make it work? I've tried `grep -P "(?<=\\[')[^,]*"` but it returns the whole line.


title: Getting IO privileges in Linux

text: I have installed `flashrom` software. When i try to run `sudo flashrom` command it gives me "Could not get I/O privileges (Operation not permitted). You need to be root" error. Also I tried `su` command to switch root and run again. I also tried `sudo -i` command to login as root. However any of them did not work


title: CentOS 6 - No Updates

text: I've had a CentOS 6.3 VM set up for some time now, but I'm not seeing any updates when I run yum check-update, or yum list-security. There has to be something (especially with Apache/MySQL!). If I run `yum list --security` or `\--bugfix`, I do see quite a few packages, but I know many of them don't apply as they're not installed. When running `yum check-update --security`, again I get > No packages needed for security; 0 packages available Now, perhaps there aren't _any_ , but that doesn't seem plausible.


title: LXC containers as a sandbox environment

text: I am currently starting a project evaluating untrusted programs (student assignments) in a secure sandbox environment. Main idea is to create a web app for GlassFish and Java wrapper around lxc-utils to manage LXC containers. It'll have a queue of waiting programs and a Java wrapper will maintain a fixed number (pool) of LXC containers, assigning each program one (unused) container. Each container should be secured with SELinux to protect the host system. My question is: Is it a good idea to create such a mechanism for a sandbox environment, or are there any better fitting solution to this problem? It should be light and secure against student creativity.


title: List subdirectories only n level deep

text: Festival stores voicepack data in the following example directory structure: `/usr/share/festival/voices/<language>/<voicepack name>` What is the simplest one-liner (preferably using `ls`) to print out just the `<voicepack name>`'s, in all the potentially numerous `<language>` subdirectories?


title: Cannot install BIND dns with yum on Oracle Enterprise Linux 6.1

text: I am currently using Oracle Enterprise Linux 6.1 to use for Oracle RAC. However I am stuck at installing BIND (DNS Server) at the VM I've set up. I've used the following command:               yum install bind_libs bind bind-utils      I get the error: `no package bind available` Any help is appreciated.


title: Why do I need a tty to run sudo if I can sudo without a password?

text: I have configured `sudo` to run without a password, but when I try to `ssh 'sudo Foo"`, I still get `sudo: sorry, you must have a tty to run sudo`. Why does this happen and how can I work around it?


title: Linux Mint 16 display resolution and monitor

text: I am using Linux Mint 16 and I have two questions. I am very disappointed I have needed to resort to a website to answer this, usually on Windows this would be very intuitive. The first problem is that for some reason I appear to have a screen resolution waaaaaay larger than my screen. When I was opening settings, the settings were appearing in an inaccessible part of the screen. Why wasn't this detected automatically/how do I fix it? Second, I have a VGA port on my laptop I use to connect to my monitor. How can I redivert the signal to the monitor? Thanks in advance


title: Too Much System Time

text: I have observed that when running CESM (a weather modeling application), the `top` command shows a great deal of time is spent on system calls, about 25% to 60%, and only 40% to 75% is used in user code. The application does some I/O and communicates with MPI. A sample output from the top command is given below:               top - 16:54:32 up 11 days, 13:45,  2 users,  load average: 8.12, 8.25, 8.08     Tasks: 201 total,   9 running, 192 sleeping,   0 stopped,   0 zombie     Cpu(s): 74.3%us, 25.2%sy,  0.0%ni,  0.0%id,  0.0%wa,  0.0%hi,  0.5%si,  0.0%st     Mem:  24659792k total,  5259280k used, 19400512k free,  1747768k buffers     Swap: 28667984k total,   234408k used, 28433576k free,   169080k cached            PID USER    PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND     20748 user1   25   0  516m 304m  26m R 100.2  1.3  22:31.81 ccsm.exe     20750 user1   25   0  497m 293m  26m R 100.2  1.2  27:12.45 ccsm.exe     20754 user1   25   0  496m 290m  24m R 100.2  1.2  27:18.33 ccsm.exe     20751 user1   25   0  496m 291m  25m R 99.9  1.2  27:21.63 ccsm.exe     20752 user1   25   0  496m 291m  25m R 99.9  1.2  27:18.97 ccsm.exe     20749 user1   25   0  686m 446m  26m R 99.2  1.9  26:36.16 ccsm.exe     20753 user1   25   0  554m 335m  25m R 98.5  1.4  27:19.78 ccsm.exe     20755 user1   25   0  496m 289m  23m R 97.2  1.2  27:12.34 ccsm.exe      Using the `strace` command to attach to process 20748 shows a lot of               poll([{fd=4, events=POLLIN}, {fd=5, events=POLLIN}, {fd=6, events=POLLIN}, {fd=7, events=POLLIN}, {fd=10, events=POLLIN}, {fd=18, events=POLLIN}, {fd=19, events=POLLIN}], 7, 0) = 0 (Timeout)     poll([{fd=4, events=POLLIN}, {fd=5, events=POLLIN}, {fd=6, events=POLLIN}, {fd=7, events=POLLIN}, {fd=10, events=POLLIN}, {fd=18, events=POLLIN}, {fd=19, events=POLLIN}], 7, 0) = 0 (Timeout)     poll([{fd=4, events=POLLIN}, {fd=5, events=POLLIN}, {fd=6, events=POLLIN}, {fd=7, events=POLLIN}, {fd=10, events=POLLIN}, {fd=18, events=POLLIN}, {fd=19, events=POLLIN}], 7, 0) = 0 (Timeout)      Using `strace -c -p 20748` to count time for a while I got:               $ strace -c -p 20748     Process 20748 attached - interrupt to quit     Process 20748 detached     % time     seconds  usecs/call     calls    errors syscall     ------ ----------- ----------- --------- --------- ----------------      85.17    0.068864           0  11713876           poll       9.74    0.007876           2      4208           write       4.45    0.003595           1      6463           munmap       0.37    0.000302           0      6463           mmap       0.22    0.000179           0      1068           brk       0.03    0.000025           1        18           open       0.02    0.000016           1        18           read       0.00    0.000000           0        18           close       0.00    0.000000           0         2         1 stat       0.00    0.000000           0        18           fstat       0.00    0.000000           0         2           madvise       0.00    0.000000           0         1           getcwd     ------ ----------- ----------- --------- --------- ----------------     100.00    0.080857              11732155         1 total      The file descriptors appeared in the poll are sockets and a pipe.               4 -> socket:[2789396]     5 -> socket:[2789451]     6 -> socket:[2789452]     7 -> socket:[2789456]     10 -> pipe:[2789492]     18 -> socket:[2789517]     19 -> socket:[2789518]      I feel too much time are wasted in poll and wander if anything can be done to decrease this. The first thing I can think of is to find where `poll` is called. The code of the application doesn't call `poll` directly. How can I trace back to the source of the call? How to trace back to where the sockets are created?


title: How to install an old version of OpenBSD inside VirtualBox?

text: I'm reading an old Phrack article and I would like to install OpenBSD 3.0 inside VirtualBox. I remember installing this very version using actual physical floppy disks in 2001, but nowadays I don't feel like dedicating one physical machine to it. So how do you boot using `cdrom30.fs` with VirtualBox ? `file cdrom30.fs` outputs: cdrom30.fs: Unix Fast File system [v1] (little-endian), last mounted on /mnt, last written at Thu Oct 18 22:54:56 2001, clean flag 1, number of blocks 5760, number of data blocks 5695, number of cylinder groups 1, block size 4096, fragment size 512, minimum percentage of free blocks 0, rotational delay 0ms, disk rotational speed 5rps, SPACE optimization How to make a bootable ISO CDROM image of this file ? Any other solution, like a network installation, would be acceptable. I just need to know how to have a clean install of OpenBSD 3.0


title: How do I connect a serial terminal to a KVM instance?

text: Perhaps I'm misunderstanding what KVM is capable of, but the ability to add/remove hardware on the VM seems to imply I can add a serial port that then acts as a terminal. So, my questions are:   1. Which settings are best for the guest FreeBSD distribution? (There are many!)   2. How do I access said terminal from my Linux host?


title: What are the best general purpose programming tools to complement Vim?

text: I've been using Vim as my text editor for a little while now and I feel like I'm taking the long way to do anything. I use ctags to tag my code base for navigation and I use grep (although inefficiently) to find where certain methods are used. But I have a feeling there are some very useful tools out there that I don't know about that could make me more productive. What is the best software stack I could use for general programming that would complement Vim? How do you navigate a code base, run make, push changes to your source control system, etc? Do you have a 2nd console open next to Vim?


title: chroot "jail" - what is it and how do I use it?

text: I have heard/read a lot about the chroot jail under linux but have never yet used it (I use Fedora day-to-day), so what is a chroot "jail"? When and why might I use it/not use it and is there anything else I should know? How would I go about creating one?


title: How can I easily configure samba share in Debian Wheezy?

text: I have just installed a new Debian Wheezy and I am trying to create a new share. I am using KDE 4, and there in the folder preferences menu I found option to share the folder with Samba - it doesn't seem to do anything though! Is there a GUI or some web based configuration tool available in Debian?


title: iptables... blocking a range without flooding ipset set with IPs

text: I have this range of IPS 197.192.x.x that is brute force attacking my pop/imap/smtp servers day after day. I have this ipset in place that is blocking every IP that tries to hack on my server. I would like to block access for pop/smtp/imap for all IPs starting with 197.192 To do this, I have typed this command:               ipset -A myIpset 197.192.0.0/24      but this added 65536 IPs to my ipset, making it huge and now I cannot add more IPs to it. Is there another way to do this in a more elegant way?


title: Fedora Failed to get D-Bus connection

text: I have a VPS with fedora 16 installed. I have setup mysql and it was working a couple of days ago. Now suddenly when I try to start mysql I get the error:               Failed to get D-Bus connection: Failed to connect to socket /org/freedesktop/systemd1/private: Connection refused      I'm not sure when mysql stopped working as I haven't worked with it in a couple of days. The only software I installed recently was jenkins and redmine.


title: Mutt silently failing when trying to send an e-mail from command line

text: I'm trying to send and e-mail from mutt from command line using following command:               mutt -F /my/path/to/muttrc -s "Hello" an@email.com < test.txt      But nothing happens. Mutt doesn't display any error but mail it's not sent. Everything works fine if I enter interactive mutt using `mutt` command and send the e-mail from there. In my muttrc I have configured a gmail account, like this:               account-hook    imaps://a_user@imap.gmail.com 'set imap_user=a_user@gmail.com imap_pass="password"'     folder-hook     'imaps://a_user@imap.gmail.com' 'set folder=imaps://a_user@imap.gmail.com/'     set folder=imaps://a_user@imap.gmail.com/     mailboxes +INBOX     set spoolfile = +INBOX     folder-hook    imaps://a_user@imap.gmail.com 'set smtp_url="smtps://a_user:password@smtp.gmail.com"'     folder-hook     'imaps://a_user@imap.gmail.com' 'set from=a_user0@gmail.com'     folder-hook    imaps://a_user@imap.gmail.com 'set realname="A Real Name"'          set header_cache=~/.mutt/cache/headers     set message_cachedir=~/.mutt/cache/bodies     set certificate_file=~/.mutt/certificates     unset record     set timeout=15     set mail_check=60     set imap_keepalive = 900     unset imap_passive     set move = no     set sort = 'last-date-received'     set charset=utf-8     set locale=$LANG     send-hook "~f a_user@gmail.com" 'set signature="~/.mutt/signature"'     set editor = 'vim'


title: Change IP address of a Virtual Machine running linux ubuntu on windows 8?

text: I currently have created two virtual machines in VirtualBox both running linux Ubuntu 14.04, and now want to have them have different IP addresses. (By default, they have the same IP address.) However, when I go to the Network settings of a virtual machine, and try to use the "Bridged Adapter" instead of the "NAT" network, the Bridged Adapter simply offers "Not Selected", and no other network choice. Thus, does anyone know how I can change the IP address of one of my virtual machines in another manner?


title: Install Debian on ONE partition

text: My plan was to dual boot Windows 8.1 and Debian. Currently I have Windows installed. My disk can only have 4 partitions. One is system reserved. I want to give both OS their own 64GB partitions, and have the 3rd partition serve as 'Media' drive shared by both OS (it will serve as a pseudo user home for pics, documents, etc) So that means all 4 partitions would be put to use. Debian MUST be installed on ONLY the partition I reserved for it. When I install Debian, how can I ensure that it ONLY installs on that partition? Because I know that it can use an extra one for swap. Also, doing this wont interfere with my Windows installation, will it?


title: How to add boot parameters in arch linux

text: I want to add `i915.i915_enable_rc6=1` as a kernel line as described here but I'm unsure where/how exactly.


title: Networking and Samba from a quest OS running on qemu

text: I'm trying to test some software on a big endian system to ensure compatibility. My plan is to use qemu on Ubuntu 12.04 to emulate a MIPS system. So far I've been able to create the quest system successfully, but I haven't been able to network it with the host system. I can access the outside world from the guest system (e.g. wget or apt-get), but my attempts at setting up samba have failed. According to this, in QEmu 1.1 and newer the network bridge helper can set tun/tap up for you without the need for additional scripting. I'm trying to use that since I've seen different versions of the scripts. Right now `qemu- system-mips -version` reports the following:               QEMU emulator version 1.0.50 (Debian 1.0.50-2012.03-0ubuntu2.1), Copyright (c) 2003-2008 Fabrice Bellard      I've compiled from the 1.4.1 source and used the version from `apt-get`. Both report the same thing. I'm working under the assumption that I have version 1.1 or later despite what `-version` is telling me. Anyway, the next instruction was to turn on the setuid attribute for the default network helper:               sudo chmod u+s /usr/local/libexec/qemu-bridge-helper      Next I created a `bridge.conf` file in `/etc/qemu/` and `/usr/local/etc/qemu` with `-rw-r--r--` for permissions. The contents of the file are:               allow br0      If I start QEmu with the following command:               qemu-system-mips -M malta -kernel vmlinux-2.6.32-5-4kc-malta -hda disk.img -append "root=/dev/sda1 console=ttyS0" -nographic -net nic -net bridge,br=br0 -smb /home/uli/samba      or with               qemu-system-mips -M malta -kernel vmlinux-2.6.32-5-4kc-malta -hda disk.img -append "root=/dev/sda1 console=ttyS0" -nographic -netdev bridge,id=hn0 -device virtio-net-pci,netdev=hn0,id=nic1      or with               qemu-system-mips -M malta -kernel vmlinux-2.6.32-5-4kc-malta -hda disk.img -append "root=/dev/sda1 console=ttyS0" -nographic  -netdev tap,helper=/usr/local/libexec/qemu-bridge-helper,id=hn0 -device virtio-net-pci,netdev=hn0,id=nic1      I get the following error:               failed to get mtu of bridge `br0': No such device     failed to launch bridge helper     qemu-system-mips: -net bridge,br=br0: Device 'bridge' could not be initialized      Fair enough, I didn't create the br0 bridge. I've tried creating one with a script I don't understand, but then my quest MIPS QEmu system no longer connects to anything. It sees br0, but it doesn't get an IP address. Clearly I'm doing something wrong here:               ifconfig br0 down     brctl delbr br0          ifconfig eth2 0.0.0.0 promisc up          brctl addbr br0     brctl setfd br0 0     brctl addif br0 eth2          echo 1 > /proc/sys/net/ipv4/conf/br0/proxy_arp     echo 1 > /proc/sys/net/ipv4/conf/eth2/proxy_arp     echo 1 > /proc/sys/net/ipv4/ip_forward          dhclient br0     ifconfig br0 up      Is there an easier way to do this? Personally, I would be fine just using the SMB server on \10.0.2.4\qemu that's described here, but that hasn't worked for me either (115 errors when I try to mount the share, presumably because of networking trouble). **Update** Once I create the bridge, I see the following output from ifconfig on the host machine:               br0       Link encap:Ethernet  HWaddr XX:XX:XX:XX:XX:XX                 inet addr:10.2.32.101  Bcast:10.2.32.255  Mask:255.255.255.0                         UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1               RX packets:85 errors:0 dropped:0 overruns:0 frame:0               TX packets:51 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:0                RX bytes:8235 (8.2 KB)  TX bytes:9227 (9.2 KB)          eth2      Link encap:Ethernet  HWaddr XX:XX:XX:XX:XX:XX                 UP BROADCAST RUNNING PROMISC MULTICAST  MTU:1500  Metric:1               RX packets:196581 errors:0 dropped:0 overruns:0 frame:0               TX packets:44205 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:1000                RX bytes:139517339 (139.5 MB)  TX bytes:3365206 (3.3 MB)      Checking the `brctl show` output, I see the following:               bridge name     bridge id           STP enabled     interfaces     br0             8000.XXXXXXXXXXXX       no              eth2      Now I start the quest system in QEmu. If I run ifconfig, I see the following:               eth0      Link encap:Ethernet  HWaddr XX:XX:XX:XX:XX:XX                 UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1               RX packets:536 errors:1 dropped:51 overruns:0 frame:0               TX packets:13 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:1000                RX bytes:55083 (53.7 KiB)  TX bytes:2862 (2.7 KiB)               Interrupt:10 Base address:0x1020      And the bridge looks like this:               bridge name     bridge id           STP enabled     interfaces     br0             8000.XXXXXXXXXXXX   no      eth2                                                             tap0      Unfortunately with this setup, the quest system has lost the limited "user mode" networking it once had (i.e. wget and apt-get no longer work). The only IP address I see is for the bridge, so I'm not sure how the quest will appear on the network. The host still appears, at the same IP address as br0. **Update** Here is the output from iptables -L               Chain INPUT (policy ACCEPT)     target     prot opt source               destination                   Chain FORWARD (policy ACCEPT)     target     prot opt source               destination                   Chain OUTPUT (policy ACCEPT)     target     prot opt source               destination


title: Information about the 1630/master app

text: When I run               $ sudo netstat -a --programs | grep LISTENING | grep 1630      I will get this output. Do you know what good are processes running under this app name? Why they I running on my system and if it's OK to have them running?               $ sudo lsof -Pwn | grep 1630/master      founds no information               $ find /usr -type f -perm +111 -name master      gives               /usr/lib/postfix/master      Is this a security problem? I don't remember I have installed mail server. Could this be installed by malicious software? Can I remove if from running processes if I don't need it?


title: Memory Management: Faulting virtual addresses

text: I came across the following on http://tldp.org/LDP/tlk/mm/memory.html > If the faulting virtual address is invalid this means that the process has > attempted to access a virtual address that it should not have. Maybe the > application has gone wrong in some way, for example writing to random > addresses in memory. In this case the operating system will terminate it, > protecting the other processes in the system from this rogue process. Now, my doubt is related to this phrase > "faulting virtual address is invalid". What is exactly meant by this? **How can a * _virtual address be invalid_ ***? After all, any 32 bit value (on a 32 bit machine) would correspond to some 'valid' address in the virtual address space.


title: Looking for a centred, full-screen terminal

text: There exist out there several different 'distraction-free editors' for writing: these provide a fullscreen, minimal environment with the goal of forcing oneself to focus on the task at hand. I want to do something similar with `vim`. While I can simply fire it up in a terminal and then press F11 to put it to fullscreen, I _also_ want to limit the width to around 75 characters and centre the area I'm using. Think about how word processors provide a virtual page in the middle of the program -- that's what I want. Sort of. Is there a way to do this, either with a special terminal program or with some setting in vim? If one of the GUI vim programs have this capability, or if there's any other way of doing it that I haven't thought of, that would also be a useful answer.


title: Highlight today in Mac's cal

text: Every Mac comes with `cal` which shows a simple calendar of current month. Output is something like this:                  February 2014     Su Mo Tu We Th Fr Sa                        1      2  3  4  5  6  7  8      9 10 11 12 13 14 15     16 17 18 19 20 21 22     23 24 25 26 27 28      I was wondering if we can use some `sed` and `date` magic and highlight today's number using ANSI escape sequences. I haven't tried anything because I don't know much about `sed`.


title: Is it possible for a sysadmin to eavesdrop on his/her users' terminals?

text: When logged in to a machine, I can find out each user's pseudo-terminal device(s) from the output of `w`. Being a sysadmin, is it possible for me to eavesdrop on this terminal without the user being aware? In other words, I would like to see everything being done on this terminal as output on my own terminal. Please note the following:   * This is not for a practical use case of monitoring user activities: I'm aware there are system auditing tools for that. I'm just curious if it can be done.   * I'm aware of this question and it doesn't seem to cover what I'm asking about as all the solutions suggested there are either invasive (the user would be aware of what I'm doing) or produce too much noise (the `strace` solution). The one solution that comes close is the one that suggests using `gdb`. But this only lets me see stdout of the other terminal. **What I have tried** I tried this from my terminal:               tee /dev/pts/user_pts </dev/pts/user_pts      This allows me to see each character the user types in the other pseudo- terminal as they type it. The problem is, every few characters, it would "skip": it would show one rogue character on one terminal device but not the other. It also prevents the execution of any commands from the user's pseudo terminal device. I'm not really sure why this is happening and whether there's a way to improve it. **What I would like to see**               USER TERMINAL        |    MY TERMINAL     $ echo "Test"        |    # slick_command_here     Test                 |    echo "Test"     $                    |    Test


title: benchmarking ftp in 3 methods of virtualization

text: My Bachelor Final Project is about benchmarking visualization methods with ftp, web and mysql services: installing Debian on xen (para-visualization) kvm and lxc with equal resources config (equal CPU cores , RAM size and HDD size) everything is ok but: Para-ftp Benchmark Jmeter Screenshot LXC-ftp Benchmark Jmeter Screenshot I used dedicated Hard Disk with LVM partitions for all lxc , xen and kvm. My question is: why does this result happen while in other tests with services such as MySQL [for DBMS test] and Apache [for web service], the container based systems go about 2X faster than paravirtualized system?


title: Can't increase partition size with GParted?

text: I've got an external disk with 6 partitions: 4 for linux, one storage in HFS+, and one storage in ext4. I'd like to delete the ext4 storage one and move it's resulting unallocated space into my HFS+ one, but in GParted, I delete the ext4, and it becomes unallocated. But when I try to resize my HFS+, I can't enter a new value for "New size (MiB)", and the up arrow for it's size is disabled. How can I do this? My partitions:               /dev/sdb1 ext4 /boot 476.84 MiB     /dev/sdb2 linux-swap 1.86 GiB     /dev/sdb3 ext4 / 9.31 GiB     /dev/sdb4 ext4 /home 46.57 GiB     /dev/sdb5 hfs+ SodiumOxide 523.32 GiB (89.81 used, 433.51 unused)     /dev/sdb6 ext4 WiiMC 14.65 GiB (5.36 used, 9.29 unused)      I'd like to delete sdb6 and add it's resulting unallocated space to sdb5 (SodiumOxide)


title: Vimrc, map control-; to an action

text: How do I map holding down `Ctrl` and pressing `;` in Vim? It doesn't work on my Linux terminal. `Ctrl`-`l` works fine after putting `<c-l> some_action` in my vimrc, but `<c-;> some_action` does nothing.


title: Booting from ISO in Xen Paravirtualized Environment

text: Specifically, Citrix XenServer 5.6. I can map the an ISO from a Storage Repository with no issues and mount it inside the OS but I can't boot from the DVD drive without converting it to HVM, which causes problems because the ISO I'm trying to boot from is a "Bare Metal" restore so it's a tad bit sensitive to whether it boots into paravirt or HVM mode (for example, former uses paravirt drivers for primary HDD at `/dev/xvda` whereas the latter puts primary HDD at `/dev/sda`). I've looked online and the only thing I've been able to find are instructions on how to boot from ISO by converting to HVM (which works for the boot, but undercuts the reason for the boot in the first place). I've looked around without much luck on how to configure Citrix's PyGrub to boot from ISO. No joy on that, and the only PyGrub examples I've found don't look like they're going to play well with Citrix and are far too manual for that to be our SOP in case of disaster recovery.


title: Mail Server Spoofing Prevention

text: I was in the mail logs yesterday when i noticed the following messages.. only there were more like 10,000 odd hits...               Jun 21 10:47:10 exi-svr-2 dovecot: pop3-login: Disconnected: user=, method=PLAIN, rip=67.228.94.206, lip=xxx.xxx.xxx.xxx     Jun 21 10:47:10 exi-svr-2 dovecot: pop3-login: Disconnected: user=, method=PLAIN, rip=67.228.94.206, lip=xxx.xxx.xxx.xxx I added 67.228.94.206 to my firewall like so               iptables -I RH-Firewall-1-INPUT -s 67.228.94.206 -j DROP     service ip tables save The attack stopped straight away, however in the process it managed to successfully obtain a user account and started spoofing with it. I deleted that user account however it appears that it is still being spoofed as I am getting flooded with bounce emails from various mailservers               Jun 22 15:08:08 exi-svr-2 postfix/smtp[27219]: connect to vahoo.com[216.151.212.175]: Connection refused (port 25)     Jun 22 15:08:07 exi-svr-2 postfix/smtp[27158]: connect to mail.gamdak.co.za[196.215.56.13]: Connection refused (port 25)     Jun 22 15:08:07 exi-svr-2 postfix/smtp[27169]: A72A61068460: to=, relay=none, delay=33839, delays=33839/0.13/0.51/0, dsn=4.4.1, status=deferred (connect to keywordranking.com[208.87.35.105]: Connection refused)     Jun 22 15:08:07 exi-svr-2 postfix/smtp[27169]: connect to keywordranking.com[208.87.35.105]: Connection refused (port 25)     Jun 22 15:08:07 exi-svr-2 postfix/smtp[27179]: 40A9C1068515: to=, relay=none, delay=32038, delays=32038/0.22/0.19/0, dsn=4.4.1, status=deferred (connect to graintech-makeway.com[50.116.103.74]: Connection refused) Not entirely sure how to go about fixing this and the preventive measures I need to take to stop this happening going forward? I have read elsewhere that this kinda thing is unavoidable and can pretty much ignored by not trapping these messages on the log... obviously i'm not entirely comfortable with this. Im running CentOS 5.6 Postfix, Dovecot, AMaViS, SpamAssassin, ClamAV


title: Where to submit new mimetypes?

text: I've defined new mimetypes with file suffix, where should I submit my work, so that it will be included in future linux/unix distros ?


title: Can awk use field identifiers also for shell strings (variables)?

text: Well, this apparently is not possible the way I'm trying it. This alternate approach to obtain **bar** as a resulting string works, though:               #!/bin/bash          path1=/usr/tmp/foo/bar/baz          awk -F/ '{print $5}' <<< "$path1"      So far so good, but what if I want to do without the `<<<` operator as well as those notorious `echo | ...` pipes? In a nutshell, what I'm trying to do is passing `path1` as a variable with the `-v pa="$path1"` directive _and_ using both the field separator `-F/` and the field identifiers (e. g. `$5`) to parse the `awk`- **internal** `pa` variable, which got its value assigned from the **external** `path1` shell variable. Can this be done "inside" `awk`, too?


title: Is there a way to see which process invoked a shell script?

text: Is there a possibility so see from some unix log file what process have invoked a bash/ksh shell script or is this shell script invoked manually from command line? So is there some log file which stores this kind of history automatically?


title: How to display a .jpg file using fbi in a bash script for set amount of time and then execute the next command in the script

text: I am trying to use `fbi` in a bash script to display a series of `.jpg` images. But once `fbi` begins its process, it continues to cycle through the images and I only want to display each image once for a set period of time.


title: Which system configuration setting(s) on HP Compaq dc5750 need to be changed if "running Unix"?

text: HP Compaq dc5750 small form factor Athlon 64 X2 3800+ 2.0GHz 2GB 160GB On starting the system it displayed this message: > If you are running Unix, you need to configure your system using the > computer setup utility (F10) Which system configuration setting(s) need to be changed?


title: How do I fix broken libxml2-dev dependency on Debian using apt?

text: When I run `sudo apt-get upgrade` on my Debian Squeeze install, I get the following error:               You might want to run 'apt-get -f install' to correct these.     The following packages have unmet dependencies:      libxml2-dev : Depends: libxml2 (= 2.7.8.dfsg-2+squeeze3) but 2.7.8.dfsg-2+squeeze5 is installed     E: Unmet dependencies. Try using -f.      I'm not sure what "squeeze3" versus "squeeze5" means, but it is the only thing that differs in the libxml2 package. When I try "sudo apt-get install -f", I get:               The following extra packages will be installed:       libxml2-dev     The following packages will be upgraded:       libxml2-dev     1 upgraded, 0 newly installed, 0 to remove and 8 not upgraded.     108 not fully installed or removed.     Need to get 0 B/830 kB of archives.     After this operation, 69.6 kB disk space will be freed.     Do you want to continue [Y/n]? Y     (Reading database ... 96842 files and directories currently installed.)     Preparing to replace libxml2-dev 2.7.8.dfsg-2+squeeze3 (using .../libxml2-dev_2.7.8.dfsg-2+squeeze5_amd64.deb) ...     Unpacking replacement libxml2-dev ...     dpkg: error processing /var/cache/apt/archives/libxml2-dev_2.7.8.dfsg-2+squeeze5_amd64.deb (--unpack):      unable to install new version of `./usr/include/libxml2': No such file or directory     configured to not write apport reports                                           dpkg-deb: subprocess paste killed by signal (Broken pipe)     Errors were encountered while processing:      /var/cache/apt/archives/libxml2-dev_2.7.8.dfsg-2+squeeze5_amd64.deb     E: Sub-process /usr/bin/dpkg returned an error code (1)      A similar error occurs with `sudo apt-get upgrade -f`. My /etc/apt/sources.list is currently:               deb http://ftp.us.debian.org/debian/ squeeze main contrib non-free     deb http://ftp.debian.org/debian/ squeeze-updates main contrib non-free     deb http://security.debian.org/ squeeze/updates main contrib non-free      How do I go about fixing this? Thanks!


title: How do I mass-convert the "last modified" dates in a particular directory?

text: For example, say, I know that my time-offsets are off by several hours (perhaps because my system clock was a few hours ahead at a certain time). In that case, how would I mass-change the "last modified" dates of all the files in a particular directory? Note that different files will need to have their modification time changed to different values.


title: How does the screen backlight work?

text: Everything about the backlight settings and controls work for me except: Backlight resets to max. on every reboot/boot. The backlight minimum goes on to complete black screen, instead of the minimum brightness setting elsewhere. NB> I see that 1. above is answered on a lot of places with different answers, so I am actually looking for someone or somplace where I can read and understand how it all works. I have 2 different backlight folders in my laptop and many conf files to edit. So need to understand what on those files impacts what on the sytem.


title: Installing RTL8723AE Wireless LAN drivers on a machine with no internet connection

text: I've bought a netbook with a Realtek RTL8723AE Wireless LAN card, which functions, when I run Windows 7. I can access the Internet only via wireless networks. Now I want to install Linux on my machine. In order for the wireless LAN card to work, I need to obtain its drivers for Linux. It doesn't work out of the box (I tried it with Xubuntu and Slax). Now there are 2 options to make the wireless card work:   1. Build and install the drivers from the sources as suggested to in the answer here.   2. Use Windows wireless drivers as described in the Xubuntu documentation.   3. Install a Linux distro, in which these proprietary drivers are included. The problem with first 2 solutions is that they both require Internet connection, which I don't have (wireless card doesn't work without drivers and I don't have access to wired Internet). The third option is problematic, because I'm not sure whether such a Linux distro exists (one, in which Realtek drivers are part of the ISO image). How can I install RTL8723AE wireless LAN drivers on a Linux machine with no Internet connection? An ideal solution would be a collection of package files (RPM, DEB or similar), which I can install offline. **Update 1 (22.07.2013 14:00):** `ndisgtk` is not installed and attempts to install `build-essentials` etc. from files fail due to missing dependencies. So now I think about downloading the ISO image and installing all packages from there. How can I configure Xubuntu's packaging system to look for available packages in an ISO image?


title: scp does not auto-complete in the same way as other commands

text: I am using tcsh. I found that when I do `scp my`tab, it doesn't autocomplete to `my-file.txt` under the current directory I have to prefix a `./` there to make it complete. This seems to only happen with `scp`. I tried other commands, it seems to work fine. I find that `scp` `tab` gives me the value of of `$HOSTNAME` (i.e. the current hostname) `localhost` So it looks like it's trying to match the hostname, don't know why.. **added in response to comment:**                ~/temp/test>ls -al     total 12     drwxr-xr-x 2 liw liw 4096 Jul 21 15:16 .     drwxr-xr-x 9 liw liw 8192 Jul 21 15:15 ..     -rw-r--r-- 1 liw liw    0 Jul 21 15:16 my_file.txt          ~>more .cshrc.user      set prompt="%n@%m %~%#"          set path=($HOME/bin $path)          if (-o $HOME/.aliases) source $HOME/.aliases          set filec     set autolist     set autoexpand     set addsuffix          bindkey ^r i-search-back          ~> complete scp     'c%*@*:%`set q=$:-0;set q="$q:s/@/ /";set q="$q:s/:/ /";set q=($q " ");ssh $q[2] -l $q[1] ls -dp $q[3]\*`%' 'c%*:%`set q=$:-0;set q="$q:s/:/ /";set q=($q " ");ssh $q[1] ls -dp $q[2]\*`%' 'c%*@%$hosts%:' 'C@[./$~]*@f@' 'n/*/$hosts/:'


title: Tomcat: no xmx/xms value set, where is the heap value being defined?

text: I have a Tomcat 7 install running with Java 1.7 on a Linux 2.6 server, and `jinfo` shows no `xmx` or `xms` values. `ps` output shows nothing set for xmx/xms on the command line for the java process. Tomcat is running fine, but I am curious what settings will be used for heap when xmx and xms are not being set anywhere. They aren't in catalina.sh and setenv.sh doesn't exist. What does the JVM use in this scenario?


title: Monodevelop D Bindings for Debian / Ubuntu?

text: I want to install the D-Language binding for MonoDevelop but it does require MonoDevelop 4.x, which isn't available yet for Linux based systems. Is there any way I can get around this? I tried manually installing Mono and MonoDevelop but that just ended up in a huge mess and a lot of errors.


title: Raise Brightness When Maximizing Terminal

text: I'm looking to raise the brightness when I maximize or foreground the Terminal window which has Vim running. I would like to reset the brightness to normal when I minimize or background that process as well. I usually need more brightness when working with the black background of Vim than the white background of Chrome so I'd like it to happen automatically. I use this to programatically decrease the brightness:               $ echo 1 | sudo tee /sys/class/backlight/acpi_video0/brightness      Can I somehow hook into the minimize/maximize event of a GUI window and run the above as a script if the window is Terminal with Vim running?


title: Unable to extend desktop with USB display adapter and libdlo

text: Anyone familiar with using **libdlo** for DisplayLink's USB display adapters? I've followed the instruction steps from README file of libdlo                Install a compatible libusb version (0.13)       $ ./configure       $ sudo make install       $ make check      and after the last command (make check) I've seen various testing screens which ended at this one: ![last test screen of libdlo's make check](http://i.stack.imgur.com/hZejx.jpg) But I have no idea what to do next. How do I start using this additional screen in order to extend my desktop? I can't detect it in Display settings. I'm using Debian with xfce desktop.


title: Invoking CPU Stress

text: Looking for an app or tool to invoke CPU usage on my virtual Linux and Unix guests. I found the app "stress" from a post on Stackoverflow, but curious what the Unix/Linux crowd would recommend.


title: Automount in Xfce4 just stopped working

text: A little while ago my usb drives stopped auto mounting. It might have been after an update but not sure where to look. I have been manually mounting them as root and that is a pain. Is there maybe even something better that I can have more control over the mounting? I would like a small program that would let me mount and unmount drives with one click to a folder in `/mnt/(device name)` with user read/write permissions. Udev is kind of a gray area/black magic to me. I have tried 100 times to figure it out but I can't help but think there should be a much simpler way. Such as in Puppy Linux how you can open the mount menu and mount/unmount each device. Though every thing in Puppy runs as root so it is easier. I am running Gentoo on AMD64 (amdfam10). One side question, How can you tell which `/dev/...` files are currently representing actual devices? Here is the last 30 lines fresh after plugging in a usb drive               Jun 26 15:19:41 core dbus[9204]: [system] Activating service name='org.freedesktop.ConsoleKit' (using servicehelper)     Jun 26 15:20:06 core dbus[9204]: [system] Failed to activate service 'org.freedesktop.ConsoleKit': timed out


title: rsyslog && sending data to other host

text: Using **CentOS** 6.4. Problem is - that messages from `kern.*` facility doesn't appear on other server. Tring to send data:               # logger -p kern.warning -t TEST "Test warning for remote host KERNEL"     # logger -p cron.warning -t TEST "Test warning for remote host CRON"     # logger -p mail.warning -t TEST "Test warning for remote host MAIL"      Checking **MySQL** data:               mysql> select ID,Message from SystemEvents order by ID desc limit 3;     +--------+------------------------------------+     | ID     | Message                            |     +--------+------------------------------------+     | 524007 |  Test warning for remote host MAIL |     | 524006 |  Test warning for remote host CRON |     | 524005 |  Test warning for remote host MAIL |     +--------+------------------------------------+     3 rows in set (0.00 sec)      There is no data from `kern` facility. Why? Config on host-recipient:               # cat /etc/rsyslog.conf | egrep -v '^[[:space:]]*$|#'     $ModLoad imudp     $UDPServerRun 514     $ModLoad imtcp     $ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat     $IncludeConfig /etc/rsyslog.d/*.conf     kern.*                                                 /var/log/kern.log     syslog.*                                                /var/log/syslog.log     *.info;mail.none;authpriv.none;cron.none;local0.none                /var/log/messages     authpriv.*                                              /var/log/secure     mail.*                                                  -/var/log/maillog     cron.*                                                  /var/log/cron     *.emerg                                                 *     uucp,news.crit                                          /var/log/spooler     local7.*                                                /var/log/boot.log      **MySQL** config on recipient:               # cat /etc/rsyslog.d/hostname.conf     $ModLoad ommysql     :fromhost, isequal, "hostname" :ommysql:localhost,Syslog,rsyslog,megapass      And host-sender:               # cat /etc/rsyslog.conf | egrep -v '^[[:space:]]*$|#'     $ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat     $IncludeConfig /etc/rsyslog.d/*.conf     kern.*                                                  @hostname     syslog.*                                                /var/log/syslog.log     *.info;mail.none;authpriv.none;cron.none                /var/log/messages     authpriv.*                                              /var/log/secure     mail.*                                                  -/var/log/maillog     mail.*                                                  @hostname     cron.*                                                  /var/log/cron     cron.*                                                  @hostname     *.emerg                                                 *     uucp,news.crit                                          /var/log/spooler     local7.*                                                /var/log/boot.log     local4.*                                                /var/log/ldap.log      **UPD** Also, I noticed that data doesn't send even to local file:               kern.*                                                  /var/log/kern.log      And:               # logger -p kern.warning -t TEST "Test warning for local host KERNEL"      And:               # tail /var/log/kern.log | grep "TEST"      Return nothing. So - am I correct if I guess that `logger`can't send data "from kernel"? It's sounds logical...


title: How do I increase my iterm (tmux) window scrollback (not the line scrollback)

text: When I want to scroll back, i.e. with my mouse (or with `PageUp`) I can only go up about 43 pages (about 2000 lines). Can I increase that? I have my terminal preference -> "Scrollback Lines" set to 1000000   I also have my bashrc set with               HISTSIZE=100000     HISTFILESIZE=200000      but these settings aren't helping. You see how far in the terminal top right, i.e. ![enter image description here](http://i.stack.imgur.com/J6W9u.png) and 1900-2000 seems about the max at which point older content is lost.


title: .ssh/config to start remote session in zsh

text: I would like to start a remote session without typing the following command               ssh user@remoteserverip -t zsh      I know that I can change the host names in the `~/.ssh/config` to simply use something like this:               ssh serveralias -t zsh      But I want to remove the `-t zsh` parameter. Is there a way to achieve this without writing a function?


title: Colon breaks the variable subsitution

text: I am trying to lookup some C functions so that I could debug while using strace. So I setup a bash function to look it up in firefox (or links), but the substitution falls apart with `:` and escaping does not work, at least not in a simple way. ### Working               ff() {         firefox "https://www.google.com/search?hl=en&q=%*"     }      ### Not working               cr() {         firefox "codewiki.wikidot.com/c:system-calls:%*"     }      firefox gets `:` parsed in as input, but also $* gets parse in as literal characters. ### Tried:               1. Escaping : % *     2. Enclosing ${%*}     3. Changing " '     4. EnvVariable COMP_WORDBREAKS=${COMP_WORDBREAKS//:}      **Edit:** My question is flawed. My working code had `$*` all along. I wish to delete my question, but I leave it for reference to people who might be encouraged to write answers and improve questions on similar problem.


title: mod-mono-server 4 is not working, while 2 does

text: I need to deploy an ASP.NET MVC4 (MVC3 at least) application on Centos 6 server. I've installed Mono 3.2.1, XSP4, mod_mono (for use with apache web server) and succesfully ran the test application that goes with mono. I used a config tool to create a config for app directory and deployed an empty ASP.NET WebPages project created in VS2012 on .Net 2.0 - it ran ok. But I need to run an .net 4.5 or at least 4.0 application, so I've set the MonoServerPath to mod-mono- server4 instead of mod-mono-server2 in the config, but now i'm getting a "Service Temporarily Unavailable" error while trying to access the asp.net project directory (even empty). What should I check for? **Update:** I checked the apache log and here what it shows:               mod-mono-server4     Exception caught during reading the configuration file:     System.MissingMethodException: Method not found: 'System.Configuration.IConfigurationSectionHandler.Create'.       at System.Configuration.ClientConfigurationSystem.System.Configuration.Internal.IInternalConfigSystem.GetSection (System.String configKey) [0x00000] in <filename unknown>:0        at System.Configuration.ConfigurationManager.GetSection (System.String sectionName) [0x00000] in <filename unknown>:0        at System.Configuration.ConfigurationManager.get_AppSettings () [0x00000] in <filename unknown>:0        at Mono.WebServer.Apache.Server.get_AppSettings () [0x00001] in /usr/src/xsp-2.10.2/src/Mono.WebServer.Apache/main.cs:208        at Mono.WebServer.Apache.Server+ApplicationSettings..ctor () [0x0002a] in /usr/src/xsp-2.10.2/src/Mono.WebServer.Apache/main.cs:63      mod-mono-server4     Listening on: /tmp/mod_mono_server_Unreal     Root directory: /var/www/html/Unreal     Error: An exception was thrown by the type initializer for System.Net.Sockets.Socket     mod-mono-server4     Exception caught during reading the configuration file:     System.MissingMethodException: Method not found: 'System.Configuration.IConfigurationSectionHandler.Create'.       at System.Configuration.ClientConfigurationSystem.System.Configuration.Internal.IInternalConfigSystem.GetSection (System.String configKey) [0x00000] in <filename unknown>:0        at System.Configuration.ConfigurationManager.GetSection (System.String sectionName) [0x00000] in <filename unknown>:0        at System.Configuration.ConfigurationManager.get_AppSettings () [0x00000] in <filename unknown>:0        at Mono.WebServer.Apache.Server.get_AppSettings () [0x00001] in /usr/src/xsp-2.10.2/src/Mono.WebServer.Apache/main.cs:208        at Mono.WebServer.Apache.Server+ApplicationSettings..ctor () [0x0002a] in /usr/src/xsp-2.10.2/src/Mono.WebServer.Apache/main.cs:63      mod-mono-server4     Listening on: /tmp/mod_mono_server_Unreal     Root directory: /var/www/html/Unreal     Error: An exception was thrown by the type initializer for System.Net.Sockets.Socket     mod-mono-server4     Exception caught during reading the configuration file:     System.MissingMethodException: Method not found: 'System.Configuration.IConfigurationSectionHandler.Create'.       at System.Configuration.ClientConfigurationSystem.System.Configuration.Internal.IInternalConfigSystem.GetSection (System.String configKey) [0x00000] in <filename unknown>:0        at System.Configuration.ConfigurationManager.GetSection (System.String sectionName) [0x00000] in <filename unknown>:0        at System.Configuration.ConfigurationManager.get_AppSettings () [0x00000] in <filename unknown>:0        at Mono.WebServer.Apache.Server.get_AppSettings () [0x00001] in /usr/src/xsp-2.10.2/src/Mono.WebServer.Apache/main.cs:208        at Mono.WebServer.Apache.Server+ApplicationSettings..ctor () [0x0002a] in /usr/src/xsp-2.10.2/src/Mono.WebServer.Apache/main.cs:63      mod-mono-server4     Listening on: /tmp/mod_mono_server_Unreal     Root directory: /var/www/html/Unreal     Error: An exception was thrown by the type initializer for System.Net.Sockets.Socket     [Wed Sep 25 08:45:13 2013] [error] Failed to connect to mod-mono-server after several attempts to spawn the process.      **Update 2** Well, after some googling i've found the solution.. **To fix it** u have to copy mod-mono-server4.exe from /opt/mono/lib/mono/4.0 (or wherever u've installed it) to /opt/mono/lib/mono/4.5 and then to edit mod-mono-server4 in /opt/mono/bin from               exec /opt/mono/bin/mono $MONO_OPTIONS "/opt/mono/lib/mono/4.0/mod-mono-server4.exe" "$@"      to               exec /opt/mono/bin/mono $MONO_OPTIONS "/opt/mono/lib/mono/4.5/mod-mono-server4.exe" "$@"


title: In `while IFS= read..`, why does IFS have no effect?

text: I might have something absolutely wrong, but it looks convincing to me, that setting IFS as one of the **commands** in the pre-do/done list has absolutely no effect.   The outer IFS (outside the `while` construct) prevails in all examples shown in the script below.. What's going on here? Have I got the wrong idea of what IFS does in this situation? I expected the array-split results to be as shown in the "expected" column. * * *               #!/bin/bash     xifs() { echo -n "$(echo -n "$IFS" | xxd -p)"; } # allow for null $IFS      show() { x=($1)               echo -ne "  (${#x[@]})\t |"              for ((j=0;j<${#x[@]};j++)); do                 echo -n "${x[j]}|"              done              echo -ne "\t"              xifs "$IFS"; echo     }     data="a  b   c"     echo -e "-----   --  -- \t --------\tactual"     echo -e "outside        \t  IFS    \tinside"      echo -e "loop           \t Field   \tloop"      echo -e "IFS     NR  NF \t Split   \tIFS (actual)"      echo -e "-----   --  -- \t --------\t-----"     IFS=$' \t\n'; xifs "$IFS"; echo "$data" | while         read; do echo -ne '\t 1'; show "$REPLY"; done      IFS=$' \t\n'; xifs "$IFS"; echo "$data" | while IFS=    read; do echo -ne '\t 2'; show "$REPLY"; done      IFS=$' \t\n'; xifs "$IFS"; echo "$data" | while IFS=b   read; do echo -ne '\t 3'; show "$REPLY"; done     IFS=" ";      xifs "$IFS"; echo "$data" | while         read; do echo -ne '\t 4'; show "$REPLY"; done      IFS=" ";      xifs "$IFS"; echo "$data" | while IFS=    read; do echo -ne '\t 5'; show "$REPLY"; done      IFS=" ";      xifs "$IFS"; echo "$data" | while IFS=b   read; do echo -ne '\t 6'; show "$REPLY"; done     IFS=;         xifs "$IFS"; echo "$data" | while         read; do echo -ne '\t 7'; show "$REPLY"; done      IFS=;         xifs "$IFS"; echo "$data" | while IFS=" " read; do echo -ne '\t 8'; show "$REPLY"; done      IFS=;         xifs "$IFS"; echo "$data" | while IFS=b   read; do echo -ne '\t 9'; show "$REPLY"; done     IFS=b;        xifs "$IFS"; echo "$data" | while IFS=    read; do echo -ne '\t10'; show "$REPLY"; done     IFS=b;        xifs "$IFS"; echo "$data" | while IFS=" " read; do echo -ne '\t11'; show "$REPLY"; done     echo -e "-----   --  -- \t --------\t-----"      * * * Output:               -----   --  --   --------       actual        outside           IFS           inside                assigned        loop             Field          loop    #              inner     IFS     NR  NF   Split          IFS     #  expected    IFS     -----   --  --   --------       -----   #  ---------  --------     20090a   1  (3)  |a|b|c|        20090a  #                                   20090a   2  (3)  |a|b|c|        20090a  #  |a  b   c|  IFS=     20090a   3  (3)  |a|b|c|        20090a  #  |a  |   c|  IFS=b     20       4  (3)  |a|b|c|        20      #                               20       5  (3)  |a|b|c|        20      #  |a  b   c   IFS=     20       6  (3)  |a|b|c|        20      #  |a  |   c|  IFS=b              7  (1)  |a  b   c|             #                                        8  (1)  |a  b   c|             #  |a|b|c|     IFS=" "              9  (1)  |a  b   c|             #  |a  |   c|  IFS=b     62      10  (2)  |a  |   c|     62      #  |a  b   c|  IFS=     62      11  (2)  |a  |   c|     62      #  |a|b|c|     IFS=" "     -----   --  --   --------       -----      ---------   -------


title: How to mount a device in Linux? (Beginner's confusion)

text: I read some resources about the mount command for mounting devices on Linux, but none of them is clear enough (at least for me). On the whole this what most guides state:               $ mount     (lists all currently mounted devices)          $ mount -t type device directory     (mounts that device)          for example (to mount a USB drive):     $ mount -t vfat /dev/sdb1 /media/disk      What's not clear to me:   * How do I know what to use for "device" as in `$ mount -t type device directory`? That is, how do I know that I should use "/dev/sdb1" in this command `$ mount -t vfat /dev/sdb1 /media/disk` to mount my USB drive?   * what does the "-t" parameter define here? type? I read the man page (`$ man mount`) a couple of times, but I am still probably missing something. Please clarify.


title: What does the route Dest: 123.123.123.123, GW: 0.0.0.0 mean?

text: I have a route table:               Kernel IP routing table     Destination       Gateway         Genmask         Flags Metric Ref    Use Iface     123.123.123.123   0.0.0.0         255.255.255.255 UH    0      0        0 vmbr0     123.123.123.0     0.0.0.0         255.255.255.224 U     0      0        0 vmbr0     0.0.0.0           123.123.123.1   0.0.0.0         UG    0      0        0 vmbr0      Does the               123.123.123.123   0.0.0.0         255.255.255.255 UH    0      0        0 vmbr0      mean, that there is no mediator (router) to this device (123.123.123.123), i.e. devices (current and 123.123.123.123) are directly connected? So the packet could be send directly to the device (123.123.123.123), with the help of arp routing table, extracting from there the MAC of 123.123.123.123? Or am I misunderstanding that and it means: if destination IP is 123.123.123.123 look this table further and match the 0.0.0.0 rule, i.e. then route it to the 123.123.123.1? It seems to be very basic, but I cannot find anything clearly, unambiguous explainable this staff. If there is some good articles, I would appreciate to read them.


title: How to develop a small linux distro?

text: Since Linux uses open-source packages, I was wondering if I could develop my own Linux distro by compiling these packages. I tried to read the Linux From Scratch book but it's quite big and uses lots of packages. I want to develop a small Linux distro using the Linux kernel and busybox. I tried searching on the internet but didn't find a good guide.


title: Why is $# always 0 in my function?

text: Bash is driving me nuts. I can't figure out why the following (nor any of the dozens of variations I've literally copied and pasted from examples) fails to work:               #!/bin/bash          echo $#          function main {         if (( $# < 1 )); then             usage         fi              echo "good"     }          function usage {         echo "Usage: $0 <outputdir>"         exit 1     }          main      For some reason the argument check fails every time, even when I pass an argument and can clearly see `$#` is set as expected.


title: zero downtime on server

text: The scenario is, I have two web servers both are running nginx on it, also I have configured haproxy after the LB for both the servers, I have checked with heartbeat, but no luck to make downtime count "zero". I want some application which will switch to secondary server instantly when primary server gets down, in other words it should not give any downtime. Thanks for your help.


title: mount error "is not a block device"

text: I am trying to make `olddir` accessible from `newdir` with the mount command:               mount olddir newdir      Why do I get the following error? > mount: olddir is not a block device


title: CCD cam to USB - AV grabber for linux

text: I was wondering if there is an AV Grabber that supports Linux. I have IC-348 model I.C.U (international camera unit) camera made in P.R.C, which uses a Sony CCD 420TVL. I want to grab the video output and use it in a program that I am writing. The thing is that I couldn't find a good CCD Cam to USB hardware that supports Linux. Is there one? Can you please give me a model name? Or can you tell me another way to get CCD Cam image in to a Linux laptop?


title: What is the difference between "extended" partition and "logical" partition

text: What is the difference between "extended" partitions and "logical" partitions on my hard disk? What's the need for each? I am using Linux


title: `man ascii` is misaligned when using vim as a pager

text: To use Vim as a pager for man I have               export MANPAGER="/usr/share/vim/vim73/macros/manpager.sh"      in my profile. Now man pages look very good with colors and stuff. However, when trying `man ascii` as a way of looking at the ASCII table, I notice that the table is mis-aligned as in the screenshot below: ![Messed up ASCII table](http://i.stack.imgur.com/nBjem.png) This problem doesn't happen to the default pager. When I set `export MANPAGER="view -"` the table is also correct, so something must be wrong with the `manpager.sh` script:               #!/bin/sh     sed -e 's/\x1B\[[[:digit:]]\+m//g' | col -b | \     vim \         -c 'let no_plugin_maps = 1' \         -c 'set nolist nomod ft=man' \         -c 'let g:showmarks_enable=0' \         -c 'runtime! macros/less.vim' -      How can I fix this?


title: Linux installation on an extended drive related

text: ![my machine's partition table](http://i.stack.imgur.com/E4hvm.png) I just want to install another version of same distro linux into the extended partition, i. e. into the /dev/sda7. Does it make any problem into current Linux and its data and contents? If no, I can dual boot into two distro's after installation right? Also , how can I efficiently mount the / and /home for the new installation? All suggestions are welcome


title: Remapping caps-lock to escape, and menu to compose, on the linux console

text: When running X I use a .xmodmaprc to remap certain keys thusly:               ! Make it so that both Caps Lock and Escape do Escape     clear Lock     keysym Caps_Lock = Escape     ! Remap the menu key as Compose     keysym Menu = Multi_key      How can I accomplish the same things on the console? ## update In addition to the partial solution given in my answer, I've learned that the console maps CTRL-`.` to Compose. So I may be able to get used to that. Setting up the Menu key as Compose is not so easily done, as there are a ton of nul-assigned keycodes and no obvious contender for an alternate name for Menu. I've also realized that the compose bindings themselves are much more limited than what I'm used to under X, and that most of the special characters I use frequently are not there. Perhaps there is a utility that will translate X-syntax compose bindings into something that `loadkeys` can read?


title: printing a string's "canonical print-escaped form"

text: I'm trying to write a function, I'll call it `escape`, that will behave like this:               % IFS=$' \t\n\000'     % escape FOO $IFS     FOO=$' \t\n\000'      In other words, `escape` takes two arguments, and then, taking the first one to be a variable name, it prints out a line a zsh _source code_ in which a variable of that name is assigned a `$''`-quoted, "canonically `print`-escaped" string, such that, upon evaluating this line of source code, the variable named by the the first argument will have the second argument as its value. (I'm sure that was as clear as mud, so I'll give more examples of how `escape` is supposed to behave at the end of this post.) Here's an incomplete implementation of the `escape` function:               escape () {         local varname=$1         local value="$2"         print -n "$varname=\$'"         # ???         print "'"     }      The missing part (indicated by `???`) is where the contents of `$value` are "canonically `print`-escaped". The qualifier "canonical" is necessary because there are many characters for which there are at least a couple of representations that `print` will recognize them as. For example, `print` knows `\n` also as `\012` and as `\C-J`. In this case, `\n` is the canonical form. In general, the standard escape sequences `\n`, `\r`, `\t`, etc. are the canonical forms for their corresponding characters. The standard display form of printable ASCII characters (e.g. `A`, `=`, `9`) are canonical. For the remaining characters, if there's a choice of representation, I'd pick the octal form as the canonical one (at least up to `\177`; I'm not sure of how `$''` deals with higher codes), but this preference is not strong. Of course, I'm not looking to see code to implement this functionality "from scratch", as it were. Rather, I'm hoping that a utility already exists to perform this translation from bytes to a `print`-escaped text representation. Any pointers would be much appreciated! * * * Here are some more examples of `escape` in action (hypothetically):               % escape HELLO $( echo 'hello world' )     HELLO=$'hello world\n'     % escape SUBSEP $( perl -e 'print $;' )     SUBSEP=$'\034'     % abc=$'\141\012\142\012\143\012'     % print -n $abc     a     b     c     % escape ABC $abc     ABC=$'a\nb\nc\n'


title: Having trouble with packets not making it into Fedora 16 Apache

text: Background: I haven't done anything with `iptables` in a few years... I have Fedora 16 running in a VM on VMWare, with my firewall (TomatoUSB) port forwarding to the VM. VM is at `192.168.1.155`. I know that the packets are making it to the VM... Based on this illustration to see how the packets are supposed to go, I would expect the packets to come out of `nat-PREROUTING` and either go to `mangle- INPUT` or `mangle-FORWARD` unless the kernel is dropping them for some other reason. So I turned on some logging:               iptables -t mangle -v -A PREROUTING -j LOG -p tcp --destination-port 80 --log-prefix 'mangle-PREROUTING '     iptables -t nat -v -A PREROUTING -j LOG -p tcp --destination-port 80 --log-prefix 'nat-PREROUTING '     iptables -t filter -v -I INPUT 1 -j LOG -p tcp --destination-port 80 --log-prefix 'filter-INPUT '     iptables -t filter -v -I FORWARD 1 -j LOG -p tcp --destination-port 80 --log-prefix 'filter-FORWARD '     iptables -t mangle -v -I INPUT 1 -j LOG -p tcp --destination-port 80 --log-prefix 'mangle-INPUT '      iptables -t mangle -v -I FORWARD 1 -j LOG -p tcp --destination-port 80 --log-prefix 'mangle-FORWARD '      and then I used an external test service and I can see the packets coming in past the `PREROUTING` chains, but then being ignored:               Apr 23 19:11:52 webmail64 kernel: [  351.116042] mangle-PREROUTING IN=eth1 OUT= MAC=00:0c:29:fa:36:c7:bc:ae:c5:c3:68:f9:08:00 SRC=66.249.67.195 DST=192.168.1.155 LEN=60 TOS=0x00 PREC=0x20 TTL=48 ID=20466 DF PROTO=TCP SPT=64135 DPT=80 WINDOW=5840 RES=0x00 SYN URGP=0      Apr 23 19:11:52 webmail64 kernel: [  351.121701] nat-PREROUTING IN=eth1 OUT= MAC=00:0c:29:fa:36:c7:bc:ae:c5:c3:68:f9:08:00 SRC=66.249.67.195 DST=192.168.1.155 LEN=60 TOS=0x00 PREC=0x20 TTL=48 ID=20466 DF PROTO=TCP SPT=64135 DPT=80 WINDOW=5840 RES=0x00 SYN URGP=0      Apr 23 19:11:55 webmail64 kernel: [  354.113372] mangle-PREROUTING IN=eth1 OUT= MAC=00:0c:29:fa:36:c7:bc:ae:c5:c3:68:f9:08:00 SRC=66.249.67.195 DST=192.168.1.155 LEN=60 TOS=0x00 PREC=0x20 TTL=48 ID=20467 DF PROTO=TCP SPT=64135 DPT=80 WINDOW=5840 RES=0x00 SYN URGP=0      Apr 23 19:11:55 webmail64 kernel: [  354.114834] nat-PREROUTING IN=eth1 OUT= MAC=00:0c:29:fa:36:c7:bc:ae:c5:c3:68:f9:08:00 SRC=66.249.67.195 DST=192.168.1.155 LEN=60 TOS=0x00 PREC=0x20 TTL=48 ID=20467 DF PROTO=TCP SPT=64135 DPT=80 WINDOW=5840 RES=0x00 SYN URGP=0      Apr 23 19:12:01 webmail64 kernel: [  360.109534] mangle-PREROUTING IN=eth1 OUT= MAC=00:0c:29:fa:36:c7:bc:ae:c5:c3:68:f9:08:00 SRC=66.249.67.195 DST=192.168.1.155 LEN=60 TOS=0x00 PREC=0x20 TTL=48 ID=20468 DF PROTO=TCP SPT=64135 DPT=80 WINDOW=5840 RES=0x00 SYN URGP=0      Apr 23 19:12:01 webmail64 kernel: [  360.111023] nat-PREROUTING IN=eth1 OUT= MAC=00:0c:29:fa:36:c7:bc:ae:c5:c3:68:f9:08:00 SRC=66.249.67.195 DST=192.168.1.155 LEN=60 TOS=0x00 PREC=0x20 TTL=48 ID=20468 DF PROTO=TCP SPT=64135 DPT=80 WINDOW=5840 RES=0x00 SYN URGP=0       You can see that `TTL` is fine. The VM's IP is `192.168.1.155` so it should go to `INPUT` next but it never makes it. If the packet came from inside my network, it is as expected:               Apr 23 19:20:03 webmail64 kernel: [  841.725402] mangle-PREROUTING IN=eth1 OUT= MAC=00:0c:29:fa:36:c7:00:1f:3b:cb:2e:99:08:00 SRC=192.168.1.69 DST=192.168.1.155 LEN=40 TOS=0x00 PREC=0x00 TTL=128 ID=4562 DF PROTO=TCP SPT=61520 DPT=80 WINDOW=4042 RES=0x00 ACK FIN URGP=0      Apr 23 19:20:03 webmail64 kernel: [  841.729647] mangle-INPUT IN=eth1 OUT= MAC=00:0c:29:fa:36:c7:00:1f:3b:cb:2e:99:08:00 SRC=192.168.1.69 DST=192.168.1.155 LEN=40 TOS=0x00 PREC=0x00 TTL=128 ID=4562 DF PROTO=TCP SPT=61520 DPT=80 WINDOW=4042 RES=0x00 ACK FIN URGP=0      Apr 23 19:20:03 webmail64 kernel: [  841.731056] filter-INPUT IN=eth1 OUT= MAC=00:0c:29:fa:36:c7:00:1f:3b:cb:2e:99:08:00 SRC=192.168.1.69 DST=192.168.1.155 LEN=40 TOS=0x00 PREC=0x00 TTL=128 ID=4562 DF PROTO=TCP SPT=61520 DPT=80 WINDOW=4042 RES=0x00 ACK FIN URGP=0      Apr 23 19:20:03 webmail64 kernel: [  841.732784] mangle-PREROUTING IN=eth1 OUT= MAC=00:0c:29:fa:36:c7:00:1f:3b:cb:2e:99:08:00 SRC=192.168.1.69 DST=192.168.1.155 LEN=40 TOS=0x00 PREC=0x00 TTL=128 ID=4563 DF PROTO=TCP SPT=61520 DPT=80 WINDOW=4042 RES=0x00 ACK URGP=0      Apr 23 19:20:03 webmail64 kernel: [  841.734257] mangle-INPUT IN=eth1 OUT= MAC=00:0c:29:fa:36:c7:00:1f:3b:cb:2e:99:08:00 SRC=192.168.1.69 DST=192.168.1.155 LEN=40 TOS=0x00 PREC=0x00 TTL=128 ID=4563 DF PROTO=TCP SPT=61520 DPT=80 WINDOW=4042 RES=0x00 ACK URGP=0      Apr 23 19:20:03 webmail64 kernel: [  841.735676] filter-INPUT IN=eth1 OUT= MAC=00:0c:29:fa:36:c7:00:1f:3b:cb:2e:99:08:00 SRC=192.168.1.69 DST=192.168.1.155 LEN=40 TOS=0x00 PREC=0x00 TTL=128 ID=4563 DF PROTO=TCP SPT=61520 DPT=80 WINDOW=4042 RES=0x00 ACK URGP=0       What have I tried?   * Turned off SELinux   * Totally turned off `iptables`   * Ensured that the default policies are `ACCEPT`     * Saw that the packet counts for the `ACCEPT` incremented   * Turned on IP forwarding (`/proc/sys/net/ipv4/ip_forward`) just in case My setup: * `kernel` = `Linux webmail64 3.3.2-1.fc16.x86_64 #1 SMP Sat Apr 14 00:31:23 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux` * `iptables v1.4.12` Here are all the `iptables` in case it matters:               [root@webmail64 ~]# iptables-save      # Generated by iptables-save v1.4.12 on Mon Apr 23 20:47:24 2012     *nat     :PREROUTING ACCEPT [916:127527]     :INPUT ACCEPT [1:60]     :OUTPUT ACCEPT [87:7857]     :POSTROUTING ACCEPT [87:7857]     -A PREROUTING -p tcp -m tcp --dport 80 -j LOG --log-prefix "nat-PREROUTING "     COMMIT     # Completed on Mon Apr 23 20:47:24 2012     # Generated by iptables-save v1.4.12 on Mon Apr 23 20:47:24 2012     *mangle     :PREROUTING ACCEPT [1402:193108]     :INPUT ACCEPT [1343:189856]     :FORWARD ACCEPT [0:0]     :OUTPUT ACCEPT [303:67789]     :POSTROUTING ACCEPT [303:67789]     -A PREROUTING -p tcp -m tcp --dport 80 -j LOG --log-prefix "mangle-PREROUTING "     -A INPUT -p tcp -m tcp --dport 80 -j LOG --log-prefix "mangle-INPUT "     -A FORWARD -p tcp -m tcp --dport 80 -j LOG --log-prefix "mangle-FORWARD "     COMMIT     # Completed on Mon Apr 23 20:47:24 2012     # Generated by iptables-save v1.4.12 on Mon Apr 23 20:47:24 2012     *filter     :INPUT ACCEPT [0:0]     :FORWARD ACCEPT [0:0]     :OUTPUT ACCEPT [1075:220262]     -A INPUT -p tcp -m tcp --dport 80 -j LOG --log-prefix "filter-INPUT "     -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT     -A INPUT -p icmp -j ACCEPT     -A INPUT -i lo -j ACCEPT     -A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT     -A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT     -A INPUT -j REJECT --reject-with icmp-host-prohibited     -A FORWARD -p tcp -m tcp --dport 80 -j LOG --log-prefix "filter-FORWARD "     -A FORWARD -j REJECT --reject-with icmp-host-prohibited     COMMIT     # Completed on Mon Apr 23 20:47:24 2012      Where can I look next? # Update I was asked to run `tcpdump` and it looks like I am never sending `ACK` packets?:               tcpdump -i eth1 -An -vvv \(net 50 or net 173\)     tcpdump: listening on eth1, link-type EN10MB (Ethernet), capture size 65535 bytes     19:31:26.305048 IP (tos 0x20, ttl 53, id 26094, offset 0, flags [DF], proto TCP (6), length 60)         50.22.90.226.48891 > 192.168.1.155.http: Flags [S], cksum 0xca12 (correct), seq 2918539684, win 5840, options [mss 1460,sackOK,TS val 1152517194 ecr 0,nop,wscale 7], length 0     E .<e.@.5..r2.Z........P..a....................     D..J........     19:31:26.521815 IP (tos 0x20, ttl 53, id 61033, offset 0, flags [DF], proto TCP (6), length 60)         50.22.90.226.48892 > 192.168.1.155.http: Flags [S], cksum 0x82b4 (correct), seq 1826089481, win 5840, options [mss 1460,sackOK,TS val 1152517216 ecr 0,nop,wscale 7], length 0     E .<.i@.5...2.Z........Pl..     ...................     D..`........     19:31:29.300994 IP (tos 0x20, ttl 53, id 26095, offset 0, flags [DF], proto TCP (6), length 60)         50.22.90.226.48891 > 192.168.1.155.http: Flags [S], cksum 0xc8e6 (correct), seq 2918539684, win 5840, options [mss 1460,sackOK,TS val 1152517494 ecr 0,nop,wscale 7], length 0     E .<e.@.5..q2.Z........P..a....................     D..v........     19:31:29.521214 IP (tos 0x20, ttl 53, id 61034, offset 0, flags [DF], proto TCP (6), length 60)         50.22.90.226.48892 > 192.168.1.155.http: Flags [S], cksum 0x8188 (correct), seq 1826089481, win 5840, options [mss 1460,sackOK,TS val 1152517516 ecr 0,nop,wscale 7], length 0     E .<.j@.5...2.Z........Pl..     ...................     D...........     19:31:35.302578 IP (tos 0x20, ttl 53, id 26096, offset 0, flags [DF], proto TCP (6), length 60)         50.22.90.226.48891 > 192.168.1.155.http: Flags [S], cksum 0xc68e (correct), seq 2918539684, win 5840, options [mss 1460,sackOK,TS val 1152518094 ecr 0,nop,wscale 7], length 0     E .<e.@.5..p2.Z........P..a....................     D...........     19:31:35.532347 IP (tos 0x20, ttl 53, id 61035, offset 0, flags [DF], proto TCP (6), length 60)         50.22.90.226.48892 > 192.168.1.155.http: Flags [S], cksum 0x7f2f (correct), seq 1826089481, win 5840, options [mss 1460,sackOK,TS val 1152518117 ecr 0,nop,wscale 7], length 0     E .<.k@.5...2.Z........Pl..     ........./.........     D...........


title: rsync only missing directories

text: Is there a way to tell `rsync` to sync only source directories that are missing on a destination (whole directories, not just any missing file)? Considering `S` as the set of source directories, and `D` the set of destination directories, I want to:   * copy the entire directory `s` in `S` if `s` not in `D`.   * skip entirely the directory `s` (indep. of the files it contains) if `s` in `D`. Of course it's possible to list the directories on both sides, `rsync` the list from the destination, do some `perl` and generate a list of all directories that need to be copied, but it would be better if it were possible with just one invocation of `rsync`. For example, if source and destination are on the same server, one could do:               src=/some/where     dst=/else/where     cd /tmp     (cd $src; find . -type d) | sort > a     (cd $dst; find . -type d) | sort > b     comm -23 a b | perl -e 'L: while(<>) {chomp; $p=$_; while ($p=~s,/[^/]+$,,) { next L if $n{$p}; } $n{$_}++; s,^./,/,; print "$_/***\n"}' > tocopy     rsync -vmazn --include-from tocopy --exclude '*' $src/ $dst/      (without the `-n` if for real).


title: terminal: non-english characters

text: I used to be able to copy&paste (or type if I load respective keyboard layout) any kind of characters (eg. é ö ñ ß و 好) in my console/terminal. Now I bought a new computer and it does not work any more, only English/ASCII characters (but in other programs, e.g. firefox, it still works). Distribution: Ubuntu. Terminals tried: gnome-terminal, xterm, konsole. I tried setting LANG in /etc/environment to en_US.UTF-8 but after reboot `echo $LANG` still gives `C`. I also tried setting `Character encoding` to `Unicode(UTF-8)` in the gnome-terminal `Terminal`-menu - without effect. Question: How can I get a terminal that is able to deal with non-English characters?


title: After installing VirtualBox to Fedora 17 the system won't boot (NVidia drivers)

text: My luck I had couple of older kernels, which work. The new kernel, probably somehow patched by VirtualBox fails to load. What fails is X-server, when it tries to start, here's the log:               [    14.284] (II) LoadModule: "nvidia"     [    14.284] (II) Loading /usr/lib64/xorg/modules/drivers/nvidia_drv.so     [    14.285] (II) Module nvidia: vendor="NVIDIA Corporation"     [    14.285]    compiled for 4.0.2, module version = 1.0.0     [    14.285]    Module class: X.Org Video Driver     [    14.294] (EE) NVIDIA: Failed to load the NVIDIA kernel module. Please check your     [    14.294] (EE) NVIDIA:     system's kernel log for additional error messages.     [    14.294] (II) UnloadModule: "nvidia"     [    14.294] (II) Unloading nvidia     [    14.294] (EE) Failed to load module "nvidia" (module-specific error, 0)     [    14.294] (EE) No drivers available.     [    14.294]      Fatal server error:     [    14.294] no screens found      Probably, I could just uninstall VirtualBox, then upgrade the kernel + NVidia drivers (oh god why...) and I'd get my laptop back to normal, however, this will mean no VirtualBox for me. The question thus: is there any way to make friends between VirtualBox and NVidia? Perhaps I need some specific drivers for VirtualBox? * * * **EDIT** (I'm the author of the question, but due to some errors happening in account management, I no longer appear as such) Below is what I could get from `dmesg` but it's as terse as the note above:               [   14.058801] nvidia: module license 'NVIDIA' taints kernel.     [   14.058807] Disabling lock debugging due to kernel taint     [   14.172337] input: HDA NVidia HDMI/DP,pcm=9 as /devices/pci0000:00/0000:00:01.0/0000:01:00.1/sound/card1/input13     [   14.172636] input: HDA NVidia HDMI/DP,pcm=8 as /devices/pci0000:00/0000:00:01.0/0000:01:00.1/sound/card1/input14     [   14.172888] input: HDA NVidia HDMI/DP,pcm=7 as /devices/pci0000:00/0000:00:01.0/0000:01:00.1/sound/card1/input15     [   14.173166] input: HDA NVidia HDMI/DP,pcm=3 as /devices/pci0000:00/0000:00:01.0/0000:01:00.1/sound/card1/input16     [   14.175252] vgaarb: device changed decodes: PCI:0000:01:00.0,olddecodes=io+mem,decodes=none:owns=io+mem     [   14.175527] NVRM: loading NVIDIA UNIX x86_64 Kernel Module  304.54  Sat Sep 29 00:05:49 PDT 2012      I will also look now into yum logs to see if there maybe was a record of what exactly did it do to the kernel / configuration. * * * **EDIT2**               Jul 26 00:53:18 Installed: kmod-VirtualBox-3.9.10-100.fc17.x86_64-4.2.12-1.fc17.13.x86_64     Jul 26 00:53:19 Installed: kmod-VirtualBox-4.2.12-1.fc17.13.x86_64     Jul 26 00:53:25 Installed: VirtualBox-4.2.12-1.fc17.x86_64     Jul 26 00:53:25 Erased: 1:kmod-nvidia-3.5.3-1.fc17.x86_64-304.51-1.fc17.x86_64      OK, so, apparently, `yum` decided it needs to erase the NVidia kernel module... Is my guess correct then, that these two are incompatible? And if so, there is no way they will work together? What would be an alternative, if any to VirtualBox? * * * Sorry, I cannot comment yet. Just to make it clear: the driver is for the host system, not the guest. I actually took courage to just remove all things related to NVidia, reinstall them and VirtualBox started allright. What I did would be something along the lines of:               # yum update kernel* selinux-policy*     # yum list installed | grep nvidia | yum remove     # reboot     # yum install akmod-nvidia nvidia-settings nvidia-xconfig      I think I had CUDA drivers (used for development for NVidia paralleling technology), but I didn't use them anyway.


title: Any good usb-serial (RS485) adapter to use with GNU/Linux?

text: I'm having problem with usb-serial (RS485) adapters. Firstly, I tried ch341 without success. The problem in this case is the linux driver, made by reverse engeneering (sadly without any help from the company). At Windows it works great. So I changed to FTDI (FT232BL) but, despite "working", it fails consistently, erroring a bit in one byte from time to time and this prevents its use. But, i think it is not linux driver fault because errors happen at Windows also. So... Do you recommend any good usb-serial (RS485) adapter to use with GNU/Linux? PS: I'd like to put tag "usb-serial" in this question, but i don't have reputation enough to create that.


title: xargs and < and > to the same files

text: I want to run `git stripspace` on all my source code files, on each build (or precommit or just manually), to remove extraneous whitespace, and later maybe to format the code in a standard way, So I want to do something like               git stripspace < project/code.m > project/code.m      so I thought I should be able to use `find -exec` or `xargs` but by the looks of `find` does not like 'git stripspace' (maybe because of the space in between or the < or >) and I don't know how to pass the same file name, same argument, twice in a row with the proper redirections (< >) .


title: Forcing Bash to use Perl RegEx Engine

text: As you may already know, a lot of the features modern RegEx engines support (back referencing, lookaround assertions, etc.) are not supported by Bash RegEx engine. Following is a simple Bash script I have just created to try to explain what my end goal is:               #!/bin/bash          # Make sure exactly two arguments are passed.     if [ $# -lt 2 ]     then         echo "Usage: match [string] [pattern]"         return     fi          variable=${1}     pattern=${2}          if [[ ${variable} =~ ${pattern} ]]     then         echo "true"     else         echo "false"     fi      So for instance, something like the following command will return false:               . match.sh "catfish" "(?=catfish)fish"      whereas the exact same expression will find a match when used in a Perl or a JavaScript regex tester. Backreferences (e.g. (expr1)(expr2)[ ]\1\2) won't match as well. I have simply come to the conclusion that my problem will only be solved when forcing bash to use a Perl-compatible RegEx engine. Is this doable? If so, how would I go about performing the procedure?


title: How to delete directories based on `find` output?

text: I issue the following command to find the .svn directories:               find . -name ".svn"      That gives me the following results:               ./toto/.svn     ./toto/titi/.svn     ./toto/tata/.svn      How could I process all these lines with `rm -fr` in order to delete the directories and their content?


title: tightvnc configuration - software version check

text: I have a raspberry pi and just managed to setup TightVNC running fine, but it looks like I can't use file transfer on the client. The viewer is 2.7 but I don't know what is my tightvncserver's version number. How can I check a software's version number on Linux easily? I used `apt-get install tightvncserver`... so everything was automatic but I guess would be great to track things back and see if I can do more. I'm on the command prompt so TightVNC doesn't have a GUI as far as I know for Linux - only the viewer.