title: Drop TCP packets and prevent TCP retransmission

text: I have an application that sends TCP data to a server. My server is made to intentionally drop the packets sent by the application, and as a result the client retransmits the packets. I need to prevent the client from retransmitting them. Is there any setting that I can do on the client to prevent retransmits. Maybe some iptables rule? Or with some `net.ipv4.tcp` variables? I understand that TCP inherently has to retransmit packets, but I actually need to test out a functionality on my server, where I have to observe how the server behaves when it drops a TCP packet and it does not get retransmitted. So I cannot use UDP here. The client is able to complete the TCP handshake, and only the packets sent after that are dropped, for which the retransmission is happening. This is the retransmission that I need to prevent. I am using Fedora :               [root@test sipp.svn]# uname -r     2.6.23.1-42.fc8     [root@test sipp.svn]#


title: Significance of arrows symbols in duplicating/closing file descriptors under bash

text: I'm reading a book about Linux command line where author doesn't seem to follow the conventions in bash manual regarding arrows symbols used in redirection operations. Namely, he always uses left arrow `<` in duplicating and closing file descriptors regardless of whether the descriptors are input or output ones. Here is an example:               exec 3<&0 4<&1 #shouldn't be 4>&1 ?     #...     exec 3<&- 4<&- #shouldn't be 4>&- ?      Bash man page is vague in this point, according to it, the duplicating/closing and moving file descriptors have the following syntaxes:               #Duplicating and closing (in case word expands to -):     [n]<&word      [n]>&word          #Moving:     [n]<&digit-     [n]>&digit-      They are described to have different behaviour only if we don't explicitly supply the `n`. But when we do, does it mean that we can use these forms interchangeably?


title: How to create an ISO file out of 2.5M files?

text: So I have a good number of files (based on current node count in the filesystem, 2498329) and when I try to make an .iso out of it, mkisofs runs out of memory, pushes the machine into swap and then runs out of that too. Is there something to make mkisofs less memory hungry? The reason I am creating an ISO because I would like to distribute these files but I can't just drop 2.5M files on people via an archive they extract onto existing filesystems (there would be serious risk of inode exhaustion for ext3, at least) so I thought ISO files are easy to mount on Linux, Windows, Mac OS X. EDIT: tried --no-cache-inodes - it may or may not have helped, but memory usage still spiked back up past 1G during the initial scan.


title: How do you mount an ext2 formatted qemu disk image?

text: I am having issues mounting an image I created with the `qemu-img` program. Every time I attempt to invoke mount upon the subsequent file, it responds with `failed to setup loop device: No such file or directory`. It does not matter which user I invoke the following commands under, it continuously fails (su - or not).               $ qemu-img create flash.img 512M     $ mkfs.ext2 -L "FLASH001" flash.img     $ mount -t ext2 -o loop,rw flash.img /mnt/dfs/      * * * Is there anything that I am missing? I have a typical Arch Linux install with all of the above commands installed from the Arch Linux repositories.


title: Why would someone want to change the last access date of a file without making actual changes within the file itself?

text: CentOS 6 I'm studying RHEL / Centos and recently learned that the `touch` command can be used to change the last access date of a file. I'm struggling to understand a practical reason why anyone would want to do this (without actually making any changes to a file). Can someone please elaborate?


title: Output ls -l size field with digits grouped by thousands?

text: It is possible to make ls -l output the size field with digits grouped by thousands? If so, how? For instance:               $ ls -l     -rw-rw---- 1 dahl dahl 43,210,052 2012-01-01 21:52 test.py      (Note the commas in the size). Maybe by modifying the LC_NUMERIC setting inside the locale I'm using (en_US.utf8)? I'm on Kubuntu 12.04 LTS.


title: Disable xscreensaver when program is running?

text: I find it very annoying that xscreensaver sometimes helpfully starts while I'm playing Urban Terror, and was wondering if there is a better way to solve this than making some script to run Urban Terror which kills xscreensaver first. My system is Arch Linux, with xscreensaver 5.22.


title: Log out a user and delete the account

text: I am having a problem on the server (CentOS 6, Plesk 11.5) where a particular user is using a mass mailer and is blacklisting our IP address. I have tried to delete this user using:               /usr/sbin/userdel test      but it returns a message saying that the user is currently logged in. I thought ok, kill the process. So I tried:               pkill -u test      and also locked the account using:               passwd -l test      which will hopefully stop him logging into the system in future. Still saying user is logged in. How can I log this user out to enable me to delete him off the system?


title: How to add tmux confirm prompt when I kill a window?

text: I see in `tmux`'s list-keys:               bind-key & confirm-before -p "kill-window #W? (y/n)" kill-window      I use `tmuxinator`, and will often go overboard on the `Ctrl`-`D`, where I accidentally close a window. Is there a way to add this prompt to any window/pane I close, but only for those created by `tmuxinator`? I don't want this for temporary or new windows, but just those that were created on my new session.


title: How to rename files with sed and csv

text: I'm new with Linux, `sed`, and `awk` but I don't mind challenging myself on new ideas. That being said, I understand the purpose and how to use `rename` and `sed` for a common event such as adding a `$date` or removing a `_1234` from all the files. However, I want to figure out how to rename 100's of files that have no relation to one another other than the file type. Renaming example:   * old name alpha.ai renamed to omega.ai    * old name pie32.ai renamed to apple.ai   * old name xmas.ai renamed to santa.ai I originally used a bash script to pull all the names to a .csv file and placed them in column A. In column B I wrote in the new names. Now since there is not a common event occurring how could you write `sed` or the like to do this??               #!/bin/bash     for i in *.ai     do             mv $i $(echo $i | sed "a1,b1")          done


title: Where is max process size specified?

text: I've got a RHEL4 machine with 1TB of memory and have discovered that malloc and mmap refuse to allocate any memory above 512GB. Meanwhile, I don't seem to have a problem with RHEL5 machines. I'm presuming, then, that it's just a matter of kernel configuration. Does anyone know what controls the maximum process size (assuming a fixed page size)?


I have a script that works well when I ssh to the server to execute it myself, but has problems when Hudson, a continuous integration server, runs it. I am automating tests on an embedded linux system (the target). The target is connected to Server A (RHEL 5) via serial and operated over minicom. Server B (FC 12) builds the tests that actually run on the target, and can ssh to Server A. Server C (RH) hosts Hudson, with Server B as a slave. I've written a runscript (http://linux.die.net/man/1/runscript) script to do everything needed on the actual target; it boots the image, mounts a directory from Server B and executes the tests. A bash script on Server B invokes minicom with the runscript script along with some companion actions. I have a bash script on Server B which uses               ssh -t -t ServerA bashScript.sh      to get those tests run on the target. I am on Server C, I can get those tests run by ssh'ing to Server B and executing the script that ssh's to Server A which executes minicom with runscript. _Whew._ To review: Server A: Hudson uses its slave mechanism to ssh to Server B. Server B: `kickOffTests.sh` has the line `ssh -t -t ServerA runTests.sh` Server A: `runTests.sh` calls a perl script which invokes `minicom -S my.script ttyE1` Target, after booting: Mounts a directory from Server B, where the tests are, and enters that directory. It invokes yet another bash script, which runs the tests, which are compiled C executables. Now, when _I_ execute any of these scripts myself, they do what they should. However, when Hudson tries to do the same thing, over in the minicom session it complains about a line in the "yet another bash script" that invokes the C executable, `./executable`, with `./executable: cannot execute binary file` I still have a lot to learn about linux, but I surmise this problem is a result of Hudson not connecting with a console. I don't know exactly what Hudson does to control its slave. I tried using the line `export TERM=console` in the configuration just before running kickOffTests.sh, but the problem remains. Can anyone explain to me what is happening and how I can fix it? I cannot remove any of the servers from this equation. It may be possible to take minicom out of the equation but that would add an unknown amount of time to this project, so I'd much prefer a solution that uses what I already have.


title: Old laptop won't boot from live CDs

text: I've got an old Pentium III based Dell Laptop, the originally shipped with Windows 2K and has had Windows XP installed on it. I though I could get something useful out of it if I run Puppy, Lubuntu, or CrunchBang on it. I've created live CDs for each of the distros. I've test the CDs in other machines and the CDs are fine. But when I put them in the laptop, it won't boot. The machine powers on and runs the self test. At that point, I can tell that it is reading the CD, but nothing ever happens. As far as I know the CD drive is fine. I have confirmed that in the BIOS, the machine will boot from the optical drive. ### Questions   * Is there anything else I should check in the BIOS?   * Are there other distributions that are better for older laptops?


title: Double-Ended USB Unrecognized Alfa AWUS036NHR

text: I have a wonderful little wireless adapter that works perfectly well on Windows, but drops the connection regularly in Arch. As far as I can tell, it's not getting enough power to function properly. It has a USB cable that has two male ends, in order to double power input, but for whichever reason, Arch refuses to recognize that anything is in the other USB slot. This is the output from lsusb:               Bus 007 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub     Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub     Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub     Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub     Bus 001 Device 003: ID 0bda:817f Realtek Semiconductor Corp. RTL8188RU 802.11n WLAN Adapter     Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub     Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub     Bus 002 Device 002: ID 046d:c52b Logitech, Inc. Unifying Receiver     Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub      The adapter is at Bus 001. Any thoughts?


title: How to unpack libc6 source on Hardy using debian/rules?

text: How do I unpack the libc6 source code on Hardy without building everything? I run               apt-get source libc6      and I get               $ ls -1d glibc-2.7/*     glibc-2.7/debian     glibc-2.7/glibc-2.7.tar.bz2     glibc-2.7/glibc-libidn-2.7.tar.bz2     glibc-2.7/glibc-linuxthreads-20071023.tar.bz2     glibc-2.7/glibc-ports-2.7.tar.bz2     glibc-2.7/stamp-dir      What I want is the unpacked and patched source code. Using google find this obsolete blog: Which says to run:               ./debian/rules configure_i686       But that gives me:               $ ./debian/rules configure_i686     make: *** No rule to make target `configure_i686'.  Stop.      Besides I want to unpack for amd64 (x86_64) not i686 anyway. So what is the super-secret target for unpacking libc6 via debian/rules? I do not want to start the build process. I not have the space for that. Thanks


title: How to script this task?

text: First of all, I can make basic use of the linux command line, but have slim to none experience with shell scripting. What I want to do: I have a router running OpenWRT, a destop pc and an Android phone. When the phone connects to the wifi, I want the router to wake-on-lan my pc. I have a vague idea on how to do this but need a little help on putting the pieces together:   * run a script with crontabs every 10 seconds to check if the phone is connected   * script does: `iwinfo wlan0 assoclist` to check if my phone's MAC is connected   * if my phone is connected, send wake-on-lan packet   * keep a boolean pcHasBeenWokenUp so the script doesn't send WOL packets all the time (because the phone is connected )   * when the phone disappeared for > 10 minutes: set pcHasBeenWokenUp to false a. Is this the right direction? b. Should the script be a bash script or rather something like perl? c. How can I maintain my pcHasBeenWokenUp variable between the starts of my script? Some hints would be highly appreciated :)


title: macro: mutt freezes

text: I am experiencing a strange problem with my new macro in mutt. The following macro works OK. `s` moves message to my archive folder immediately               macro index s ":set confirmappend=no delete=yes auto_tag=yes\n<save-message>=archive\n<sync-mailbox>:set confirmappend=yes delete=ask-yes\n"      however, when I remove `confirmappend=no` at the beginning and `confirmappend=yes` at the end:               macro index s ":set delete=yes auto_tag=yes\n<save-message>=archive\n<sync-mailbox>:set delete=ask-yes\n"      the macro does not work, and moreover mutt freezes so that I have to kill it with `pkill` Can somebody please explain what is wrong? Why doeas the macro cause mutt to freeze? If I want the macro to ask me confirmation for the append (but not for deleting), how can I do it?


title: Can I change an unmounted partition's type from another partition on the drive?

text: On my hard drive I have a largish unused partition that I would like to use. Trouble is, it's an old Windows partition and I'd prefer to make it a proper Linux partition (I intend using it via LVM if that makes a difference). So what I'd like to do is re-jig the partition type and reformat it then add it to my already-existing LVM group. But what I'd really like to do is do this from within my existing Linux distribution running on the same drive. I'd rather not have to go through the hassle of making/finding a live CD. So to be clear: the partition that I want to change is _not_ mounted, but is on the same drive as my Linux distribution. Is there a partitioning tool that will do that, and do it safely?


title: How to install 64 Bit snort on 64 Bit openSUSE 13.1?

text: My question is simple: I would like to install 64 Bit snort on my 64 Bit openSUSE 13.1. There is an unstable package available here:http://software.opensuse.org/package/snort I got everything but where can I get libpcre.so.0(64bit) that is missing on my system? The same question was on official openSUSE forum, but without any answer. It would be useful if someone can help me.


title: Put the XFCE extended dektop on the right-side monitor

text: Is it possible to make an aoutput showing extended desktop to the left of the primary? I'm using xfce.               $ xrandr --output VGA1 --primary --right-of LVDS1      The above command makes VGA1 as extended desktop to the right of LVDS1 but the primary part of the desktop (the part showing the apps menu button, the desktops, apps instances, applets, time and date ...) is on LVDS1. I want it on VGA1.


title: Is there some memory leak in Mint 16? Or else what is this?

text: So this has happened to me 3 times now: I have left my computer on over night and when I come back in the morning all of my ram is being used and about a third to a half of my swap space is full. Here's some information that may or may not be pertinent:   * I have 7.8GiB ram and 8GiB swap.   * I am running Linux Mint Petra with cinnamon 2.   * When I look at system monitor while this is happening no process is using an inordinate of memory and all 8 cores of my CPU are running sub 10%   * Aside from my start-up applications, the only thing I have running overnight is firefox idling on my open tabs. I have only added Guake and Cairo Dock to my start-up apps in addition to the default Mint start-up applications.   * I have installed jack and therefore some of my memory limits may have been changed. This is the output from `ulimit -a`:              core file size          (blocks, -c) 0      data seg size           (kbytes, -d) unlimited     scheduling priority             (-e) 0     file size               (blocks, -f) unlimited     pending signals                 (-i) 61806     max locked memory       (kbytes, -l) 64     max memory size         (kbytes, -m) unlimited     open files                      (-n) 1024     pipe size            (512 bytes, -p) 8     POSIX message queues     (bytes, -q) 819200     real-time priority              (-r) 0     stack size              (kbytes, -s) 8192     cpu time               (seconds, -t) unlimited     max user processes              (-u) 61806     virtual memory          (kbytes, -v) unlimited     file locks                      (-x) unlimited      (I think that I had not installed jack the first time this happened, though I am not positive)   * I have done some anti-virus things including, but not limited to, completely reinstalling my system between incident 2 and 3. Also incident 3 came on night 2 after reinstall. All anti-virus things seem to indicate that my computer is clean.   * I had to leave in the middle of writing this question. I was gone for 12 hours. Aside from my start-up apps, firefox, system monitor, and my Downloads folder were still open: my memory usage has gone from about 1.1-1.2 Gib when I left to 1.6 GiB now.  So my questions are: (a) Is this indicative of a memory leak? I don't quite know what a memory leak looks like. (b) If yes, how do I ferret out the culprit? (c) If no, is there anything else I could start looking at?


title: Apache Virtual Host pointing to wrong DocumentRoot

text: I operate a VPS on Digital Ocean running Ubuntu 12.04.3, with virtual hosts. I was able to set things up following this tutorial here: https://www.digitalocean.com/community/articles/how-to-set-up-apache-virtual- hosts-on-ubuntu-12-04-lts However, after a few days I navigated to my main domain (noelforte.com) to check and see if everything was running smoothly, but instead of seeing the landing page that I had temporarily set up, I instead was greeted with a directory listing. Oddly enough, the subdomain I had configured with VHosts was still pointed to the right directory, however my main domain reverted to pointing at the default document root of `/var/www`. Deleting the config files in `/etc/apache2/sites-available` and setting everything up again yielded the same results: any subdomain will point to the right location, however the root TLD remains stuck pointing to `/var/www`. What might cause a situation like this, and why then did it initially work properly?


title: how to get user's last login including the year in C

text: I'm trying to write a program that can get the user's last login time. Then i want to do something with the data. eg. check which user havent login for 90 days. So I tried using `last` command. This works great. Just that it doesnt display the year. So if I would do the checking on January 2014, how would I know the last login is actually would be on Dec 2013 or Dec 2012? This is an example of the code:               FILE *file1;     extern FILE *popen();     char command[1024];     char *username;     char result[1024];     char buff[1024];          username = "fikrie";     sprintf(command,"last %s",username);     file1 = popen(command, "r");     while(fgets(result, sizeof(result), file1)!=NULL){        sprintf(buff,"%s",result);     }     pclose(file1);      After some googling, I found out there's a -F flag to display the year. Unfortunately, it doesn't work on HP-UX or Solaris. These platform doesn't recognize that flag. I've also tested to used utmp based from this link here .The problem is this code will fail on Solaris and HP-UX. Seems like ut_tv doesn't exist in utmp struct.               #include <stdio.h>     #include <utmp.h>     #include <string.h>     #include <time.h>          int main(void) {         struct utmp *line;         time_t timestamp;         utmpname("/var/log/wtmp");         setutent();         while( (line = getutent()) != NULL) {                 if (line->ut_type == USER_PROCESS ) {                         timestamp = line->ut_tv.tv_sec;                         printf("%s %s", line->ut_user, asctime(localtime(&timestamp)));                 }         }         endutent();         return 0;     }      So, is there a way to do a C code that can generally get the last login for all the Unix platform. (Solaris, Redhat/Linux/CentOS, AIX, HP-UX, Ubuntu). Seems like when I manage to get it on 1 platform, then it fails on the others.


title: Why there is no Linux Handbook?

text: Look e.g. onto the BSD's family: FreeBSD Handbook: http://www.freebsd.org/doc/en/books/developers- handbook/debugging.html OpenBSD FAQ, nearby FreeBSD's Handbook: http://www.openbsd.org/faq/index.html I'm really discouraged what can be called official Linux documentation. Information scattered around the network. Where is the core? Is it `ii linux-doc 3.11.0-14.21 all Linux kernel specific documentation for version 3.11.0` of my Ubuntu?


title: Can't mkdir /root (btrfs)

text: I performed a standard Debian install using wheezy/testing netinst iso for amd64. After the install completed I booted into a live environment so that I could snapshot the root as a btrfs subvolume named 'root'. To do so I renamed the /root directory to /rootuser temporarily however I am not able to move /rootuser back to /root in the new subvolume. I've seen other posts where people rename and move around the /root directory without any appearent issue. Is this a bug with btrfs? Here are the steps to replicate: Install Debian on btrfs (/dev/sda3, /dev/sda1=/boot (ext4), /dev/sda2=swap), reboot into live environment (Linux Mint Debian Ediiton 2012-04 in my case) then from a terminal:               $ sudo su -      # btrfs filesystem label /dev/sda3 root     # mkdir /media/root     # mount /dev/sda3 /media/root     # cd /media/root     # mv /root /rootuser     # btrfs subvolume snapshot . root     # btrfs subvolume list . # get the subvolume id as $SUBVOLID     # btrfs subvolume set-default $SUBVOLID root     # rm -rf bin boot etc ... # everything except the root subvolume.     # mv root/rootuser root/root      The result is a 'not permitted' error.               # mkdir root/root      results ins an 'already exists' message. I've also tried the equivelent from inside a chroot environment via:               # mount /dev/sda1 boot     # mount --rbind /dev dev     # mount --rbind /proc proc     # mount --rbind /sys sys     # chroot /media/root/root /bin/bash      but I got the same results. Am I doing something wrong? Any pointers would be helpful. I know I shouldn't have messed with he /root folder in the first place, but it's too late now.


title: Identifying kernel modules

text: How do I get more information about a kernel module, like a long description? For example, I can see kernel modules like `lp` or `hid`, but those short codes do not mean anything useful to me.


title: Asynchronous and parallel algorithms in the Linux kernel

text: In the Linux kernel configuration, I see these options:               config CRYPTO_PCRYPT             tristate "Parallel crypto engine"             depends on SMP             select PADATA             select CRYPTO_MANAGER             select CRYPTO_AEAD             help               This converts an arbitrary crypto algorithm into a parallel               algorithm that executes in kernel threads.          config CRYPTO_CRYPTD             tristate "Software async crypto daemon"             select CRYPTO_BLKCIPHER             select CRYPTO_HASH             select CRYPTO_MANAGER             select CRYPTO_WORKQUEUE             help               This is a generic software asynchronous crypto daemon that               converts an arbitrary synchronous software crypto algorithm               into an asynchronous algorithm that executes in a kernel thread.      What is the difference between arbitrary algorithms, asynchronous algorithms, and parallel algorithms in cryptography?


title: Can I split a avi file into 2 valid (watchable) files with only standard unix commands?

text: The question is self explanatory. I have a very big movie file, I want to split it in 2. How can I do this?


title: How does the server find out what client port to send to?

text: As I understand it this is what happens when a client makes a connection request:   1. The server will be bound to a particular port number. The port number is always bound to a listening process. Since only the server is listening for incoming connections, we don't need to bind on the client side   2. The server will keep on listeninig on that port number.   3. The client will send a `connect()` request.   4. The server will accept the request using `accept()`. As soon as the server accepts the client request, the kernel allocates a random port number for the server for further `send()` and `receive()`, since the same port number on the server can't be used for sending as well as listening, and the previous port is still listening for new connections Given all that, how does the server find out what port the client is receiving on? I know the client will send TCP segments with a source port and destination port, so the server will use the source port of that segment as its destination port, but what function does the server call to find out about that port? Is it `accept()`?


title: Draw On Screen Live

text: I'd like to have functionality like this in Linux, Xorg, whereby I can sketch on the desktop as in the example image below. Anybody have suggestions? ![enter image description here](http://i.stack.imgur.com/GvwXH.jpg)


title: How to "combine" lines printed by multiple programs safely?

text: Suppose I want to execute multiple programs in parallel and combine their outputs to one pipe:               sh -c '         (echo qqq; echo qqq2; echo qqq3)&         (echo www; echo www2; echo www3)&          (echo eee; echo eee2; echo eee3)&        wait; wait; wait'      This shell approach works well for this simple case, but I expect it to fail if programs output more and longer lines in buffered way, like this (constructed):               qqq     qqwww     q2     qqq3www2          wwweee3          eee2     eee3      One of the solution I was hinted to use was `tail -f`:               tail -n +0 -q -f <(echo qqq; echo qqq2; echo qqq3) <(echo www; echo www2; echo www3) <(echo eee; echo eee2; echo eee3)      , but this is sub-optimal option: it outputs data sluggishly, it does not terminate; I see outputs not in "sleep" order, but in arguments order in this case:               tail -n +0 -q -f <(sleep 1; echo qqq; sleep 1; echo qqq2; echo qqq3) <(echo www; echo www2; sleep 10; echo www3) <(echo eee; sleep 4; echo eee2; echo eee3) | cat      I've implemented a special little program for this, but believe that there should be some standard good way to do it. How to do it using standard tools (and without `tail -f` disadvantage)?


title: public key authentification doesn't pass, why?

text: I'm trying to connect to Server with ssh and id_rsa key. That key is only key in authorized_keys (just added with ssh-copy-id) When i do connect, server ask doesnt end with keys but always ask for user pass there is output any suggestion? I suppose is Q of sshd config tunning? [SOLVED] - was question of permissions set on .ssh and authorized_keys output with debug level: >> **ssh-add id_rsa;ssh -vv vps**               Enter passphrase for id_rsa:      Identity added: id_rsa (id_rsa)     OpenSSH_5.5p1, OpenSSL 1.0.0i-fips 19 Apr 2012     debug1: Reading configuration data /home/yurij/.ssh/config     debug1: Applying options for vps     debug1: Reading configuration data /etc/ssh/ssh_config     debug1: Applying options for *     debug2: ssh_connect: needpriv 0     debug1: Connecting to 78.47.XX.XX [78.47.XX.XX] port 22     debug1: Connection established.     debug2: key_type_from_name: unknown key type '-----BEGIN'     debug2: key_type_from_name: unknown key type 'Proc-Type:'     debug2: key_type_from_name: unknown key type 'DEK-Info:'     debug2: key_type_from_name: unknown key type '-----END'     debug1: identity file /home/yurij/.ssh/id_rsa type 1     debug1: identity file /home/yurij/.ssh/id_rsa-cert type -1     debug1: identity file /home/yurij/.ssh/id_dsa type -1     debug1: identity file /home/yurij/.ssh/id_dsa-cert type -1     debug1: Remote protocol version 2.0, remote software version OpenSSH_4.3     debug1: match: OpenSSH_4.3 pat OpenSSH_4*     debug1: Enabling compatibility mode for protocol 2.0     debug1: Local version string SSH-2.0-OpenSSH_5.5     debug2: fd 3 setting O_NONBLOCK     debug1: SSH2_MSG_KEXINIT sent     debug1: SSH2_MSG_KEXINIT received     debug2: kex_parse_kexinit: diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1     debug2: kex_parse_kexinit: ssh-rsa-cert-v00@openssh.com,ssh-dss-cert-v00@openssh.com,ssh-rsa,ssh-dss     debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se     debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se     debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96     debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96     debug2: kex_parse_kexinit: none,zlib@openssh.com,zlib     debug2: kex_parse_kexinit: none,zlib@openssh.com,zlib     debug2: kex_parse_kexinit:      debug2: kex_parse_kexinit:      debug2: kex_parse_kexinit: first_kex_follows 0      debug2: kex_parse_kexinit: reserved 0      debug2: kex_parse_kexinit: diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1     debug2: kex_parse_kexinit: ssh-rsa     debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se     debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se     debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96     debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96     debug2: kex_parse_kexinit: none,zlib@openssh.com     debug2: kex_parse_kexinit: none,zlib@openssh.com     debug2: kex_parse_kexinit:      debug2: kex_parse_kexinit:      debug2: kex_parse_kexinit: first_kex_follows 0      debug2: kex_parse_kexinit: reserved 0      debug2: mac_setup: found hmac-md5     debug1: kex: server->client aes128-ctr hmac-md5 none     debug2: mac_setup: found hmac-md5     debug1: kex: client->server aes128-ctr hmac-md5 none     debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent     debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP     debug2: dh_gen_key: priv key bits set: 119/256     debug2: bits set: 515/1024     debug1: SSH2_MSG_KEX_DH_GEX_INIT sent     debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY     debug1: checking without port identifier     debug1: Host '78.47.184.37' is known and matches the RSA host key.     debug1: Found key in /home/yurij/.ssh/known_hosts:9     debug1: found matching key w/out port     debug2: bits set: 487/1024     debug1: ssh_rsa_verify: signature correct     debug2: kex_derive_keys     debug2: set_newkeys: mode 1     debug1: SSH2_MSG_NEWKEYS sent     debug1: expecting SSH2_MSG_NEWKEYS     debug2: set_newkeys: mode 0     debug1: SSH2_MSG_NEWKEYS received     debug1: Roaming not allowed by server     debug1: SSH2_MSG_SERVICE_REQUEST sent     debug2: service_accept: ssh-userauth     debug1: SSH2_MSG_SERVICE_ACCEPT received     debug2: key: /home/yurij/.ssh/id_rsa (0xb9608568)     debug2: key: id_rsa (0xb9609890)     debug2: key: /home/yurij/.ssh/id_dsa ((nil))     debug1: Authentications that can continue: publickey,password     debug1: Next authentication method: publickey     debug1: Offering public key: /home/yurij/.ssh/id_rsa     debug2: we sent a publickey packet, wait for reply     debug1: Authentications that can continue: publickey,password     debug1: Offering public key: id_rsa     debug2: we sent a publickey packet, wait for reply     debug1: Authentications that can continue: publickey,password     debug1: Trying private key: /home/yurij/.ssh/id_dsa     debug2: we did not send a packet, disable method     debug1: Next authentication method: password      **sudo tail -F /var/log/secure when i tried to connect with keys and then logged with pass**               Nov  8 10:18:50 sshd[3892]: pam_unix(sshd:session): session opened for user yurij by (uid=0)     Nov  8 10:20:23 sshd[3892]: pam_unix(sshd:session): session closed for user yurij     ^Z


title: IOMMU causing freezes, disabling causes USB to not work

text: I'm somewhat new to linux, but I'm running a Xubuntu machine that I recently built. Since I started it up, I had noticed frequent freezes, where both the screen (if plugged in) and any SSH session would become unresponsive. After some searching around, I was told to check kern.log for any errors. Every time the computer because unresponsive, there would be a long line of                   AMDvi: completion-wait loop timed out      entries. At the top of them, some string of errors, starting with a reference to a problem in .../drivers/AMD-iommu. After some more googling around, I was able to edit the grub config to force iommu=off at boot time, which I believed would solve my problems. Now I'm not getting any response from any IO on my motherboard, except for the PS/2 port. I've also checked my BIOS (It's the MSI Touch BIOS II), and have no options regarding disabling/modifying iommu settings. Any advice?


title: How to set awesome's wibox visible only for certain tags?

text: I'd like to have special wiboxes for certain tags like multimedia, development. I couldn't find any option in wibox for that and I'm newbie to awesome. I think it can be done using some event handlers and show/hide it manually, but isn't it implemented in some module and if not what's the best way to do it?


title: Is there any reason to escape a dot in a bash filename expansion?

text: I am working with a bash script that someone else wrote and I see the following line:               cp -v  ${LOG_DIR}/${APPLICATION}\.*.log ${ARCHIVED_LOG_DIR}      The files with which it's working are all named like: `EXAMPLE.command1.log` `EXAMPLE.command2.log` Is there any reason for the backslash escaping the dot since a dot isn't treated specially in filename expansions? What are the implications of doing this vs without the backslash as such?:               cp -v  ${LOG_DIR}/${APPLICATION}.*.log ${ARCHIVED_LOG_DIR}


title: How to configure SELinux using samba? Scientific Linux?

text: when I'm trying to mount a read-only samba share, then I get this messages on the samba server (and timeout on client side)               Nov  5 18:45:49 localhost kernel: type=1400 audit(1352137549.469:17): avc:  denied  { module_request } for  pid=3046 comm="smbd" kmod="net-pf-10" scontext=unconfined_u:system_r:smbd_t:s0 tcontext=system_u:system_r:kernel_t:s0 tclass=system      I already tried:               setsebool -P samba_export_all_ro 1     getsebool -a | egrep -i 'smb|samba'     yum install policycoreutils-python     semanage fcontext -a -t samba_share_t '/PATH/TO/SAMBASHARE(/.*)?'     restorecon -R /PATH/TO/SAMBASHARE     /etc/init.d/smb restart      How can I configure SELinux to allow the read-only samba share? Turning off SELinux is just idiotic. UPDATE:               [root@SERVER ~]# getsebool -a|grep -i smbd     allow_smbd_anon_write --> off     [root@SERVER ~]# setsebool -P smbd_disable_trans 1     libsemanage.dbase_llist_set: record not found in the database     libsemanage.dbase_llist_set: could not set record value     Could not change boolean smbd_disable_trans     Could not change policy booleans


title: How to generate SELinux policies based on logs?

text: Afaik there is a solution/software that can automatically generate SELinux policies based on logfiles. I just don't know the name of the software/method that can do this..


title: Enable 9p filesystem type in Centos 6 virtual guest?

text: My question is linked to this one : http://stackoverflow.com/questions/17880460/mounting-shared-folder-in-kvm-vm- error-mount-unknown-filesystem-type-9p (but can't comment it) I have apparently the same settings. Here is my problem : I want to create a shared folder between host and guest using 9p virtio. I'm following http://www.linux-kvm.org/page/9p_virtio :               # mount -t 9p [...]          mount: unknown filesystem type '9p'      According to http://wiki.qemu.org/Documentation/9psetup this line in my `/boot/confg-$(uname -r)` is not correct (and quite obviously) : `               # egrep 'CONFIG_(NET_)?_9P' /boot/config-$(uname -r)          CONFIG_NET_9P=m      CONFIG_NET_9P_VIRTIO=m     CONFIG_NET_9P_RDMA=m     # CONFIG_NET_9P_DEBUG is not set     # CONFIG_9P is not set      <------------      ` the doc tells me to enable it, ok, but how ? I'm not at ease with linux kernel settings... at the beginning of the config file there is : > automaticaly generated make config - do not modify meaning I can't just add the line. My questions : Should I recompile the kernel with some option? Can't I simply enable that on boot, e.g. by changing something in grub settings ? Can I automaticaly enable that on CentOS installation ? (since this will be some kind of template that should be repeatedly done)


title: How are the services exactly starting in (K)Ubuntu?

text: I have latest Kubuntu. I have installed mysql.   I was looking into the /etc/init.   I see the following:               In /etc/init/mysql.conf          description     "MySQL Server"                                                                                [18/40]       author          "Mario Limonciello <superm1@ubuntu.com>"            start on runlevel [2345]       stop on starting rc RUNLEVEL=[016]          If I understand this correctly mysql should start on level 2 and be up in all levels 2 up to 5.   Then I did the following:               Linux:/etc$ ls rc0.d/       K10unattended-upgrades  K20kerneloops  README  S20sendsigs  S30urandom  S31umountnfs.sh  S40umountfs  S48cryptdisks  S59cryptdisks-early  S60umountroot  S90halt       Linux:/etc$ ls rc1.d/       K20kerneloops  K20saned  README  S30killprocs  S70dns-clean  S70pppd-dns  S90single       Linux:/etc$ ls rc2.d/       README  S20kerneloops  S50rsync  S50saned  S70dns-clean  S70pppd-dns  S75sudo  S99grub-common  S99ondemand  S99rc.local       Linux:/etc$ ls rc3.d/       README  S20kerneloops  S50rsync  S50saned  S70dns-clean  S70pppd-dns  S75sudo  S99grub-common  S99ondemand  S99rc.local       Linux:/etc$ ls rc4.d/       README  S20kerneloops  S50rsync  S50saned  S70dns-clean  S70pppd-dns  S75sudo  S99grub-common  S99ondemand  S99rc.local       Linux:/etc$ ls rc5.d/         README  S20kerneloops  S50rsync  S50saned  S70dns-clean  S70pppd-dns  S75sudo  S99grub-common  S99ondemand  S99rc.local        I was expecting that the mysqld would be listed in one of those directories.   I mean the services have the .conf files in the /etc/init and for each runtime level there is a link to the service executable to start/stop.   But why there is nothing for mysql?   Please note that mysql is up and running:               Linux:/etc$ ps -ef|grep mysql       mysql      994     1  0 21:24 ?        00:00:08 /usr/sbin/mysqld       jim      4396  4223  0 23:44 pts/8    00:00:00 grep --color=auto mysql


title: Using expect to send Ctrl+D to a telnet connection

text: I want to use expect file for connecting to telnet session automatically, the flow is:   * when we connect to some IP & port, it will show `escape character is ]`   * after that we have to give `Ctrl`+`D` I wrote one expect file that sends `\x04` for `Ctrl`+`D`. When I run that file it is fine for connecting but expecting me to give `Ctrl`+`D` from keyboard. But I want it to automatically enter `Ctrl`+`D` from the script itself. Nothing should be done manually. Can you please explain the way?


title: Installing JDK 7 on debian

text: So I just rented a dedicated server running Debian, and I know nothing about Linux. Anyway, I want to install the JDK 7, first I connected through SSH and granted myself administrator rights by typing `su -`. Then I typed `apt-get install openjdk-7-jdk`, however I get a message saying that the package `openjdk-7-jdk` cannot be found Am I doing something wrong?


title: On ssh connection the auth.log shows as source IP the external IP of the server instead of the IP of the client

text: I have a very odd situation with my ssh connection. Every time I connect to my server, whatever is my external ip, the connection have as source the server's external ip. Example                     Server S.O.:  PCLinuxOS         Client ip:    [C.C.C.C]         Server ip:    [S.S.S.S]      After ssh successful connection, I execute the "last" command and I get this:               username pts/0        [S.S.S.S]   Wed Jan 29 19:29   still logged in      This is the result of netstat searching for port 22:               $ netstat -atn | egrep '(:22)'     tcp        0     96 192.168.1.34:22            [S.S.S.S]:31685        ESTABLISHED      **I can't find the client ip [C.C.C.C] anywhere.** I wouldn't have any particular issue on this, but now comes the best part. I found an attack on my server inside the auth.log:               Jan 27 12:55:42 localhost sshd[2295]: Invalid user a from [S.S.S.S]     Jan 27 12:55:42 localhost sshd[2295]: input_userauth_request: invalid user a [preauth]     Jan 27 12:55:42 localhost sshd[2299]: Invalid user a from [S.S.S.S]     Jan 27 12:55:42 localhost sshd[2299]: input_userauth_request: invalid user a [preauth]     Jan 27 13:49:58 localhost sshd[17917]: Invalid user jack from [S.S.S.S]     Jan 27 13:49:58 localhost sshd[17917]: input_userauth_request: invalid user jack [preauth]     Jan 27 13:50:07 localhost sshd[17923]: Invalid user ibsadmin from [S.S.S.S]     Jan 27 13:50:07 localhost sshd[17923]: input_userauth_request: invalid user ibsadmin [preauth]      After this attack the result is that my fail2ban daemon will insert the server IP [S.S.S.S] on the banned list and I can't connect to my server anymore. The server is behind a router with a NAT port forwarding on ssh port. The issue is not present when I connect to the server from inside my LAN, the correct IP is showed in this case. This is my sshd_config file:               AcceptEnv LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES     AcceptEnv LC_IDENTIFICATION LC_ALL     AcceptEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT     AuthorizedKeysFile      .ssh/authorized_keys     ChallengeResponseAuthentication no     ClientAliveInterval 60     HostKey /etc/ssh/ssh_host_dsa_key     HostKey /etc/ssh/ssh_host_key     HostKey /etc/ssh/ssh_host_rsa_key     IgnoreRhosts yes     KeyRegenerationInterval 1h     LoginGraceTime 30     MaxAuthTries 2     MaxSessions 4     MaxStartups 10:30:60     PasswordAuthentication no     PermitEmptyPasswords no     PermitRootLogin no     Port 22     PubkeyAuthentication yes     RSAAuthentication yes     StrictModes yes     Subsystem       sftp    /usr/lib64/ssh/sftp-server     TCPKeepAlive yes     UseDNS  no     UsePAM no     UsePrivilegeSeparation yes     X11Forwarding yes      I know for sure that I didn't had this issue one month ago, but I can't figure out what is changed. EDIT: This is the result of iptables -L command:               $ iptables -L     Chain INPUT (policy ACCEPT)     target     prot opt source               destination     fail2ban-SSH  tcp  --  anywhere             anywhere             tcp dpt:ssh          Chain FORWARD (policy ACCEPT)     target     prot opt source               destination          Chain OUTPUT (policy ACCEPT)     target     prot opt source               destination          Chain fail2ban-SSH (1 references)     target     prot opt source               destination     RETURN     all  --  anywhere             anywhere


title: Learning to Use Virtual Manager in opensuse 12.2

text: Ok just installed virt-manager, and then install opensuse 12.2, installed correctly, but when do zypper up had no network, then turn off the virtual machine and change the network card to a vlan in the configuation files. Another thing I did as I was was to rename the vm. When I reboot I got the following error: ![enter image description here](http://i.stack.imgur.com/Tn8OZ.png) I'm totally a noob with kvm and virt-manager. So any thing that you can tell me about this and adding some extra info. would be great, thanks!


title: Overclocking tools in Linux

text: I am trying to overclock my machine. All the changes are made on the BIOS level, but then one needs to check all the temperatures, voltages, etc and test the stability of the overclock. Most tutorials (if not all) are written for Windows. What would be Linux alternatives for: **CPU-Z** : to display all the CPU information, including Core Speed, Core Voltage, current multiplier, etc. **HWMonitor** : check fan speed and core temperatures **Prime95** : stress testing with results validation Also I would like to be able to monitor VTT and NB voltages (see a short explanation of all voltages) for Intel processors (I have a Q9450) - I haven't actually found a Windows program that does it yet.


title: Audible iTunes Linux

text: Using Linux Mint I need to find some way of running iTunes so i can update my 7th Gen iPod, which cannot be done in `Rhythmbox`. I've tried legacy versions of iTunes in WINE. I've tried to use play on Linux. I've not tried to run Windows in VirtualBox yet. Has anyone previously done this, or have any suggestions?


title: What does the CONFIG_NLS_UTF8 kernel option do?

text: The kernel configuration contains an `NLS_UTF8` option. It can be found under _File systems → Native language support_. What does it do? Its description maintains that it is needed for using a FAT or JOLIET CD-ROM filesystem. Is it necessary for an ext[234] filesystem?


title: Mounting another VM's .vdi in VirtualBox

text: I have two VMs in VirtualBox. For exmaple, VM 1 runs Red Hat, and VM 2 runs Ubuntu. For the Red Hat VM I have redhat.vdi and redhat2.vdi, and for the Ubuntu VM I have ubuntu.vdi and unbuntu2.vdi. Each VM can access its own virtual disks without problem. How can I access ubuntu.vdi from the Red Hat virtual machine, using VirtualBox?


title: ldconfig not following user-created symbolic link

text: I'm attempting to run Inkscape 0.48.4-15 (armv7) which is installed via pacman from Arch Linux ARM.               $ inkscape     inkscape: error while loading shared libraries: libMagick++-6.Q16HDRI.so.3: cannot open shared object file: No such file or directory      As expected, the shared object is not available in /usr/lib:               $ ll /usr/lib | grep libMagick+     lrwxrwxrwx   1 root root       30 Jun  5 03:04 libMagick++-6.Q16HDRI.so ->     libMagick++-6.Q16HDRI.so.4.0.0     lrwxrwxrwx   1 root root       30 Jun  5 03:04 libMagick++-6.Q16HDRI.so.4 -> libMagick++-6.Q16HDRI.so.4.0.0     -rwxr-xr-x   1 root root   379428 Jun  5 03:06 libMagick++-6.Q16HDRI.so.4.0.0      So I make a symbolic link linking *.so.3 to *.so.4.0.0:               $ sudo ln -s libMagick++-6.Q16HDRI.so.4.0.0 libMagick++-6.Q16HD.so.3     lrwxrwxrwx   1 root root       30 Jun  5 03:04 libMagick++-6.Q16HDRI.so -> libMagick++-6.Q16HDRI.so.4.0.0     lrwxrwxrwx   1 root root       30 Jun  6 15:15 libMagick++-6.Q16HDRI.so.3 -> libMagick++-6.Q16HDRI.so.4.0.0     lrwxrwxrwx   1 root root       30 Jun  5 03:04 libMagick++-6.Q16HDRI.so.4 -> libMagick++-6.Q16HDRI.so.4.0.0     -rwxr-xr-x   1 root root   379428 Jun  5 03:06 libMagick++-6.Q16HDRI.so.4.0.0      and verify that *.so.3 is indeed linked to *.so.4.0.0.               $ readlink -f libMagick++-6.Q16HDRI.so.3     /usr/lib/libMagick++-6.Q16HDRI.so.4.0.0      Now I reconfigure the dynamic linker run time bindings and rerun Inkscape:               $ sudo ldconfig      $ ldd $(which inkscape) | grep libMagick++     libMagick++-6.Q16HDRI.so.3 => /usr/lib/libMagick++-6.Q16HDRI.so.3 (0x75cf9000)      Why is *.so.3 linking to itself and not following the symbolic link created earlier?


title: Changing systemd dependencies during boot

text: I am looking for a way to instruct systemd to recalculate service dependencies while the system is booting. Specifically, I need one service to be able to enable another service, and have the second service start up later in the same boot sequence. This is part of my automatic deployment process; very early in the boot process, the first time the system starts up, it automatically configures itself. One of the steps that it may need to take is enabling other services. Unfortunately, any changes it makes at that step do not seem to take effect until the following reboot. Rebooting the machine after initial deployment is not an option. Here's a generalized idea of what I'm trying to achieve /etc/systemd/system/firstboot.service:               [Unit]     Description=Enable MyService     DefaultDependencies=no     After=sysinit.target     Before=basic.target          [Service]     Type=oneshot     ExecStart=/bin/systemctl enable myservice.service     ExecStartPost=/bin/systemctl disable firstboot.service          [Install]     RequiredBy=basic.target      /etc/systemd/system/myservice.service:               [Unit]     Description=MyService          [Service]     Type=simple     ExecStart=/usr/local/bin/myservice          [Install]     WantedBy=multi-user.target      Unfortunately, this doesn't work as I expected; the service is enabled, but is not started before `multi-user.target`:               $ systemctl status myservice     myservice.service - MyService        Loaded: loaded (/etc/systemd/system/myservice.service; enabled)        Active: inactive (dead)      I can force it to start with `systemctl isolate multi-user.target` or by rebooting the machine. I have tried adding `systemctl daemon-reload` and/or `systemctl daemon-reexec` to `ExecStart`/`ExecStartPost` of `firstboot.service`, but neither seem to have any effect. Is there any way I can tell systemd to recalculate the boot path and include the changes that were made while it was still booting? Or will I need to do something later in the boot process to force my service to start?


Indic keyboards of Linux Mint 17 Cinnamon not working in Chrome/Chromium. Reinstalled both OS and Browser. But none helped. ![enter image description here](http://i.stack.imgur.com/fA6sd.png)


title: What do the different memory counters in FreeBSD mean?

text: top tells me:               last pid: 64807;  load averages:  0.99,  0.97,  0.92                                          up 189+04:47:22 09:16:17     45 processes:  1 running, 44 sleeping     CPU:  0.4% user,  0.0% nice,  0.2% system,  6.4% interrupt, 93.0% idle     Mem: 222M Active, 2151M Inact, 2008M Wired, 823M Buf, 3499M Free     Swap: 8192M Total, 8192M Free      Munin shows a this a little more clearly: ![rtr1 yearly memory usage](http://i.stack.imgur.com/Xy8K1.png) As you can see, the server has around 8GB of ram. I wondering if I can cram this beast into a more modest 2GB server. Now I know what active and buffers mean, I think. But I am really concerned about the "wired" and "inactive" blobs of memory. Those do not map to any existing process as far as I know. Note how the green "active" line went up in December: that's when we started using a BGP daemon on this router. I don't exactly understand what happened in April and May, but I remember doing a system upgrade and switching to pkgng around that time. Here's the spare router for the first one, with less ram (4GB): ![rtr0 yearly memory usage](http://i.stack.imgur.com/XlXR4.png) It seems this one lives perfectly well with half the RAM and still leaves around 2GB free, which leads me to believe I could switch to a 2GB box for this server, lowering costs and maintenance... Any suggestions? What do the various memory counters shown in top mean? More specifically, what does:   * Active   * Inactive   * Cache   * Buffers   * Wired   * Free ...really mean? I have found some posts explaining bits of the VM subsystem works, and I remember having a "ah-ah!" moment understanding all of this about 12 years ago, but I forgot. :) Even the faithful FreeBSD handbook failed to answer my question... Can I downgrade to 2GB?


title: The equivalent of start-stop-daemon for RedHat 6

text: I have an upstart script to create a service in RedHat 6:               env PLAY_BINARY=/usr/bin/play     env HOME=/opt/warda     env USER=root     env GROUP=root          [...]          script         exec start-stop-daemon --start --exec $PLAY_BINARY --chuid $USER:$GROUP --chdir $HOME --start $HOME     end script      In Ubuntu everything goes right. However in RedHat, when I launch `sudo initctl start play`, I get a successful feedback `play start/running`, but `play` doesn't run. I think that the problem is that `start-stop-daemon` doesn't exist in RedHat. How can I replace the `exec start-stop-daemon...` command?


title: Debian packaging with dependency (from the scratch)

text: I would like to package my software (in C) into a .deb file, but I encounter some difficulties. It would be nice if someone could give me a hand... Let the source code be the following toy example:               #include <stdio.h>     #include <stdlib.h>     #include <lbfgs.h>          int main(void)     {         printf("liblbfgs will be used here!\n");         return 0;     }      In the above C program, liblbfgs library will be used. liblbfgs is available in repos. I have written the following simple Makefile:               CXX=gcc     CFLAGS=-Wall -g     LIBS=-lm -llbfgs     OUTPUT=toypackage          $(OUTPUT): $(OUTPUT).o         $(CXX) -o $(OUTPUT) $(LIBS) $(OUTPUT).o          .PHONY: clean          clean:         rm -f *~ *.o      If I install the library via synaptic/apt-get or by manually compiling the available source code, and by building the above code, everything is alright. But it would be very desired to avoid installing liblbfgs first. For this reason, I want to package my software into a .deb file where I should define liblbfgs as a dependency. I create a folder, say toypackage_1.0/, where I store the source code and the Makefile. Then I compress this directory as               tar czvf toypackage_1.0.orig.tar.gz toypackage-1.0/      Then, I run dh_make as follows               $ cd toypackage-1.0/     $ dh_make          Type of package: single binary, indep binary, multiple binary,     library, kernel module, kernel patch?       [s/i/m/l/k/n] s            Maintainer name  : geppetto       Email-Address    : geppetto@phi        Date             : Fri, 06 Jun 2014 16:25:22 +0300       Package Name     : toypackage       Version          : 1.0       License          : blank       Type of Package  : Single       Hit <enter> to confirm:        Skipping creating ../toypackage_1.0.orig.tar.gz because it already exists       Done. Please edit the files in the debian/ subdirectory now. You should also       check that the toypackage Makefiles install into $DESTDIR and not in / .          $ debuild            dpkg-buildpackage -rfakeroot -D -us -uc       dpkg-buildpackage: source package toypackage       dpkg-buildpackage: source version 1.0-1       dpkg-buildpackage: source distribution unstable       dpkg-buildpackage: source changed by geppetto <geppetto@phi>       dpkg-source --before-build toypackage-1.0       dpkg-buildpackage: host architecture amd64       fakeroot debian/rules clean       dh clean      dh_testdir     dh_auto_clean       make[1]: Entering directory '/home/geppetto/LAB/Debian_Packaging/ToyPackage/toypackage-1.0'       rm -f *~ *.o       make[1]: Leaving directory '/home/geppetto/LAB/Debian_Packaging/ToyPackage/toypackage-1.0'     dh_clean       dpkg-source -b toypackage-1.0       dpkg-source: info: using source format `3.0 (quilt)'       dpkg-source: info: building toypackage using existing ./toypackage_1.0.orig.tar.gz       dpkg-source: info: building toypackage in toypackage_1.0-1.debian.tar.xz       dpkg-source: info: building toypackage in toypackage_1.0-1.dsc       debian/rules build       dh build      dh_testdir     dh_auto_configure     dh_auto_build       make[1]: Entering directory '/home/geppetto/LAB/Debian_Packaging/ToyPackage/toypackage-1.0'       cc -Wall -g -D_FORTIFY_SOURCE=2  -c -o toypackage.o toypackage.c       gcc -o toypackage -lm -llbfgs toypackage.o       make[1]: Leaving directory '/home/geppetto/LAB/Debian_Packaging/ToyPackage/toypackage-1.0'     dh_auto_test       fakeroot debian/rules binary       dh binary      dh_testroot     dh_prep     dh_auto_install     dh_installdocs     dh_installchangelogs     dh_perl     dh_link     dh_compress     dh_fixperms     dh_strip     dh_makeshlibs     dh_shlibdeps     dh_installdeb     dh_gencontrol       dpkg-gencontrol: warning: Depends field of package toypackage: unknown substitution variable ${shlibs:Depends}     dh_md5sums     dh_builddeb       dpkg-deb: building package `toypackage' in `../toypackage_1.0-1_amd64.deb'.       dpkg-genchanges  >../toypackage_1.0-1_amd64.changes       dpkg-genchanges: including full source code in upload       dpkg-source --after-build toypackage-1.0       dpkg-buildpackage: full upload (original source is included)       Now running lintian...       E: toypackage changes: changed-by-address-malformed geppetto <geppetto@phi>       W: toypackage source: dh-make-template-in-source debian/init.d.ex       W: toypackage source: dh-make-template-in-source debian/manpage.1.ex       W: toypackage source: dh-make-template-in-source debian/manpage.sgml.ex       W: toypackage source: dh-make-template-in-source debian/manpage.xml.ex       W: toypackage source: dh-make-template-in-source debian/menu.ex       W: toypackage source: dh-make-template-in-source debian/postinst.ex       W: toypackage source: dh-make-template-in-source debian/postrm.ex       W: toypackage source: dh-make-template-in-source debian/preinst.ex       W: toypackage source: dh-make-template-in-source debian/prerm.ex       W: toypackage source: dh-make-template-in-source debian/toypackage.cron.d.ex       W: toypackage source: dh-make-template-in-source debian/toypackage.default.ex       W: toypackage source: dh-make-template-in-source debian/toypackage.doc-base.EX       W: toypackage source: dh-make-template-in-source debian/watch.ex       W: toypackage source: package-needs-versioned-debhelper-build-depends 9       E: toypackage source: maintainer-address-malformed geppetto <geppetto@phi>       W: toypackage source: superfluous-clutter-in-homepage <insert the upstream URL, if relevant>       W: toypackage source: bad-homepage <insert the upstream URL, if relevant>       W: toypackage source: out-of-date-standards-version 3.9.4 (current is 3.9.5)       W: toypackage: wrong-bug-number-in-closes l3:#nnnn       E: toypackage: debian-changelog-file-contains-invalid-email-address geppetto@phi       W: toypackage: new-package-should-close-itp-bug       E: toypackage: changelog-is-dh_make-template       E: toypackage: helper-templates-in-copyright       W: toypackage: copyright-has-url-from-dh_make-boilerplate       E: toypackage: copyright-contains-dh_make-todo-boilerplate       W: toypackage: readme-debian-contains-debmake-template       E: toypackage: description-is-dh_make-template       E: toypackage: maintainer-address-malformed geppetto <geppetto@phi>       E: toypackage: section-is-dh_make-template       W: toypackage: superfluous-clutter-in-homepage <insert the upstream URL, if relevant>       W: toypackage: bad-homepage <insert the upstream URL, if relevant>       Finished running lintian.       Now signing changes and any dsc files...       signfile toypackage_1.0-1.dsc geppetto <geppetto@phi>       gpg: skipped "geppetto <geppetto@phi>": secret key not available       gpg: /tmp/debsign.wQjBHrJP/toypackage_1.0-1.dsc: clearsign failed: secret key not available       debsign: gpg error occurred!  Aborting....       debuild: fatal error at line 1283:       running debsign failed      It seems a bit erroneous, but if I               $ cd ..     $ sudo dpkg -i toypackage_1.0-1_amd64.deb          [sudo] password for geppetto:      Selecting previously unselected package toypackage.     (Reading database ... 426247 files and directories currently installed.)     Preparing to unpack toypackage_1.0-1_amd64.deb ...     Unpacking toypackage (1.0-1) ...     Setting up toypackage (1.0-1) ...          $ cd ./toypackage-1.0/     $ cd ./toypackage          liblbfgs will be used here!      then I see that the code has been built correctly, as I have already installed liblbfgs via apt-get. Here are my questions:   * What if I have not installed liblbfgs before? What should I do to be able to build my code correctly?   * What would be a meaningful Makefile for my purposes? Could you suggest me how to change it using $DESTDIR$ in order the binaries are stored to /usr/bin/? Please forgive my unawareness on these topics... I am a bit confused with all this stuff, so I would like someone to give me some guidelines. Thanks a lot in advance!


title: Why does wc -l tell me that this non-empty file has 0 lines?

text: `xclip`/`xsel` are utilities that allow you to pipe clipboard output to the shell on Ubuntu. Unfortunately, they seem to fail in combination with the `wc` command. Try this. Open a new file and type:               this is a line      **without hitting the enter key at the end of the line**. Now, copy this text and try the following:               $ xsel -o | wc -l     0      The output is 0, when in fact it should be 1. Save the file (call it `myfile.txt`). Now try:               $ cat myfile.txt | wc -l     1      The output is 1, as expected. Why is the output 0 in the first case?


title: ksh if with several conditions

text: I'd like to know what's the syntax for this kind of if in ksh :               if [[ $tmpEngine != "a" || $tmpEngine != "b" || $tmpEngine != "s" ]]; then        ...     fi      Actually, my code doesn't work, what's the problem here ? The problem is not about the meaning of my if, but rather how to write it correctly from a syntax point of view.


title: What Causes Maintenance Shell Segmentation Fault?

text: I'm running Ubuntu 14.04 Trusty Tahr in a Microsoft Hyper-V virtual machine on Windows Server 2012 R2. I've stopped the VM, replaced an EXT4-formatted virtual disk volume (/dev/sdb) with a new (unformatted) disk volume and restarted the VM. I see the following messages: Filesystem check or mount failed. A maintenance shell will now be started. CONTROL-D will terminate this shell and continue booting after re-trying filesystems. Any further errors will be ignored Give root password for maintenance (or type Control-D to continue): Upon typing the root password, I see: Segmentation Fault I would like to determine which process has caused the segmentation fault and why. I am reproducing a issue that was brought to my attention and would like to provide an explanation for the segmentation fault. Is it a bug in Ubuntu 14.04? If so, is there a work-around? If there is a work-around, I would like to see it documented here.


title: Why SAMP is not listening to the port

text: I have forwarded 38474 port to internal port 7778. Then I launched San Andreas Multiplayer on my CentOS server. When I'm typing `netstat -npl` I see this:               Proto: tcp     Recv-Q: 0     Send-Q: 0     Local Address: 0.0.0.0:7778     Foreign Address: 0.0.0.0:*     State:     PID/Program name: 1343/./samp03svr      So why `state` field is empty. When I'm looking to my server through SAMP client, it shows that server is available and shows ping to this server.


title: How to remove dot and space from beginning of filenames

text: I'm trying to change jpg files named with a dot and a space at the beginning and with a missing dot before the end (like this `. Startjpg` to `Start.jpg` The dot makes the files hidden from `sed` and `ls -al` lists those files so I'm piping `ls -al` to `sed`. I've read through many manuals online and I always get this error               sed: -e expression #1, char 6: unknown command: `/'      I've tried               ls -al | sed -r '/^\./*.*/g'     ls -al | sed -r '/^\.//g'     ls -al | sed -r '/.*/[\.]g'     ls -al | sed 's/^\./\\1*./g'      and many more and even many more many more. also I need to change filejpg to file.jpg


title: Centos rpm -qa vs yum list installed

text: I want to have server b to have exactly the same setup as server a. My plan is to have a list of all installed things on server a and install it by using the list on server b something like :               yum -y install $(cat installed.txt)      In server a, should I rather use:               rpm -qa > installed.txt      or:               yum list installed > installed.txt        ? The lists seem to be different and I have no idea why. `yum list installed` has 930 lines while `rpm -qa` has 895 lines, what might be the difference ?


title: Uptime showing in tmux status bar

text: I want to show the uptime in the tmux status bar in this format `DD:HH:MM` without any of the other cruft that the `uptime` command shows. I've tried               #set -g status-left '#[fg=green]#H #[fg=black]•#[fg=green,bright]#(uptime|awk '{split(substr($0, index($0, "load")),a, ":"); print a[2]})'#[default]'     set -g status-right '#[fg=red,bg=default]#(uptime) #[fg=blue]%a%d-%m-%Y %H:%M:%S'      Neither of these work as I want, and What I'm looking for is just a straight uptime of `DD:HH:MM`, which will be updated every 30 seconds with the normal statusbar update.


title: How to upgrade Linux version without breaking the original settings or configs?

text: I want to upgrade my linux version to an upper level, but I am afraid of by doing that, it will format the original settings or configs on my machine. So is there any way that we can avoid this happen?


title: Install virtualenv on Fedora 16

text: I come from Ubuntu. I know how to install virtualenv and configure stuff on Ubuntu. Now Fedora seems pretty strange to me... Following these two guides: Setting up virtualenv, pip, virtualenvwrapper and IPython on Fedora   How to Install Virtualenv in Fedora 16 / 15 / 14 I am getting this when I tried to setup my virtualenv > bash: virtualenv: command not found... I installed under root. If I do `ls`:               $ su -     [root@localhost ~]# ls     anaconda-ks.cfg  bin  lib     [root@localhost bin]# ls     virtualenv  virtualenvwrapper.sh     [root@localhost bin]#      [root@localhost bin]# cd     [root@localhost ~]# cd lib     [root@localhost lib]# ls     python2.7     [root@localhost lib]# cd python2.7/     [root@localhost python2.7]# ls     site-packages     [root@localhost python2.7]# cd site-packages/     [root@localhost site-packages]# ls     virtualenv-1.7-py2.7.egg-info  virtualenvwrapper     virtualenv.py                  virtualenvwrapper-2.11-py2.7.egg-info     virtualenv.pyc                 virtualenvwrapper-2.11-py2.7-nspkg.pth     virtualenv_support     [root@localhost site-packages]#      The `bin` and `lib` contains virtualenv. They appear after I installed virtualenv through pip. (I checked this against my fresh Fedora on my laptop, lib and bin do not exist under root directory). During the installation, it was clear to me that virtualenv was installed under the root directory. How do I fix this? What is the correct way to install virtualenv on Fedora? (I know how to do this on Ubuntu...) I think `su -` is bad. plain su will log me in as root but put me in my user's directory instead of the root directory (in the case of `su -`).


title: manpages for my kindle?

text: I'd like to read unix manpages on my kindle. I know I can just redirect the man output to a file and give it a .txt extension. But is there a convenient way to convert them _en masse_ to a format with proper cross-references? Edit: An apology for my behavior in this question. I told pat that I would accept the comment if submitted as an answer, and then better answers came and I did not keep my promise (Sorry). I enthusiastically accepted Caleb's answer that produces html versions of the manpages; and then some time later when I actually tried transferring the files to the kindle, I discovered that the kindle would not display html files; and I switched acceptance without explanation (Sorry). The kindle appears to require .txt or .pdf (or one of the various _real_ eBook formats). I hope I have explained myself. Also, I didn't have a realistic understanding of how many, many manpages there are with a Debian Linux distribution, and so Caleb's comment about selecting a "Best Of" collection appears to be the best idea. But I don't really have the inclination to try to do this myself (which is a prerequisite for asking questions on StackExchange sites), so I'm not comfortable asking how to select the "Best Of", even though it really is necessary practically in order to do this.


title: No wireless networks after dhcp3-server installation

text: My laptop is both using a wired connexion and a wireless one. I installed dhcps3-server, after that I guessed that there is no wireless network displayed. What can I do to see available wireless networks (I have my own wireless network that is not displayed).      I had the same problem yesterday when I installed dhcp3-server. I checked for solutions on internet but in vain. So I had to reinstall Ubuntu again. I do not want to reinstall it again each time i need dhcp3-server or any other tool.      When I run `nm-tool`, I got this (for the wireless part):               NetworkManager Tool          State: connected          - Device: wlan0 ----------------------------------------------------------------       Type:              802.11 WiFi       Driver:            ath9k       State:             unmanaged       Default:           no       HW Address:        D8:AF:9A:B7:DA:D9            Capabilities:            Wireless Properties         WEP Encryption:  yes         WPA Encryption:  yes         WPA2 Encryption: yes            Wireless Access Points       My wireless device is not disabled by hardware. I run `rfkill list` and I got this:               0: phy0: Wireless LAN         Soft blocked: no         Hard blocked: no      My Ubuntu can see my wireless device also. I run `lshw -C network` and I got this (for the wireless part, and you can also see that the driver for wireless adpater is installed):               *-network                           description: Wireless interface            product: AR9285 Wireless Network Adapter (PCI-Express)            vendor: Atheros Communications Inc.            physical id: 0            bus info: pci@0000:25:00.0            logical name: wlan0            version: 01            serial: d0:df:9a:5b:da:4a            width: 64 bits            clock: 33MHz            capabilities: bus_master cap_list ethernet physical wireless            configuration: broadcast=yes driver=ath9k driverversion=2.6.38-8-generic firmware=N/A ip=10.1.18.68 latency=0 multicast=yes wireless=IEEE 802.11bgn            resources: irq:19 memory:d4600000-d460ffff      Also, my wireless PCI device is shown (but its driver not working ?) when I run : `lspci -nn`:                Network controller [0280]: Atheros Communications Inc. AR9285 Wireless Network Adapter (PCI-Express) [168c:002b] (rev 01)      I run `iwconfig` and I got these information:               lo        no wireless extensions.          eth0      no wireless extensions.          wlan0     IEEE 802.11bgn  ESSID:off/any                 Mode:Managed  Access Point: Not-Associated   Tx-Power=17 dBm                  Retry  long limit:7   RTS thr:off   Fragment thr:off               Power Management:off      How can I resolve this problem (displaying back the wirless networks )?   **Note that my wired connexion works well.**


title: ProvisioningError installing Samba

text: I'm trying to install samba, but it fails:               kavinlu@kavinlu-IT:/etc/init.d$ sudo apt-get -f install samba4     Reading package lists... Done     Building dependency tree            Reading state information... Done     The following extra packages will be installed:       libdcerpc-server0 libdcerpc0 libgensec0 libregistry0 libsamba-policy0 python-samba samba4-common-bin     Suggested packages:       bind9 phpldapadmin samba-gtk swat2     Recommended packages:       samba4-dsdb-modules     The following NEW packages will be installed:       libdcerpc-server0 libdcerpc0 libgensec0 libregistry0 libsamba-policy0 python-samba samba4 samba4-common-bin     0 upgraded, 8 newly installed, 0 to remove and 0 not upgraded.     Need to get 0 B/4,143 kB of archives.     After this operation, 23.2 MB of additional disk space will be used.     Do you want to continue [Y/n]? y     Preconfiguring packages ...     Selecting previously deselected package libgensec0.     (Reading database ... 207432 files and directories currently installed.)     Unpacking libgensec0 (from .../libgensec0_4.0.0~alpha17~git20110807.dfsg1-1ubuntu1_amd64.deb) ...     Selecting previously deselected package libdcerpc0.     Unpacking libdcerpc0 (from .../libdcerpc0_4.0.0~alpha17~git20110807.dfsg1-1ubuntu1_amd64.deb) ...     Selecting previously deselected package libregistry0.     Unpacking libregistry0 (from .../libregistry0_4.0.0~alpha17~git20110807.dfsg1-1ubuntu1_amd64.deb) ...     Selecting previously deselected package libdcerpc-server0.     Unpacking libdcerpc-server0 (from .../libdcerpc-server0_4.0.0~alpha17~git20110807.dfsg1-1ubuntu1_amd64.deb) ...     Selecting previously deselected package libsamba-policy0.     Unpacking libsamba-policy0 (from .../libsamba-policy0_4.0.0~alpha17~git20110807.dfsg1-1ubuntu1_amd64.deb) ...     Selecting previously deselected package python-samba.     Unpacking python-samba (from .../python-samba_4.0.0~alpha17~git20110807.dfsg1-1ubuntu1_amd64.deb) ...     Selecting previously deselected package samba4-common-bin.     Unpacking samba4-common-bin (from .../samba4-common-bin_4.0.0~alpha17~git20110807.dfsg1-1ubuntu1_amd64.deb) ...     Selecting previously deselected package samba4.     Unpacking samba4 (from .../samba4_4.0.0~alpha17~git20110807.dfsg1-1ubuntu1_amd64.deb) ...     Processing triggers for man-db ...     Processing triggers for ureadahead ...     Setting up libgensec0 (4.0.0~alpha17~git20110807.dfsg1-1ubuntu1) ...     Setting up libdcerpc0 (4.0.0~alpha17~git20110807.dfsg1-1ubuntu1) ...     Setting up libregistry0 (4.0.0~alpha17~git20110807.dfsg1-1ubuntu1) ...     Setting up libdcerpc-server0 (4.0.0~alpha17~git20110807.dfsg1-1ubuntu1) ...     Setting up libsamba-policy0 (4.0.0~alpha17~git20110807.dfsg1-1ubuntu1) ...     Setting up python-samba (4.0.0~alpha17~git20110807.dfsg1-1ubuntu1) ...     Setting up samba4-common-bin (4.0.0~alpha17~git20110807.dfsg1-1ubuntu1) ...     Setting up samba4 (4.0.0~alpha17~git20110807.dfsg1-1ubuntu1) ...     Administrator password will be set randomly!     Unknown parameter encountered: "max log size"     Ignoring unknown parameter "max log size"     Unknown parameter encountered: "syslog"     Ignoring unknown parameter "syslog"     Unknown parameter encountered: "passdb backend"     Ignoring unknown parameter "passdb backend"     Unknown parameter encountered: "unix password sync"     Ignoring unknown parameter "unix password sync"     Unknown parameter encountered: "passwd program"     Ignoring unknown parameter "passwd program"     Unknown parameter encountered: "pam password change"     Ignoring unknown parameter "pam password change"     Unknown parameter encountered: "map to guest"     Ignoring unknown parameter "map to guest"     Unknown parameter encountered: "usershare allow guests"     Ignoring unknown parameter "usershare allow guests"     Unknown parameter encountered: "guest ok"     Ignoring unknown parameter "guest ok"     Unknown parameter encountered: "guest ok"     Ignoring unknown parameter "guest ok"     Unknown parameter encountered: "max log size"     Ignoring unknown parameter "max log size"     Unknown parameter encountered: "syslog"     Ignoring unknown parameter "syslog"     Unknown parameter encountered: "passdb backend"     Ignoring unknown parameter "passdb backend"     Unknown parameter encountered: "unix password sync"     Ignoring unknown parameter "unix password sync"     Unknown parameter encountered: "passwd program"     Ignoring unknown parameter "passwd program"     Unknown parameter encountered: "pam password change"     Ignoring unknown parameter "pam password change"     Unknown parameter encountered: "map to guest"     Ignoring unknown parameter "map to guest"     Unknown parameter encountered: "usershare allow guests"     Ignoring unknown parameter "usershare allow guests"     Unknown parameter encountered: "guest ok"     Ignoring unknown parameter "guest ok"     Unknown parameter encountered: "guest ok"     Ignoring unknown parameter "guest ok"     ProvisioningError: guess_names: 'realm =' was not specified in supplied /etc/samba/smb.conf.  Please remove the smb.conf file and let provision generate it     dpkg: error processing samba4 (--configure):      subprocess installed post-installation script returned error exit status 1     Processing triggers for libc-bin ...     ldconfig deferred processing now taking place     Processing triggers for python-support ...     Errors were encountered while processing:      samba4     E: Sub-process /usr/bin/dpkg returned an error code (1)      What's going wrong? How do I fix it?


title: How to do an automated measurement for the boot time for freshly build images?

text: I want to generate images for an embedded system and automatically measure the time they took for booting (especially for different systems). I'm using Buildroot to generate my Linux Images. I already know the methods and how to apply them, it's just the question about how to do the time measuring. ATM for the measuring, a GPIO Pin is set in the 1st-level bootloader to "high" and the same pin is set to "low" when entering the userspace. Then with an oscilloscope the time is measured with the cursors by hand. Now to the problem: I got some methods I'd like to be automatically implemented by choosing these in a GUI and then let the program apply them (this shouldn't be a big deal). What I'm not so sure about is to measure the boot time afterwards when the images are ready automatically. Has anyone a nice idea for measuring the boot time? The only thing that comes to my mind is to rely on the kernel printk times, unfortunately these measure only the kernel time.