title: How to start a process chain from the shell

text: Is it possible and if so how do I:   1. Start a `/bin/bash` process that is not bound to a terminal from a terminal? Hence, a shell process that shows up in the process tree as `init -- bash`. (Shells usually have the process tree structure `terminal-emulator-of-your-choosing -- bash`)   2. Start a `/bin/bash` process not bound to a terminal that has as its child another process e.g. a browser like `firefox` from a shell session in a terminal? Hence, a shell process with a child that shows up in the process tree as `init -- bash -- firefox`.   3. It is easy to get `init -- firefox` directly from the shell via something along the lines of `exec firefox & exit` or `/bin/bash -c firefox & exit`. (This question is part of a series of related questions that first enabled me to formulate these questions precisely (cf. How to "correctly" start an application from a shell and How to start a process from the shell and make it the child of another process). The three questions have been formulated and discussed partially in the comments of the two former questions but as I see it not been answered. Furthermore, they do seem more appropriate as short question in their own right not suited for discussion in comments.)


title: VirtualBox: modprobe can't find vboxguest, vboxsf, vboxvideo

text: I've been following these instrctions to install the guest packages for arch linux. Unfortunatelly `modprobe` returns:               [snooc@archfire ~]$ modprobe -a vboxguest vboxsf vboxvideo     modprobe: WARNING: Module vboxguest not found.     modprobe: WARNING: Module vboxsf not found.     modprobe: WARNING: Module vboxvideo not found.      `pacman -Ss virtualbox` is showing:               [snooc@archfire ~]$ pacman -Ss virtualbox     ...     community/virtualbox-guest-modules 4.3.12-1 [installed]         Guest kernel modules for VirtualBox     ...     community/virtualbox-guest-utils 4.3.12-1 [installed]         VirtualBox Guest userspace utilities     ...      How can I fix this? I have no idea where to begin. _Arch Linux is guest on VirtualBox which runs under Win7._


title: Letters from mail server comes as raw html (Outlook 2013)

text: I have two servers with **sendmail** (php, zf2) and I send mail (from both) to my outlook mail.   Message body in html format. From the first email server it comes normally.   But from second server letters shows as **raw html**. Only difference in these letters is: First letter:               Content-Type: text/html     Content-Transfer-Encoding: 8bit      Second:               Content-Type: =?utf-8?Q?text/html?=     Content-Transfer-Encoding: =?utf-8?Q?8bit?=      Q: This is the problem?


How to trigger mount/umount before/after hibernation? I use s2disk. **Note:** Debian


title: Any guides for dummies to setting up a VPN?

text: I am looking for a guide to setting up a VPN on a VPS, most of the guides don't explain certain elements and I've been left feeling clueless halfway through them. For example when I was installing openVPN the guide was talking about easy-rsa being in a folder in /usr/share/easyVPN but it simply was not present, so I had to manually get it and after everything I just didn't understand where I was supposed to get the IP's for the bridges etc, it was overall, very confusing. The guide needs to make no use of a GUI, as the VPN is manipulated solely over secure shell, the OS is CentOS 6 as well, as I can't seem to find one for CentOS 6 either. Any help is greatly appreciated, thanks.


title: create a debian installer with custom kernel

text: First what I need to do is install a debian on a 3300mx computer which is based on a vortex cpu. The problem is the debian installer always crash because the required drivers are in the kernel as modules only. So I tried to create a custom kernel with the required drivers as native instead of modules. After a few attemps I managed to get 3 files: >   * linux-headers-3.0.0_0.2_i386.deb >   * linux-image-3.0.0_0.2_i386.deb >   * linux-libc-dev_0.2_i386.deb > I'm not even sure that I compiled these files the right way. I tried to follow some tutorials that asked me to compile my kernel with the command line : > $>fakeroot make-kpkg --append-to-version "-custom" --revision "0.1" --us > --uc --initrd kernel_image kernel_headers The problem is that when I do that, I've got the following output: >   * /usr/bin/make EXTRAVERSION=-boxls ARCH=i386 -C Documentation/lguest >   * make: _*_ Documentation/lguest: No such file or directory. Stop. >   * make: _*_ [debian/stamp/build/kernel] Error 2 > To get the 3 .deb files I had to use a simpler command line without all the params like --append-to-version so I'm not sure they are good. Once I'll be sure my .deb files are ok I need to create a custom tftp debian installer to try it on the computers. I'm lost because I can't find out what to do with my .deb files as all the tutorials ends with a simple installation on the current system instead of the creation of a custom debian installer... Can you help me please? Thanks a lot for your help!


title: How to filter wvdial/pppd terminal output

text: I use wvdial to connect to the net with with my USB modem. It works correctly, and I am quite happy with it. When I start it in XFCE I have it set to output to a borderless, transparent terminal so the status displays on my desktop, life is good. Everything is great, I just want to tweak it. I'm hoping to filter the output with a 'grep -v' to remove unsightly non- information. Here is the output from a sample run. The output is consistantly the same, except for IP addresses..               --> WvDial: Internet dialer version 1.60     --> Cannot get information for serial port.     --> Initializing modem.     --> Sending: ATZ     ATZ     OK     --> Sending: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0     ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0     OK     --> Modem initialized.     --> Sending: ATDT#777     --> Waiting for carrier.     ATDT#777     CONNECT     --> Carrier detected.  Waiting for prompt.     ~[7f]}#@!}!}!} }9}"}&} } } } }#}%B#}%}%}&3za[02]}'}"}(}"J};~     --> PPP negotiation detected.     --> Starting pppd at Mon Nov 14 11:00:06 2011     --> Warning: Could not modify /etc/ppp/pap-secrets: Permission denied     --> --> PAP (Password Authentication Protocol) may be flaky.     --> Warning: Could not modify /etc/ppp/chap-secrets: Permission denied     --> --> CHAP (Challenge Handshake) may be flaky.     --> Pid of pppd: 17776     --> Using interface ppp0     --> pppd: >[7f]     --> pppd: >[7f]     --> pppd: >[7f]     --> pppd: >[7f]     --> local  IP address 10.81.25.50     --> pppd: >[7f]     --> remote IP address 10.133.28.10     --> pppd: >[7f]     --> primary   DNS address 10.133.20.11     --> pppd: >[7f]     --> secondary DNS address 10.132.20.11     --> pppd: >[7f]     ^CCaught signal 2:  Attempting to exit gracefully...     --> Terminating on signal 15     --> pppd: >[7f]     --> Connect time 0.2 minutes.     --> pppd: >[7f]     --> pppd: >[7f]     --> Disconnecting at Mon Nov 14 11:00:16 2011      Can someone please help me with a command line or script that would filter that output and remove the `\--> pppd: >[7f]` lines, and possibly the pap/chap warnings(they're bogus). I've tried several things, with pipes and redirection to grep but haven't hit on anything that seems to effect the output. As a note: in the pppd:/[7f] lines it appears the second '>' character could be just about anything(still don't know what pppd is trying to tell me. :) Thanks! EDIT: I got it. Simple stuff really, if you're not a knob. I'm a knob.. wvdial 2>&1 | grep -v -i -E "7f]|pap|chap" the output is on stderr and pipes are for stdout. the 2>&1 redirects so it will pipe properly. If you've read this far, thanks.


title: How to convert .doc to ODF with a command line?

text: I'd like to convert many Microsoft Word documents to ODF (the OO.org formata with a command line (because there are many of them). (I need them for reading afterwards on a device where reading OO.org format is possible, but not the .doc format -- actually, an Android with only free software, such as OpenDocument Reader, primarily from F-Droid packages repository.) What can I use as the commmand for such a conversion?


title: Controlling users' default printer as an administrator

text: What are the necessary steps to change the default printer for individual users on a reasonably recent Linux system using CUPS? (i.e. not the system- wide default) The CUPS `lpr` manpage indicates that setting the `PRINTER` environment variable is looked to first by the printing system. But does this also affect the default printer for GNOME & KDE applications? Does this also override whatever the user has changed by going to, for instance, the 'Printing' setup application in Ubuntu? Or the equivalent in RHED? How can I cover all my bases?


title: What's the difference between config fonts in /etc/fonts/conf.d and gnome-tweak-tool?

text: I can change the hinting and sub-pixel settings from `/etc/fonts/conf.d` or `gnome-tweak-tool`. What's the difference of those two methods? It seems to me that `google-chrome` and `gnome-terminal` changes more obviously from /etc/fonts/.


title: external variable in awk

text: > **Possible Duplicate:**   >  Use a script parameter in awk I have a script, in which a script snippet is               x=3     awk '$2=$x{print $1}' infile      the external variable is x, but it prompts an error in awk so in this situation,how to make awk run successfully? thanks!


title: Why is this variable not getting passed to awk?

text: > **Possible Duplicate:**   >  external variable in awk How do I pass this variable below? This doesn't work:               fname=testfile.txt     lsof | awk '/deleted/&&/$fname/ {print $4}'  *----no output*      While this works:               lsof | awk '/deleted/&&/testfile.txt/ {print $4}'     3r


title: Stress testing SD cards using linux

text: I got into a little debate with someone yesterday regarding the logic and/or veracity of my answer here, vis., that logging and maintaining fs meta-data on a decent (GB+) sized SD card could never be significant enough to wear the card out in a reasonable amount of time (years and years). The jist of the counter-argument seemed to be that I must be wrong since there are so many stories online of people wearing out SD cards. Since I do have devices with SD cards in them containing rw root filesystems that are left on 24/7, I had tested the premise before to my own satisfaction. I've tweaked this test a bit, repeated it (using the same card, in fact) and am presenting it here. The two central questions I have are:   1. Is the method I used to attempt to wreck the card viable, keeping in mind it's intended to reproduce the effects of continuously re-writing _small_ amounts of data?   2. Is the method I used to verify the card was still okay viable?  I'm putting the question here rather than S.O. or SuperUser because an objection to the first part would probably have to assert that my test didn't really write to the card the way I'm sure it does, and asserting that would require some special knowledge of linux. _[It could also be that SD cards use some kind of smart buffering or cache, such that repeated writes to the same place would be buffered/cached somewhere less prone to wear. I haven't found any indication of this anywhere, but I amasking about that on S.U.]_ The idea behind the test is to write to the same small block on the card millions of times. This is well beyond any claim of how many write cycles such devices can sustain, but presuming wear leveling is effective, if the card is of a decent size, millions of such writes still shouldn't matter much, as "the same block" would not literally be the same physical block. To do this, I needed to make sure every write was truly flushed to the hardware, and to the same _apparent_ place. For flushing to hardware, I relied on the POSIX library call `fdatasync()`:               #include <stdio.h>     #include <string.h>     #include <fcntl.h>     #include <errno.h>     #include <unistd.h>     #include <stdlib.h>          // Compile std=gnu99          #define BLOCK 1 << 16          int main (void) {         int in = open ("/dev/urandom", O_RDONLY);         if (in < 0) {             fprintf(stderr,"open in %s", strerror(errno));             exit(0);         }              int out = open("/dev/sdb1", O_WRONLY);         if (out < 0) {             fprintf(stderr,"open out %s", strerror(errno));             exit(0);         }              fprintf(stderr,"BEGIN\n");              char buffer[BLOCK];         unsigned int count = 0;         int thousands = 0;         for (unsigned int i = 1; i !=0; i++) {             ssize_t r = read(in, buffer, BLOCK);             ssize_t w = write(out, buffer, BLOCK);             if (r != w) {                 fprintf(stderr, "r %d w %d\n", r, w);                 if (errno) {                     fprintf(stderr,"%s\n", strerror(errno));                     break;                 }             }             if (fdatasync(out) != 0) {                 fprintf(stderr,"Sync failed: %s\n", strerror(errno));                 break;             }             count++;             if (!(count % 1000)) {                 thousands++;                 fprintf(stderr,"%d000...\n", thousands);             }             lseek(out, 0, SEEK_SET);         }         fprintf(stderr,"TOTAL %lu\n", count);         close(in);         close(out);              return 0;     }                                       I ran this for ~8 hours, until I had accumulated **2 million+ writes** to the beginning of the `/dev/sdb1` partition.1 I could just have easily used `/dev/sdb` (the raw device and not the partition) but I cannot see what difference this would make. I then checked the card by trying to create and mount a filesystem on `/dev/sdb1`. This worked, indicating the specific block I had been writing to all night was feasible. However, it does not mean that some regions of the card had not been worn out and displaced by wear levelling, but left accessible. To test that, I used `badblocks -v -w` on the partition. This is a _destructive_ read-write test, but wear levelling or not, it should be a strong indication of the feasibility of the card since it must still provide space for each rolling write. In other words, it is the literal equivalent of filling the card completely, then checking that all of that was okay. Several times, since I let badblocks work through a few patterns. _[Contra Jason C's comments below, there is nothing wrong or false about using badblocks this way. While it would not be useful for actually identifying bad blocks due to the nature of SD cards, it is fine for doing destructive read- write tests of an arbitrary size using the`-b` and `-c` switches, which is where the revised test went (see my own answer). No amount of magic or caching by the card's controller can fool a test whereby several megabytes of data can be written to hardware and read back again correctly. Jason's other comments seem based on a misreading -- IMO an **intentional** one, which is why I have not bothered to argue. With that head's up, I leave it to the reader to decide what makes sense and what **does not**.]_ 1 The card was an old 4 GB Sandisk card (it has no "class" number on it) which I've barely used. Once again, keep in mind that this is not 2 million writes to literally the same physical place; due to wear leveling the "first block" will have been moved constantly by the controller during the test to, as the term states, _level out the wear._


title: Deleting the starting 10 MB from a open file

text: I have a log file of size nearly 100 MB which is opened by some program and logging is continuously going on in that file. I want to delete the first 10MB from that file. Is there any way to do that without affecting the logging process into that file.


title: create a tunnel to a local server

text: Using a VPN, I am connected through SSH on a distant Ubuntu Computer. From this computer, I can browse using telnet through a local server (192.168.x.x). Is there any way, from the terminal or Firefox, to configure my browser to create a king of SSH tunnel so then I would be able to browse the 182.168.X.X directly in a GUI browser? **edit:** Example: From my home (`127.0.0.1`), using a VPN, I connect myself through SSH computer: `root@distant-server.com -p 5555`. It's ip is `192.168.151.2` Once connected, I can browse to an intranet server as:               telnet 192.168.151.100 80     GET /index.html HTTP/1.0      What I do, is to configure something in my `127.0.0.1` Firefox GUI, so that I would be able to browse directly to 192.168.151.100. **edit 2:** For a strange reason, The problem has been fixed when I used SOCKS v4 instead of v5.


title: How can I start the python SimpleHTTPServer on port 80?

text: I am using this command on Ubuntu but it is starting on port 8080 and I don't have another server running so I'd like it to start on port 80. I saw ways that you could set up a bash script to do something like this, but isn't there a command line flag or something simpler to specify the port?               python -m SimpleHTTPServer


title: cd ~ works in one terminal session but not another (no error reported)

text: I have two PuTTy sessions open to the same host. One one `cd ~` gets me back to my home dir fine and on another one it doesn't -- stays in the same dir. I have never seen something like this happen. Any idea why this might be happening? OS: SunOS 5.10


title: Is it useful to setup RAID0 on laptop?

text: I have a Dell laptop, which I am going to replace the CD-ROM hub with a HDD. I am thinking if I setup a **RAID0** on my original HDD and the new HDD, would I have some I/O performance improvement? Theoretically, there will be some improvement. But I would like to know how much it will be? If it just _kinda of improved_ , I don't think it worth the effort. Especially, I need to move my data around to do the converting.


title: How to update kernel without reboot? (ksplice alternative)

text: How to update running kernel without reboot? I know about Oracle ksplice but it's not free and it supports only distributions that I don't use. Are there alternatives to ksplice?


title: Cannot upgrade Scientific Linux to version 6.5

text: I have been trying to figure out a way to get my Scientific Linux box to upgrade to version 6.5. It's currently 6.4 and everytime I perform a yum update I get an error message (see below!). Can anyone tell me what needs to be done to get past this issue? **Some Stats:**   * Scientific Linux 32 bit - running on Lenovo Thinkpad 430 4GB RAM - 320GB HDD   * No extras or addons at all, just plain install via CD/DVD which was done from around Nov. 2012 error message:               [triton@localhost ~]$ su     Password:      [root@localhost triton]# yum update     Loaded plugins: fastestmirror, refresh-packagekit, security     Loading mirror speeds from cached hostfile      * elrepo: mirror.symnds.com      * elrepo-extras: mirror.symnds.com      * elrepo-kernel: mirror.symnds.com      * epel: mirrors.ptd.net      * epel-source: mirror.cogentco.com      * rpmforge: mirror.rit.edu      * rpmforge-extras: mirror.rit.edu      * sl: ftp.scientificlinux.org      * sl-addons: ftp.scientificlinux.org      * sl-security: ftp.scientificlinux.org     http://dl.atrpms.net/src/el6.4-i386/atrpms/stable/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"     Trying other mirror.     Error: Cannot retrieve repository metadata (repomd.xml) for repository: atrpms-source. Please verify its path and try again     [root@localhost triton]#


title: Sorting columns from two files with awk

text: I have two input files               28a39a289906c01159f999a68996091a tom@dong.com     274d1d2c7e931fb55ac0c91dd41f2be7 go@far.com     44d25d3b1b70b240d5058f1be1cef576 person@domain.com     2227a768f6d253b7bf81bb4ecb15b52d person@gmail.com      and               28a39a289906c01159f999a68996091a     274d1d2c7e931fb55ac0c91dd41f2be7     44d25d3b1b70b240d5058f1be1cef576     2227a768f6d253b7bf81bb4ecb15b52d      i'm trying to exclude all the rows in file 1 where file2 and file1 have a matching column 1. md5 suppression. What i could find was `awk 'NR==FNR{a[$1]=$0;next}{print a[$2]}' $1 $2` which i know is pretty close just not sure what i did before to do what i want to do now.


title: Is zswap eligible to reduce swap IO?

text: Does zswap compress pages, that are written to the swap device? Is it eligible to reduce swap IO?


title: Bring hidden Gnome 3 notifications back

text: I was working with Gnome 3 network settings, and accidentally clicked the "Hide" button on a VPN disconnect notification. Unfortunately, this means whenever my VPN gets disconnected, it doesn't say anything. Is there any way to get this back? I'm thinking deleting my configuration folder should work, but presumably there's an easier way (I hope).


title: How to create an ad-hoc connection?

text: I need to make an adhoc connection on Archlinux (netbook used as a wifi repeater), I was using this tutorial to do it on Ubuntu : > At the terminal install execute `sudo apt-get install dnsmasq-base` and then > `sudo apt-get remove dnsmasq` > > Restart the NetworkManager by executing `sudo /etc/init.d/network-manager > restart` > > Left-click on the NetworkManager icon and click "Create New Wireless > Network" > > Name it "UbuntuAdhoc" and set the encryption to "WEP40" > > Connect PC2 using Ad-Hoc to the PC1 The main problem is `dnsmasq-mase` is missing but `dnsmasq` is present on Archlinux. Here's what I found that could be helpful: https://wiki.archlinux.org/index.php/Dnsmasq https://bbs.archlinux.org/viewtopic.php?id=6431               pacman -S dnsmasq     mkdir /etc/dnsmasq     mv /etc/resolv.conf /etc/dnsmasq     cd /etc     echo nameserver 127.0.0.1 > resolv.conf     mv rc.conf rc.conf.save      sed  '/DAEMON/s/network/network dnsmasq.local/g' rc.conf.save>rc.conf     cd rc.d     sed  '/-z/s/dnsmasq/dnsmasq -r /etc/dnsmasq/resolv.conf /g' dnsmasq>dnsmasq.local     /etc/rc.d/dnsmasq.local start     /etc/rc.d/network restart      I have a problem with:               sed  '/-z/s/dnsmasq/dnsmasq -r /etc/dnsmasq/resolv.conf /g' dnsmasq>dnsmasq.local      It say that's the `../s/..` is not a known option. It seems to have broken the `networkmanager` applet on xfce4. I blacklisted the dnsmasq stuff in `/etc/rc.conf`, it will be to repair in the progress, I can't use my wifi connection for now but my lan will do for now ... I also checked about various ways of using a adhoc connection, as my girlfriend use my PC and I travel sometimes, I need a graphical way to make the adhoc connection. I checked my favorite software `wicd` but it cannot make multiple connections and adhoc. It said that the version 2.0 maybe would but for now, the only alternative is `networkmanager`. So, how I do it?


title: Absolutely cannot get FTP access after adding many rules to iptables in CentOS5

text: I'm a complete noob and am just having the worst time trying to get FTP access to the server. I want to keep the firewall enabled. **Edit** : Updated the iptables information. I have the following rules enabled:               Chain INPUT (policy DROP 0 packets, 0 bytes)      pkts bytes target     prot opt in     out     source               destination     58398 7869K RH-Firewall-1-INPUT  all  --  *      *       0.0.0.0/0            0.0.0.0/0         0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:22         0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:21         0     0 ACCEPT     all  --  lo     *       0.0.0.0/0            0.0.0.0/0         0     0 DROP       tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp flags:!0x17/0x02 state NEW         0     0 ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0           state RELATED,ESTABLISHED         0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:21 state NEW          Chain FORWARD (policy DROP 0 packets, 0 bytes)      pkts bytes target     prot opt in     out     source               destination         0     0 RH-Firewall-1-INPUT  all  --  *      *       0.0.0.0/0            0.0.0.0/0          Chain OUTPUT (policy DROP 5841 packets, 350K bytes)      pkts bytes target     prot opt in     out     source               destination      4046  299K ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0           state RELATED,ESTABLISHED         2   114 ACCEPT     all  --  *      lo      0.0.0.0/0            0.0.0.0/0      2935  196K ACCEPT     udp  --  *      *       0.0.0.0/0            0.0.0.0/0           udp dpt:53 state NEW       170 10200 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:21 ctstate NEW,ESTABLISHED         0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:20 ctstate NEW,ESTABLISHED          Chain RH-Firewall-1-INPUT (2 references)      pkts bytes target     prot opt in     out     source               destination         0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:80         0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:3306        26 10260 ACCEPT     all  --  lo     *       0.0.0.0/0            0.0.0.0/0         0     0 ACCEPT     icmp --  *      *       0.0.0.0/0            0.0.0.0/0           icmp type 255         0     0 ACCEPT     esp  --  *      *       0.0.0.0/0            0.0.0.0/0         0     0 ACCEPT     ah   --  *      *       0.0.0.0/0            0.0.0.0/0         0     0 ACCEPT     udp  --  *      *       0.0.0.0/0            224.0.0.251         udp dpt:5353         0     0 ACCEPT     udp  --  *      *       0.0.0.0/0            0.0.0.0/0           udp dpt:631         0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:631      8465  774K ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0           state RELATED,ESTABLISHED         0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           state NEW tcp dpt:22     49907 7084K REJECT     all  --  *      *       0.0.0.0/0            0.0.0.0/0           reject-with icmp-host-prohibited         0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           state NEW tcp dpts:30000:35000         0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           state NEW tcp dpt:21         0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           state NEW tcp dpt:20         0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           state NEW tcp dpt:21         0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           state NEW tcp dpt:22         0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:22         0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:21         0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:20         0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:21 ctstate NEW,ESTABLISHED         0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:20 ctstate NEW,ESTABLISHED         0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           state ESTABLISHED      I know it's waaaay more than necessary, but I'm at my wits end. I can connect to the server just fine when I disable iptables, so I know it has something to do with the firewall. I'd just like to connect, using port 21 and a passive connection. I'd like to open ports 39000 through 40000 for the passive connection. What do I do? * * * AHA! I fixed it! I took another look at the rules and marked down which number rule that reject one was. I had a hunch it was blocking the rules after it, and it was! So, it was the following rule that was blocking my connections:               49907 7084K REJECT     all  --  *      *       0.0.0.0/0            0.0.0.0/0           reject-with icmp-host-prohibited      So what I did to fix it, was restart the server which reset the rules, and then added my port 21 rule to be _before_ that reject rule:                sudo iptables -I RH-Firewall-1-INPUT 11 -p tcp -m tcp --dport 21 -m state --state NEW,ESTABLISHED -j ACCEPT      sudo iptables -I RH-Firewall-1-INPUT 11 -p tcp -m tcp --dport 39000:40000 -m state --state RELATED,ESTABLISHED -j ACCEPT      Then, I added the following to my vsftpd.conf:               pasv_enable=YES     pasv_max_port=39000     pasv_min_port=40000      Now I can connect, hooray!


title: Creating a signed subordinate CA for client certificates

text: I have a root self-signed CA which I've created for myself. With this CA (we'll call it `country`), I've created a server certificate and key for my webserver, nginx. I now would like to create a second CA, `state` which will be used as my `ssl_client_certificate` CA in nginx. I'd like to keep `state` and `country` separated for various reasons and not use my root CA `country` for directly signing client certificates. How can I generate a certificate authority `state` which is signed by `country` for authenticating client certificates in nginx?


title: Shell script not executing

text: Not sure what is happening. Lets call script `a.sh` with the following               /users/guru$ cat a.sh     #! /usr/bin/ksh          echo "Hello"     date      Execute with `ksh`. It gets done.               /users/guru$ ksh a.sh     Hello     Tue Jul 15 15:00:52 EDT 2014      Ensure file permission and `ksh` path.               /users/guru$ ls -l a.sh     -rwxrwxrwx    1 guru  kpc         35 Jul 15 15:00 a.sh     /users/guru$ a.sh     ksh: a.sh:  not found     /users/guru$ which ksh     /usr/bin/ksh


title: MacBook Pro Retina: huge power consumption

text: I'm currently running Debian/Jessie on a MacBook Pro Retina 10,1 15" (early-2103). Everything is going well (ethernet, WiFi, retina, etc.) but I worry about its power consumption. laptop-mode manages the automatic power management of all my devices, all the tunables of powertop are _Good_ and my i7 is running in _powersave_ mode. The dicrete Nvidia video card isn't even running (Bumblebee/bbswitch turns it off as I don't need it). All bluetooth, card reader and stuff are disabled. However, powertop reports the following with **no X11, keyboard and screen brightness set to 0 and all devices powered off** :               The battery reports a discharge rate of 15.7 W     System baseline power is estimated at 15.0 W          Power est.  Usage   Device name     692 mW  0.3%    CPU core     484 mW  29.9%   Display backlight     299 mW  0.3%    CPU misc     264 mW  0.0 ops/s   GPU core     0 mW    32.9%   USB device: EHCI Host Controller     0 mW    22.9%   USB device: usb-device-8087-0024     0 mW    12.8%   USB device: usb-device-0424-2512     0 mW    2.7%    USB device: Apple Internal Keyboard / Trackpad (Apple Inc.)     0 mW    0.0%    Audio codec hwC0D0: Cirrus Logic     0 mW    0.0%    Display backlight     0 mW    0.0%    USB device: usb-device-8087-0024     0 mW    0.0%    USB device: xHCI Host Controller     0 mW    0.0%    USB device: xHCI Host Controller     0 mW    0.0%    USB device: EHCI Host Controller     0 mW    0.0%    USB device: BRCM20702 Hub (Apple Inc.)     0 mW    0.0%    USB device: usb-device-05ac-820a     0 mW    0.0%    USB device: usb-device-05ac-820b     0 mW    0.0%    USB device: Bluetooth USB Host Controller (Apple Inc.)     0 mW    0.0 ops/s   GPU misc     0 mW    0.0%    USB device: FaceTime HD Camera (Built-in) (Apple Inc.)     100.0%  PCI Device: Intel Corporation 7 Series/C210 Series Chipset Family MEI Controller #1     100.0%  PCI Device: Intel Corporation 3rd Gen Core processor Graphics Controller     100.0%  PCI Device: Broadcom Corporation NetXtreme BCM57765 Memory Card Reader     100.0%  PCI Device: Intel Corporation 7 Series/C210 Series Chipset Family High Definition Audio Controller     100.0%  PCI Device: Intel Corporation Xeon E3-1200 v2/3rd Gen Core processor PCI Express Root Port     100.0%  PCI Device: Intel Corporation Xeon E3-1200 v2/3rd Gen Core processor PCI Express Root Port     100.0%  PCI Device: Intel Corporation Xeon E3-1200 v2/3rd Gen Core processor PCI Express Root Port     100.0%  PCI Device: Intel Corporation 7 Series Chipset Family 6-port SATA Controller [AHCI mode]     100.0%  PCI Device: Intel Corporation HM77 Express Chipset LPC Controller     100.0%  PCI Device: NVIDIA Corporation GK107 HDMI Audio Controller     100.0%  PCI Device: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 1     100.0%  PCI Device: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 2     33.0%   PCI Device: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #1     0.0%    PCI Device: Broadcom Corporation Device 16a3     0.0%    PCI Device: Broadcom Corporation BCM4331 802.11a/b/g/n     0.0%    PCI Device: NVIDIA Corporation GK107M [GeForce GT 650M Mac Edition]     0.0%    PCI Device: Intel Corporation 7 Series/C210 Series Chipset Family SMBus Controller     0.0%    PCI Device: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #2     0.0%    PCI Device: Intel Corporation 7 Series/C210 Series Chipset Family USB xHCI Host Controller     0.0%    PCI Device: Intel Corporation 3rd Gen Core processor DRAM Controller      Manually doing the sum gives a ridiculously low value, but powertop stills report a 15W consumption. However, running powertop in interactive mode in X11 gives me more plausible values:               The battery reports a discharge rate of 29.0 W     System baseline power is estimated at 16.4 W          Power est.    Usage     Device name     12.3 W    100.0%        Display backlight     8.01 W     29.9%        Display backlight     4.61 W     19.4%        CPU core     3.78 W    419.6 ops/s   GPU misc     3.12 W      4.3 pkts/s  Network interface: wlan0 (b43)     2.76 W     19.4%        CPU misc     1.35 W    419.6 ops/s   GPU core     188 mW    100.0%        USB device: Apple Internal Keyboard / Trackpad (Apple Inc.)      What? My retina display is consuming 20W? No way! (actually, with a 50% brightness it gives like 15W, which is _huge_ ). Also, sometimes the Apple Internal Keyboard is consuming 5 W. It's not even a bug in powertop since my battery is indeed discarging very fast (like 2h30 when fully charged with only X11 running).   * Do you guys have an idea of what my problem is? I saw on other sites that some MBPr users report 10 W power consumption, or even less   * Why is there this huge difference between the "battery discharge rate report" and the "system baseline power"?   * Is that normal that my Screen and Keyboard use that much power? I'm running a 3.10-3-amd64 stock kernel.


title: Screen brightness reverts to max after returning from `xset dpms` display suspend

text: I'm running the openbox window manager and using this line in my `autostart.sh` to control display power management:               xset dpms 0 60 0      This works nicely, causing the display to suspend after 60 seconds of inactivity. However, when the display reawakens in response to a mouse movement, keypress, etc., the screen is at full brightness. This is wasteful of power and sometimes blinding. If I use the laptop's brightness control keys (`Fn` + `<-`/`->`) to adjust the brightness, the first press will restore the brightness to what it was before the display was suspended. What I'd like is for the screen to be at the pre-suspend brightness as soon as the display is reawakened, i.e. without having to hit one of the brightness control keys. I'm running ubuntu 10.10 on an Acer Aspire 5742.


title: Replace complex string in several files

text: A hacker got into a web server and added this string (removed some characters for security purposes and **added line breaks** for readability) in all `index.php` files:               <?php      eval(gzuncompress(base64_decode('eF5Tcffxd3L0CY5WjzcyNDGGMV4+1dSwqSqzU0LQGAJCPCMM=')));      eval(gzuncompress(base64_decode('eF5LK81LLsnMzKx+JjNW0rgUAqDUUxQ==')));       eval(gzuncompress(base64_decode('eF6VlMmy/3sMxOez/iJOojHFT0Ig/8jlTymmN/I=')));      ?>      I have tried using the `sed` command to remove it (replacing it with nothing) but it is nearly impossible to define a working regular expression with such a huge string. Is there another way, maybe reading the string from a .txt file?


title: Backup Manager and Cron : CentOs and Ubuntu 11.10

text: I have two dedicated servers: one has CentOS, the other Ubuntu. I installed backup manager on both servers. But I have two different behaviors. On CentOS:   * The backup of my files is "every night". I wish "every week."   * The backup of my DB is "every night" (that's good).   * the action is executed twice each night (once at 2 am, once at 4am ... why??)   * Backup Manager for erase on my FTP files older than 5 days ... So, this morning, my backup server was completely full. On Ubuntu:   * The backup does not start automatically. Why?   * When I start it manually, it seems to work but I get an error. In fact, I use a PHP script that fires when Backup Manager has completed. My script detects file integrity with md5 checksum. But there seems to be an error. Here is my backup-manager.conf on CentOS Here is my post-backup script for CentOS   * It does not use the checksum   * It works   * However, I do not find the hostname: why??   * The mail is sent like this:              Ns390769.ovh.net-sacdunjour.20111115.sql.gz (0.08 GB)     nns390769.ovh.net-www.20111115.tar.gz (0.01 GB)     nns390769.ovh.net-www.20111115.master.tar.gz (1.65 GB)     nns390769.ovh.net-20111115.md5 (0 GB) nns390769.ovh.net-itbag_prestashop.20111115.sql.gz (0 GB)      nTotal: 1.74 Go      Here is my backup-manager.conf on ubuntu Here is my post-backup script on ubuntu   * Use of checksum   * It does not find me the file size   * I find the hostname (not CentOS)   * The mail is sent like this              Files locally:          Ns384990.ovh.net-20111108.md5 (0 B)     Ns384990.ovh.net-all-mysql-databases.20111108.sql.bz2 (0 B)     Ns384990.ovh.netwww.20111108.master.tar.gz (0 B)          TOTAL: 0 B     Integrity problem in the files sent to the FTP server`      It's a real headache for me. Can you help me? Sorry for the length of my message, but I wanted to give you much information.


title: Count how many elements in the nth column in a whole file

text: Input file:               A    1,2,3,4      #length($2)=4     B    1,2          #length($2)=2     C    9,8,7,6,5,4  #length($2)=6      Expected output:               12 #4+2+6      A method like: `awk -F '[\t,]' '{print length($2)}'` but working on the whole file.


title: Is it possible to force a group member to run something allowed by sudoers as himself only?

text: The sudoers line is               %game_servers   ALL=      NOPASSWD:/usr/bin/renice      which allows group members `renice` any process run by any user without pw, but I'd like to allow group members `renice` their own processes only, to negative value. I couldn't spot the answer from `man sudoers`, from where I got the idea to change `ALL=(root:root)` to `ALL=`, which proved to be bad idea `ALL=()` is syntax error.


title: Quickly calculate date differences

text: I often want to make some quick date calculations, such as:   * What is the difference between these two dates?   * What is the date _n_ weeks after this other date? I usually open a calendar and count the days, but I think there should be a program/script that I can use to do these kinds of calculations. Any suggestions?


title: Linux kernel with absolutely no virtual memory

text: I am interested in obtaining (or building myself) a version of the Linux kernel that has absolutely no virtual memory and none of its attendant overhead. No swap file, no nothing. What are my options?


title: Why doesn't PIPESTATUS work on pipelines within a command substitution

text: Proof below: Bash 4               Prompt> $(echo hello|sed 's/h/m/'|xargs -I{} ls {} 2>/dev/null|sed 's/ /_/')     Prompt> for i in ${PIPESTATUS[@]}; do echo $i;done     Output> 0          Prompt> echo hello|sed 's/h/m/'|xargs -I{} ls {} 2>/dev/null|sed 's/ /_/'     Prompt> for i in ${PIPESTATUS[@]}; do echo $i;done     Output> 0     Output> 0     Output> 123     Output> 0      Is command substitution not considered to be run in a foreground shell? that's my guess.


title: Generate resource usage report

text: I'm looking for load/usage data for a server in terms of CPU/RAM/network/Disk from OS perspective. The OS is RHEL5. I know sar is able to report system activity info, but the only commands I know are "sar -r -f sa10" and "sar -q -f sa10", and it's in hourly format. I would like to generate resource (CPU/RAM/network/Disk) usage report over the past month. Is sar able to do this? If yes, how? If no, what tool I can use to generate this quickly. Example:               11/01/11      runq-sz  plist-sz   ldavg-1   ldavg-5  ldavg-15     11/01/11            0       137      0.00      0.00      0.00     11/02/11            3       139      0.00      0.00      0.00     11/03/11            5       139      0.03      0.01      0.00


title: How can I disable a part of the screen in X.Org

text: I'm running a Laptop with Arch Linux, X.org and i3. Due to a broken LCD panel, I would like to disable/ignore the left ~228 Pixels of the screen until I have time to get it repaired. So far, I've tried using a non-standard resolution and then adding an offset, but had no success. Is there any simple solution for this?


title: Linux Operating System Graphical user interface

text: So I am currently looking into operating systems at the moment out of interest and have read quite a few articles and guides on making your own, I found Linux and how its possible to create your own from scratch this doesn't appeal to me. So I found that you can get pre-made Linux os's when you can customise your self, however after looking into it further it turns out not what I am looking for. I'm looking to be able to customise the part of the os which the user interacts with (the application?), for instance the task bar (on windows), start button, desktop etc. as I have no interest in changing how to load files and process applications, but where do I start looking?   * also I'm not looking to create a theme which just has some different pretty coloured button i wish to learn the basics and potentially recreate the way it is displayed.  a point in the right direction would be nice, and any things that I might need to learn on the way. (I have no existing knowledge in os's but I do in several higher coding languages)


title: Fastest and Safest way to increase Swap Space on Scientific Linux

text: **Memory Swap Ratio Company System** Today, a monitoring system indicated that one of the systems in the company has run out of memory. Executing `htop` on this system indicated that the `Memory` was nearly full `(~8GB)` even as the `Swap Space (~0.5GB)`. Stopping some of the services decreased the `Memory` use, but the `Swap Space` remained fully allocated. According to this documentation it seems that the `Swap Space` of this Company's system does not match the recommended space: `S = M < 2 ? M * 2 : M + 2` **Default Swap Space Test System** Executing `htop` on a test system results in: ![enter image description here](http://i.stack.imgur.com/vJbUg.png) which means a ratio of `~1:1 (1877/1799)`. **Subquestion:** Why does the default `Swap Memory Space Ratio` not equal `2:1`? * * * **Clear and Increase Swap Space on a running system** _Increase Swap Space_ This documentation indicates that several commands should be executed in order to increase the Swap Space. Are all these commands really required? _Clear Swap Space_ According to this documentation the Swap Space could be cleared by executing: `swapoff -a && swapon -a` _Safely increase Swap Space_ This documentation recommends to create a backup before increasing the Swap Space, but it does not indicate the possible impact. As this concerns a production system it is important to know if it is safe to increase the Swap Space on the system while it runs or e.g. should a new system be created and the date subsequently be moved? * * * **Question:** What is the fastest and safest way to increase the Swap Space on Scientific Linux?


title: How to parse fields out of a text file and write them to another file

text: I have executed a database command and have generated an output file of the results. Each field name starts with `dbt_xxxxxx` Each field value is the value after the equal sign. how can I parse the file and write out a new file where the field name is in on column and the value is another column and create a header for the file               dbt_dbid=4   dbt_stat=0x0 (0x0000)     dbt_extstat=0x0 (0x0000)     dbt_stat2=0x0 (0x0000)     dbt_stat3=0x20000 (0x00020000 (DBT3_SYSPARTITIONS_EXISTS))     dbt_stat4=0x0 (0x00000000)     dbt_runstat=0x0(0x0000)     dbt_state=0x2(0x0002 (DBST_ACTIVE))   dbt_keep=0  dbt_hdeskeep=0     dbt_next=0x000000002197DE80   dbt_systask_keep=0 dbt_detachxact_keep 0         dbt_dcompver_default=1     dbt_lock=0  dbt_dbaid=1     dbt_verstimestamp= May 15 2012  3:37PM   dbt_dbname=TestDB     dbt_logrows=0     dbt_lastlogbp=0x0000000000000000     dbt_logsema=000000000099EE10      dbt_nextseq=11  dbt_oldseq=11     dbt_dbinfobuf.dbi_logvers=7     dbt_dbinfobuf.dbi_upgdvers=35 ... .dbi_upgd_minor=1720     dbt_dbinfobuf.dbi_dbinfovers=5     dbt_dbinfobuf.dbi_sarg_vers=2  dbt_threshstat=0x0     dbt_thresholds=0x00000000219873B8  dbt_thresh_spin=0x000000002011E300     dbt_maxthresh=256     thc_segment   2 thc_level   664 thc_status 0xf  <-- last chance threshold     dbt_nextid=560001995 dbt_nextidstat=0x0     dbt_dflinfo=0x0000000000000000  dbt_dflstat=0x0     dbt_dumpthreadlock=0     dbt_dbts=0x0000 0x00001492   dbt_xdesqueue   next=0x0000000021986C20


title: Why flipping is done on data from Big endian before storing in LE?

text: Simple but confusing question for a beginner. Suppose A is a BE machine and is sending 0x44332211 sending data to B which is LE. By default A will be using htonl of 0x44332211 which is nothing but 0x44332211. Now when 0x44332211 reaches B,B knows that its a BE format, so B will flip by using htonl function and change it to 0x11223344. What does this flipping meeans? I read this concept from internet. Why flipping is required before storing? Because in that case flipped value 0x11223344 will be stored in LE like 0x44332211,which is different from what A send because B interprets it differently though they look alike? /* Conversion from BE to LE */


title: Can not analyze output from Squid and varnish

text: I'm using one `Squid` server between tow `cache` server. I get from headers following information:               X-Cache MISS, HIT from cache-zz     X-Cache-Age 515     X-Cache-Control public, max-age=3600     X-Cache-Lookup  HIT from cache-zz     X-Cache-O   MISS     X-Cache-Route   cache-xx/cache-yy      In `cache-zz` I have squid and in `cache-xx` and `cache-yy` I have varnish. I can not analyze that.   * How can we have MISS and HIT from `cache-zz` in the same time?   * And how can we get the HIT from `cache-zz`, which is between two caches?


title: convert - unrecoverable error when pdf to jpg

text: When I'm converting pdf to jpg with the following command               $ convert -density 300 file.pdf file.jpg      I'm getting this error. > Last OS error: 2 GPL Ghostscript 8.71: Unrecoverable error, exit code 1 > convert: Postscript delegate failed `file.pdf': No such file or directory @ > pdf.c/ReadPDFImage/634. convert: missing an image filename `file.jpg' @ > convert.c/ConvertImageCommand/2838. Could you help me with this command to work? thank you


title: How to exclude directories with blanks via locate's PRUNEPATHS?

text: I would like to exclude some Windows folders on an NTFS mount from being indexed by `locate`. I'm familiar with the `PRUNEPATHS` syntax in `/etc/updatedb.conf`. It is a white-space separated list of directory names. My problem is that I want to exclude directories that contain white space themselves (e.g. `Program Files (x86)`). I tried backslash escapes but that didn't work.


title: How to set up remote graphical sessions on CentOs?

text: Trying to set up a Centos 6 server configuration where we can automate the running of an application that uses Selenium. In this case, ideally, we should be able to:   1. Create a graphical session (which should remain open for at least 30 minutes).   2. Run an application that will continue running while the session is active.   3. Have that application, using Selenium, run automated website tests. What sort of installation / configuration do I need to do this? I've already set up `gdm` and a `vnc` server to test it out. I am at a loss, however, on what to do next.


title: Starting Resque worker with script doesnt work, starting by hand does

text: I am trying to figure out why my process doesn't work if started via a script, but works fine if started by hand. Here's the details: script is a resque worker start script. The script location is /etc/monit/conf.d/start_resque.sh. Permissions are 755 and owned by ubuntu:ubuntu When I run the script, the log output gets a pid and it says "starting worker ip-xx-xxx-xxx-xx:26732 (or whatever the pid is)", however when I ps aux | grep 26732, nothing is shown as running. When I run the same exact command by hand in my rails project directory, the same "starting worker" output is displayed, and the process is actually started and continues to run. One thing to note, additional output is displayed if started by hand: "nohup: ignoring input" Another question someone might be able to help with, is why does BACKGROUND=yes not actually daemonize my worker...thus I'm resorting to nohup, which seems to work fine. Here's my script (the command I run by hand is after the cd):               #!/bin/bash     echo "starting worker.."     workercount="$(ps aux | grep -c resque)"     currentdir="/var/www/apps/myapp/current"     logdir=$currentdir/log/resque_worker.log     pidfile=$currentdir/tmp/pids/resque_worker_$workercount.pid     cd $currentdir     nohup bundle exec rake environment resque:work RAILS_ENV=production QUEUE='*' VERBOSE=1 PIDFILE=$pidfile >> $logdir 2>&1 &     echo "started worker $workercount! view log at $logdir. view pidfile at $pidfile"      Additional notes: on Ubuntu 12.04 and am connected via `ssh` while running both the script and the manual command.


title: How to run an app in a framebuffer?

text: If I can see a movie from the console (like in this post), then how can I use other apps like Firefox from the console? I'm looking for something that works in Ubuntu, Fedora, or OpenBSD.


title: How do I use curl to download content from sourceforge?

text: Simply typing http://downloads.sourceforge.net/project/romfs/genromfs/0.5.2/genromfs-0.5.2.tar.gz works fine on a browser, but I'm trying to download from a CLI environment with limited utilities. The following just returns an empty file:               curl http://downloads.sourceforge.net/project/romfs/genromfs/0.5.2/genromfs-0.5.2.tar.gz      How do I get genromfs-0.5.2.tar.gz from sourceforge using curl?


title: How to change the colour of embedded terminal in linux mint 12 to be able to use `ls` and `byobu`?

text: I'm using Linux Mint 12 and am having problems with the embedded terminal in gedit. Using the default themes I'm unable to use 'ls' and 'byobu' as in part of their output foreground and background colours are the same. Problems shown in this screenshot. Byobu is running (bottom two lines of terminal) and ls has just been used. http://i.stack.imgur.com/BPboj.png I've followed the instructions in http://askubuntu.com/questions/67593/make- gedit-embedded-terminal-colours-the-same-as-the-default-terminal but have had no luck with that. Any ideas would be very appreciated!


title: Key-binding to open a terminal running python in ratpoison

text: In my .ratpoisonrc file I'm failing to write a key-binding to open a terminal running python. I'm running a minimal Debian setup on which I basically just run emacs. Sometimes I want to just get a python shell and I'm not sure how to set up the key binding to get that right.               bind p exec ???? python


title: How to attach terminal to detached process?

text: I have detached a process from my terminal, like this:               $ process &      That terminal is now long closed, but process is still running and I want to send some commands to that process's stdin. Is that possible?


title: How can I exclude proftp authentication failure messages from logwatch?

text: I use `logwatch` on my server, now I get thousands of these lines in the report email:               --------------------- pam_unix Begin ------------------------            proftpd:         Unknown Entries:            check pass; user unknown: 339 Time(s)            authentication failure; logname= uid=0 euid=0 tty= ruser= rhost=::ffff:62.115.255.98 : 27 Time(s)            authentication failure; logname= uid=0 euid=0 tty= ruser= rhost=::ffff:188.102.152.23 : 7 Time(s)     ...      I already have loglevel Low


title: Perl only one option at a time

text: There is a requirement where I can't put two options at the same time. For instance with `-a` option:               file.pl -a file.text        # executes file      But if I write               file.pl -a -a file.text     # it is supposed to print a msg      or               file.pl -a -b file.text     # it is supposed to print a msg      Below is my script:               if ($ARGV[1] eq "-a" or "-b" or "-c" ) {          print "error \n"; }      The problem is even though I just write `file.pl -a file.text`, it still prints the msg.


title: any feature on linux like Perfermance Counter on Windows servers?

text: I have a tomcat web application, when invoking an unstable remote API, I want to get realtime http request time at any time. On windows server, I can use Performance Counter, does centos provide someone like that?


title: apt-get: install modified package with dependencies

text: I have downloaded a Debian package `lxde`, together with all its dependencies:               apt-get install --no-install-recommends lxde --download-only      So now, I have all packages in my `/var/cache/apt/archives`. I have made modifications to one package `lxde_4+nmu1_all.deb` (removed `galculator` from dependencies) and now I would like to install lxde from my modified package (i.e. with the modified dependencies). `dpkg -i lxde_4+nmu1_all.deb` does not work, because of unmet dependencies. How can I tell `apt-get` to install my modified package `/var/cache/apt/archives/lxde_4+nmu1_all.deb` ?


title: ls command in ftp> not working!

text: I was practicing ftp but faced an issue: ls command isn't working on ftp> . Why? I checked on 2 remote servers but ls didn't work on either and gave different output when ls was executed. Please see below for the 2 remote boxes. The below shows my remote server where I installed vsftpd today.               ravbholua@ravbholua-Aspire-5315:~$ ftp rs     Connected to ravi.com.     220 (vsFTPd 3.0.2)     Name (rs:ravbholua):      331 Please specify the password.     Password:     230 Login successful.     Remote system type is UNIX.     Using binary mode to transfer files.     ftp> pwd     257 "/home/ravbholua"     ftp> ls     500 Illegal PORT command.     ftp: bind: Address already in use     ftp>       The below is for a different remote machine where I have to send some files. _But as ls on ftp> isn't working, how will I transfer files from my local box to that box because I can't be confirmed without ls whether the files have been transferred or not._               ravbholua@ravbholua-Aspire-5315:~$ ftp 125.21.153.140     Connected to 125.21.153.140.     220---------- Welcome to Pure-FTPd [TLS] ----------     220-You are user number 1 of 10 allowed.     220-Local time is now 04:34. Server port: 21.     220-This server supports FXP transfers     220 You will be disconnected after 2 minutes of inactivity.     Name (125.21.153.140:ravbholua): peacenews     331 User peacenews OK. Password required     Password:     230 OK. Current restricted directory is /     Remote system type is UNIX.     Using binary mode to transfer files.     ftp> ls     200-FXP transfer: from 123.63.112.168 to 10.215.10.80     200 PORT command successful      Please note that for the above machine, once I ran ls on ftp>, the prompt didn't come back. On both the remote machines, I got different output when executed ls on ftp>


title: Cannot mount LVM2 partitions

text: I have a 160GB hard drive here with an LVM2 partition that contains two EXT3 partitions that I'm trying to mount. However, when I try to mount either of those two partitions inside the LVM2, I get the error:               mount: wrong fs type, bad option, bad superblock on /dev/loop0,            missing codepage or helper program, or other error            In some cases useful info is found in syslog - try            dmesg | tail  or so      Also, when I run fdisk, it shows the two partitions as not containing "a valid partition table"               Disk /dev/sdd: 160.0 GB, 16004188696 bytes     255 heads, 63 sectors/track, 19457 cylinders, total 312581808 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x0002d815          Device      Boot    Start       End     Blocks      Id  System     /dev/sdd1   *   63      305234      152586      83  Linux     /dev/sdd2       305235      4498199     2096482+    82  Linux swap / Solaris     /dev/sdd3       4498200     312576704   154039252+  8e  Linux LVM          Disk /dev/mapper/VolGroup00-lv_root: 21.5 GB, 21474836480 bytes     255 heads, 63 sectors/track, 2610 cylindars, total 41943040     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x00000000          Disk /dev/mapper/VolGroup00-lv_root doesn't contain a valid partition table          Disk /dev/mapper/VolGroup00-lv_usr2: 136.2 GB, 136197439488 bytes     255 heads, 63 sectors/track, 16558 cylindars, total 266010624 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x00000000          Disk /dev/mapper/VolGroup00-lv_usr2 doesn't contain a valid partition table      Here are the contents of lvdisplay:                 --- Logical volume ---       LV Name                /dev/VolGroup00/lv_root       VG Name                VolGroup00       LV UUID                jOeBez-2QxJ-Rwth-ufsK-kohE-dHrW-XwDeEi       LV Write Access        read/write       LV Status              available       # open                 0       LV Size                20.00 GiB       Current LE             640       Segments               1       Allocation             inherit       Read ahead sectors     auto       - currently set to     256       Block device           252:0            --- Logical volume ---       LV Name                /dev/VolGroup00/lv_usr2       VG Name                VolGroup00       LV UUID                YvbvFJ-yq2t-gSoV-6CqL-Imby-qx6E-uNu3Iz       LV Write Access        read/write       LV Status              available       # open                 0       LV Size                126.84 GiB       Current LE             4059       Segments               1       Allocation             inherit       Read ahead sectors     auto       - currently set to     256       Block device           252:1      Do you guys have any advice? I am positive they are ext3 partitions..


title: Get indication of ssh command

text: I need to get indication whatever the `ssh` command succeeded or not without it leaving the connected server. I use this command:               ssh -q  user1@server1 "echo 2>&1" && echo SSH_OK || echo SSH_NOK      My problem with that command is that I dont stay in the connected server. I dont wish to add test after the `ssh` command, I wish to do it like how I do it so far - by one command. Here is a sample of how it works now:               [nir@dhcppc4 ~]$ ssh -q  user1@server1 "echo 2>&1" && echo SSH_OK || echo SSH_NOK     SSH_NOK     [nir@dhcppc4 ~]$ hostname     dhcppc4     [nir@dhcppc4 ~]$ ssh -q  user1@server2 "echo 2>&1" && echo SSH_OK || echo SSH_NOK     SSH_OK     [nir@dhcppc4 ~]$ hostname     dhcppc4      And here is a sample of what I want:               [nir@dhcppc4 ~]$ ssh -q  user1@server1 "echo 2>&1" && echo SSH_OK || echo SSH_NOK     SSH_NOK     [nir@dhcppc4 ~]$ hostname     dhcppc4     [nir@dhcppc4 ~]$ ssh -q  user1@server2 "echo 2>&1" && echo SSH_OK || echo SSH_NOK     SSH_OK     [nir@server2 ~]$ hostname     server2


title: Case insensitive search in man pages

text: Is there a way to search man pages case-insensitively? Using the '/' search feature matches exact case.


title: What is the easiest way to draw graphics on Linux framebuffer?

text: I have some embedded Linux ARM chip with LCD display on frame-buffer. I connect to chip with serial console. I can access frame-buffer directly with low-level commands. However I need to draw some figures or even sprites. I am searching something. Can for example SDL run on frame-buffer without X, or there is similar graphical libraries? High performance video like speed is not needed, because probably animation will not be used, but GUI should be at least usable. Ncurses was useful for text interface, but I need some graphical interface.


title: Sed: replacing digits

text: I am trying to write some install scripts for when I install/upgrade Ubuntu. I'm having trouble with fixing `logrotate.d`:               /var/log/ufw.log     {     rotate 7     weekly     missingok     notifempty     compress     delaycompress     sharedscripts     postrotate         reload rsyslog >/dev/null 2>&1 || true     endscript     }      I want to change `rotate nnn` to `rotate 99`. It must work for nnn to be any number of digits (normally 1 or 2), yet not affect the `postrotate` line. I've tried these two but neither does what I need (and I tested with nnn being 1,2 or 3 digits).               sudo sed  's/rotate[0-9]*/rotate 99/' /etc/logrotate.d/ufw     sudo sed  's/^rotate[0-9]/rotate 99/' /etc/logrotate.d/ufw


title: Remove GNOME and install dwm

text: I'm currently running Fedora 19 on my PC and I want to remove GNOME and then use dwm. Is it enough when I install dwm and remove GNOME completely?


title: What doesn't need defragmentation? Linux or the ext2 ext3 FS?

text: Why don't you have to defrag a Linux system? Because it's using the ext2/ext3 file system or because it's Linux? That's relevant, because a have a double boot system (W7 / Ubuntu) and a common partition (NTFS) that can be accessed by both system. If I'm using this partition with Linux, will it get fragmented? Another issue are the Truecrypt containers. I also access them with Linux and Windows, and they are FAT32. Do they get fragmented by Linux operating on them?


title: Open program as root, close root session but still program is running

text: When I run my backup script, first I switch to root, mount a truecrypt partition and then run the script. I've noticed that after run truecrypt as root, I can exit the root session and truecrypt remains opened. Why does it happen? Shouldn't it close as long as I close root session? The commands order is: `su` `truecrypt &` I mount the hidden volume using Truecrypt's UI `./Backup.sh` and then the usual is unmount the Truecrypt's volume, close Truecrypt, exit root session. However, if I only close root session Truecrypt keeps running with root permissions.


title: Debian: Unable to activate wifi on HP Pavilion Dm1-4055sg (with Broadcom BCM4313)

text: I just installed Debian Wheezy stable. I am now facing the problem, that I am not able to activate the WiFi. I use a HP-Pavilion DM1 notebook with a button (F12 and wlan button) to activate the WiFi. However pressing it does not cause any reaction. Furthermore `ifconfig -a` does not list `wlan0`. The computer is equipped with a Broadcom BCM4313 Wireless LAN controller, so I installed the `firmware- brcm80211` driver. As a network manager I installed WICD since I use the XFCE desktop. Does anybody have a clue what is going on?


title: Extend partition size without unmounting it

text: I would like to create an image of a Linux Mint disc. Then I'd like to copy it to a bigger disc and extend its partition to the full size of the disc. I have already copied the disc using `WinImage` to another PC, wrote the data on a bigger disc and turned it on. I have been searching for some mechanism to extend a partition with Linux without success. With `GParted` it works perfectly, but I would like to do it in a console. I have been trying to do this using `parted`, `GPart` or `lvextend` but I cannot find any option which allows me to extend a partition size without unmounting it. **EDIT** Type of file system is `ext4`, which I checked with `parted` command.


title: MS Intelli Mouse Optical not working on Mint Linux 15 64-bit

text: The title tells everything I guess: I have a _MS Intelli Mouse Optical_ with _5 Buttons_ and the side buttons are _not working_. I have searched for a `xorg.conf` file but I couldn't find it. _What can I do to make the mouse work like in Windows 7? (You know the plug & play stuff)_


title: Specify rows/columns of a fullscreen X terminal?

text: For presentations it would be convenient to have a X terminal which supports following workflow:   * make it fullscreen   * specify how many columns/rows should be displayed -> the terminal then automatically selects the right font type and size Which X terminal supports this?


title: How many cores can Linux kernel handle?

text: I'm interested in theoretical limits, perhaps with examples of systems having huge numbers of CPU's.


title: Getting visual feedback of workspace switch in xfce

text: I make heavy use of workspaces, and have a lot of them (a 6x4 grid). I usually run openbox, but am currently using a machine that doesn't have openbox set up, so I'm using xfce because it's already mostly configured to my liking. I've gotten used to getting visual feedback when I switch workspaces, showing me which one I've just moved to, and am finding myself a bit disoriented in xfce. In openbox this is a big heads-up display, which is pretty much ideal. I'm aware that the workspace switcher panel applet will highlight the active workspace, but this only seems to work for workspaces which have some desktop space showing; since I generally have all my windows maximized, this isn't super helpful. Is there a way to enable visual feedback showing the new workspace when switching workspaces in xfce?


title: How to edit files with VIM through FTP

text: I'm trying to use: `vim ftp://user@hostname//` - this gives me a correct directory tree, but when I try to open given file, by pressing Enter, at the first time - nothing happens (just cursor jumps to the "control" line at the bottom of the screen), when I'm pressing Enter again, I'm getting:                 1 ftp: username.hostname: Ta nazwa lub usługa jest nieznana // Rough translation: This name or service is not known       2 Not connected.       3 Not connected.       4 Not connected.      I changed username and hostname above. I want to edit file through FTP, what I'm doing wrong?


title: Identify python script is waiting for a manual input

text: I'm writing a shell script which executes a Python script. The Python script halts for a manual enter to be provided. However, I don't wan't to have to press enter each time to the script. Instead, I want to pass the manual enter from the executing shell script. Kindly help, if there is a way to do that?


title: Dual boot Linux / Windows. How to deny completely Windows?

text: I have a dual boot setup (Debian / Ubuntu and Windows) on my laptop. I would like GRUB to start Linux automatically, without a prompt for Windows. And eventually start Windows only with (for example) a combination of keys. Or have some rows of fake entries installed and at 3rd/4th/nth place Win (with a fake name, eg. "Restart Now"). My goal: if an inexperienced person boots my laptop, he can not boot Windows.


title: How to use STL in unix and linux?

text: How to use STL(standard template library) in HP-Unix . How to compile and run the program with STL functions?


title: /proc/config.gz is of 0 bytes

text: I have an Android TV stck I compiled Linux for IT from https://github.com/Galland/rk3x_kernel_3.0.36 But when I booted that Image I found /proc/config.gz is of 0 bytes can some please explain how the command line params from .config file in kernel source get mounted to /proc. I mean what goes in the background??


title: Accessed a TrueCrypt container without TrueCrypt. What dangers await?

text: I've got a TrueCrypt volume. In light of the unexpected demise of TrueCrypt, I've been trying to figure out what to do (reading lots of HOWTO websites). I'd like something that is simple and can work as simply as truecrypt, but so far as I can tell, no such thing exists. I'm taking baby steps, finding out if I can learn to mount the TrueCrypt container without using TrueCrypt. This is than expected. In case you want to try, here's how. In my case, the container is a file called "container". Create a mountpoint directory `~/TrueMount2` and then:               $ sudo cryptsetup open --type tcrypt ~/container flopper          $ sudo mount -t ext4 /dev/mapper/flopper ~/TrueMount2      I called this one "flopper" because I can! That variable is a placeholder. You can name it anything you want to. Freedom! It is liberating. After that, the contents of the TrueCrypt folder show up under `~/TrueMount2`. The files are there, just as expected. This volume is about 70GB, so I can certify that it works for big encrypted things. I ran find in that directory and it was plenty fast. Also good news, this mount survives a suspend/resume cycle. That's a relief. I suspended the machine before remembering to read a HOWTO about suspending when an encrypted container is mounted :). I also learned that, if I want to disconnect the encrypted drive, I need to take 2 steps:               $ sudo umount TrueMount2          $ sudo cryptsetup close flopper      This works in Ubuntu 14.04. I experimented with some other methods (`tcplay`), but didn't get a good result. I probably need to try harder. I've also found it does work to put the container file inside the directory `~/TrueMount2`. I like that idea because, at least while the thing is mounted, the mountpoint "protects" the container file from accidental deletion. Now, here are the questions for you.   1. Will the container itself be damaged if the machine turns off without unmounting the container? I am absolutely certain I will not remember to umount that thing explicitly every time the machine turns off. What bad thing will happen?   2. Have I made this simpler than it should be? In other instructions, such as this one: How can I create an encrypted, file-system–agnostic, mountable volume? one has to go to the trouble of finding an open loopback device, using it, and then closing it down after. Why don't I have to do that with a TrueCrypt container? Why doesn't it need loopback and losetup and the other confusing bits? I'm experimenting with the storage method described above, but it appears to not be scriptable. I don't manually want to ask the system which loop is free when I start the day. I want the mounter to "just work" on the first free loop. Little details like that made TrueCrypt useful to me and I'm very sorry they are shut down.


title: Merging folders with practically the same name but different casing

text: When digging around in the advanced settings in Dropbox I lost a folder. I only discovered this about a month later. I managed to get this folder back from Dropbox however the file structure of the subfolders have changed dramatically. The current folder now contains two versions of each original subfolder. Currently it looks like this:               folder       /folder1         /folder11           /folder111           /Folder111            /file1111            /file1112            /file1113         /Folder11           /file111           /file112         /folder12         /Folder12       /folder2       /folder3        So I have lowercase subfolders and I have BumpyCase subfolders. The lowercase subfolders contain subsubfolders and the BumpyCase subfolders contain files. The subsubfolders again contain a lowercase and a BumpyCase version of their respective subfolders. And this story goes on for several levels deep. Fortunately there is no duplication in files, only in folders (same letters but different casing). So on each level I need to merge folders which differ only in the casing of names. And to do this correctly I need to start at the deepest level and work myself up to the top level folder. I want everything to go into the CamelCase directories. The partition where the data is is an Ext4 partition. I have access to several NTFS partitions. Is there a handy Linux command/tool or someone with an idea for a script which could accomplish this? I'm already very happy that I got my stuff back, but the current structure is a big inconvenience.


title: smartctl on external hdd inside ide-to-usb enclosure

text: I have a very old 2.5" IDE drive inside a USB enclosure that gives some buffer I/O error. I tried to use `smartctl` to see what SMART says about it, but I can't manage to make it work. Being `root`, if I just write:               #> smartctl --all /dev/sde      `smartctl` answers:               /dev/sde: Unknown USB bridge [0x14cd:0x6600 (0x201)]     Smartctl: please specify device type with the -d option.      So I've tried every `-d TYPE` available in the help summary, and the best result is achieved with:               #> smartctl --all -d scsi /dev/sde      that outputs:               Vendor:               IC25N030     Product:              ATMR04-0     User Capacity:        30,005,821,440 bytes [30,0 GB]     Logical block size:   512 bytes     scsiModePageOffset: response length too short, resp_len=4 offset=4 bd_len=0     >> Terminate command early due to bad response to IEC mode page     A mandatory SMART command failed: exiting. To continue, add one or more '-T permissive' options.      If I also add `-T permissive` the last line is replaced with:               Error Counter logging not supported     Device does not support Self Test logging      It seems that just a few models of USB enclosures are officially supported by `smartmontools`. Is there something that I'm missing or simply the device implements an archaic version of SMART without any counters (and hence almost useless)?


title: Which 'smartctl -d' option should I use on this hard-disk: 'scsi' or 'ata'?

text: On the back of How to repair a corrupted HFS+ partition?, I have separate question. I'd like to run `smartctl` tests on a hard disk, but I'm not sure which option I should use to correctly initialize the tests. The drive in question is a Toshiba MK2555GSXF 250GB SATA/300 5400RPM 8MB 2.5" Hard Drive, and I connect it to the Linux box using an Icy Box IB-AC603A-U3 Adaptor SATA 6.4 cm / 2.5 Inches to USB 3.0 external disk case. Here's relevant output from `lshw`:                *-scsi           physical id: 3           bus info: usb@2:5           logical name: scsi7           capabilities: emulated scsi-host           configuration: driver=usb-storage         *-disk              description: SCSI Disk              product: 2105              vendor: ASMT              physical id: 0.0.0              bus info: scsi@7:0.0.0              logical name: /dev/sdb              version: 0              serial: 00000000000000000000              size: 232GiB (250GB)              capabilities: gpt-1.00 partitioned partitioned:gpt              configuration: ansiversion=6 guid=6b43402b-9887-4a33-a329-9801b59ccdc7            *-volume:0                 description: Windows FAT volume                 vendor: BSD  4.4                 physical id: 1                 bus info: scsi@7:0.0.0,1                 logical name: /dev/sdb1                 version: FAT32                 serial: 70d6-1701                 size: 199MiB                 capacity: 199MiB                 capabilities: boot fat initialized                 configuration: FATs=2 filesystem=fat label=EFI name=EFI System Partition            *-volume:1                 description: Apple HFS partition                 vendor: Mac OS X (fsck)                 physical id: 2                 bus info: scsi@7:0.0.0,2                 logical name: /dev/sdb2                 version: 4                 serial: d9a741cc-8313-cc78-0000-000000800000                 size: 232GiB                 capabilities: journaled bootable osx hfsplus initialized                 configuration: boot=osx checked=2009-09-24 02:29:07 created=2009-09-23 17:29:07 filesystem=hfsplus lastmountedby=fsck modified=2013-11-03 01:02:00 name=Customer state=unclean      When I run a `smartctl` `Self Test`, it seems to fail:               root@liv-HP-Compaq-dc7900:/home/liv# smartctl -i -H -c '/dev/sdb'     smartctl 5.41 2011-06-09 r3365 [x86_64-linux-3.2.0-57-generic] (local build)     Copyright (C) 2002-11 by Bruce Allen, http://smartmontools.sourceforge.net          /dev/sdb: Unknown USB bridge [0x174c:0x5136 (0x001)]     Smartctl: please specify device type with the -d option.          Use smartctl -h to get a usage summary      The trouble is that I'm not sure what to use for the `-d` option. I checked the man page, and the most sensible options seem `ata` or `scsi`. I understand that this particular drive is `SATA`, but for some reason `lshw` identifies it as `SCSI`. So I'm not sure what option is appropriate in this case? * * * **UPDATE1** : As suggested in the answers, I identified the device manufacturer:               root@liv-HP-Compaq-dc7900:/home/liv# lsusb -v     Bus 002 Device 007: ID 174c:5136 ASMedia Technology Inc.      Device Descriptor:       bLength                18       bDescriptorType         1       bcdUSB               2.10       bDeviceClass            0 (Defined at Interface level)       bDeviceSubClass         0        bDeviceProtocol         0        bMaxPacketSize0        64       idVendor           0x174c ASMedia Technology Inc.       idProduct          0x5136        bcdDevice            0.01       iManufacturer           2 ASMedia       iProduct                3 AS2105       iSerial                 1 00000000000000000000       bNumConfigurations      1       Configuration Descriptor:         bLength                 9         bDescriptorType         2         wTotalLength           32         bNumInterfaces          1         bConfigurationValue     1         iConfiguration          0          bmAttributes         0xc0           Self Powered         MaxPower                0mA         Interface Descriptor:           bLength                 9           bDescriptorType         4           bInterfaceNumber        0           bAlternateSetting       0           bNumEndpoints           2           bInterfaceClass         8 Mass Storage           bInterfaceSubClass      6 SCSI           bInterfaceProtocol     80 Bulk-Only           iInterface              0            Endpoint Descriptor:             bLength                 7             bDescriptorType         5             bEndpointAddress     0x81  EP 1 IN             bmAttributes            2               Transfer Type            Bulk               Synch Type               None               Usage Type               Data             wMaxPacketSize     0x0200  1x 512 bytes             bInterval               0           Endpoint Descriptor:             bLength                 7             bDescriptorType         5             bEndpointAddress     0x02  EP 2 OUT             bmAttributes            2               Transfer Type            Bulk               Synch Type               None               Usage Type               Data             wMaxPacketSize     0x0200  1x 512 bytes             bInterval               0     Device Status:     0x0001       Self Powered      Then checked whether the device (`ASMedia AS2105` with ID `0x174c:0x5136`) is listed in Smartmontools USB Device Support. There were a couple of very similar matches with successful outcomes, all suggesting the use of `-d sat`. And this seems to work in my case, too:               root@liv-HP-Compaq-dc7900:/home/liv# smartctl -d sat -i -H -c '/dev/sdb'     smartctl 5.41 2011-06-09 r3365 [x86_64-linux-3.2.0-57-generic] (local build)     Copyright (C) 2002-11 by Bruce Allen, http://smartmontools.sourceforge.net          === START OF INFORMATION SECTION ===     Device Model:     TOSHIBA MK2555GSXF     Serial Number:    10J9SA69S     LU WWN Device Id: 5 000039 245a067fd     Firmware Version: FH205B     User Capacity:    250,059,350,016 bytes [250 GB]     Sector Size:      512 bytes logical/physical     Device is:        Not in smartctl database [for details use: -P showall]     ATA Version is:   8     ATA Standard is:  Exact ATA specification draft version not indicated     Local Time is:    Fri Jan 17 16:18:03 2014 CET     SMART support is: Available - device has SMART capability.     SMART support is: Enabled          === START OF READ SMART DATA SECTION ===     SMART overall-health self-assessment test result: PASSED          General SMART Values:     Offline data collection status:  (0x00) Offline data collection activity                         was never started.                         Auto Offline Data Collection: Disabled.     Self-test execution status:      (   0) The previous self-test routine completed                         without error or no self-test has ever                          been run.     Total time to complete Offline      data collection:        (  120) seconds.     Offline data collection     capabilities:            (0x5b) SMART execute Offline immediate.                         Auto Offline data collection on/off support.                         Suspend Offline collection upon new                         command.                         Offline surface scan supported.                         Self-test supported.                         No Conveyance Self-test supported.                         Selective Self-test supported.     SMART capabilities:            (0x0003) Saves SMART data before entering                         power-saving mode.                         Supports SMART auto save timer.     Error logging capability:        (0x01) Error logging supported.                         General Purpose Logging supported.     Short self-test routine      recommended polling time:    (   2) minutes.     Extended self-test routine     recommended polling time:    (  90) minutes.     SCT capabilities:          (0x0039) SCT Status supported.                         SCT Error Recovery Control supported.                         SCT Feature Control supported.                         SCT Data Table supported.      Now to make `gsmartcontrol` recognize the disk, I had to `Device > Add Device`, put `/dev/sdb` in `Name` and select `sat,16` for `Type`. So this pretty much solves this particular question.


title: Chkrootkit found alot of suspicious files and directories, and /sbin/init INFECTED

text: I was just running chkrootkit on my Fedora 20 x86_64. Here are some dubious results. Anyone know if these are false positives? Do I have a compromised system? Here are the suspect files and directories:               Searching for suspicious files and dirs, it may take a while...           /usr/lib/.libgcrypt.so.11.hmac /usr/lib/python2.7/site-packages/martian     /testswithbogusmodules/.bogussubpackage /usr/lib/python2.7/site-packages/fail2ban     /tests/files/config/apache-auth/digest_time/.htaccess /usr/lib/python2.7/site-     packages/fail2ban/tests/files/config/apache-auth/digest_time/.htpasswd /usr/lib     /python2.7/site-packages/fail2ban/tests/files/config/apache-auth/noentry     /.htaccess /usr/lib/python2.7/site-packages/fail2ban/tests/files/config/apache-     auth/basic/file/.htaccess /usr/lib/python2.7/site-packages/fail2ban/tests/files     /config/apache-auth/basic/file/.htpasswd /usr/lib/python2.7/site-packages/fail2ban     /tests/files/config/apache-auth/basic/authz_owner/.htaccess /usr/lib/python2.7     /site-packages/fail2ban/tests/files/config/apache-auth/basic/authz_owner     /.htpasswd /usr/lib/python2.7/site-packages/fail2ban/tests/files/config/apache-     auth/digest_anon/.htaccess /usr/lib/python2.7/site-packages/fail2ban/tests/files     /config/apache-auth/digest_anon/.htpasswd /usr/lib/python2.7/site-packages     /fail2ban/tests/files/config/apache-auth/digest_wrongrelm/.htaccess /usr/lib     /python2.7/site-packages/fail2ban/tests/files/config/apache-auth/digest_wrongrelm     /.htpasswd /usr/lib/python2.7/site-packages/fail2ban/tests/files/config/apache-     auth/digest/.htaccess /usr/lib/python2.7/site-packages/fail2ban/tests/files/config     /apache-auth/digest/.htpasswd /usr/lib/python2.7/site-packages/pylons/docs/en     /.gitignore /usr/lib/python2.7/site-packages/pylons/templates/default_project     /+package+/templates/.distutils_placeholder /usr/lib/python2.7/site-packages     /pylons/templates/minimal_project/+package+/templates/.distutils_placeholder      /usr/lib/.libssl.so.1.0.1e.hmac /usr/lib/.libcrypto.so.1.0.1e.hmac /usr/lib     /.libssl.so.10.hmac /usr/lib/debug/.build-id /usr/lib/debug/usr/.dwz /usr/lib     /debug/.dwz /usr/lib/mono/xbuild-frameworks/.NETFramework /usr/lib     /.libcrypto.so.10.hmac              /usr/lib/python2.7/site-packages/martian/tests/withbogusmodules     /.bogussubpackage /usr/lib/debug/.build-id /usr/lib/debug/.dwz /usr/lib     /mono/xbuild-frameworks/.NETFramework      * * * And then there was this:               Searching for Suckit rootkit... Warning: /sbin/init INFECTED      * * * Finally:               Checking `chkutmp'...  The tty of the following user process(es) were not found      in /var/run/utmp !     ! RUID          PID TTY    CMD     ! root         1631 tty1   /usr/bin/X :0 vt1 -background none -nolisten tcp -seat seat0 -auth /var/run/kdm/A:0-EiPPra     chkutmp: nothing deleted     Checking `OSX_RSPLUG'... not infected


title: Regain access to seemingly frozen Live CD session

text: A few weeks back I started a machine up with a copy of Parted Magic, and loaded up some webpages in Firefox on it. Just last week, upon getting back to looking at the machine, I noticed that `lxpanel` had grown to a larger than normal memory size, and UI response was sluggish. At that time I set ¿stupidly? `xset s on` & `xset s 1`. Today I go to use the machine and find I cannot use the keyboard or mouse to make the display turn on for 1 second (enough time for me to launch terminal and `xset s off` (My basic attempt to create secure screen saver like functionality)). I am aware I can kill `X`, or launch `oom_kill`, but both of these options will/could loose my unsaved form data that I would prefer not to recreate, even if more time is involved with regaining access to the current session. Does anyone have any other solutions?


title: X Starting Instead of Openbox (Arch)

text: I recently installed Arch for the first time in VMWare Workstation 9.0.2, twice (I reinstalled to change some partition sizes). In the first installation I was able to start Openbox instead of X when running startx by copying xinitrc to my /home/user directory, and then simply adding "exec ck- launch-session dbus-launch openbox-session" to the end on both the xinitrc in my user folder as well as the one in /etc/X11/xinit. However, on the second installation, although modifying xinitrc in the same manner as the first time, X starts instead of Openbox after running startx. The end of both xinitrc files look like this:               twm &     xclock -geometry 50x50-1+1 &     xterm -geometry 80x50+494+51 &     xterm -geometry 80x20+494-0 &     exec xterm -geometry 80x66+0+0 -name login     exec ck-launch-session dbus-launch openbox-session      Does anyone know what the issue is?


title: Copy-paste between Hyper-V guest and host

text: My computer runs Windows Server 2008 R2. It hosts a Hyper-V virtual machine running Ubuntu 12.04 as the guest OS. I want to copy text from Ubuntu and paste this text in Windows (and copy text in Windows and paste it in Ubuntu). How can I do this?


title: iptables: what the difference between filter and mangle

text: I am using iptables to to mark the package and want to route based on the marks. First I added the ip rule:               sudo ip rule add fwmark 1 prohibit      (The "prohibit" is just for test, I will change it to some route table later.) Then I began to mark the packages:               sudo iptables -A OUTPUT -d 192.168.1.0/24 -j MARK --set-mark 1      But the computer can still access the 192.168.1.0/24 networks. After a long time's googling and struggling, I tried:               sudo iptables -t mangle -A OUTPUT -d 192.168.1.0/24 -j MARK --set-mark 1      It works and the connection was blocked. In the first case, the default table of filter is used. So my question is what is the difference between mangle table and filter table? Which one should be used in what cases? As my understanding, all these tables will be consulted before the routing policy, then why the filter table doesn't work properly?


title: gksu login and groups

text: After installing Wireshark, I added my user to `wireshark` group. As I didn't want to restart my X session in order to relogin, I tried running it with `gksu -l -u myuser`. As `su - myuser` showed my new group membership (both are login versions of respective commands), I thought it would work - but it didn't. Neither running terminal session with login `gksu` appears with expected result, nor does the Wireshark work (not surprising). It doesn't seem to preserve the parent groups, because it shows the same (old) result after using `newgrp`. What happened and why is that so?


title: How can I chainload GRUB on another drive?

text: I have two pen drives. On one I have a full install of Arch GNU/Linux. This install is compatible with both EFI systems and BIOS systems; it has a GPT drive with a BIOS Compatibility Region and an EFI partition. GRUB2 is installed as an EFI application in the EFI partition, and it is also embedded into the BIOS Compatibility Region. On the second pen drive, I have an MBR and a FAT32 partition that fills the entire drive. I have a BIOS computer (an XPS 13 that came preinstalled with Windows 7) that refuses to boot the GPT drive, despite the fact that I have successfully booted using the BIOS Compatibility Region on other computers. The only explanation is that there is a bug in the computer's BIOS; therefore, I've tried updating the BIOS, to no avail. I've also set the bootable flag on the Protective MBR's GPT partition - this did nothing. I've called Dell technical support, and went through 3 departments until they eventually wanted me to pay $60 to have one of their support guys help me work around a bug in their own BIOS. I declined. Because of all this, I've decided that fixing the BIOS is a dead end. What I want to do instead is use the second pen drive to chainload the first, since if a drive has an MBR, the BIOS will boot it just fine. I don't care how this is done. It can be done using Syslinux, GRUB2, or some other specialized tool. I would prefer to not have to create another partition on the drive to house config files, but I doubt this will be possible. I've tried messing around with Syslinux's `chain32` command (IIRC, that's what it's called), but it seems like this can only do stuff on the same drive. Likewise with GRUB's `chainload +1`. I've fiddled with all this endlessly, but with no luck. I've Googled, but haven't found anything useful. So: how can I chainload a GRUB installation that resides on a separate drive?


title: Prevent dhcpcd from setting hostname

text: How to prevent dhcpcd from setting hostname got from server? Change of it breaks a lot of things (including X session). My current distribution is Gentoo, init system is systemd and dhcpcd is spawn by networkmanager.


title: How to compile LXDE on OpenIndiana - how to deal with those AM errors in lxde-common-qt?

text: OI is latest 151a7. Fresh install, total newbie, installed ss-dev, gcc-dev, sunstudio, a few other packages I thought were relevant based on what I read. Just want to compile LXDE from source because when I look at installing from components ( http://lxde.org/download ) well not all the newer QT based stuff is there plus I get errors configuring so it's not even easier. So I use http://lxde.git.sourceforge.net/git/gitweb-index.cgi instead i.e. let's start with lxde-common-qt. Clone that. autogen.sh complains automake is not there. export AUTOMAKE="automake-1.10" as trying automake+tab yields that (I know this is not the best way of doing this, but using export guarantees I don't screw up in any lasting fashion). This works, as autogen goes further. Here it starts:               + [ x != x ]     + aclocal ./autogen.sh[25]: aclocal: not found [No such file or directory]     + automake-1.10 --add-missing --copy --include-deps configure.ac: no proper invocation of AM_INIT_AUTOMAKE was found. configure.ac: You should verify that configure.ac invokes AM_INIT_AUTOMAKE, configure.ac: that aclocal.m4 is present in the top-level directory, configure.ac: and that aclocal.m4 was recently regenerated (using aclocal). configure.ac:8: installing `./install-sh' man/Makefile.am:5: ENABLE_REGENERATE_MAN does not appear in AM_CONDITIONAL     + autoconf configure.ac:3: error: possibly undefined macro: AM_INIT_AUTOMAKE           If this token and others are legitimate, please use m4_pattern_allow.           See the Autoconf documentation. configure.ac:40: error: possibly undefined macro: AM_CONDITIONAL     + rm -rf autom4te.cache      * * * So let's take a look at configure.ac:               C_PREREQ([2.57])     AC_INIT(lxde-common-qt,[0.5.5], [],lxde-common-qt)     AM_INIT_AUTOMAKE()     dnl  AC_PROG_INTLTOOL(, [no-xml])     dnl AM_MAINTAINER_MODE          Checks for programs. AC_PROG_INSTALL AC_PROG_LN_S          AC_ARG_ENABLE(man,            [AC_HELP_STRING([--enable-man],                    [regenerate roff man pages from Docbook @<:@default=no@:>@])],            [enable_man="${enableval}"],            [enable_man=no] )  xsessions data of path for GDM AC_ARG_WITH([xsession-path],         AS_HELP_STRING(             [--with-xsession-path=PATH],             [set the install path of xsession data [[DATAROOTDIR/xsessions]]]),             [test x$withval != x && xsesspath="$withval"],             [xsesspath="\${datarootdir}/xsessions"]) AC_SUBST(xsesspath)               if test x"$enable_man" = x"yes"; then         AC_PATH_PROG([XSLTPROC], [xsltproc])         if test -z "$XSLTPROC"; then             enable_man=no         fi              dnl check for DocBook DTD and stylesheets in the local catalog.         JH_CHECK_XML_CATALOG([-//OASIS//DTD DocBook XML V4.1.2//EN],             [DocBook XML DTD V4.1.2], [], enable_man=no)         JH_CHECK_XML_CATALOG([http://docbook.sourceforge.net/release     /xsl/current/manpages/docbook.xsl],             [DocBook XSL Stylesheets >= 1.70.1], [], enable_man=no) fi          AM_CONDITIONAL(ENABLE_REGENERATE_MAN, test "x$enable_man" != "xno")          AC_OUTPUT([   Makefile   startlxde-qt   lxde-logout-qt   LXDE-Qt.desktop   lxde-logout-qt.desktop   lxpanel/panel   openbox/rc.xml   man/Makefile ])          if test x"$sysconfdir" != x'/etc'; then         echo         echo         echo 'Error: sysconfdir is not /etc.'         echo 'Please consider passing --sysconfdir=/etc to configure.';         echo 'Otherwise default config files will be installed to wrong place.'         echo         echo fi      * * * Sure I see AM_INIT_AUTOMAKE is empty, so I tried putting all sorts of variations of "[lxde-common-qt 0.5.5]" but not success... I mean no, nothing has ever been compiled on this and I don't have much experience. Usually I'll try to install missing packages, use export a bit for obvious things, but those automake errors... what is that. There's no aclocal.m4 file in the project folder:               AUTHORS     lxde-logout-qt.desktop.in      autogen.shlxde-logout-qt.in     autostart     LXDE-Qt.desktop.in     ChangeLog     lxpanel config.h.in     Makefile.am configure     man configure.ac     NEWS     COPYING     openbox     desktop.conf     cmanfm-qt     imagesREADME     INSTALL     startlxde-qt.in     install-sh     wallpapers      Do I need to use something like a *m4_pattern_allow([^m4_cv_])* entry in the configure.ac file?


title: Which set of commands will limit the outgoing data rate to X kbps for traffic to or from port Y?

text: I have a Raspberry Pi, and I'd like to have bitcoind running on it. This consumes a lot of my outgoing bandwidth at times, so I'd like to make sure it never uses more than 20 KB/s for Bitcoin data. The Bitcoin protocol uses port 8333 for connections, so I figure it should be possible to identify connections easily by just looking at if either the source or destination port equals 8333. On Linux, which set of commands will make sure that data to and from port 8333 will not exceed 20 KB/s?


title: How to disable receive email at dns level?

text: I'm completely new to DNS and how it work. Lately I've been getting mail spammed like crazy on one of my domain. I'm not using any mail for this domain and don't need it. I don't want to stop it just locally, is there a way to edit DNS so that this domain won't even receive any email whatsoever? Thanks in advance.


title: reliable return code of background process

text: Let's assume the following piece of bash code:               foo > logfile 2>&1 &     foo_pid=$!          while ps -p$foo_pid     do         ping -c 1 localhost     done          wait $foo_pid          if [[ $? == 0 ]]     then         echo "foo success"     fi      Is it safe to assume that `$?` indeed contains the return code of `foo` and not the return code of `ping`? If the answer to that question is: "You cannot assume that." then how can I modify this piece of code to be sure that `$?` always contains the return code of `foo`?


title: Command substitution vs I/O Redirection?

text: I am wondered about differences between **I/O Redirection** and **Command substitution**? For example when I want to redirect `which` command output to `cd` command (I know that it's not a directory) then the `cd` command do not use `which` redirection.   For example `which w3af | cd`? I have to use command substitution like `cd $( which w3af )`, why?