title: How to block loading kernel module only in single user boot when blacklist fails?

text: On a "Linux debian 2.6.32-5-amd64 #1 SMP" installation where loading a kernel module (mpt2sas) is desired to be delayed to be loaded after starting sshd and users can remotely login, the mpt2sas module was disabled from loading in single user boot, by:               $ echo 'blacklist mpt2sas' >> /etc/modprobe.d/mpt2sas.conf; depmod -aeF /boot/System.map-2.6.32-5-amd64; update-initramfs -u -k $(uname -r)      Later on a `modeprobe -v mpt2sas` will be run in /etc/rc.local. **After installing a newer mpt2sas driver** , using `dpkg -i mpt2sas-15.00.00.00-3_Debian6.0.5.amd64.deb` the result is that the old driver is renamed from `/lib/modules/2.6.32-5-amd64/kernel/drivers/scsi/mpt2sas/mpt2sas.ko` to `/lib/modules/2.6.32-5-amd64/kernel/drivers/scsi/mpt2sas/mpt2sas.ko.orig` and the new driver is installed at `/lib/modules/2.6.32-5-amd64/weak- updates/mpt2sas/mpt2sas.ko`. The side effect is that the line **blacklist mpt2sas** in `/etc/modprobe.d/mpt2sas.conf` **no longer has any effect** , when modules are loaded in the single user boot process, mpt2sas is loaded as first kernel module. Regression:   * I know that /etc/modprobe.d/mpt2sas.conf is still being loaded, because when entering a faulty line in this file, a warning is display at console during boot (4 times).   * Running `depmod -aeF /boot/System.map-2.6.32-5-amd64; update-initramfs -u -k -t $(uname -r); reboot` doesn't improve.   * Adding kernel boot parameter `modprobe.blacklist=mpt2sas` doesn't improve. How can I block loading the new mpt2sas kernel module during the single user boot phase? (I still want to load mpt2sas using `modprobe` in /etc/rc.local).


title: Linux OS running a single application

text: I want to build a Linux based OS which is custom made for only one application and is totally light-weight and uses minimum system resources. How do I go about this? Would stripping down an already existing OS such as Ubuntu be a good idea?


title: Difference between initramfs.cpio and rootfs.cpio

text: What are the differnces between the two? Can I just use initramfs.cpio or do I need to use both? Actually my rootfs.cpio file is 7 Mb and initramfs.cpio is just 0.5mb, so I was thinking if I can use initramfs.cpio only or not


title: How to detect aspect ratio of monitor?

text: How do you detect the `aspect ratio` of your monitor? I tried:               root@malou-laptop:/home/liv# xrandr -q     xrandr: Failed to get size of gamma for output default     Screen 0: minimum 640 x 480, current 1680 x 1050, maximum 1680 x 1050     default connected 1680x1050+0+0 0mm x 0mm        1680x1050      60.0*         1280x1024      61.0          1280x800        0.0          1024x768       61.0          800x600        61.0          640x480        60.0        And figured out that you can compute it by `1680:1050 = 1.6 = 16:10`, or by checking the Display resolution list on Wikipedia. But is there a command that nicely outputs this? I already tried `lshw` and `hardinfo`, with no luck.


title: Why do some commands 'hang' the terminal until they've finished?

text: Sometimes you run a program from the terminal, say, `lxpanel`†. The terminal won't drop you back to the prompt, it'll hang. You can press `Ctrl`+`C` to get back to the prompt, but that will kill `lxpanel`. However, pressing `Alt`+`F2` (which pops up a window to take a command) and running `lxpanel` works gracefully. Why is this? What is different between running a command from the terminal and from the 'run' window that appears when you press `Alt`+`F2`? † lxpanel here was just used as an example. I have experienced this with multiple programs


title: Making sense of auth log

text: I am seeing some log enties that look like hacking attempts **Type 1**               Dec 26 03:09:01 ... CRON[9271]: pam_unix(cron:session): session closed for user root     Dec 26 03:17:01 ... CRON[9308]: pam_unix(cron:session): session opened for user root by (uid=0)      **Type 2**               Dec 26 03:27:11 ... sshd[9364]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=60.217.235.5  user=root     Dec 26 03:27:12 ... sshd[9364]: Failed password for root from 60.217.235.5 port 47933 ssh2      What does these mean? They usually come in 5's. I enabled `ufw limit ssh`. So I think UFW is trottling this. But wonder why are there 2 kinds, 1 authentication failure, 1 session closed. I suppose I should respond to this by using `denyhosts`, changing ssh port & disable root login? What else can I do? Last time I used deny hosts, it blocked me too ... Also can I increase the UFW retry time? Like only allow login 1hour later? Perhaps reduce the login attempts to 3?


title: audacius warning

text: After               audacious -p song.mp3       I got the following: > ** WARNING ** > > Audacious has detected that your ALSA device has a broken timer. A > workaround is being used to prevent CPU overload. Please report this problem > to your Linux distributor or to the ALSA developers. Is it important? How to solve it? I'm using **Audacious 2.4.4 (Ubuntu package)** with               Linux vaio 3.0.0-16-generic-pae #28-Ubuntu SMP Fri Jan 27 19:24:01 UTC 2012 i686 i686 i386 GNU/Linux


title: Good practice to use same SSH keypair on multiple machines?

text: I recently got a new laptop for work, and I was wondering whether it'd be good practice to keep using the same RSA keypair as I'm using on my old work laptop. I'd really like to not have to create another keypair to keep track of. Is this, generally speaking, an acceptable practice? Since the keypair does have a passphrase, it should be fairly secure, as long as my physical machines are secure, right?


title: Fedora 20 consistent old style (ethx) interface names

text: New Dell Latitude laptop with Fedora 20. One built-in Ethernet interface, one add-in ExpressCard Ethernet interface. I can't seem to get consistent old- style (ethx) interface names. I've toyed with adding biosdevname=0 and net.ifnames=0 to grub.cfg, creating /etc/udev/rules.d/70-persistent-net.rules, copying /lib/udev/rules.d/71-biosdevname.rules to /etc/udev/rules.d and uncommenting the branch command, removing the biosdevname RPM package, and creating /etc/modules-load.d/ethernet_drivers.conf with the necessary drivers listed in the right order. No combination seems to get the right result. If the add-in card is not present, it seems fairly easy to get the built-in port named eth0 as I want. But when the add-in card is present, the best I've been able to get is for it to be named eth0 and the built-in port named eth1. Of course, that is backward and inconsistent. Here is a summary of my results. Removing the biosdevname package did not change these results.               grub2          udev  udev  add-in   Ethernet  Ethernet     biosdevname=0  70    71    present  built-in  add-on       net.ifnames=0     =============  ====  ====  =======  ========  ========     no             no    mod   no       enp12s0   --     no             no    mod   yes      enp12s0   ens1     no             no    no    no       enp12s0   --     no             no    no    yes      enp12s0   ens1     no             yes   mod   no       enp12s0   --     no             yes   mod   yes      eth0      ens1     no             yes   no    no       enp12s0   --     no             yes   no    yes      eth0      ens1     yes            no    mod   no       eth0      --     yes            no    mod   yes      eth1      eth0     yes            no    no    no       eth0      --     yes            no    no    yes      eth1      eth0     yes            yes   mod   no       eth0      --     yes            yes   mod   yes      eth1      eth0     yes            yes   no    no       eth0      --     yes            yes   no    yes      eth1      eth0      Here's the content of /etc/udev/rules.d/70-persistent-net.rules (just two lines).               SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="ec:f4:bb:02:44:7a", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"     SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:13:3b:00:73:cb", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"      Here's the content of /etc/modules-load.d/ethernet_drivers.conf (just two lines).               tg3     r8169      And here's the content of /etc/sysconfig/network-scripts/ifcfg-eth?.               TYPE="Ethernet"     BOOTPROTO="dhcp"     DEFROUTE="yes"     IPV4_FAILURE_FATAL="no"     IPV6INIT="yes"     IPV6_AUTOCONF="yes"     IPV6_DEFROUTE="yes"     IPV6_PEERDNS="yes"     IPV6_PEERROUTES="yes"     IPV6_FAILURE_FATAL="no"     NAME="eth0"     UUID="cda65a57-3f30-444d-b041-2e77c056a1b1"     ONBOOT="yes"     HWADDR="EC:F4:BB:02:44:7A"     PEERDNS="yes"     PEERROUTES="yes"          TYPE=Ethernet     BOOTPROTO=dhcp     DEFROUTE=yes     IPV4_FAILURE_FATAL=no     IPV6INIT=yes     IPV6_AUTOCONF=yes     IPV6_DEFROUTE=yes     IPV6_PEERDNS=yes     IPV6_PEERROUTES=yes     IPV6_FAILURE_FATAL=no     NAME="eth1"     UUID=722a5c3b-b6e5-44a8-93fa-e0f070059d8c     ONBOOT=no     HWADDR=00:13:3B:00:73:CB     PEERDNS=yes     PEERROUTES=yes      Syslog seems to show that the drivers are loaded in the correct sequence. There are also some interface renaming messages. So what's the right way to accomplish my objective?


title: FreeBSD 10 trace disk activity

text: Is there any way to find some process which is periodically writing to disk (according to hdd led) on FreeBSD 10 with ZFS (maybe turn ZFS into verbose logging mode)? `lsof` and other instantly aggregating statistics utilities seems not able to catch anything due to a short time of a moment of a disk access.


title: Can you explain the entropy estimate used in random.c

text: `/dev/random` uses the timings of kernel interupts to add to the entropy pool. The amount of entropy in the pool is tracked in a variable named `entropy_count`. Here is the relevant snippet of code from `random.c`. It represents the time (in jiffies I think) between the last two interupts in variable `delta` and the differences in deltas as `delta2`.               delta = time - state->last_time;     state->last_time = time;          delta2 = delta - state->last_delta;     state->last_delta = delta;          if (delta < 0) delta = -delta;     if (delta2 < 0) delta2 = -delta2;     delta = MIN(delta, delta2) >> 1;     for (nbits = 0; delta; nbits++)       delta >>= 1;          r->entropy_count += nbits;          /* Prevent overflow */     if (r->entropy_count > POOLBITS)       r->entropy_count = POOLBITS;      It looks like the estimate of the entropy added is essentially the floor (not ceil because of the initial bitshift before the loop) of base 2 logarithm of delta. This makes some intuitive sense, though I'm not sure what assumptions would be needed to make this formally correct. So, my first question is _"what is the reasoning behind this estimate?"_ My second question is about `delta = MIN(delta, delta2) ...`. What does this do? Why take the minimum of this delta and the last one? I don't know what this is supposed to achieve - perhaps it makes the estimate better, maybe just more conservative. **Edit:** I've found a paper that specifies the estimate, but it doesn't really give a reasoned argument for it (though it does outline some informal conditions that the estimator should meet). Other resources that have come up in the comments:   * Wikipedia on `/dev/random` and `/dev/urandom`   * A paper that tries to explain it (I'm skeptical about it, see comments)   * A blog post about `/dev/random` with comments from the guy who wrote the code above.   * A secutity.SE answer about the `/dev/random` entropy pool.


title: Using vlock without changing VT from X

text: X screen lockers are fine, but I sometimes have stuff open on other TTYs that I want to lock as well. For this reason I would like to use `vlock -a` to lock all TTYs at the same time. However, I am typically in an X session when I want to run this command. `vlock` cannot be run from within X because it complains that the current terminal is not a virtual console. I tried to make some solution with `chvt` but I don't know how to run the command in that console afterwards. How can I lock all TTYs without exiting X (preferably using `vlock`, but I'm open to other suggestions)?


title: Should the "laptop" option be selected for netbooks when installing Debian?

text: When installing Debian on an Eee PC netbook, the "Software selection" screen shows "Desktop environment" is selected by default, but not "Laptop". ![enter image description here](http://i.stack.imgur.com/wTTzA.png) As laptops are similar to netbooks, should I select "laptop" when installing Debian?


title: Automatically update GCC to a later release without upgrading distribution

text: My understanding is that C++11 support in G++ 4.7.2 wasn't great (it gives me a warning everytime I try to compile my C++ code, presumably there are good reasons for these warnings), so thought I would try to update to something newer. I don't have a lot of download quota so I really want to limit the amount I download, so I definitely don't want to upgrade Debian stable (Wheezy) or upgrade `build-essentials` unless I really need to. Is there a simple command I can use to `apt-get` the latest GCC release (or any with full C++11 support) without doing anything screwy to my aptitude repos? I would prefer it if the answer came in the form of a command I can run that will overwrite any existing install, as I'm still struggling with the whole Linux install process.


title: Which user owns X display?

text: How to determine, as root, which user owns X display :0? (on a Fedora 18 system with defaults)


title: What live distribution is well-suited for presentations?

text: My students often use the classroom projector screen to give presentations, usually using PowerPoint, but sometimes they show pre-recorded presentations in SMPlayer. The classroom computer is sufficiently powerful, but as it uses Windows, we ran into many problems which wastes class time. Windows simply has too many problems recognizing USBs, handling viruses, displaying multimedia inside PowerPoint slides, and opening the PowerPoint files created with different versions of PowerPoint. I never have these issues on my Linux desktop computer, so I think if I ran a live Linux distribution from CD or DVD, the students could give their presentations without a glitch. Is there any live distribution specifically designed or well-suited for presentations? This would, minimally, need to include:   * Adobe Acrobat (for PDFs)   * LibreOffice of similar software (for PPTs, PPTXs)   * Music/video playback software (for as many formats as possible)   * Web browser, with Flash plugin


title: Which network services depend on the "accept related input" iptables rule?

text: **Background** I am setting up a firewall for a webserver and was wondering if it would be a good security meassure to even reject RELATED input traffic and only except established connections by default. **In practise** For example using               iptables -A INPUT -m state --state ESTABLISHED -j ACCEPT      instead of the common               iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT      since this should be more secure according to my understanding. **Question** Are there any problems with that? I know HTTP should be fine with it, and FTP which would have a problem could either have it's own rule with additional RELATED option, or (like in my case) might not be necessary at all. But are there any other typical webserver services that might break because of that? Otherwise I like going with the more secure/narrower ruleset.


title: Richacl invalid argument when trying to set atributes

text: I've compiled a kernel to use richacls, and compiled the richacl's utility, (but not the `e2fsprogs`). I've mounted a loop file with richacl flags               /root/fs_prueba_10mb on /media/ext4_con_richacl type ext4 (rw,loop=/dev/loop0,richacl,user_xattr)      There is no problem when I do:               # richacl --get file     file:         owner@:rwp---A--Co--::allow      everyone@:r------------::allow      but if I try change the attributes:               # richacl --modify facevedo:rwpCo::allow file      file: Invalid argument      I'm using a 64-bit system, I've linked `/usr/lib64/librichacl.so.1` -> `/usr/lib/librichacl.so.1`. What am I doing wrong?


title: Unable to log in. xsession-errors file error

text: I screwed up my directory. I know I did it but don't know how to fix it. Apparently I was trying to add a new line to the `~/.profile`, after using gedit text editor to open it, I added a few lines. Now I can not log in; I get a black screen with the errors below. I want to correct it. Right now I am logged on and can see all my files from a second partition I created and added UBUNTU to. Can the mending be done from the UBUNTU? and what line will I need to correct it? Thanks in advance. Just to drop this, I have tried using the `/usr/bin/nano/etc/profile` and it didn't work.               /etc/mdm/Xsession: Beginning session setup...     /etc/mdm/Xsession: 1: /etc/profile: id: not found     /etc/mdm/Xsession: 12: [: Illegal number:      /etc/mdm/Xsession: Executing default failed, will try to run x-terminal-emulator     /etc/mdm/Xsession: 205: exec: x-terminal-emulator: not found


title: Missing source ~/.bashrc Mac terminal : ~/.profile?

text: I need to install Gerris on mac 10.9.1. The website http://gfs.sourceforge.net/wiki/index.php/Mac_OSX_Installation says:               Note: make sure that the file ~/.profile contains the line source ~/.bashrc     for these changes to be taken into account.      But there is no source `~/.bashrc` as shown below:               GNU nano 2.0.6        File: /Users/samirebalta/.profile                                      # MacPorts Installer addition on 2014-01-21_at_11:48:31: adding an appropriate $     export PATH=/opt/local/bin:/opt/local/sbin:$PATH     # Finished adapting your PATH environment variable for use with MacPorts.               ##     # Your previous /Users/samirebalta/.profile file was backed up as /Users/samire$     ##          # MacPorts Installer addition on 2014-01-21_at_12:00:12: adding an appropriate $     export PATH=/opt/local/bin:/opt/local/sbin:$PATH     # Finished adapting your PATH environment variable for use with MacPorts.               ##     # Your previous /Users/samirebalta/.profile file was backed up as /Users/samire$     ##source ~/.bashrc                                         [ Read 23 lines ]     ^G Get Help  ^O WriteOut  ^R Read File ^Y Prev Page ^K Cut Text  ^C Cur Pos     ^X Exit      ^J Justify   ^W Where Is  ^V Next Page ^U UnCut Text^T To Spell


title: Tar actions not working as intended

text: I have a huge uncompressed tar file (1 tb) and I want to check it, therefore I am trying to extract it to see if everything goes well. Since it is going to take a long time, I'd like to have some info printed on screen while extracting. Too bad the checkpoint actions suggested here don't work as intended. If try this command:               tar -xf big_fat_backup.tar --checkpoint=10000 --checkpoint-action=ttyout='%{%Y-%m-%d %H:%M:%S}t (%d sec): #%u, %T%*\r'      The meta characters in the string are not expanded (except for the %u), and I have the following output:               %{%Y-%m-%d %H:%M:%S}t (%d sec): #10000, %T%*      I simply copied from the manual, so what am I doing wrong? Bonus question: If I create the archive with the -W switch and no errors are printed, should I be sure that the archive was written correctly?


title: How can I check the condition of an SD card?

text: How can I check the health condition of an SD card? When I want to check a hard drive, I can use SMART, how should I check an SD card? Is there a universal approach?


title: Can LXC be used to jail instances of an installed browser?

text: Is it possible to use LXC on a desktop system to confine browsers and other pieces of software that have in the past been shown to be prone to certain kinds of exploits. So what I want to achieve is to jail, say Firefox, be still able to view its windows etc and yet be sure it only has read and write access to anything "inside the bubble", but not the host system. The example `lxc-sshd` container in LXC suggests something like this should be possible (app-level containers), but I have only seen this for program that require a TTY at most. Can this work also under KDE, GNOME, Unity ...?


title: PGP words of an RSA fingerprint

text: Is there a program that displays my SSH RSA key fingerprint > 43:51:43:a1:b5:fc:8b:b7:0a:3a:a9:b1:0f:66:73:a8 as PGP words? * * * **Added on 16th October 2012:** I decided to write my own code. I found pgp words from Wikipedia. However, I find some word capitalized while others not. Is this a typo, or are they to be used as is?


title: Opening files from Ubuntu server over ssh from Mac Terminal

text: So I SSH into a Ubuntu server and try to open the file in a Mac program (Coda) and get an error:               Couldn't get a file descriptor referring to the console      Using the command               open myfile.html      This works in a Mac terminal. I hope there are common Unix commands that provide a way to bridge this so I can open directly and edit/save in the editor of my choice on the Mac.


title: What could be the use case of changing modified time of a file to the future?

text: I was reading through the `man` page of `ls` on UNIX, specifically OS X Mavericks. This got me intrigued: > If the modification time of the file is more than 6 months in the past or > future, then the year of the last modification is displayed in place of the > hour and minute fields. Why would someone set the modification time to the future?


title: Adding supllimentary group so that user can have access

text: I am using opensuse. I have created a directory projects under /srv and set its permissions to 770 and `chown -R wwwrun:developer /srv/projects/`   I have used   `usermod -a -G developer username`   but I can't access that directory, I always get permission denied entry.   I want to clone a git repo in projects so that only apache and group of developer able to rwx it.


title: Is it possible to customise the prompt to show the if there are any background jobs?

text: Is it possible to customise the bash prompt to show the if there are any background jobs? I find it easy to forget that there are background jobs. Say if the prompt was...               $      Is there a way to make it show the number of background jobs? For example, if there were two background jobs sent to the background using `CTRL+Z`, the prompt would be...               2 $


title: Connect from Windows 8 from home network to office Linux server

text: My client's office has a Linux server. Whilst I am in the client's office, I am able to connect to their Linux server from my Windows 8 laptop using PuTTY with their wifi connection. I wonder is it possible when I am working from home, would I be able to connect to the client Linux server using my wifi connection? My client does not have a VPN facility to provide me. I have to travel a long distance to work with my client.


title: Unexpectedly lost speaker output. Headphone output works fine

text: Yesterday when I opened my laptop I noticed that I no longer had sound from the built-in speakers. I carefully checked settings in Sound Preferences, and then dropped to shell and looked in alsamixer. Nothing is showing muted or 0/no volume. Everything is on and set to max volume. The profile is Analog Stereo Duplex, the default. Sound works fine when using headphones. I compared my alsa conf files with samples from known good systems and am not finding any difference. I'm runnning out of ideas and even updated my kernel to 3.8.8 in hopes that would shake this loose. No dice there, so I purged that and am back to the factory kernel 3.5.0. Here are my current specs:               RELEASE=14     CODENAME=nadia     EDITION="MATE 64-bit"     DESCRIPTION="Linux Mint 14 Nadia"     DESKTOP=MATE     TOOLKIT=GTK      lspci: > 00:1b.0 Audio device: Intel Corporation 7 Series/C210 Series Chipset Family > High Definition Audio Controller (rev 04) cat /proc/asound/card0/codec#* | grep Codec               Codec: IDT 92HD91BXX     Codec: Intel PantherPoint HDMI     astembridge-Inspiron-5720      aplay -l               **** List of PLAYBACK Hardware Devices ****     card 0: PCH [HDA Intel PCH], device 0: STAC92xx Analog [STAC92xx Analog]       Subdevices: 1/1       Subdevice #0: subdevice #0     card 0: PCH [HDA Intel PCH], device 3: HDMI 0 [HDMI 0]       Subdevices: 0/1       Subdevice #0: subdevice #0      Alsamixer screengrab: ![enter image description here](http://i.stack.imgur.com/zmQ2C.png) If I need to post more here please indicate in a comment. EDIT: The laptop itself is less than a month old and never dropped or otherwise mistreated. It is a Dell Inspiron 17R - 5720.


title: PPTP ping client to client error

text: I installed pptp server on a centos 6 64bit server   * PPTP Server ip : 55.66.77.10   * PPTP Local ip : 10.0.0.1   * Client1 IP : 10.0.0.60 centos 5 64bit   * Client2 IP : 10.0.0.61 centos5 64bit PPTP Server can ping Client1 And client 1 can ping PPTP Server PPTP Server can ping Client2 And client 2 can ping PPTP Server **The problem is client 1 can not ping Client 2** and i get this error also on PPTP server error log `Cannot determine Ethernet address for proxy ARP` Ping from Client2 to Client1               PING 10.0.0.60 (10.0.0.60) 56(84) bytes of data.     --- 10.0.0.60 ping statistics ---     6 packets transmitted, 0 received, 100% packet loss, time 5000ms      `route -n` on PPTP Server               Destination     Gateway         Genmask         Flags Metric Ref    Use Iface     10.0.0.60       0.0.0.0         255.255.255.255 UH    0      0        0 ppp0     10.0.0.61       0.0.0.0         255.255.255.255 UH    0      0        0 ppp1     55.66.77.10     0.0.0.0         255.255.255.248 U     0      0        0 eth0     10.0.0.0        0.0.0.0         255.0.0.0       U     0      0        0 eth0     0.0.0.0         55.66.77.19     0.0.0.0         UG    0      0        0 eth0      `route -n` On Client 1               Destination     Gateway         Genmask         Flags Metric Ref    Use Iface     10.0.0.1        0.0.0.0        255.255.255.255 UH    0      0        0 ppp0     55.66.77.10     70.14.13.19    255.255.255.255 UGH   0      0        0 eth0     10.0.0.0        0.0.0.0        255.0.0.0       U     0      0        0 eth1     0.0.0.0         70.14.13.19    0.0.0.0         UG    0      0        0 eth0      `route -n` On Client 2               Destination     Gateway         Genmask         Flags Metric Ref    Use Iface     10.0.0.1        0.0.0.0         255.255.255.255 UH    0      0        0 ppp0     55.66.77.10     84.56.120.60    255.255.255.255 UGH   0      0        0 eth1     10.0.0.0        0.0.0.0         255.0.0.0       U     0      0        0 eth0     0.0.0.0         84.56.120.60    0.0.0.0         UG    0      0        0 eth1      `cat /etc/ppp/options.pptpd` on PPTP server               ###############################################################################     # $Id: options.pptpd,v 1.11 2005/12/29 01:21:09 quozl Exp $     #     # Sample Poptop PPP options file /etc/ppp/options.pptpd     # Options used by PPP when a connection arrives from a client.     # This file is pointed to by /etc/pptpd.conf option keyword.     # Changes are effective on the next connection.  See "man pppd".     #     # You are expected to change this file to suit your system.  As     # packaged, it requires PPP 2.4.2 and the kernel MPPE module.     ###############################################################################               # Authentication          # Name of the local system for authentication purposes      # (must match the second field in /etc/ppp/chap-secrets entries)     name pptpd          # Strip the domain prefix from the username before authentication.     # (applies if you use pppd with chapms-strip-domain patch)     #chapms-strip-domain               # Encryption     # (There have been multiple versions of PPP with encryption support,     # choose with of the following sections you will use.)               # BSD licensed ppp-2.4.2 upstream with MPPE only, kernel module ppp_mppe.o     # {{{     refuse-pap     refuse-chap     refuse-mschap     # Require the peer to authenticate itself using MS-CHAPv2 [Microsoft     # Challenge Handshake Authentication Protocol, Version 2] authentication.     require-mschap-v2     # Require MPPE 128-bit encryption     # (note that MPPE requires the use of MSCHAP-V2 during authentication)     require-mppe-128     # }}}               # OpenSSL licensed ppp-2.4.1 fork with MPPE only, kernel module mppe.o     # {{{     #-chap     #-chapms     # Require the peer to authenticate itself using MS-CHAPv2 [Microsoft     # Challenge Handshake Authentication Protocol, Version 2] authentication.     #+chapms-v2     # Require MPPE encryption     # (note that MPPE requires the use of MSCHAP-V2 during authentication)     #mppe-40    # enable either 40-bit or 128-bit, not both     #mppe-128     #mppe-stateless     # }}}               # Network and Routing          # If pppd is acting as a server for Microsoft Windows clients, this     # option allows pppd to supply one or two DNS (Domain Name Server)     # addresses to the clients.  The first instance of this option     # specifies the primary DNS address; the second instance (if given)     # specifies the secondary DNS address.     #ms-dns 10.0.0.1     #ms-dns 10.0.0.2          # If pppd is acting as a server for Microsoft Windows or "Samba"     # clients, this option allows pppd to supply one or two WINS (Windows     # Internet Name Services) server addresses to the clients.  The first     # instance of this option specifies the primary WINS address; the     # second instance (if given) specifies the secondary WINS address.     #ms-wins 10.0.0.3     #ms-wins 10.0.0.4          # Add an entry to this system's ARP [Address Resolution Protocol]     # table with the IP address of the peer and the Ethernet address of this     # system.  This will have the effect of making the peer appear to other     # systems to be on the local ethernet.     # (you do not need this if your PPTP server is responsible for routing     # packets to the clients -- James Cameron)     proxyarp          # Normally pptpd passes the IP address to pppd, but if pptpd has been     # given the delegate option in pptpd.conf or the --delegate command line     # option, then pppd will use chap-secrets or radius to allocate the     # client IP address.  The default local IP address used at the server     # end is often the same as the address of the server.  To override this,     # specify the local IP address here.     # (you must not use this unless you have used the delegate option)     #10.8.0.100               # Logging          # Enable connection debugging facilities.     # (see your syslog configuration for where pppd sends to)     debug          # Print out all the option values which have been set.     # (often requested by mailing list to verify options)     #dump               # Miscellaneous          # Create a UUCP-style lock file for the pseudo-tty to ensure exclusive     # access.     lock          # Disable BSD-Compress compression     nobsdcomp           # Disable Van Jacobson compression      # (needed on some networks with Windows 9x/ME/XP clients, see posting to     # poptop-server on 14th April 2005 by Pawel Pokrywka and followups,     # http://marc.theaimsgroup.com/?t=111343175400006&r=1&w=2 )     novj     novjccomp          # turn off logging to stderr, since this may be redirected to pptpd,      # which may trigger a loopback     nologfd          # put plugins here      # (putting them higher up may cause them to sent messages to the pty)      `cat /etc/ppp/options.pptp` on Client1 and Client2               ###############################################################################     # $Id: options.pptp,v 1.3 2006/03/26 23:11:05 quozl Exp $     #     # Sample PPTP PPP options file /etc/ppp/options.pptp     # Options used by PPP when a connection is made by a PPTP client.     # This file can be referred to by an /etc/ppp/peers file for the tunnel.     # Changes are effective on the next connection.  See "man pppd".     #     # You are expected to change this file to suit your system.  As     # packaged, it requires PPP 2.4.2 or later from http://ppp.samba.org/     # and the kernel MPPE module available from the CVS repository also on     # http://ppp.samba.org/, which is packaged for DKMS as kernel_ppp_mppe.     ###############################################################################          # Lock the port     lock          # Authentication     # We don't need the tunnel server to authenticate itself     noauth          # We won't do PAP, EAP, CHAP, or MSCHAP, but we will accept MSCHAP-V2     # (you may need to remove these refusals if the server is not using MPPE)     refuse-pap     refuse-eap     refuse-chap     refuse-mschap          # Compression     # Turn off compression protocols we know won't be used     nobsdcomp     nodeflate          # Encryption     # (There have been multiple versions of PPP with encryption support,     # choose which of the following sections you will use.  Note that MPPE     # requires the use of MSCHAP-V2 during authentication)     #     # Note that using PPTP with MPPE and MSCHAP-V2 should be considered     # insecure:     # http://marc.info/?l=pptpclient-devel&m=134372640219039&w=2     # https://github.com/moxie0/chapcrack/blob/master/README.md     # http://technet.microsoft.com/en-us/security/advisory/2743314          # http://ppp.samba.org/ the PPP project version of PPP by Paul Mackarras     # ppp-2.4.2 or later with MPPE only, kernel module ppp_mppe.o     # If the kernel is booted in FIPS mode (fips=1), the ppp_mppe.ko module     # is not allowed and PPTP-MPPE is not available.     # {{{     # Require MPPE 128-bit encryption     #require-mppe-128     # }}}          # http://mppe-mppc.alphacron.de/ fork from PPP project by Jan Dubiec     # ppp-2.4.2 or later with MPPE and MPPC, kernel module ppp_mppe_mppc.o     # {{{     # Require MPPE 128-bit encryption     #mppe required,stateless     # }}}      `IPtables` is stopped on clients and server, Also `net.ipv4.ip_forward = 1` is enabled on PPTP Server. How can I solve this problem?


title: How can I prevent 'grep' from showing up in ps results?

text: When I search for some process that doesn't exist, e.g.               $ ps aux | grep fnord                               wayne    15745  0.0  0.0  13580   928 pts/6    S+   03:58   0:00 grep fnord      Obviously I don't care about grep - that makes as much sense as searching for the `ps` process! How can I prevent grep from showing up in the results?


title: Computing the visible area of a partly hidden window

text: I have to (scriptly) take screenshots of windows, some of which may be partially or fully hidden by other windows. Of course, in such a case the screenshot is useless, and I'd rather print a warning. Unfortunately I'm not in a situation where I can use a Window Manager which prints even hidden or minimized windows — I'm stuck with an old KDE. I can use e.g. `xwininfo -id <windowid> | grep "Map State"` to determine if the window `IsViewable` (which basically means standard screenshot tools won't complain), but I can't seem to figure out how to determine if the window is overlapped by other windows and how much it is (then I could print the warning if, say, less than 50 % of the window are visible). (As I'm actually trying to workaround it because I don't believe it exists, of course I won't complain if anyone points me to an easy method to e.g. "virtually redraw" windows so that the screenshot is worth it…)


title: How can I use ForwardAgent with keychain, or detect a new login?

text: My scenario: I have `Server A` at home, and `Server B` at my parents house. I also have `Laptop A` and `Laptop B` at home. I do all sorts of strange ssh hops - I might connect `Laptop A -> Server A -> Server B`. Or `Laptop B -> Server A -> Laptop A`. Or `Server A -> Server B` I've got keychain set up on all of these machines, and like a good security- conscious geek, I have               eval `keychain --clear`      in my `.zlogin` file. My problem is that even though I unlock my keys on `Laptop A`, once I've connected to `Server A` it tries to use the keychain/ssh-agent on Server A, so I have to unlock _those_ keys, too. I've got `ForwardAgent` setup on all of these machines as well. What I would prefer to happen is something like this:   * Login to `Laptop A`   * Unlock `Laptop A` keys   * ssh to `Server A`   * ssh to `Server B` - using keys from `Laptop A`. How can I do this?


I want Print nth line before the matched line, Matching line and nth line from the matched line where "n" is greater than 2. _Here's an example of my data file (the line numbers below are not part of the data and just for identification), The pattern that I am searching for is "blah", in the`example.txt` file._               $ cat example.txt       1. a      2. b      3. c      4. d      5. blah      6. e      7. f      8. g      9. h      10. blah      11. i      12. f      13. g      14. h      And I want the Output as:                1. b      2. blah      3. g      4. f      5. blah      6. g      Please suggest any one liner!


title: Is there a way to monitor progress of a btrfs rebalance?

text: I'm replacing a failed harddrive in a mirrored btrfs. `btrfs device delete missing /[mountpoint]` is taking _very_ long, so I assume that it's actually rebalancing data across to the replacement drive. Is there any way to monitor the progress of such an operation? I don't necessarily expect a pretty looking GUI, or even a % counter; and I'm willing to write a couple of lines of shell script if that's necessary, but I don't even know where to start looking for relevant data. `btrfs filesystem show` for example just hangs, presumably waiting for the balance operation to finish before it displays any information about the mirrored fs.


title: How can I remap the shortcut keys for scroll down/up in gnome terminal

text: According the gnome-terminal usage: > You can also scroll up or down one line at a time by pressing > Control+Shift+Up or Control+Shift+Down. In this document shows: `Control` + `Shift` + `Up` / `Down` can **scroll up** or **scroll down** the `gnome-terminal` one line. And, yes, they can! Now, I want to re-map these two shortcut keys, like: `Alt` + `J` / `K` (Vimer habit). ## My understanding Here some signal must be triggered after press `Ctrl` + `Alt` + `Up` | Down. The question is, **what signal is triggered?** * * * Here are some questions:   * `0x115` is the signal of windows scrolling. what about Linux?   * Can the scrolling be executed by command in gnome-terminal? (Some command inputted and gnome-terminal scrolling up/down) I've download the source code of Gnome-Terminal, and tried to find the answer. But my C is terrible... * * * By the way, my Linux is Ubuntu 13.10, and `gnome-terminal` is 3.6:               $ gnome-terminal --version     GNOME Terminal 3.6.1     $ lsb_release -a     No LSB modules are available.     Distributor ID: Ubuntu     Description:    Ubuntu 13.10     Release:    13.10     Codename:   saucy


title: Debian Squeeze wifi interrupted no way to re-enable

text: So I am messing around with #! Linux on my desktop I really like it as an OS and it runs flawlessly on my laptop. Desktop as long as its kernel 2.6 and lower it runs just as good. My issue being that my NIC being an Alfa awus036h will connect to the internet on #! but it wont let me surf the web I get two pages in and it pops up the "You have been disconnected" message. I go to right click on the networking icon in the tint2 Bar and I'm presented with no option to re-enable wireless. lsusb does recognizes the driver even after it shuts down. The unit itself still flickers on / off as if it still running and getting a signal. Any ideas what is going on here and how to fix it?


title: Icon themes, when is svg format helpful?

text: I found that arch provides both `oxygen-icons` and `oxygen-icons-svg`, what's the necessity of svg format? Is there something that a PNG image "can't do", maybe performance issue? Not sure about it.


title: Is the Filesystem Hierarchy Standard a UNIX standard or a GNU/Linux standard?

text: The Filesystem Hierarchy Standard says where to put stuff in a UNIX distribution. Is the FHS used/designed for use outside of GNU/Linux, or is it mostly limited to GNU/Linux?


title: Unable to stat symbolic link to file

text: **Background** I am trying to wrap my head around how html is unable to access a file via a symlink. I performed the following simple experiment to try and gain an understanding of how apache would be trying to stat/access a file pointed to via a simlink but I unable to understand why it didn't work. As the user jzhu, I have a symlink in my home directory to a directory in root called other which has the file anaconda-ks.cfg which I want to be able to stat/read in vi. However, I am getting the following results when I am running the stat command.               [jzhu@localhost ~]$ stat /home/jzhu/other/anaconda-ks.cfg     stat: cannot stat `/home/jzhu/other/anaconda-ks.cfg': Permission denied      Here is the stat command of the /home/jzhu/other symlink so you can have further clarification on how I am set up.               [jzhu@localhost ~]$ stat /home/jzhu/other       File: `/home/jzhu/other' -> `/root/other/'       Size: 12          Blocks: 0          IO Block: 4096   symbolic link     Device: fd00h/64768d    Inode: 43313       Links: 1     Access: (0777/lrwxrwxrwx)  Uid: (    0/    root)   Gid: (    0/    root)     Access: 2013-11-03 08:52:20.602126433 +0000     Modify: 2013-11-03 08:52:20.187918394 +0000     Change: 2013-11-03 08:52:20.187918394 +0000      Looking up the man page for lstat I see the following quote: > These functions return information about a file. No permissions are required > on the file itself, but — in the case of stat() and lstat() — execute > (search) permission is required on all of the directo- ries in path that > lead to the file. From my understand the stat command does not need executable permissions on /root itself because, unlike lstat, the root directory that it starts off with is the current one in which it is run which means it won't use the full path of "/root/other/" but will use the path "/home/jzhu/other/". I confirmed this via strace with the following relevant output below               lstat("/home/jzhu/other/anaconda-ks.cfg", 0x7fff14d5a7c0) = -1 EACCES (Permission denied)      So in order for me to stat this file, all I should need is executable permission on /home /home/jzhu and /home/jzhu/other As jzhu, I ran a stat on both /home and /home/jzhu to confirm that I had executable permissions. Shown below               [jzhu@localhost ~]$ stat /home/       File: `/home/'       Size: 4096        Blocks: 8          IO Block: 4096   directory     Device: fd00h/64768d    Inode: 2278        Links: 4     Access: (0755/drwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)     Access: 2013-11-03 08:52:13.797724760 +0000     Modify: 2013-11-04 00:03:45.377150769 +0000     Change: 2013-11-04 00:03:45.377150769 +0000     [jzhu@localhost ~]$ stat /home/jzhu       File: `/home/jzhu'       Size: 4096        Blocks: 8          IO Block: 4096   directory     Device: fd00h/64768d    Inode: 43317       Links: 3     Access: (0700/drwx------)  Uid: (  500/    jzhu)   Gid: (  500/    jzhu)     Access: 2013-11-04 00:00:30.809916040 +0000     Modify: 2013-11-03 23:49:54.781060426 +0000     Change: 2013-11-03 23:49:54.781060426 +0000      However I was unable to stat /home/jzhu/other as jzhu:               [jzhu@localhost ~]$ stat /home/jzhu/other/     stat: cannot stat `/home/jzhu/other/': Permission denied      Changing back too and running stat on the directory. I am confused as to why I am unable to stat the directory as jzhu. As can be seen below, other has read and executable permissions on that directory.               [root@localhost jzhu]# stat /home/jzhu/other/       File: `/home/jzhu/other/'       Size: 4096        Blocks: 8          IO Block: 4096   directory     Device: fd00h/64768d    Inode: 32674       Links: 2     Access: (0755/drwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)     Access: 2013-11-03 08:50:36.935318703 +0000     Modify: 2013-11-03 08:50:35.772737444 +0000     Change: 2013-11-03 08:50:35.772737444 +0000     [root@localhost jzhu]# stat /home/jzhu/other/anaconda-ks.cfg        File: `/home/jzhu/other/anaconda-ks.cfg'       Size: 985         Blocks: 8          IO Block: 4096   regular file     Device: fd00h/64768d    Inode: 43297       Links: 1     Access: (0777/-rwxrwxrwx)  Uid: (    0/    root)   Gid: (    0/    root)     Access: 2013-11-03 08:50:35.772737444 +0000     Modify: 2013-11-03 08:50:35.781741701 +0000     Change: 2013-11-03 08:54:50.814196796 +0000      So the two questions I want to ask are the following.   1. Why am I unable to stat /home/jzhu/other/ even though I have read and executable permission on other in that directory?   2. Why am I unable to stat the anaconda-ks.cfg file?


title: Mount NTFS drive with 777 permissions

text: I need to mount a NTFS drive with permissions set to 777. The code i have in fstab now is:               /dev/sdb2       /disk    ntfs    defaults,nls=utf8,umask=000,uid=1000,windows_names        0       0      But when using this all files get the permissions 600, anybody know whats wrong?


title: Search in iptables.log file takes a long time

text: I have used iptables to save information about connections by modifying the `/etc/syslog.conf` file to save information in `/var/log/iptables.log`. So, every X hours, I need to extract information from the log file. But the problem is the file will be bigger and the search will be slower. So I used:               sed -i '/string/d' iptables.log      In order to delete what I don't need anymore. But when I use this command, iptables stops saving data in the `iptables.log` file. So, what's wrong? How can I solve this problem?


title: Setfattr always returns operation not supported

text: I'm trying to get a script working however I'm having issues with a particular line trying to set file attributes with setfattr. The line in question is               ret=os.system('setfattr -n "user.dummy" -v "dummy" /apachelogs/data/file')      The fstab output of this location is as follows.               /dev/sdb1 /apachelogs          reiserfs    user,noauto,rw,exec,suid,user_xattr        0       2      Returns the error message:               setfattr: /apachelogs/data/file: Operation not supported      Can anyone give me any advice on what I might be doing wrong? My google-fu is only telling me that the problem usually occurs when someone doesn't prefix user on the first variable. Cheers.


title: Unable to get NVidia 9600GT working with Kubuntu 14.04

text: Problem: Nvidia drivers are not loading Hardware: Dell T110 Graphics Card               root@madeye:~# lspci | grep VGA     02:00.0 VGA compatible controller: NVIDIA Corporation G96 [GeForce 9500 GT] (rev a1)      Nvidia Packages Installed               root@madeye:~# dpkg --get-selections | grep nvidia     nvidia-304                  deinstall     nvidia-304-updates              install     nvidia-current-updates              install     nvidia-libopencl1-304               deinstall     nvidia-libopencl1-304-updates           install     nvidia-opencl-icd-304               deinstall     nvidia-opencl-icd-304-updates           install     nvidia-settings                 install      I have updated all packages after the install and installed kernel-headers Relevant lines from `Xorg.0.log`:               [    19.739] (II) LoadModule: "nvidia"     [    19.739] (II) Loading /usr/lib/x86_64-linux-gnu/xorg/extra-modules/nvidia_drv.so     [    19.740] (II) Module nvidia: vendor="NVIDIA Corporation"     [    19.740]    compiled for 4.0.2, module version = 1.0.0     [    19.740]    Module class: X.Org Video Driver     [    19.774] (EE) NVIDIA: Failed to load the NVIDIA kernel module. Please check your     [    19.774] (EE) NVIDIA:     system's kernel log for additional error messages.     [    19.774] (II) UnloadModule: "nvidia"     [    19.774] (II) Unloading nvidia     [    19.774] (EE) Failed to load module "nvidia" (module-specific error, 0)Ke      Relevant lines from `kern.log`:               Jun 28 16:05:12 madeye kernel: [   19.835310] NVRM: This PCI I/O region assigned to your NVIDIA device is invalid:     Jun 28 16:05:12 madeye kernel: [   19.835310] NVRM: BAR1 is 0M @ 0x0 (PCI:0000:02:00.0)     Jun 28 16:05:12 madeye kernel: [   19.835318] NVRM: The system BIOS may have misconfigured your GPU.     Jun 28 16:05:12 madeye kernel: [   19.835325] nvidia: probe of 0000:02:00.0 failed with error -1     Jun 28 16:05:12 madeye kernel: [   19.835361] NVRM: The NVIDIA probe routine failed for 1 device(s).     Jun 28 16:05:12 madeye kernel: [   19.835364] NVRM: None of the NVIDIA graphics adapters were initialized!     Jun 28 16:05:12 madeye kernel: [   19.875318] NVRM: This PCI I/O region assigned to your NVIDIA device is invalid:     Jun 28 16:05:12 madeye kernel: [   19.875318] NVRM: BAR1 is 0M @ 0x0 (PCI:0000:02:00.0)     Jun 28 16:05:12 madeye kernel: [   19.875324] NVRM: The system BIOS may have misconfigured your GPU.     Jun 28 16:05:12 madeye kernel: [   19.875328] nvidia: probe of 0000:02:00.0 failed with error -1     Jun 28 16:05:12 madeye kernel: [   19.875348] NVRM: The NVIDIA probe routine failed for 1 device(s).     Jun 28 16:05:12 madeye kernel: [   19.875350] NVRM: None of the NVIDIA graphics adapters were initialized!      What further troubleshooting steps to I need to take? What can I do to get the kernel to recognize the graphics card? * * * **EDIT** As per terdon's answer, if I run the command, I get the below message:               dthacker@madeye:~$ sudo apt-get install nvidia-kernel-dkms nvidia-xconfig nvidia-settings     Reading package lists... Done      Building dependency tree Reading state information... Done      Package nvidia-kernel-dkms is not available, but is referred to by another package.      This may mean that the package is missing, has been obsoleted, or is only available from another source      E: Package 'nvidia-kernel-dkms' has no installation candidate      E: Unable to locate package nvidia-xconfig`      @terdon, I used this utility from the article you pointed me towards:               root@madeye:~# ubuntu-drivers devices | grep recommended     driver   : nvidia-331 - distro non-free recommended      I then installed nvidia-331 and the restricted drivers utility shows that it is being used. The nvidia GUI utility still has no options visible for configuring multiple monitors (there are currently two connected to the card) and I am still getting errors in the `kern.log` saying the Nvidia init module failed. Still working towards a solution... Output of `apt-get install nvidia-driver`:               root@madeye:~# apt-get install nvidia-driver     Reading package lists... Done     Building dependency tree            Reading state information... Done     Package nvidia-driver is not available, but is referred to by another package.     This may mean that the package is missing, has been obsoleted, or is only available from another source`


title: How to enlarge existing file to specific size

text: I have _hdd.img_ file, which I user as HDD for my virtual machine, but it's size is too small, how can I enlarge it? There is one method, something like:               dd if=/dev/zero ds=10GB count=8 >> hdd.img      but it takes a lot of time :(


title: How can one make a hot-pluggable live linux USB, similar to WIndows to Go

text: I like the functionality of Windows to Go, a way of running Windows on a USB Drive. Especially, I like these two features of it:   * It is hot-pluggable, I can unplug it, and as long as I plug it in again in 60 seconds, my machine won't power down or kernel panic.   * I can have multiple driver configurations for every computer I plug it into and the correct driver set can be autodetected. Is there a way to do this with a Linux distro?


title: Why is konsole reading /etc/passwd?

text: In relation to this question: While observing the behavior of fatrace, I notice something which concerns me. Here are the first few lines of output of the command "fatrace|grep konsole"               konsole(4112): O /etc/passwd     konsole(4112): CO /etc/passwd     konsole(4112): C /etc/passwd     konsole(4112): O /etc/passwd     konsole(4112): C /etc/passwd     konsole(4112): O /etc/passwd     konsole(4112): C /etc/passwd     konsole(4112): O /etc/passwd     konsole(4112): C /etc/passwd     konsole(4112): O /etc/passwd     konsole(4112): C /etc/passwd     konsole(4112): O /etc/passwd     konsole(4112): C /etc/passwd     konsole(4112): O /etc/passwd     konsole(4112): C /etc/passwd     konsole(4112): O /etc/passwd     ...      The thing is that lsof|grep passwd shows that passwd is not open by any process. So any idea what is going on?


title: OpenVPN struggling

text: I've got some problems with my OpenVPN setup. **The Setup:** -> Ubuntu Server 12.04 -> Two active NIC's: eth0 (default): 192.168.1.0/24 eth1: x.x.x.x (external ip) I've managed to get the routing to work so i can connect to the outside world with the eth1 NIC.               holmen@filserver:~$ ping -I eth1 -c 3 www.linuxquestions.org     PING www.linuxquestions.org (75.126.162.205) from 192.168.1.2 eth1: 56(84) bytes of data.     64 bytes from www.linuxquestions.org (75.126.162.205): icmp_req=1 ttl=50 time=133 ms     64 bytes from www.linuxquestions.org (75.126.162.205): icmp_req=2 ttl=50 time=133 ms     64 bytes from www.linuxquestions.org (75.126.162.205): icmp_req=3 ttl=50 time=133 ms          --- www.linuxquestions.org ping statistics ---     3 packets transmitted, 3 received, 0% packet loss, time 2002ms     rtt min/avg/max/mdev = 133.281/133.336/133.379/0.423 ms     One curious thing is that the "from ip #". It says "from 192.168.1.2 eth1" but that ip is the servers ip on the eth0 iface.      **Netstat:**               holmen@filserver:~$ netstat -anr     Kernel IP routing table     Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface     0.0.0.0         192.168.1.1     0.0.0.0         UG        0 0          0 eth0     x.x.x.x     0.0.0.0         255.255.128.0   U         0 0          0 eth1     192.168.1.0     0.0.0.0         255.255.255.0   U         0 0          0 eth0      **But here comes the real problem:** When setting up openvpn with the option "local x.x.x.x (eth1 ext ip)" it still tunnels the eth0 interface. And i cant understand why. **OpenVPN settings:**               client          dev tap          proto udp          local x.x.x.x          remote openvpn.anonine.net 1194     remote openvpn.anonine.net 1195     remote openvpn-2.anonine.net 1196     remote openvpn-2.anonine.net 1197     remote openvpn-3.anonine.net 1198     remote openvpn-3.anonine.net 1199     remote openvpn-4.anonine.net 1200     remote openvpn-4.anonine.net 1201          remote-random          resolv-retry infinite          auth-user-pass          persist-key     persist-tun          ca anonine.ca.crt          ns-cert-type server          comp-lzo          reneg-sec 0          verb 3      **Netstat (tunnel active):**               holmen@filserver:~$ netstat -anr     Kernel IP routing table     Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface     0.0.0.0         46.246.20.129   128.0.0.0       UG        0 0          0 tap0     0.0.0.0         192.168.1.1     0.0.0.0         UG        0 0          0 eth0     x.x.x.x         0.0.0.0         255.255.128.0   U         0 0          0 eth1     46.246.20.128   0.0.0.0         255.255.255.128 U         0 0          0 tap0     80.67.8.222     192.168.1.1     255.255.255.255 UGH       0 0          0 eth0     128.0.0.0       46.246.20.129   128.0.0.0       UG        0 0          0 tap0     192.168.1.0     0.0.0.0         255.255.255.0   U         0 0          0 eth0      Anyone got any ideas?


title: Why do I see my unlocked desktop briefly before the login screen when returning from sleep mode on my laptop?

text: It has happened consistently on multiple laptops for me. If this is a common occurrence, I'm wondering why it is happening.


title: incoming ACCEPT all iptables rule still appearing

text: I'm following this guide here: http://isalazyadmin.net/2009/07/02/configuring- a-basic-firewall-for-debian-linux/ And I have the iptables listed shown, but my server still appears to be accepting all incoming connections (ie: bittorrent peers are still connecting, even though I didn't allow those ports). /etc/iptables.rules               *filter          # This will allow all loopback (lo0) traffic and drop all traffic to 127/8     # that does not use lo0     -A INPUT -i lo -j ACCEPT     -A INPUT ! -i lo -d 127.0.0.0/8 -j REJECT          #  This accepts all already established connections     -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT          # This allows all outbound traffic     -A OUTPUT -j ACCEPT          # This will allow HTTP and HTTPS connections from anywhere, this are the normal     # ports used for a web server     -A INPUT -p tcp --dport 80 -j ACCEPT     -A INPUT -p tcp --dport 443 -j ACCEPT          # Allow SSH connections     -A INPUT -p tcp -m state --state NEW --dport 22 -j ACCEPT          # Allow bittorrent/rtorrent ports, from ~/.rtorrent.rc     ## -A INPUT -p tcp --dport 8071:8079 -j ACCEPT               # Allow ICMP ping     -A INPUT -p icmp -m icmp --icmp-type 8 -j ACCEPT          # Reject all other inbound traffic     -A INPUT -j REJECT     -A FORWARD -j REJECT          COMMIT      When I run iptables -L after a reboot, I still get this as my first rule: iptables -L               Chain INPUT (policy ACCEPT)     target     prot opt source               destination              ACCEPT     all  --  anywhere             anywhere        Not sure where this is coming from. Here is the full list:               Chain INPUT (policy ACCEPT)     target     prot opt source               destination              ACCEPT     all  --  anywhere             anywhere                 REJECT     all  --  anywhere             loopback/8          reject-with icmp-port-unreachable      ACCEPT     all  --  anywhere             anywhere            state RELATED,ESTABLISHED      ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:www      ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:https      ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:ssh      ACCEPT     icmp --  anywhere             anywhere            icmp echo-request      REJECT     all  --  anywhere             anywhere            reject-with icmp-port-unreachable           Chain FORWARD (policy ACCEPT)     target     prot opt source               destination              REJECT     all  --  anywhere             anywhere            reject-with icmp-port-unreachable           Chain OUTPUT (policy ACCEPT)     target     prot opt source               destination              ACCEPT     all  --  anywhere             anywhere      Here is the output of iptables-save:               # Generated by iptables-save v1.4.8 on Fri Jan 11 09:54:19 2013     *raw     :PREROUTING ACCEPT [6701:942626]     :OUTPUT ACCEPT [8927:989420]     COMMIT     # Completed on Fri Jan 11 09:54:19 2013     # Generated by iptables-save v1.4.8 on Fri Jan 11 09:54:19 2013     *nat     :PREROUTING ACCEPT [3281:284415]     :INPUT ACCEPT [9:720]     :OUTPUT ACCEPT [1758:148908]     :POSTROUTING ACCEPT [1758:148908]     COMMIT     # Completed on Fri Jan 11 09:54:19 2013     # Generated by iptables-save v1.4.8 on Fri Jan 11 09:54:19 2013     *mangle     :PREROUTING ACCEPT [6701:942626]     :INPUT ACCEPT [6701:942626]     :FORWARD ACCEPT [0:0]     :OUTPUT ACCEPT [8928:989684]     :POSTROUTING ACCEPT [8928:989684]     COMMIT     # Completed on Fri Jan 11 09:54:19 2013     # Generated by iptables-save v1.4.8 on Fri Jan 11 09:54:19 2013     *filter     :INPUT ACCEPT [0:0]     :FORWARD ACCEPT [0:0]     :OUTPUT ACCEPT [0:0]     -A INPUT -i lo -j ACCEPT      -A INPUT -d 127.0.0.0/8 ! -i lo -j REJECT --reject-with icmp-port-unreachable      -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT      -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT      -A INPUT -p tcp -m tcp --dport 443 -j ACCEPT      -A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT      -A INPUT -p icmp -m icmp --icmp-type 8 -j ACCEPT      -A INPUT -j REJECT --reject-with icmp-port-unreachable      -A FORWARD -j REJECT --reject-with icmp-port-unreachable      -A OUTPUT -j ACCEPT      COMMIT     # Completed on Fri Jan 11 09:54:19 2013      Here is the iptables -vL output:               $ sudo iptables -vL     [sudo] password for ettinger:      Chain INPUT (policy ACCEPT 0 packets, 0 bytes)      pkts bytes target     prot opt in     out     source               destination               8303 1206K ACCEPT     all  --  lo     any     anywhere             anywhere                     0     0 REJECT     all  --  !lo    any     anywhere             loopback/8          reject-with icmp-port-unreachable        12M 7191M ACCEPT     all  --  any    any     anywhere             anywhere            state RELATED,ESTABLISHED         18   980 ACCEPT     tcp  --  any    any     anywhere             anywhere            tcp dpt:www          7   344 ACCEPT     tcp  --  any    any     anywhere             anywhere            tcp dpt:https        379 22728 ACCEPT     tcp  --  any    any     anywhere             anywhere            state NEW tcp dpt:ssh      18316 1110K ACCEPT     tcp  --  any    any     anywhere             anywhere            tcp dpts:8071:8079       120K   15M ACCEPT     udp  --  any    any     anywhere             anywhere            udp dpt:6881      24809 1489K ACCEPT     tcp  --  any    any     anywhere             anywhere            tcp dpt:9001        688 35244 ACCEPT     tcp  --  any    any     anywhere             anywhere            tcp dpt:9030        874 73072 ACCEPT     icmp --  any    any     anywhere             anywhere            icmp echo-request      12705  871K REJECT     all  --  any    any     anywhere             anywhere            reject-with icmp-port-unreachable           Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)      pkts bytes target     prot opt in     out     source               destination                  0     0 REJECT     all  --  any    any     anywhere             anywhere            reject-with icmp-port-unreachable           Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)      pkts bytes target     prot opt in     out     source               destination                14M   12G ACCEPT     all  --  any    any     anywhere             anywhere


title: User denied ssh access while in AllowUsers list

text: I've inherited the administration of a linux box in my workplace; it was set up by a colleague who is now gone. Recently, I added a new user to the system, and tried to give her ssh access as well; the way most people who use the machine access it. This, I can't get to work. Here's what happens:               scmb-bkobe03m:~ xzhang$ ssh -v -X -p 22 arwen@myServer     OpenSSH_5.2p1, OpenSSL 0.9.8r 8 Feb 2011     debug1: Reading configuration data /etc/ssh_config     debug1: Connecting to myServer [152.98.xx.xx] port 22.     debug1: Connection established.     debug1: identity file /Users/xzhang/.ssh/identity type -1     debug1: identity file /Users/xzhang/.ssh/id_rsa type 1     debug1: identity file /Users/xzhang/.ssh/id_dsa type -1     debug1: Remote protocol version 2.0, remote software version OpenSSH_5.5p1 Debian-6+squeeze2     debug1: match: OpenSSH_5.5p1 Debian-6+squeeze2 pat OpenSSH*     debug1: Enabling compatibility mode for protocol 2.0     debug1: Local version string SSH-2.0-OpenSSH_5.2     debug1: SSH2_MSG_KEXINIT sent     debug1: SSH2_MSG_KEXINIT received     debug1: kex: server->client aes128-ctr hmac-md5 none     debug1: kex: client->server aes128-ctr hmac-md5 none     debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent     debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP     debug1: SSH2_MSG_KEX_DH_GEX_INIT sent     debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY     debug1: Host '[myServer]:22' is known and matches the RSA host key.     debug1: Found key in /Users/xzhang/.ssh/known_hosts:1     debug1: ssh_rsa_verify: signature correct     debug1: SSH2_MSG_NEWKEYS sent     debug1: expecting SSH2_MSG_NEWKEYS     debug1: SSH2_MSG_NEWKEYS received     debug1: SSH2_MSG_SERVICE_REQUEST sent     debug1: SSH2_MSG_SERVICE_ACCEPT received     debug1: Authentications that can continue: publickey     debug1: Next authentication method: publickey     debug1: Trying private key: /Users/xzhang/.ssh/identity     debug1: Offering public key: /Users/xzhang/.ssh/id_rsa     debug1: Authentications that can continue: publickey     debug1: Trying private key: /Users/xzhang/.ssh/id_dsa     debug1: No more authentication methods to try.      Now, I have of course added her public ssh-key to authorized_keys. So I had a look in /var/log/auth.log and found               Jan  7 11:37:12 sauron sshd[5002]: User arwen from myClientMachine not allowed because not listed in AllowUsers      Which is funny since I did add her to AllowUsers:               daniel@sauron:~$ sudo more /etc/ssh/sshd_config | grep AllowUsers     AllowUsers jonathan daniel rafael simon thomas li arwen      I don't know where to go from here. Any takers?


title: why is dhcpd listening on udp port 38053 and udp6 port 40572?

text: I am running a dhcp server with dhcpd from isc and thought it should only be listening on port 67. Why is it also listening on those other ports? I cannot seem to find what those ports are for, but my guess is they provide remote administration of some sort even though I don't have it explicitly called out in my configuration file.


title: Trouble embedding clang in a standalone application

text: I am running Ubuntu 13.04 on my end and I have **installed clang** as well as **libclang-dev** and **llvm** (through apt). I tried hard to run **RecursiveASTVisitor** example given here:- http://clang.llvm.org/docs/RAVFrontendAction.html but no luck. One thing also annoying me is:               Unknown CMake command "llvm_map_components_to_libraries"      I don't know how to write a CMakeLists.txt file, but here is what I am using:               cmake_minimum_required(VERSION 2.8)          set(CMAKE_MODULE_PATH       ${CMAKE_MODULE_PATH}       "."     )          find_package(LibClang REQUIRED)          find_package(LLVM)          if(NOT LLVM_FOUND)         message(FATAL_ERROR "Fatal Error: LLVM cannot be found.")     endif()          add_definitions(${LibClang_DEFINITIONS})          include_directories(       ${LibClang_INCLUDE_DIRS}     )          include_directories( ${LLVM_INCLUDE_DIRS} )     link_directories( ${LLVM_LIBRARY_DIRS} )          add_executable(ast TestCLang.cpp)     target_link_libraries(ast       ${LibClang_LIBRARIES}     )          include_directories( ${LLVM_INCLUDE_DIRS} )     link_directories( ${LLVM_LIBRARY_DIRS} )          llvm_map_components_to_libraries(REQ_LLVM_LIBRARIES jit native)          #target_link_libraries(ast REQ_LLVM_LIBRARIES)          #add_subdirectory(test)          set(LLVM_USED_LIBS clangTooling)          #add_clang_executable(find-class-decls TestCLang.cpp)      I cannot use **llvm_map_components_to_libraries** or **add_clang_executable** as it complains about not knowing these commands. I guess I am using LLVM-3.2. Here is my **FindLibClang.cmake** :               execute_process(       COMMAND llvm-config --cxxflags       OUTPUT_VARIABLE LibClang_DEFINITIONS)          set(LibClang_DEFINITIONS ${LibClang_DEFINITIONS} "-fno-rtti")          execute_process(       COMMAND llvm-config --includedir       OUTPUT_VARIABLE LibClang_INCLUDE_DIR)          find_library(LibClang_LIBRARY NAMES clang)          set(LibClang_LIBRARIES ${LibClang_LIBRARY})     set(LibClang_INCLUDE_DIRS ${LibClang_INCLUDE_DIR})          include(FindPackageHandleStandardArgs)     find_package_handle_standard_args(LibClang DEFAULT_MSG LibClang_LIBRARY LibClang_INCLUDE_DIR)          mark_as_advanced(LibClang_INCLUDE_DIR LibClang_LIBRARY)      May be wrong on my end?


title: What are the permissions of a cron job?

text: When a cron job runs with what privilege does it execute? I'm not sure about that. Is it with the same privileges of the user that added it via `crontab -e`?


title: ArchLinux pacman updates on Arm

text: I have ArchLinux embedded in userspace on my Samsung Series 3 Chromebook. The version of GCC I have installed via pacman is 4.7.2. I'd like a newer version, and the package database here shows that the Core repository has GCC 4.8.0-4. However, when I run `sudo pacman -Syu`, I am told there is nothing to do. I'm happy to be patient, though as a newcomer to ArchLinux, I wonder if someone can tell me why my version is not yet 4.8.


title: Is there a way to make the prompt definition multiline?

text: This is my current prompt definition:               PS1=$'%F{063}%1~%f %(1v.%F{099}%1v %f.)%F{063}%%%f '     RPROMPT='$VIMODE %m'      and I'm working on integrating this. Basically I'm starting to find it very unreadable. Is there any way that I can make it multiline in a way perhaps similar to what Perl can do with regex's (e.g., what /x mode does. Like `m{ ... }x`. the `...` can be multiline in that)? Something like this:               PS1=$'        %F{063}%1 # format blue           ~      # show current directory        %f        %(1v.%F{099}%1v %f.) # show git branch if git repo in purple        %F{063}   # format blue           %#     # % for user and # for root        %f '     RPROMPT='$VIMODE %m'


title: How to get variables from the command line while makefile is runing?

text: Such as in bash script: read -p "Only UI(y/n)" Temp_Answer. Is it possible to do this while Makefile is runing? Because I want to do different base on the $Temp_Answer (Y or N) in Makefile.


title: What is this sed command doing?

text: Can someone explain me what this `sed` command is trying to achieve?               sed 's/^[[:space:]]*//;s/[[:space:]]*$//      I understand that it is searching for whitespace characters from the beginning of the line, but I am not able to understand the part starting from `//;s/[[:space:]]*$//`


title: Testing if a variable is empty in a shell script

text: I have seen the following technique used many times on many different shells, to test if a variable is empty:               if [ "x$1" = "x" ]; then          # Variable is empty     fi      Are there any advantages on using this over the more canonical `if [ -z "$1" ]`? Could it be a portability issue?


title: Simple command line http server

text: I have a script which generates a daily report which I want to serve to the so called general public. The problem is I don't want to add to my headaches maintance of a http server (e.x. apache) with all the configurations and security implications. Is there a dead simple solution for serving one small html page without the effort of configuring a full blown http server?


title: Understanding a make file for making .ko files

text: I know the purpose of this make file; it is a driver’s Makefile, which would invoke the kernel’s build system from the kernel source. But Unable to understand what exactly is going on.               # Makefile – makefile of our first driver          # if KERNELRELEASE is not defined, we've been called directly from the command line.     # Invoke the kernel build system.     ifeq (${KERNELRELEASE},)         KERNEL_SOURCE := /usr/src/linux         PWD := $(shell pwd)     default:         ${MAKE} -C ${KERNEL_SOURCE} SUBDIRS=${PWD} modules          clean:         ${MAKE} -C ${KERNEL_SOURCE} SUBDIRS=${PWD} clean          # Otherwise KERNELRELEASE is defined; we've been invoked from the     # kernel build system and can use its language.     else         obj-m := ofd.o     endif      For example what is happening here:                `${MAKE} -C ${KERNEL_SOURCE} SUBDIRS=${PWD} modules      and here:               obj-m := ofd.o`       Can someone help me understand this by putting some more comments? I have taken this from this link. This make file has an associated .c file (driver);               /* ofd.c – Our First Driver code */          #include <linux/module.h>     #include <linux/version.h>     #include <linux/kernel.h>          static int __init ofd_init(void) /* Constructor */     {         printk(KERN_INFO "Namaskar: ofd registered");              return 0;     }          static void __exit ofd_exit(void) /* Destructor */     {         printk(KERN_INFO "Alvida: ofd unregistered");     }          module_init(ofd_init);     module_exit(ofd_exit);          MODULE_LICENSE("GPL");     MODULE_AUTHOR("Anil Kumar Pugalia <email@sarika-pugs.com>");     MODULE_DESCRIPTION("Our First Driver");


title: Install using synaptic ignoring dependencies

text: I was trying to install texmaker a latex editor in my debian system from synaptic. It shows in the dependency list texlive-base, texlive-common. etc as dependencies. But I have already installed Texlive full from the source and its working fine. Is there any way I could install texmaker from synaptic without installing the specified texlive dependencies?


title: Virtual Interface Not Showing up in ifconfig?

text: I am trying to create a virtual interface for the purpose of NameBased Virtual Hosting on my CentOS linux box; please find below is the devices' information:-               DEVICE=eth0     BOOTPROTO=dhcp     HWADDR=00:0c:29:4e:1c:14     MTU=1500     NM_CONTROLLED=yes     ONBOOT=yes     TYPE=Ethernet     USERCTL=no     PEERDNS=yes     IPV6INIT=no               DEVICE=eth0:1     BOOTPROTO=none     IPADDR=192.168.1.5     NETMASK=255.255.255.0     NM_CONTROLLED=yes     ONBOOT=no     HWADDR=00:0C:29:4E:1C:14     TYPE=Ethernet     PREFIX=24     DEFROUTE=yes     IPV4_FAILURE_FATAL=yes     IPV6INIT=no     NAME="System eth0:1"     UUID=7758ac79-c4a2-dd87-1760-71284a316d00      Running ifconfig doesn't show the virtual device eth0:1;               [root@centos network-scripts]# ifconfig -a     eth0      Link encap:Ethernet  HWaddr 00:0C:29:4E:1C:14               inet addr:192.168.1.3  Bcast:192.168.1.255  Mask:255.255.255.0               inet6 addr: fe80::20c:29ff:fe4e:1c14/64 Scope:Link               UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1               RX packets:24368 errors:0 dropped:0 overruns:0 frame:0               TX packets:21884 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:1000               RX bytes:9793531 (9.3 MiB)  TX bytes:4460526 (4.2 MiB)               Interrupt:19 Base address:0x2000          lo        Link encap:Local Loopback               inet addr:127.0.0.1  Mask:255.0.0.0               inet6 addr: ::1/128 Scope:Host               UP LOOPBACK RUNNING  MTU:16436  Metric:1               RX packets:799 errors:0 dropped:0 overruns:0 frame:0               TX packets:799 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:0               RX bytes:82196 (80.2 KiB)  TX bytes:82196 (80.2 KiB)          pan0      Link encap:Ethernet  HWaddr EE:75:AD:75:9C:84               BROADCAST MULTICAST  MTU:1500  Metric:1               RX packets:0 errors:0 dropped:0 overruns:0 frame:0               TX packets:0 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:0               RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)          sit0      Link encap:IPv6-in-IPv4               NOARP  MTU:1480  Metric:1               RX packets:0 errors:0 dropped:0 overruns:0 frame:0               TX packets:0 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:0               RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)      Any ideas what I might be missing. ----------Edit 1:- Restarted my linux box and could see all the configured virtual interfaces as below:- After System Restart:-               [root@centos ~]# date     Tue Apr 30 21:25:16 PDT 2013     [root@centos ~]# ifconfig     eth0      Link encap:Ethernet  HWaddr 00:0C:29:4E:1C:14               inet addr:192.168.1.3  Bcast:192.168.1.255  Mask:255.255.255.0               inet6 addr: fe80::20c:29ff:fe4e:1c14/64 Scope:Link               UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1               RX packets:97 errors:0 dropped:0 overruns:0 frame:0               TX packets:117 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:1000               RX bytes:9756 (9.5 KiB)  TX bytes:17204 (16.8 KiB)               Interrupt:19 Base address:0x2000          eth0:1    Link encap:Ethernet  HWaddr 00:0C:29:4E:1C:14               inet addr:192.168.1.10  Bcast:192.168.1.255  Mask:255.255.255.0               UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1               Interrupt:19 Base address:0x2000          eth0:2    Link encap:Ethernet  HWaddr 00:0C:29:4E:1C:14               inet addr:192.168.1.40  Bcast:192.168.1.255  Mask:255.255.255.0               UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1               Interrupt:19 Base address:0x2000          lo        Link encap:Local Loopback               inet addr:127.0.0.1  Mask:255.0.0.0               inet6 addr: ::1/128 Scope:Host               UP LOOPBACK RUNNING  MTU:16436  Metric:1               RX packets:4 errors:0 dropped:0 overruns:0 frame:0               TX packets:4 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:0               RX bytes:240 (240.0 b)  TX bytes:240 (240.0 b)      But after doing `system-network-restart` all my settings are gone: Please find below is the result after running the command:-               [root@centos ~]# service network restart     Shutting down interface eth0:  Device state: 3 (disconnected)                                                                [  OK  ]     Shutting down loopback interface:                          [  OK  ]     Bringing up loopback interface:                            [  OK  ]     Bringing up interface eth0:  Active connection state: activating     Active connection path: /org/freedesktop/NetworkManager/ActiveConnection/1     state: activated     Connection activated          [root@centos ~]# ifconfig     eth0      Link encap:Ethernet  HWaddr 00:0C:29:4E:1C:14               inet addr:192.168.1.3  Bcast:192.168.1.255  Mask:255.255.255.0               inet6 addr: fe80::20c:29ff:fe4e:1c14/64 Scope:Link               UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1               RX packets:290 errors:0 dropped:0 overruns:0 frame:0               TX packets:292 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:1000               RX bytes:25640 (25.0 KiB)  TX bytes:41720 (40.7 KiB)               Interrupt:19 Base address:0x2000          lo        Link encap:Local Loopback               inet addr:127.0.0.1  Mask:255.0.0.0               inet6 addr: ::1/128 Scope:Host               UP LOOPBACK RUNNING  MTU:16436  Metric:1               RX packets:4 errors:0 dropped:0 overruns:0 frame:0               TX packets:4 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:0               RX bytes:240 (240.0 b)  TX bytes:240 (240.0 b)


title: Adding separator on top level service menu

text: I have a top level service menu, now I want to add a separator before this menu, Here's my current service menu header:               [Desktop Entry]     Type=Service     Actions=A;_SEPARATOR_;B;C;     X-KDE-Priority=TopLevel     X-KDE-Submenu=Debuggers     ServiceTypes=KonqPopupMenu/Plugin,all/allfiles     Encoding=UTF-8     MimeType=application/x-ms-dos-executable;application/x-executable;application/x-msdownload;      Now I would have a sub menu named Debuggers, and it's like this,               Debuggers -->  A                  -----                    B                    C      What I want is like this,               ---------     Debuggers -->  A                  -----                    B                    C      So, how should I add the separator for the top level menu?


title: Editing a device tree to disable driver loading

text: Below is a section of device tree.                ps7_ethernet_0: ps7-ethernet@e000b000 {                             #address-cells = <1>;                             #size-cells = <0>;                             clock-names = "ref_clk", "aper_clk";                             clocks = <&clkc 13>, <&clkc 30>;                             /* compatible = "xlnx,ps7-ethernet-1.00.a";*/                             interrupt-parent = <&ps7_scugic_0>;                             interrupts = <0 22 4>;                             local-mac-address = [ 00 0a 35 00 6a 3e ];                             phy-handle = <&phy0>;                             phy-mode = "rgmii-id";                             reg = <0xe000b000 0x1000>;                             xlnx,enet-reset = "MIO 11";                             xlnx,eth-mode = <0x1>;                             xlnx,has-mdio = <0x1>;                             xlnx,ptp-enet-clock = <111111115>;                             mdio {                                     #address-cells = <1>;                                     #size-cells = <0>;                                     phy0: phy@7 {                                             compatible = "marvell,88e1116r";                                             device_type = "ethernet-phy";                                             reg = <7>;                                     } ;                      } ;                         } ;                 } ;      This shows that the OS will be loading a driver for ethernet. I want to stop the OS from doing this. When I simply commented the entire block, make reported errors. So how do I edit the device tree so that ethernet is disabled and no drievr is loaded?


title: Why does Unix time start at 1970-01-01

text: Why does Unix time start at 1970-01-01? Why not 1971-01-01 or any other date?


title: Atheros AR9285, Linux and 802.1n (oh and a linksys E3000)

text: Recently I bought me a Linksys e3000 access point. I configured this access point to, on 2.4GHz, only allow connections with 802.1n. The laptop I use has a Altheros AR9285 wifi chipset. Connecting works fine but the connection speed is not what I would expect. The distance between me and the access point is 2 meters with nothing in between. When downloading from a host behind the e3000 serving a file from a ramdisk (400MB) to a ramdisk on my laptop, I get 1544.9 kB/s. A pc which is connected using a wire reaches 27330.2 kB/s, which is considerably faster. So I did a iwlist wlan0 scan and this is what I got:                               Quality=65/70  Signal level=-45 dBm                       Encryption key:on                     Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 18 Mb/s                               24 Mb/s; 36 Mb/s; 54 Mb/s                     Bit Rates:6 Mb/s; 9 Mb/s; 12 Mb/s; 48 Mb/s      What is going on here? The AP tells me in its webinterface that it is capable of doing 150Mb/s. Also with my wi-spy I verified that nothing else is using the spectrum of the configured channel. Anyone got an idea how to fix this?


title: How to set permissions for user to smb mount with fstab?

text: Here is the line in my fstab file (with the names of the server and username changed):               //server/user /mnt/share cifs user=user,uid=1000,gid=1000,domain=DOMAIN,rw,username=user,password=password,file_mode=0777,dir_mode=0777,_netdev 0 0       When this mounts the folder (which i created by the user and chown the user as the owner) has these properties:               dr----x--t. 2 user root       0 Jul  9 08:48 share      When I try to cd into the director as the user I get a `Permission Denied` error. How can I make this work?


title: server migration experiments

text: At our premise, we are going to have to migrate some servers. I'm making some experiments for try to make all the silly stuff before put hands on real servers. I got 2 raspberry Pi, installed raspbian OS, and I wanted to do everything via SSH, but unfortunately one pi have a deficency on the SD card reader. Also I just set up a webserver lamp + other services on one SD card(SD1), did it via via SSH from my laptop to Pi. When everything worked, i removed SD1 and I replicated the same partitions on SD2 using gparted, directly on labtop with card reader, and then I copied all the files from SD1 to SD2 respecting the partitions. I just made a `cp` of the data.   * Is this approach in server migration totally wrong?   * there are some drawback that I still didnt figured out?   * any other tips/advise on server migration is really appreciated


title: Would you store the Makefile for later uninstallation?

text: * After installing a package/library from a Makefile, do you keep the Makefile, which contains `uninstall` target somewhere, for later uninstallation if any?      * If yes: Do you store it at some "standard" directory, like `/usr/local`?     * If no: How do you uninstall then?


I have copied, as usual, the iso into usb disk (/dev/sdc):               sudo dd bs=4M if=archlinux-2014.08.01-dual.iso of=/dev/sdc      But when I boot to my new PC, it shows:               ISOLINUX 6.03 6.03-pre18* EHDD Copyright (C) 1994-2014 H. Peter Anvin et al     No DEFAULT or UI configuration directive found!      I have also tried for `archlinux-2014.05.01-dual.iso` and `manjaro- xfce-0.8.10-x86_64.iso`, but it shows the same result. I have tried to rename `syslinux` folder, `syslinux.bin`, `syslinux.cfg` to `isolinux`, as suggested here using `isomaster`, then `dd` back to usb, but it won't boot at all. Note: this never happened on my previous PC. Motherboard: MSI H81M-E33 How do I solve this problem?


title: Where do I find messages regarding last failed linux boot?

text: My linux boot fails often. I have removed `quiet` from my boot options so I can see whats going on. Basically after showing a bunch of [pass] messages, it hangs. It does not hang _every_ time. Now I know dmesg is the way I can see boot messages. But I want to look at the boot messages of the previous boot and not the current boot (because this one booted normally, while last one hanged). Also are there any other logs I can look at to find the problem ? I am using Ubuntu Natty 11.04. Should I recompile my kernel with debugging support ? Is that the only way to debug this isssue ? Finally, is this what is called a kernel panic (soft / hard or something) ?.


title: Difference between SNAT and Masquerade

text: I am confused what's the actual difference between SNAT and Masquerade? If I want to share my internet connection on local network than whether should I select SNAT or Masquerade? Give me some online resources from where I can study about them. Thanks! Also let me know the iptables command for both.


title: Display output to console while grep is used

text: In vim I use the following command to compile a tex file:               pdflatex\ \-file\-line\-error\ \-shell\-escape\ \-interaction=nonstopmode\ $*\\\|\ grep\ \-P\ ':\\d{1,5}:\ '      this works in terms of getting the errors into a quick fix window (if you don't use vim, ignore this sentence). **The only problem is that I would like to see the latex output coming on the screen while the document is compiling** (now grep swallows all the output). what should I change to make this happen? I already tried piping it all to `tail`, yet to no avail.               This is pdfTeX, Version 3.1415926-2.3-1.40.12 (TeX Live 2011) (format=preamble 2011.10.2)  3 OCT 2011 23:16     entering extended mode      \write18 enabled.      file:line:error style messages enabled.      %&-line parsing enabled.     **main.tex     (./main.tex     LaTeX2e <2011/06/27>     Babel <v3.8m> and hyphenation patterns for english, dumylang, nohyphenation, ge     rman-x-2011-07-01, ngerman-x-2011-07-01, afrikaans, ancientgreek, ibycus, arabi     c, armenian, basque, bulgarian, catalan, pinyin, coptic, croatian, czech, danis     h, dutch, ukenglish, usenglishmax, esperanto, estonian, ethiopic, farsi, finnis     h, french, galician, german, ngerman, swissgerman, monogreek, greek, hungarian,      icelandic, assamese, bengali, gujarati, hindi, kannada, malayalam, marathi, or     iya, panjabi, tamil, telugu, indonesian, interlingua, irish, italian, kurmanji,      lao, latin, latvian, lithuanian, mongolian, mongolianlmc, bokmal, nynorsk, pol     ish, portuguese, romanian, russian, sanskrit, serbian, serbianc, slovak, sloven     ian, spanish, swedish, turkish, turkmen, ukrainian, uppersorbian, welsh, loaded     .     PRECOMILED PREAMBLE LOADED          LaTeX Warning: Overwriting file `./main.bib'.          \openout15 = `main.bib'.               \openout4 = `main.auxlock'.          Package biblatex Info: Trying to load language 'english'...     Package biblatex Info: ... file 'english.lbx' found.     (/usr/local/texlive/2011/texmf-dist/tex/latex/biblatex/lbx/english.lbx     File: english.lbx 2011/07/29 v1.6 biblatex localization     )          Package biblatex Warning: 'babel' detected but 'csquotes' missing.     (biblatex)                Loading 'csquotes' recommended.          \@quotelevel=\count451     \@quotereset=\count452     (./main.aux)     \openout1 = `main.aux'.          LaTeX Font Info:    Checking defaults for OML/cmm/m/it on input line 42.     LaTeX Font Info:    ... okay on input line 42.     LaTeX Font Info:    Checking defaults for T1/cmr/m/n on input line 42.     LaTeX Font Info:    ... okay on input line 42.     LaTeX Font Info:    Checking defaults for OT1/cmr/m/n on input line 42.     LaTeX Font Info:    ... okay on input line 42.     LaTeX Font Info:    Checking defaults for OMS/cmsy/m/n on input line 42.     LaTeX Font Info:    ... okay on input line 42.     LaTeX Font Info:    Checking defaults for OMX/cmex/m/n on input line 42.     LaTeX Font Info:    ... okay on input line 42.     LaTeX Font Info:    Checking defaults for U/cmr/m/n on input line 42.     LaTeX Font Info:    ... okay on input line 42.     LaTeX Font Info:    Checking defaults for PD1/pdf/m/n on input line 42.     LaTeX Font Info:    ... okay on input line 42.     LaTeX Font Info:    Checking defaults for TS1/cmr/m/n on input line 42.     LaTeX Font Info:    Try loading font information for TS1+cmr on input line 42.      (/usr/local/texlive/2011/texmf-dist/tex/latex/base/ts1cmr.fd     File: ts1cmr.fd 1999/05/25 v2.5h Standard LaTeX font definitions     )     LaTeX Font Info:    ... okay on input line 42.     Package caption Info: Begin \AtBeginDocument code.     Package caption Info: subfig package 1.2 or 1.3 is loaded.     Package caption Info: float package is loaded.     Package caption Info: hyperref package is loaded.     Package caption Info: wrapfig package is loaded.     Package caption Info: End \AtBeginDocument code.          (/usr/local/texlive/2011/texmf-dist/tex/context/base/supp-pdf.mkii     [Loading MPS to PDF converter (version 2006.09.02).]     \scratchcounter=\count453     \scratchdimen=\dimen319     \scratchbox=\box86     \nofMPsegments=\count454     \nofMParguments=\count455     \everyMPshowfont=\toks48     \MPscratchCnt=\count456     \MPscratchDim=\dimen320     \MPnumerator=\count457     \makeMPintoPDFobject=\count458     \everyMPtoPDFconversion=\toks49     ) (/usr/local/texlive/2011/texmf-dist/tex/latex/oberdiek/epstopdf-base.sty     Package: epstopdf-base 2010/02/09 v2.5 Base part for package epstopdf          (/usr/local/texlive/2011/texmf-dist/tex/latex/oberdiek/grfext.sty     Package: grfext 2010/08/19 v1.1 Managing graphics extensions (HO)     )     Package grfext Info: Graphics extension search list:     (grfext)             [.png,.pdf,.jpg,.mps,.jpeg,.jbig2,.jb2,.PNG,.PDF,.JPG,.JPE     G,.JBIG2,.JB2,.eps]     (grfext)             \AppendGraphicsExtensions on input line 452.          (/usr/local/texlive/2011/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg     File: epstopdf-sys.cfg 2010/07/13 v1.3 Configuration of (r)epstopdf for TeX Liv     e     ))     Package biblatex Info: No input encoding detected.     (biblatex)             Assuming 'ascii'.     Package biblatex Info: Automatic encoding selection.     (biblatex)             Assuming data encoding 'ascii'.     \openout3 = `preamble-blx.bib'.          Package biblatex Info: Trying to load bibliographic data...     Package biblatex Info: ... file 'main.bbl' not found.          No file main.bbl.     Package biblatex Info: Reference section=0 on input line 42.     Package biblatex Info: Reference segment=0 on input line 42.     ABD: EveryShipout initializing macros     \AtBeginShipoutBox=\box87     Package hyperref Info: Link coloring ON on input line 42.          (/usr/local/texlive/2011/texmf-dist/tex/latex/hyperref/nameref.sty     Package: nameref 2010/04/30 v2.40 Cross-referencing by name of section          (/usr/local/texlive/2011/texmf-dist/tex/generic/oberdiek/gettitlestring.sty     Package: gettitlestring 2010/12/03 v1.4 Cleanup title references (HO)     )     \c@section@level=\count459     )     LaTeX Info: Redefining \ref on input line 42.     LaTeX Info: Redefining \pageref on input line 42.     LaTeX Info: Redefining \nameref on input line 42.          (./main.out) (./main.out)     \@outlinefile=\write8     \openout8 = `main.out'.               (/usr/local/texlive/2011/texmf-dist/tex/latex/beamer/translator/dicts/translato     r-basic-dictionary/translator-basic-dictionary-English.dict     Dictionary: translator-basic-dictionary, Language: English      )     (/usr/local/texlive/2011/texmf-dist/tex/latex/siunitx/config/siunitx-abbreviati     ons.cfg     File: siunitx-abbreviations.cfg 2011/09/13 v2.3f siunitx: Abbreviated units     )     (/usr/local/texlive/2011/texmf-dist/tex/latex/siunitx/config/siunitx-binary.cfg     File: siunitx-binary.cfg 2011/09/13 v2.3f siunitx: Binary units     )     LaTeX Info: Redefining \microtypecontext on input line 42.     Package microtype Info: Generating PDF output.     Package microtype Info: Character protrusion enabled (level 2).     Package microtype Info: Using default protrusion set `alltext'.     Package microtype Info: Automatic font expansion enabled (level 2),     (microtype)             stretch: 20, shrink: 20, step: 1, non-selected.     Package microtype Info: Using default expansion set `basictext'.     Package microtype Info: No tracking.     Package microtype Info: No adjustment of interword spacing.     Package microtype Info: No adjustment of character kerning.     Package microtype Info: Redefining babel's language switching commands.      (/usr/local/texlive/2011/texmf-dist/tex/latex/microtype/mt-cmr.cfg     File: mt-cmr.cfg 2009/11/09 v2.0 microtype config. file: Computer Modern Roman      (RS)     )     \c_siunitx_mathsf_int=\count460     LaTeX Font Info:    Try loading font information for U+msa on input line 42.          (/usr/local/texlive/2011/texmf-dist/tex/latex/amsfonts/umsa.fd     File: umsa.fd 2009/06/22 v3.00 AMS symbols A     )     (/usr/local/texlive/2011/texmf-dist/tex/latex/microtype/mt-msa.cfg     File: mt-msa.cfg 2006/02/04 v1.1 microtype config. file: AMS symbols (a) (RS)     )     LaTeX Font Info:    Try loading font information for U+msb on input line 42.          (/usr/local/texlive/2011/texmf-dist/tex/latex/amsfonts/umsb.fd     File: umsb.fd 2009/06/22 v3.00 AMS symbols B     )     (/usr/local/texlive/2011/texmf-dist/tex/latex/microtype/mt-msb.cfg     File: mt-msb.cfg 2005/06/01 v1.0 microtype config. file: AMS symbols (b) (RS)     )     LaTeX Font Info:    Try loading font information for U+esint on input line 42.          (/usr/local/texlive/2011/texmf-dist/tex/latex/esint/uesint.fd     File: uesint.fd      )     LaTeX Font Info:    Try loading font information for U+rsfs on input line 42.          (/usr/local/texlive/2011/texmf-dist/tex/latex/jknapltx/ursfs.fd     File: ursfs.fd 1998/03/24 rsfs font definition file (jk)     )     \c_siunitx_mathtt_int=\count461          ./main.tex:47: Undefined control sequence.     l.47 \akaka          The control sequence at the end of the top line     of your error message was never \def'ed. If you have     misspelled it (e.g., `\hobx'), type `I' and the correct     spelling (e.g., `I\hbox'). Otherwise just continue,     and I'll forget about whatever was undefined.          Package atveryend Info: Empty hook `BeforeClearDocument' on input line 51.     [1{/usr/local/texlive/2011/texmf-var/fonts/map/pdftex/updmap/pdftex.map}]     Package atveryend Info: Empty hook `AfterLastShipout' on input line 51.          (./main.aux)     Package atveryend Info: Executing hook `AtVeryEndDocument' on input line 51.     Package atveryend Info: Executing hook `AtEndAfterFileList' on input line 51.     Package rerunfilecheck Info: File `main.out' has not changed.     (rerunfilecheck)             Checksum: D41D8CD98F00B204E9800998ECF8427E;0.     Package logreq Info: Writing requests to 'main.run.xml'.     \openout1 = `main.run.xml'.           )      Here is how much of TeX's memory you used:      2167 strings out of 455899      40306 string characters out of 2353312      1131909 words of memory out of 3000000      42382 multiletter control sequences out of 15000+200000      26633 words of font info for 111 fonts, out of 3000000 for 9000      831 hyphenation exceptions out of 8191      36i,6n,45p,773b,1377s stack positions out of 5000i,500n,10000p,200000b,50000s     {/usr/local/texlive/2011/texmf-dist/fonts/enc/dvips/cm-super/cm-super-t1.enc}     </usr/local/texlive/2011/texmf-dist/fonts/type1/public/cm-super/sfrm1000.pfb></     usr/local/texlive/2011/texmf-dist/fonts/type1/public/cm-super/sfrm1200.pfb></us     r/local/texlive/2011/texmf-dist/fonts/type1/public/cm-super/sfrm1728.pfb>     Output written on main.pdf (1 page, 19387 bytes).     PDF statistics:      29 PDF objects out of 1000 (max. 8388607)      22 compressed objects within 1 object stream      2 named destinations out of 1000 (max. 500000)      23053 words of extra memory for PDF output out of 24883 (max. 10000000)      Vim should only display:               main.tex l.47 undefined control sequence      Yet I like seeing the output so that I have some feedback about which page is being compiled etc...


title: appending a variable to a file in Bash not working

text: I have a code like this               #! /bin/bash          $version = "1.0";     $preffix = "ApplicationName.";          for f in pack*;     do         echo "bla bla bla" > myFile.txt         echo $preffix >> myFile.txt         echo "more stuff" >> myFile.txt         echo $version >> myFile.txt     done;      the output is               bla bla bla          more stuff      $version and $preffix are not added to myFile.txt... why?