title: How do I grant someone else access to my linux server

text: If you administer a Linux server, what steps do you take to properly grant someone else access? Assuming they will log in over `ssh`, don't already have an account, and will need root access. (Temporarily).


title: how can I add (subtract, etc.) two numbers with bash?

text: I can read the numbers and operation in with:               echo "First number please"     read num1     echo "Second mumber please"     read num2     echo "Operation?"     read op      but then all my attempts to add the numbers fail:               case "$op" in       "+")         echo num1+num2;;       "-")         echo `num1-num2`;;     esac      Run:               First number please     1     Second mumber please     2     Operation?     +      Output:               num1+num2      ...or...               echo $num1+$num2;;          # results in: 1+2          ...or...               echo `$num1`+`$num2`;;          # results in: ...line 9: 1: command not found      Seems like I'm getting strings still perhaps when I try add add ("2+2" instead of "4").


title: Use certain version of JRE / JDK for certain programs

text: I use ArchLinux, and an IDE called PyCharm. On its download page, it recommends using Java 6 instead of OpenJDK. ArchLinux has an OpenJDK package (`jdk7-openjdk`) that I have installed, installed, and from what I had read in the Arch Wiki on Java, it should be possible to install Oracle Java 6 along side OpenJDK 7 via a packages called `jdk6-compat` and `jre6-compat`, which install these versions of Java in `/opt/` instead of the normal location. However, after installing `jdk6-compat` and `jre6-compat`, I still see that I am running OpenJDK 7 when I run the following:               % java -version     java version "1.7.0_09"     OpenJDK Runtime Environment (IcedTea7 2.3.3) (ArchLinux build 7.u9_2.3.3-1-x86_64)     OpenJDK 64-Bit Server VM (build 23.2-b09, mixed mode)      ...even after I have set `JAVA_HOME` and added `/opt/java6/bin` to my `PATH` in my `.zshrc` file. How can I get PyCharm (or other applications) to use Oracle Java 6 instead of OpenJDK? Thanks, and apologies if I've posted in the wrong place. Other information that might be helpful:   * Using Gnome 3 as DE


title: RHEL - Group assigned incorrectly

text: In our lab, all the LDAP users are assigned to a group **vboxusers** whose home directory is present in the server. We are using NFS to mount the home directory of an user to the client machines. I was installing a new client machine and added it to the network. I configured the LDAP in this new machine and strangely there was a group **cimsrvr** which was assigned the same ID as **vboxusers** in the remaining client machines. In the newly installed machine, I find the below entry in **/etc/group** file.               cimsrvr: 501      In all of the remaining client machines, I find the entry in **/etc/group** file as,               vboxusers: 501      I was assigning permission to all the users belonging to **vboxusers** to access _Virtualbox_. When I assigned the permissions to **cimsrvr** in the new machine, the vboxusers were able to access _Virtualbox_ without any problem. So, I figured out the group name is just for our understanding and the machine just uses the group ID. That's why all the users belonging to group 501 were able to access _VirtualBox_. My question is, how did the **cimsrvr** group got assigned to 501 in the first place when I did not create any group by that name?


title: Display a right-click menu using a shell script

text: Is it possible to display a right-click menu using a shell script (or some kind of Unix command?) I'm trying to find a program that can be used to display a context menu at a specific location on the screen. For example, it would be useful to display the desktop right-click context menu programmatically (the one that appears when right-clicking on a file.) This would require some method of launching the desktop right-click menu from the command line.


title: dpkg / apt-get wants to install and overwrite different package

text: I want to install Pound. Doing this:               apt-get install pound      produces this:               root@myhost:~# apt-get install pound     Reading package lists... Done     Building dependency tree     Reading state information... Done     The following packages were automatically installed and are no longer required:       linux-headers-3.2.0-23-generic linux-headers-3.2.0-23     Use 'apt-get autoremove' to remove them.     The following NEW packages will be installed:       pound     0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.     2 not fully installed or removed.     Need to get 98.3 kB of archives.     After this operation, 226 kB of additional disk space will be used.     Get:1 http://us.archive.ubuntu.com/ubuntu/ precise/universe pound amd64 2.5-1.1 [98.3 kB]     Fetched 98.3 kB in 0s (418 kB/s)     Selecting previously unselected package pound.     (Reading database ... 102644 files and directories currently installed.)     Unpacking pound (from .../pound_2.5-1.1_amd64.deb) ...     Processing triggers for ureadahead ...     ureadahead will be reprofiled on next reboot     Processing triggers for man-db ...     Setting up mysql-server-5.5 (5.5.32-0ubuntu0.12.04.1) ...          Configuration file `/etc/apparmor.d/usr.sbin.mysqld'      ==> Modified (by you or by a script) since installation.      ==> Package distributor has shipped an updated version.      ==> Modified (by you or by a script) since installation.      ==> Package distributor has shipped an updated version.        What would you like to do about it ?  Your options are:         Y or I  : install the package maintainer's version         N or O  : keep your currently-installed version           D     : show the differences between the versions           Z     : start a shell to examine the situation      The default action is to keep your current version.      mysql-server is installed and running. I do not want to try re-installing this. The Pound package does not need mysql-server as any dependancy. How do I fix this? I don't want to upgrade this since this would take down a production system. There seems to be something stuck in `dpkg` that is forcing any package installed to force a mysql-server re-installation or upgrade.


title: NetworkManager (applet) - After click on network no window or error

text: I have a problem with NetworkManger, or to be specific with the nm-applet. When I choose the WiFi network I want to connect to nothing happens. The terminal window I opened nm-applet shows some warnings and errors, but I don't think that they have something to do with the actual problem: > >     nm-applet (nm-applet:1442): >     nm-applet-WARNING **: Error connecting to ModemManager: Error calling > StartServiceByName for org.freedesktop.ModemManager1: >     GDBus.Error:org.freedesktop.systemd1.Load Failed: Unit dbus- > org.freedesktop.ModemManager1.service failed to load: No such file or > directory. >     ** Message: Remote error from secret service: > org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.secrets > was not provided by any .service files >   I know that one error occurs because I don't have installed the notification tool that is needed for the GNOME notifications. NetworkManager's service is running. My wifi on-board card is an Intel Pro/Wireless 5100 AGN (it uses the iwlwifi driver). My distribution is Arch Linux and I'm using the awesome WM.


title: How do I find new drivers for my laptop in RHEL WS 6.4?

text: I recently installed Redhat workstation 6.4 on my laptop as some of the stuff we're doing in class uses Linux (we have an RPi that we're learning the C language on). I figured, since the school has RHEL free for students, I would try that distro hoping that there would be additional support and stuff like that over the free versions. So, everything works and I have an internet connection but I'd like to update things like drivers. Everything I search for gives Ubuntu solutions. Question one: do Ubuntu and Redhat (or all Linux in general) use the same drivers? Question two: how do I find drivers for my laptop (HP Envy 14, 14T-1100)? EDIT: To respond to those who have commented, there's a couple things that I would currently consider issues. The right mouse button on the touchpad doesn't do anything and the screen resolution is locked at SVGA or lower (or something near that). I haven't tested ethernet but the wireless works.


title: What files does authconfig modify on RHEL?

text: I am trying to allow RHEL to use login accounts that are created on the system, but use the passwords from Active Directory. I have seen someone use:               authconfig \     --enablekrb5 \     --krb5realm=KDCRealm.NET \     --krb5kdc=kcldap.net \     --krb5adminserver=kcldap.net \     --enablekrb5kdcdns \     --enablekrb5realmdns \     --update      although, I'm not sure how or what that command does, or what files it modifies.


title: Securest way to authenticate users against /etc/shadow using PHP?

text: This question became important to me, since I'm setting up a Horde environment and want to use the system accounts. Doing some search I found mainly 4 ways of doing that, which all seem to have some drawbacks. Now I'm wondering, which one is most secure or if I'm missing some alternatives.   * Method 1: Use PAM (PHP) Horde offers an auth plugin that makes use of the PAM library. Works fine, but the webserver needs read access to /etc/shadow. I found some statements saying this is as secure as publishing the password file for download.   * Method 2: Use /bin/su (PHP) In addition, Horde provides a module that uses `/bin/su` to authenticate by calling fopen (file open) on `/bin/su -c /bin/true $username` and writing the password to this "file". Currently, this does not work for me. AFAIK, this is probably because `/bin/su` is configured to only work in a terminal. I read it was possible to allow this usage of `/bin/su`, but it would be insecure.   * Method 3: Use external program (command line) I could write a small program that makes use of the PAM library and is invoked by PHP. Using SUID, no one could access `/etc/shadow`. However, I have to pass the password as an argument to or pipe it into my program, which again is said to be a security risk. (I guess that's the reason, why `/bin/su` does not allow it by default.)   * Method 4: Use external program (local network)  Same as method 3, but the communication could be done via unix sockets or tcp connections. I don't know whether this is more secure than #3, probably equivalent to the question whether it's harder to spy on local network connections than on tty!? I think it is clear, why the first option isn't a good idea. But I don't know, what's wrong with the others, so I would be glad about some short explanations.


title: /etc/shadow & gawk

text: I ran this small script on /etc/shadow: ` awk '{ FS = ":" } { print $1, $2 }' /etc/shadow ` It does what it should on all lines except for the root's record I.e. it just prints the entire record. Know why ? I executed it logged in as root. System's slackware. Kernel 3.2.29. This is quite perplexing right ?


title: I used the move command and all files disappeared

text: I was moving all data to another folder and made 1 mistake and run this commmand               mv * /*      all files have disappeared now. How can I find them? Or are they deleted?


title: linux & solaris - separate netmask IP's from ordinary IP's

text: I have file with IP address and netmask IP's my target is to cut the netmask IP's from the **file_with_IPs.txt** and paste them to another file as **file_with_only_netmask_ips.txt** remark - netmask IP can be any combination of netmask IP , and can start for example from xxx.xxx.xxx.xxx/1 until xxx.xxx.xxx.xxx/32 for example                 10.140.4.11    10.140.4.110           255.255.0.0    255.255.255.0           10.219.39.188  10.219.39.200       10.219.39.189  10.219.39.145       10.140.4.12    10.140.4.120       10.219.39.138   10.219.39.140       10.219.39.139   10.219.39.239       255.0.0.0        255.255.0.0       255.255.255.128    255.255.255.192      so finally I will have in **file_with_IPs.txt** file                 10.140.4.11    10.140.4.110           10.219.39.188  10.219.39.200       10.219.39.189  10.219.39.145       10.140.4.12    10.140.4.120       10.219.39.138   10.219.39.140       10.219.39.139   10.219.39.239      and in **file_with_only_netmask_ips.txt** I will have only the netmask IPs as the following:                 255.255.0.0    255.255.255.0       255.0.0.0        255.255.0.0       255.255.255.128    255.255.255.192      Please advice what the best way to separate the netmask IPs from the ordinary IP's ? I need to write the procedure with ksh shell , and I need to run this process on Linux and Solaris machines remark perl one linear , sed and awk can be in ksh script


title: Whta does '\+::::::/bin/bash' in /etc/passwd mean?

text: Found the line `\\+::::::/bin/bash` in my /etc/passwd, which looks strange to me. What does that mean? Has my computer been hacked?


title: SSH Authentication Mechanism

text: Doing a personal research project and I'm wondering: Why does SSH do its own mechanism negotiation rather than use SASL? At first I thought it might be to ensure confidentiality of the whole session, but looking at the wikipedia page it looks like that should be taken care of by the "transport" layer, much like exists in TLS+SASL. My question is: Is there a technical reason why ssh can't just do a key exchange and then run SASL negotiation through the tunnel before setting up the channel(s)?


title: How do I change owner/permissions of auto mount on an embedded linaro based linux

text: I have an ARM based embedded system that when it auto mounts a USB drive it mounts it:               drwx------ 6 linaro linaro 2048 Jan 1 1970 PENDRIVE      I need to change the permissions and possibly thew owner of the drive automatically as it is mounted by automount. My system is: > Linux Marsmpd 3.0.36-t3+ #19 PREEMPT Mon Aug 6 12:10:13 EST 2012 armv7l > armv7l armv7l GNU/Linux How do I accomplish this? Also is there a way to run a script automatically when it is automounted?


title: Install java, tomcat7 or tomcat6 on RHEL5 centos5

text: I wish to install tomcat7 on centos5 sticking on yum but I have               --> Finished Dependency Resolution     java-1.6.0-sun-compat-1.6.0.03-1jpp.i586 from jpackage-generic-nonfree has depsolving problems     --> Missing Dependency: jdk = 2000:1.6.0_03-fcs is needed by package java-1.6.0-sun-compat-1.6.0.03-1jpp.i586 (jpackage-generic-nonfree)     Error: Missing Dependency: jdk = 2000:1.6.0_03-fcs is needed by package java-1.6.0-sun-compat-1.6.0.03-1jpp.i586 (jpackage-generic-nonfree)     You could try using --skip-broken to work around the problem     You could try running: package-cleanup --problems                         package-cleanup --dupes                         rpm -Va --nofiles --nodigest      I've already tried with:               yum install java     yum install tomcat6     yum install tomcat7      these all end up with the same dependency resolution problem. The enabled repos are:               [jpackage-generic]     name=JPackage (free), generic     mirrorlist=http://www.jpackage.org/mirrorlist.php?dist=generic&type=free&release=5.0     failovermethod=priority     gpgcheck=1     gpgkey=http://www.jpackage.org/jpackage.asc     enabled=1          [jpackage-rhel]     name=JPackage (free) for Red Hat Enterprise Linux $releasever     mirrorlist=http://www.jpackage.org/mirrorlist.php?dist=redhat-el-$releasever&type=free&release=5.0     failovermethod=priority     gpgcheck=1     gpgkey=http://www.jpackage.org/jpackage.asc     enabled=1          [jpackage-generic-nonfree]     name=JPackage (non-free), generic     mirrorlist=http://www.jpackage.org/jpackage_generic_nonfree_5.0.txt     failovermethod=priority     gpgcheck=1     gpgkey=http://www.jpackage.org/jpackage.asc     enabled=1          # Updates          [jpackage-generic-updates]     name=JPackage (free), generic     mirrorlist=http://www.jpackage.org/mirrorlist.php?dist=generic&type=free&release=5.0-updates     failovermethod=priority     gpgcheck=1     gpgkey=http://www.jpackage.org/jpackage.asc     enabled=1          [jpackage-rhel-updates]     name=JPackage (free) for Red Hat Enterprise Linux $releasever     mirrorlist=http://www.jpackage.org/mirrorlist.php?dist=redhat-el-$releasever&type=free&release=5.0-updates     failovermethod=priority     gpgcheck=1     gpgkey=http://www.jpackage.org/jpackage.asc     enabled=1          [jpackage-generic-nonfree-updates]     name=JPackage (non-free), generic     mirrorlist=http://www.jpackage.org/jpackage_generic_nonfree_5.0-updates.txt     failovermethod=priority     gpgcheck=1     gpgkey=http://www.jpackage.org/jpackage.asc     enabled=1          [jpackage-generic-6.0]     name=JPackage (free), generic     baseurl=http://mirrors.dotsrc.org/jpackage/6.0/generic/free/     gpgcheck=1     gpgkey=http://jpackage.org/jpackage.asc     enabled=1


Feb 24 15:54:34 ns1 named[20308]: all zones loaded     Feb 24 15:54:34 ns1 named[20308]: running     Feb 24 15:54:34 ns1 systemd[1]: PID file /var/run/named/named.pid not readable (yet?) after start.     Feb 24 15:56:03 ns1 systemd[1]: named.service operation timed out. Terminating.     Feb 24 15:56:03 ns1 named[20308]: shutting down     Feb 24 15:56:03 ns1 named[20308]: stopping command channel on 0.0.0.0#953     Feb 24 15:56:03 ns1 named[20308]: exiting      I have tried renaming to named.service as mentioned here: named does't start when using systemctl


title: Have cron email output to MAILTO based on exit status

text: I have a cron job running a php command like this: `php /path/to/script.php > dev/null` This should send only STDERR output to the MAILTO address. From what I gather the php script is not outputting any STDERR information even when its exit status is 1. How can I get the output of the php command (STDOUT) and only send it to MAILTO if the exit status is non-zero?


title: Appending current date to filename

text: I'm trying to append the current date to the end of a file name like this:               TheFile.log.2012-02-11      Here is what I have so far:               set today = 'date +%Y'     mkdir -p The_Logs &     find . -name The_Logs -atime -1 -type d -exec mv \{} "The_Logs_+$today" \; &      However all I get is the name of the file, and it appends nothing. How do I append a current date to a filename?


title: sv_SE.UTF-8 Problems with Bash and VIM in iTerm2

text: Two specific issues, despite me running iconv -f iso-8859-15 on my old files when converting from sv_SE.iso8859-15 to sv_SE.utf-8 I still get distorted characters. And I believe it's because of Vim because I can't even type Swedish åäö characters in Vim any longer. The second issue is in the Bash, when open a new shell, or start a new line, the first Swedish åäö I type does not show, until I press any second key that produces any character. So typing å/ on my keyboard will only show å in the terminal. Typing åäö will show åö, and so forth. It always ignores the second character I type after one of these, and then starts showing at the third. Sort of like ignoring the second byte or skipping the second byte in the multibyte character. Edit: Clarification, after I've typed the first multibyte character, others show directly. But if I type åååå four times, the first one is delayed, and then hit enter, and then typ exit what comes out is åexit. As if it saves the last byte of the last character I typed in buffer. Here's the relevant environment configuration, please let me know if there is more needed to solve this.               $ cat .inputrc     set show-all-if-ambiguous on     set mark-directories on     set mark-symlinked-directories on     set page-completions off     set visible-stats on     set completion-query-items 9001          set input-meta on     set output-meta on     set convert-meta off          "\e[A": history-search-backward     "\e[B": history-search-forward     "\C-w": backward-kill-word          "\e[1~": beginning-of-line     "\e[4~": end-of-line     "\e[3~": delete-char          $ locale     LANG="sv_SE.UTF-8"     LC_COLLATE="sv_SE.UTF-8"     LC_CTYPE="sv_SE.UTF-8"     LC_MESSAGES="sv_SE.UTF-8"     LC_MONETARY="sv_SE.UTF-8"     LC_NUMERIC="sv_SE.UTF-8"     LC_TIME="sv_SE.UTF-8"     LC_ALL="sv_SE.UTF-8"          $ locale -a     sv_SE     sv_SE.ISO8859-1     sv_SE.ISO8859-15     sv_SE.UTF-8      Also tried this in .inputrc, advised from a Swedish mac forum. Did not help with any of the above issues. Same symptoms in both Terminal.app and iTerm2.app, with the checkbox "Escape non-ASCII characters" unchecked in Terminal.app.               set meta-flag on     set input-meta off     set output-meta on     set convert-meta off      In Vim.   * Current language: "sv_SE.UTF-8/sv_SE.UTF-8/sv_SE.UTF-8/C/sv_SE.UTF-8/sv_SE.UTF-8"   * set encoding=UTF-8   * set fileencoding=UTF-8 I'm running the latest update of Mac OS Lion with the latest beta of iTerm2. Same issue in Terminal.app so I expect this to be caused by my environment.


title: Epson Stylus CX5600: Can't print

text: I'm using Linux Mint 11 (Katya). My printer is perfeclty recognized by the OS and I can configure it without problems. But when I try to print anything, both the printer's power led and error led start blinking, and nothing happens. The printer worked just fine in previous versions of Ubuntu. I suspect that ink might be low, but there is no way to check because the ubuntu driver doesn't have that functionality. Plus, I don't have a Windows box available. Any suggestions?


title: How to know URL being observed directly in a server

text: I host many websites using cpanel. I want to know URL being accessed at real time. It seems that many old domains still point to my host and they seem to take a chunk of CPU


title: Bash 3.0 not supporting lists?

text: I have written a small script that add particular IP addresses taken from a config file and then puts it in a list :                 WAS_IP=$(grep "<was_ip>" $CONFIG| cut -d '>' -f 2 | cut -d '<' -f 1 | xargs)            NODES=()       NODES+=("$WAS_IP")      On bash `3.2.25`this works fine but on `3.0` where I have my production environment this gives an error :               ./config.sh: line 3154: syntax error near unexpected token `"$WAS_IP"'     ./config.sh: line 3154: `      NODES+=("$WAS_IP")'      How can I avoid this issue ?


title: Keyboard layout change indicator

text: I have (and often change) 3 keyboard layouts on my Mint 17/Mate. I would like to see a notification on my screen when layout is changed, e.g. "Switched to English/US". I tried to do it via keyboard settings, to find a program or script to do it, but I couldn't. The question is: are there any programs to show current layout OR is there a way to catch layout change event from X11 in user script? Any advice or guide to information would be appreciated. Update: I've found `notify-send` to actually send notification, now I need to catch layout change event.


title: Switch Maven version after installing from jpackage?

text: I've installed `maven3` on CentOS from the JPackage repository. Problem is my installs also seem to have pulled in `maven2` which is the default. Is there any way to switch `/usr/bin/mvn` to be maven3? perhaps using the `alternatives` application? (note: I can modify the path, or symlink I know, just trying to find out if there's a more correct way)


title: Cannot mount samba share: Mount error (22)

text: I am trying to mount a password protected samba share. When I access the share via smb://server/share in nautilus there is no password/user promt, it seems I am logged in as a guest and I can browse folders but I cannot access my files (which are in a subfolder that appears to be empty). When I use nautilus GUI "connect to Server" prompt, I get back "Please verify your user details" although I am absolutely certain they are correct. Note that I can access the share and my files without problem via               smbclient -U user //server/share      Also, using a MacOS machine I can also mount the shares without any problems. So I try to mount the share via the commandline:               sudo mount -t cifs -o user=user //server/share  /mnt/sth      which produces               mount error(22): Invalid argument     Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)      This seems to be a Kernel related bug: https://bugzilla.redhat.com/show_bug.cgi?id=832741. So my question is: what's the simplest way to solve this? Did anyone experience something similar? Did a Kernel update solve it (at the redheat forums it seems to work for some but not for others). Am I doing something wrong? I use linux mint xcfe 13, my Kernel version is 3.4.0. EDIT: 20/2/2013, I still don't have a solution for this and appreciate any help.


title: how to start from within my shell-script xterm which starts mplayer and plays the files that are the argument of the script

text: What I want to do: Start my script with a list of files as arguments. From within my script I want to start xterm that starts mplayer with these files. I tried several things. **I call my script like this:**               myscript.sh *      The **files are named like**               "aaa AAA"     "bbb BBB"     "ccc DDD"      (i.e. filenames with spaces) and are playable sounds, music or videos with mplayer. ## This is what I tried All of the following commands were written **inside my script!** I tried:   1. The following **works**. Files are printed.              ls -l $@        2. The following **works**. Files are printed.              IFS='\n'     ls -l $*        3. The following **works**. Files are printed. Strangely I do not need the `IFS='\n'` here. Why?              xterm -e 'ls -l $*; read'        4. This **does not** find the files.               FILES=$@     ls -l $FILES        5. This **does not** find the files. Here all filenames are treated as one long filename. (???)              IFS='\n'     FILES=$@     ls -l $FILES        6. This **does not** find the files.               export FILES=$@     ls -l $FILES        7. But the following **works**. Files are printed.              IFS='\n'     export FILES=$@     ls -l $FILES      * * * Now with mplayer.   1. This **works**.              IFS='\n'     export FILES=$@     mplayer $FILES        2. This **does not** work. But why does number 2 for `ls -l` work then? Here mplayer exits printing it’s help as if I just start `mplayer` with no arguments.              xterm -e 'mplayer $*; read'        3. This **does not** work. It fails for all the files with spaces in the filename.              IFS='\n'     FILES=$@     xterm -e 'mplayer $FILES; read'      **Question:** How can I start mplayer from its own xterm with the files saved in the `$FILES` variable?


title: How do I determine which configuration options an rpm package is built with?

text: This is my first question and I'm still pretty new so please forgive me if I've missed or botched something, or if this is an obvious solution. I'm using CentOS 5.8 (yes I know it's ancient) and trying to test some squid configurations From the Squid wiki: > NP: Squid must be built with the --enable-http-violations configure option > before building. I've done some searching to try to determine where I can find which configuration options were specified at package build, but short of reading through all of the CentOS documentation I can't seem to locate where I can find these configuration options. I know this question may be similar to this one, but in this case the specific squid package may have been custom built, and I'm not sure I have access to the source without jumping through some hoops. Is there a way I can list the configuration flags with yum or rpm without extracting the spec file?


title: How do I combine the -v and -B switches in grep?

text: I have a list of currently installed kernels, and I'm trying to grep out both the currently installed kernel and the previously installed kernel. For this example, linux-image-3.2.0-60-generic is the currently running kernel, and these are the installed kernels:               linux-image-3.2.0-49-generic     linux-image-3.2.0-51-generic     linux-image-3.2.0-52-generic     linux-image-3.2.0-53-generic     linux-image-3.2.0-54-generic     linux-image-3.2.0-55-generic     linux-image-3.2.0-56-generic     linux-image-3.2.0-57-generic     linux-image-3.2.0-58-generic     linux-image-3.2.0-59-generic     linux-image-3.2.0-60-generic     linux-image-3.2.0-61-generic     linux-image-3.2.0-63-generic     linux-image-3.2.0-64-generic      I can use `grep -v $(uname -r)` to remove the currently running kernel from this list. However, I can't seem to use `grep -v -B 1 $(uname -r)` to remove current and previous kernel from the list. Is there a way to combine the `-B` and `-v`? Or am I approaching this entirely from the wrong direction?


title: Real time priorities in non real time OS

text: If I do the following command on my standard Linux Mint installation:               comp ~ $ ps -eo rtprio,nice,cmd     RTPRIO  NI CMD     ...     99   - [migration/0]     99   - [watchdog/0]     99   - [migration/1]      -   0 [ksoftirqd/1]     99   - [watchdog/1]      I get some of the processes with realtime priority of 99. What is the meaning of `rtprio` in a non real time Linux? Does this mean that if I just run a program with `rtprio` 99 it runs real time? Where do real time OSes fall in this story?


title: Is maximum individual file size in ext3 imposed on mysql tables?

text: I am reading about the file systems in Linux from here. This particular sentence kind of confuses me. > For ext3, > >   * Maximum individual file size can be from 16 GB to 2 TB. >   * Overall ext3 file system size can be from 2 TB to 32 TB. > So, does the above sentence mean I cannot have a single file that is greater than 2 TB in size? If that is the case, can't I have a single `mysql` table which has greater than **2 TB** capacity? The tables are stored as per the `datadir` parameter mentioned in `/etc/my.cnf`. So assuming, I have a HDD of **4 TB** capacity and a `mysql` table of size **2.5 TB** , can the table be fit into the HDD or not? **EDIT** I am not concerned with the maximum file size as the answer of Barmar specifies. I am more concerned on finding out **will there be any error thrown if I have a single`mysql` table that is greater than the size of the maximum allowable individual file size of ext3 file system.**


title: Why does this script work on Ubuntu, and not Debian?

text: I run a simple minecraft server. I made a script awhile ago for Ubuntu that would automatically create a Gnu screen and start said server. I decided get a new server with debian instead. Now for some reason the script will not work and i have no idea why :/ TL;DR Switched from ubuntu to debian now script doesnt work               sleep 5     screen -dmS mc     sleep 1     screen -p 0 -S mc -X stuff "cd /home/server/Desktop/ServerSoftware/Minecraft/modpacks^AgrarianSkiesHQ^3_1_1^AgrarianSkiesHQServer"     sleep 1     screen -p 0 -S mc -X eval "stuff \015"     sleep 1     screen -p 0 -S mc -X stuff ./ServerStart.sh     sleep 1     screen -p 0 -S mc -X eval "stuff \015"      How its supposed to work:   1. Start a minimized GNU-Screen   2. Change Directory to the minecraft server directory   3. Start the server basically how it doesnt work is that it WILL create the screen and be detached from it. But after that when I resume the screen I have to CTRL+c to be able to input anything. the "cd" command never gets sent through. nore the ./StartServer.sh EDIT: The "^" in the CD line are supposed to be there. I have tested the command in terminal and it works as wanted


title: How to list all aptitude user tags or the user tags for a package?

text: I'm in a bit of a pickle. Following my own counsel I started using `user-tags` when working on projects, but now I don't remember how I called some of these tags and this cancels their usefulness. Is there a way to get those names back?


title: how to export zh_CN.utf8 in Arch liveCD environment?

text: After i typed `locale -a` it showed only `c, en_US.utf8, POSIX`, then how to export zh_CN.utf8? Cause I've to use a software, which uses zh_CN, to connect the Internet during installation progress...   Any suggestion?


title: Using regex to see if a UNIX process is up

text: In UNIX, I am checking to see if a process is up by executing the following command; E.g.               psg dtllst pe99      This returns the following output if the process is running;               UID    PID    PPID    C    STIME    TTY    TIME CMD     pe99   1234   1       0 03:29:44    pts/8  0:01 dtllst pe99      Now in Perl, I want to be able to find out whether this process is up or not. So far I am doing the following               `my $checkProc = `psg dttlst | grep $myNode 2>&1`;`    #where $myNode is something like pe01 or pe02 or pe65 or pe99 etc...      Now after this I do the following to see if the above Perl command has returned what I am looking for to see if the process is up;               if ($checkProc =~ m/dtllst $myNode | $myNode/) {         #yes, process is up     } else {         #no, process is down     }      However this is not working - specifically, regardless of whether the UNIX process is alive or not, my code ALWAYS evaluates the if statement as true. I know this is wrong. I have tried to escape the "$" character in the regex to see if this was the issue and I have also tried removing the Perl variables from within the regex altogether. What am I missing here? I know my regex is wrong somewhere :( Thanks


title: Difference between "make install" and "sudo make install"

text: Sometimes I encounter problems with using `make install` which gives me a `permission denied` error when writing to some folders. So instinctively I use `sudo make install`. Will this introduce additional problems? I am using Debian Etch.


title: How can I queue processes?

text: I have a surveillance camera and a program records videos when motion is detected. Basically, this program saves the video in a very heavy format. My solution was to call a script that converts the video using ffmpeg. The script is called each time a video is made. The conversion takes a relatively short time, but a lot of CPU use. The problem comes when a new video arrives to be converted and the conversion of the other hasn't finished. In that situation, the script is called again, resulting in two or more ffmpeg processes that make the machine almost hang during a considerable time. How can I queue the conversion job, to be executed after the prior one is done? What I want is to have just one ffmpeg process at a time. Thanks!


title: Best practise to diagnose problems

text: As Linux/Unix users, we run into problems frequently. And after long hours of problem solving, we develop the skill of debugging. Now, what are good principles, methods or best practises when trying to debug general unix problems? What tools should I have, as an average user, to make finding the cause of problems easier?


title: Properly defining a multi-line prompt in tcsh

text: I am trying to configure my `prompt` in `tcsh` to make it multi-line (i.e having one line provide system info, and the next line the one where I type commands). Currently I have the following:               set prompt="(remote) ${green}%n ${green}@ %m ${cyan}%~ ${white} ${end}"      I managed to make it multi-line by adding `%{\n>%}` at the end of it and other similar variations, but this messes my `bindkeys`               set prompt="(conda) ${green}%n ${green}@ %m ${cyan}%~ ${white} %{\n>%} ${end}"      Any thoughts on how to do this properly? For reference, in case it matters, my `bindkeys` are:               bindkey "^n" history-search-forward     bindkey "^p" history-search-backward     bindkey "^r" i-search-back     bindkey "^s" i-search-fwd


title: Do I need a special firewall on a personal computer

text: I am relatively new to Linux and was wondering about security issues. Most people agree that a virus-scanner is not useful on a linux system, but what about a firewall? I am using Debian wheezy stable and before used Ubuntu 12.04. If I only have a personal PC which is logged into a secured WLAN, do I need a firewall and what is already set up on the two OS mentioned above?


title: Fedora 19 Installation issue

text: I have downloaded the fedora 19 DVD iso and want to use it to install through USB. I have used the Linux live creator & other tools to make it bootable. The installer runs correctly but it fails to get the source for installation and says:               Error setting up source for installation.


title: How to force applications to not start maximised in Awesome WM?

text: How to reproduce:   1. `ssh -X user@host firefox` (or some other X application).   2. Maximise the window.   3. Close the application.   4. Open the application in Awesome WM (tried only locally, but should also work remotely). Result: The window is still maximised. Since I _never_ use the maximise functionality in Awesome, and often use it in other window managers, I'd like to unset the maximisation whenever I open X applications in Awesome. I tried this:               { rule = { class = "Firefox" },       properties = { tag = tags[math.min(2, screen.count())][2],                      maximized_vertical = false, maximized_horizontal = false } },      Firefox _does_ start in tag 2, but it's still maximised. Any idea how to unset the maximisation, for Firefox specifically, but even better for all X applications?


title: Error : /etc/sudoers not working - Ownership wrong

text: I have Ubuntu 12.10 on my client system. I have an error `/etc/sudoers is owned by uid 1000 should be 0`. I tried booting from an Ubuntu live CD and tried:               sudo chown root:root /etc/sudoers          sudo chmod 440 /etc/sudoers       and               sudo chown 0.0 /etc/      But it is not working. It continuously gives an error:               sudo : /etc/sudoers is owned by uid 1000 should be 0.      How can I resolve this problem?


title: Use two NICs for different subnets

text: In my office I have use a system with two network cards. I want to use both at same time. I have four subnets in my LAN. I want to route two subnets (192.168.2.0 and 192.168.4.0) through eth0 and another two subnets (192.168.3.0 and 192.168.5.0) through eth1. I want use both in parallel


title: How do I echo a line with linebreak at the end at window border?

text: I would like to echo a list all in one line, TAB separated (like `ls` does with files in one folder)               for i in one two some_are_very_long_stuff b c; do echo $i; done      will print one line per word:               one     two     some_are_very_long_stuff     b     c      instead I would like to break it, like `ls` without options does:               mkdir /tmp/test     cd /tmp/test     for i in one two some_are_very_long_stuff b c z; do touch $i; done     ls      will output               b  one                       two     c  some_are_very_long_stuff  z


title: fedora - snapshot invalid

text: I'm building fedora live images and they use dm-snapshot to make root read- write. The problem I've noticed with this is that either the space allocated for the snapshot is inadequate, or it is generally unstable. My snapshot device is 1048576 512-byte or 512MB. I've used aufs in the past for both a router and desktop and I can generally keep my usage below 512MB. I'm unable to tell exactly what is consuming all this space, I'm guessing that is the drawback to dm snapshot. Once my system blows past 512MB, it is no longer usable. Does anyone else have this issue with Fedora livecds or usb keys? I think my next best option is to make use of aufs, hopefully without needing to write a dracut module or hook.


title: How to set up a global interval between SSH log in attempts?

text: I would like to make it impossible to make more than a single remote log-in attempt in a number of seconds regardless the client IP address (except some trusted white-listed addresses perhaps). So that if, for example, an SSH user enters a bad password no other remote client can log in until the interval passes. The purpose is to protect the system from distributed (botnet) brute force password attacks. Is this possible? PS: I know I can just use certificates and disable password-only log-in but I am still curious.


title: Unix Fetchmail Utility: date on which email was received

text: I've successfully configured `fetchmail` and I'm able to download messages from the mail server but I'm not sure how to get the date on which a particular email was received. I need this date for reporting purposes.


title: How to access the Evolution calendar data from the command line?

text: I want to be able to access the Evolution calendar from the command line. Specifically, I'd like to be able to:   1. List calendar events (the one-line summary, date and time is enough)      1. Upcoming events starting today     2. Events on a specific date   2. Add an event on a specific date How can I do that? Is it possible? Google was distinctly unhelpful in this case. I'm running Evolution 3.4.4. Using additional software packages that talk to the Evolution server is perfectly fine.


title: How to wget a file to a remote machine over SSH?

text: I'd like to basically pipe a `wget` command to a file on a remote server over SSH. How can I do this? I know I could simply `ssh` into the server and have it download the file, but I'd much rather use the local machine to download it and send it.


title: Run a parallel command while waiting for ssh

text: I need to ssh into a server and check for a service to see if it is up and running. What i do is to use ssh and run a command which calls that service and check the output of that command. I want to have a progress bar to show the user that the script is trying to check the status of the service; but I am not able to run the progress bar function while ssh command is not returned from the server! (ssh must wait for the service to fully start before it can check the status) and I miss that part of the progress. Is there a standard way to deal with such a scenario? My ssh command is something like this:               State=$(ssh host "app-status")      And it should return something like:               Status OK


title: Emerge freezes on raspberry pi without error message

text: I am trying to install raspberrypi-userland to my gentoo system with the command               emerge --ask raspberrypi-userland      on my raspberry pi. I am well aware that without cross-compile environment this should take quite some time to execute, but I don't mind waiting. However, for the first two days the text was scrolling on the screen indicating that some progress was being made. Also, every now and then the number of the package number xx/106 would increase in the terminal title. However, now at the package 98/106 (ghostscript) all progress seems to have halted. When I look at the processes with htop (screenshot), I see that the compiler is not consuming CPU at all and looking at the LEDs on the circuit board, I conclude that nothing is being written to the disk either. If I look at the terminal screen where the compiling is being done, I see nothing out of the ordinary (another screenshot) except for the fact that no new text has been printed for more than ten hours now. A glance at /var/log/portage/elog/summary.log reveals me nothing that I consider relevant either, although I might not know exactly what to look for. Any help in determining _what went wrong_ is appreciated. I have received a lot of advice from people saying "just cross compile" but before I start going down that path, I would prefer to build an understanding of what is the problem and wh would it be fixed using cross compiling. Edit: upon requests, screenshots added to the question. ![screenshot1](http://i.stack.imgur.com/Ouyyz.png) ![screenshot2](http://i.stack.imgur.com/gCM8d.png)


title: Installing a printer without a ppd file

text: I am trying to set up a computer linux to be able to print from my printer: Brother DCP 7030. But (twist!) for security reasons this computer should never go online. So any software I need to install will need to be downloaded with another machine, put in a usb stick, and copied onto the linux machine. Sweet. The operating system is Ubuntu 12.04 LTS (not sure what does it mean). OS type: 32-bit. Now the system seem to only accept PPD files as printer drivers. While Brother does not offer any ppd file for this printer (I tried the 7025 and 7045, but they don't work). http://welcome.solutions.brother.com/bsc/public_s/id/linux/en/download_prn.html#DCP-7030 What should I do?


title: Help me choose the right distribution for learning and hosting web apps

text: I'm coming to Linux from the Windows world, and I want to learns the ins and outs of the system in order to make it my primary day to day work and hosting environment. I'm pretty much a complete beginner as far as the OS is concerned, so I would have to start learning it from total scratch. I'm not afraid of getting dirty, but I'd also like the process to be sufficiently pragmatic. Once I'm familiar with the OS, I will be mainly developing Ruby on Rails and Clojure applications on it that I then hope to host on the same environment. Excluding the more consumer-oriented distros like Ubuntu and Mint (or are they worth considering?), what are some good options for me from both a learning and server hosting perspective? I've heard good things of Arch Linux and Debian. Thank you!


title: Configure vim's :make to switch or open tabs on error

text: When I run `:make` from vim and there's an error, it opens that file on the error line number in the current buffer. If possible, I would prefer it switch tabs to the file if it's already open, or make a new tab with the error file. Is this possible?


title: How do I get a websites title using command line?

text: I want a command line program that prints the title of a website. For e.g.:               Alan:~ titlefetcher http://www.youtube.com/watch?v=Dd7dQh8u4Hc      should give:               Why Are Bad Words Bad?       You give it the url and it prints out the Title.


title: Is it possible to redirect system-beeps to the normal audio?

text: When I run this script I don't here any beeps - I suppose it is because there is no speaker attached to the mainboard.   Is there a way to redirect this beeps to the "normal" audio?               #!/usr/bin/env perl     use warnings;     use strict;          $|++;     my $beep = "\07";          print $beep;     sleep 2;     print $beep;     sleep 2;     print $beep;


title: FFmpeg - Split video multiple parts

text: I read the following thread, and the solution works if I want to split a video into pieces every two minutes: Split video file into pieces with ffmpeg The problem is that I want to split a video into pieces every 15 seconds. When I use the following command:               for i in {00..49}      do ffmpeg -i fff.avi -sameq -ss 00:$[ i*2 ]:00 -t 00:00:15 output_$i.avi     done      it will output 15-second video sequences, but not in order. It will skip parts of the video, so I end up with a few 15 second clips, but not all the clips. I want to be able to use ffmpeg to split any video I throw at it into many pieces based on the time I give it.


title: Install Gvim after vim

text: I would like to run vim via X11 (over SSH). Vim comes pre-installed on my NAS (running Debian), however the GUI is not. When I run `vim -g`, I get this error:               E25: GUI cannot be used: Not enabled at compile time      Is there any way to install the GUI by itself, or do I need to reinstall vim altogether?


title: Copy over existing files without confirmation?

text: I need to copy and over-write a large amount of files, I've used the following command:               # cp -Rf * ../      But then whenever a file with the same name exists on the destination folder I get this question:               cp: overwrite `../ibdata1'?       The Problem is that I have about 200 files which are going to be over-written and I don't think that pressing `Y then Enter` 200 times is the right way to do it. So, what is the right way to that?


title: How can I view 10-bit H264 (hi10p) videos in GStreamer video players like Totem?

text: I have a 10-bit H264 video, but I can't play it in Totem or VLC. I tried recompiling libx264 with 10-bit support after removing libx264-116, but it doesn't seem to work. VLC does not use GStreamer, but seems to also use libx264. ![enter image description here](http://i.stack.imgur.com/lWF3y.png)


title: Is there a more modern or more popular version of evms2?

text: I've just re-discovered evms having forgotten about it years ago thinking it was overkill for my needs. To my disappointment it appears to be unmaintained and not very well supported anymore. It seems like a very nice system and I'm wondering if there's a more recent equivalent?


title: Do sleeping processes get the same CPU time?

text: Some processes spend most of their "lives" in a `sleep` status. Daemons, servers and general listener come to mind. I was wondering if they get the same CPU time in that state? On something like my laptop, that wouldn't be very optimal! I vaguely remember from my operating system course that there are different approaches to scheduling. I am interested to find out more about my current Linux (Debian) box. How can I find out about my current scheduling policies? Can I change them dynamically? With a pretty userland app?


title: What processes on CentOS6/RHEL regulates user login but not password itself?

text: I was doing some maintenance via root account over ssh after several months of inattention. I shutdown, after startup I **can't log in to root account** at tty or via ssh. Fortunately, **sudo works** to perform root actions through my user account. There's **nothing special about the install**. Its out-of-the- box, so to speak. root uses local authentication. I first tried changing the root password. The password change was successful, because I was also able to **authenticate against the root account** with: `authconfig --test`, which asks for root password outside of sudo/su. **Reset permissions** and owner/groups with `rpm -a --setperms coreutils` **PAM debug** on `pam_succeed_if.so`. Here is the last borked session using pam debug flag:               Jul 27 18:29:18 mrwizard sshd[2054]: Server listening on 0.0.0.0 port 22.     Jul 27 18:29:18 mrwizard sshd[2054]: Server listening on :: port 22.     Jul 27 18:32:51 mrwizard login: pam_succeed_if(login:session): 'service' resolves to 'login'     Jul 27 18:32:51 mrwizard login: pam_succeed_if(login:session): requirement "service in crond" not met by user "root"     Jul 27 18:32:51 mrwizard login: pam_unix(login:session): session opened for user root by LOGIN(uid=0)     Jul 27 18:32:51 mrwizard login: ROOT LOGIN ON tty1     Jul 27 18:32:52 mrwizard login: pam_succeed_if(login:session): 'service' resolves to 'login'     Jul 27 18:32:52 mrwizard login: pam_succeed_if(login:session): requirement "service in crond" not met by user "root"     Jul 27 18:32:52 mrwizard login: pam_unix(login:session): session closed for user root     Jul 27 18:32:56 mrwizard login: pam_succeed_if(login:session): 'service' resolves to 'login'     Jul 27 18:32:56 mrwizard login: pam_succeed_if(login:session): requirement "service in crond" not met by user "root"      `requirement "service in crond"` seems normal TMI // As requested:               Jul 27 18:29:27 mrwizard crond[2271]: (CRON) STARTUP (1.4.4)     Jul 27 18:29:27 mrwizard crond[2271]: (CRON) INFO (RANDOM_DELAY will be scaled with factor 34% if used.)     Jul 27 18:29:27 mrwizard crond[2271]: (CRON) INFO (running with inotify support)     Jul 27 18:30:01 mrwizard CROND[2479]: (root) CMD (/usr/lib/sa/sa1 1 1)     Jul 27 18:40:01 mrwizard CROND[5021]: (root) CMD (/usr/lib/sa/sa1 1 1)     Jul 27 18:50:01 mrwizard CROND[7503]: (root) CMD (/usr/lib/sa/sa1 1 1)     Jul 27 19:00:01 mrwizard CROND[10985]: (root) CMD (/usr/lib/sa/sa1 1 1)     Jul 27 19:01:01 mrwizard CROND[11232]: (root) CMD (run-parts /etc/cron.hourly)     Jul 27 19:01:01 mrwizard run-parts(/etc/cron.hourly)[11232]: starting 0anacron     Jul 27 19:01:01 mrwizard run-parts(/etc/cron.hourly)[11241]: finished 0anacron     Jul 27 19:10:01 mrwizard CROND[13425]: (root) CMD (/usr/lib/sa/sa1 1 1)     Jul 27 19:20:01 mrwizard CROND[16899]: (root) CMD (/usr/lib/sa/sa1 1 1)     Jul 27 19:30:01 mrwizard CROND[19324]: (root) CMD (/usr/lib/sa/sa1 1 1)     Jul 27 19:40:01 mrwizard CROND[21719]: (root) CMD (/usr/lib/sa/sa1 1 1)     Jul 28 18:14:45 mrwizard crond[2317]: (CRON) STARTUP (1.4.4)     Jul 28 18:14:45 mrwizard crond[2317]: (CRON) INFO (RANDOM_DELAY will be scaled with factor 45% if used.)     Jul 28 18:14:45 mrwizard crond[2317]: (CRON) INFO (running with inotify support)          $ cat /etc/pam.d/crond      # The PAM configuration file for the cron daemon     # No PAM authentication called, auth modules not needed     account    required   pam_access.so     account    include    password-auth     session    required   pam_loginuid.so     session    include    password-auth     auth       include    password-auth


title: Edge cases in filesystem operations during backup and file copy

text: I have a question about file access in Linux that I cannot sum it up completely. Consider that I have a home directory that I backup it using rsync triggered via cron. My home directory is on an EXT4 file system and I'm logged in during the rsync run. My question is what happens if a file is modified during mid-backup (while rsync is reading it). AFAIK EXT fs family doesn't have any measures against it and that will corrupt (or render it meaningless) the backup of the file I just took. Is my theory correct or am I missing a small locking mechanism which guarantees sound backups.


title: Is Android compatible with the Linux Standard Base?

text: Moved from Stack Overflow, where I realize it was off-topic since it was asking for sources - far as I can tell, the rules forbid that there but not here. I know that the kernel in Android is now mostly the Linux kernel with a few exceptions like wakelocks (as described by John Stultz.) But is it close enough to be compliant with the Linux Standard Base? (Or for that matter with POSIX and/or the Single Unix Specification?) I'm writing about this in an academic term paper, so as well as the answer itself it would be great to have a relatively reliable source I can cite for it: a peer-reviewed article or book would be ideal, but something from Google's developer docs or a person with established cred (Torvalds, Andrew Josey, etc.) would be fine.


title: What's the point of rootwait/rootdelay?

text: `rootwait` and `rootdelay` are used in situations when the filesystem is not immediately available, for example if it's detected asynchroneously or mounted via usb. The thing is, it should be obvious based on the `root` bootarg if that's the case or not, so why can't the kernel realize automatically that it needs to wait for the filesystem to appear? Are there some technical constraints preventing this automatization from being implemented?


title: add bracket across numbers at only end of each line

text: I have a file having lines as:               ram_reg_10/raja_reg_9/raghu_reg_8       abc_reg_4/bcd_reg_5       cad/pqr_reg_91       I want to convert string "_reg_number" into [number] at only last of every line in vi editor.   output should be:               ram_reg_10/raja_reg_9/raghu[8]       abc_reg_4/bcd[5]       cad/pqr[91]        I tried:               :%s?_reg_[0-9]$?\[[0-9]\]?g      But it gives:               ram_reg_10/raja_reg_9/raghu[[0-9]]       abc_reg_4/bcd[[0-9]]       cad/pqr_reg_91      how to do it?


title: GRUB2: how to remember grub last choice

text: I'm currently trying out various distros so when I boot up my laptop I have several OS to choose from. Usually, all those distros install `grub2` and locate themselves at the top of the list so they're the default ones to boot up after the installation is complete. But Manjaro did something different. It installed some version of `grub2` that would _remember_ which distro I booted last time and kept booting that one (upon restart) until I selected another one (and then it would boot that one and so on). Did I imagine this? Does Manjaro actually do that? If so, how can I install **that version** of `grub` to my system? Cheers. * * * This is my `/etc/grub.d/40_custom` file:               #!/bin/sh     exec tail -n +3 $0     # This file provides an easy way to add custom menu entries.  Simply type the     # menu entries you want to add after this comment.  Be careful not to change     # the 'exec tail' line above.      and this is my `/etc/default/grub` file:               # If you change this file, run 'update-grub' afterwards to update     # /boot/grub/grub.cfg.     # For full documentation of the options in this file, see:     #   info -f grub -n 'Simple configuration'          GRUB_DEFAULT=saved     GRUB_SAVEDEFAULT=true     #GRUB_HIDDEN_TIMEOUT=0     GRUB_HIDDEN_TIMEOUT_QUIET=true     GRUB_TIMEOUT=3     GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`     GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"     GRUB_CMDLINE_LINUX=""          # Uncomment to enable BadRAM filtering, modify to suit your needs     # This works with Linux (no patch required) and with any kernel that obtains     # the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)     #GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"          # Uncomment to disable graphical terminal (grub-pc only)     #GRUB_TERMINAL=console          # The resolution used on graphical terminal     # note that you can use only modes which your graphic card supports via VBE     # you can see them in real GRUB with the command `vbeinfo'     #GRUB_GFXMODE=640x480          # Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux     #GRUB_DISABLE_LINUX_UUID=true          # Uncomment to disable generation of recovery mode menu entries     #GRUB_DISABLE_RECOVERY="true"          # Uncomment to get a beep at grub start     #GRUB_INIT_TUNE="480 440 1"


title: find command with regex {1,2}

text: I have been trying to create a find command string that will find all files that end with a number 1-99 but exclude all others. e.g. I want to find **myfile1 myfile99** but not **myfile456** and not **myfilebackup** The regex I'm thinking of is myfile[1-9]{1,2} but I can't get this to work with find. `find . -regex '.*myfile[0-9]{1,2}'` OR `find . -iname 'myfile[0-9]{1,2}'` From what I can see it's the {1,2} part that is not working. (by the way can you use -name -regex interchangably?) Any help appreciated.


title: `solaris + xargs command for solaris

text: the command               find /tmp -name 'core*' -type f -print0 | xargs -0      works fine on Linux, but `xargs -0` option is not legal on Solaris what is the equivalent option ( `xargs`? ) for Solaris 10 second question:   is it possible to change the syntax:               find /tmp -name 'core*' -type f -print0 | xargs -0      So it will fit for both OS - Linux and Solaris I try on my solaris 10 machine:               find /tmp -name 'core*' -type f -print0 | xargs -0     xargs: illegal option -- 0     xargs: Usage: xargs: [-t] [-p] [-e[eofstr]] [-E eofstr] [-I replstr] [-i[replstr]] [-L #] [-l[#]] [-n # [-x]] [-s size] [cmd [args ...]]


How do I get a variable's value from one script and import it in another script? But the catch is that the script where I am going to get the variable's value has also some commands that I don't want to run: Let's say this is script1.sh:               variable="Hello"     #some command here e.g. yum check-update      And in script2.sh:               echo $var      I've found an approach where one uses the EXPORT command and puts ./script1.sh inside the script2.sh but it runs the other commands. So, how can I get the variable's value without running the commands inside it? I hope this question is clear. Thanks in advance!


title: Cannot connect with 3g modem during Arch installation

text: I was trying to install Arch Linux with 3g modem. I had previously downloaded `usb_modswitch` and `wvdial` and their dependencies. I booted Arch and installed them. Then I copied my Ubuntu's `/etc/wvdial.conf` to Arch. Then I connect with `wvdial` and it says connected,; modem indicator also says connected. But it is actually not! `ping www.google.com` says unknown host! The modem is HUAWEI E1550 (from a provider in Bangladesh).


title: Bash in Linux v.s Mac OS

text: I am buying an iMac. I've been working on Linux for a long time and I do a bunch of bash scripting. I was wondering if all the bash commands and features are available on Mac OS ? Anyone has any experience with Mac bash scripting ? I appreciate your input.


title: SSH AuthorizedKeysCommand and SELinux

text: I'm trying to use the SSH `AuthorizedKeysCommand` in a CentOS 6.5 machine, but I'm encountering an SELinux error. When I switch SELinux to permissive mode - using `setenforce 0` - it works, but when I turn SELinux back to enforcing, the command no longer works. I get the following readout in my audit log (all one line):               type=AVC msg=audit(1404210795.382:917): avc: denied { execute } for pid=2924 comm="sshd"     name="get-keys" dev=dm-0 ino=167467 scontext=system_u:system_r:sshd_t:s0-s0:c0.c1023     tcontext=system_u:system_r:sshd_t:s0-s0:c0.c1023 tclass=file      The SELinux policy for the `get-keys` command was different before. I set it to the same settings as the `sshd` command. I've also tried setting all SSH- relevant SELinux Booleans to true - all the ones I could find with `grep`:               $ getsebool -a | grep ssh     allow_ssh_keysign --> on     fenced_can_ssh --> on     ssh_chroot_full_access --> on     ssh_chroot_manage_apache_content --> on     ssh_chroot_rw_homedirs --> on     ssh_sysadm_login --> on      `/usr/bin/get-ssh-keys/` contains the `get-keys` command. Here are the permissions for that directory:               $ ls -laZ /usr/bin/get-ssh-keys/     drwxr--r--. root root unconfined_u:object_r:etc_t:s0   .     dr-xr-xr-x. root root system_u:object_r:bin_t:s0       ..     -rwx--x--x. root root system_u:system_r:sshd_t:s0-s0:c0.c1023 get-keys          [...]          $ ls -laZ /usr/     drwxr-xr-x. root root system_u:object_r:usr_t:s0       .     dr-xr-xr-x. root root system_u:object_r:root_t:s0      ..          [...]      And here are the relevant `/etc/ssh/sshd_config` settings:               RSAAuthentication yes     PubkeyAuthentication yes     AuthorizedKeysFile .ssh/authorized_keys     AuthorizedKeysCommand /usr/bin/get-ssh-keys/get-keys     AuthorizedKeysCommandRunAs root      The `get-keys` command is connecting over a socket to another server as well as writing to log files in `/var/log/get-ssh-keys/error_log`. Maybe that's why SELinux is preventing access, but I don't think so. Is there something plainly obvious I'm missing? There's some confusion about the `AuthorizedKeysCommand`. It doesn't actually read keys from the `~/.ssh/` directory. Instead, the `AuthorizedKeysCommand` setting specifies a program that will print all keys for a given user to stdout as individual lines. The command I've specified, `get-keys`, works with SELinux set to permissive, but fails when set to enforcing. I get prompted for a password with SELinux enforcing, but I'm allowed to log in using the keys the command retrieves with SELinux permissive.


title: Compiling a distribution unspecific kernel on two different distributions

text: I downloaded _kernel 3.2.1_ from the kernel.org. Compiled it "successfully" on _OpenSuse 11.3 64 bit_. When I tried to compile the same kernel source on _Ubuntu 11.10_ , I got:               ERROR: "__modver_version_show" [drivers/staging/rts5139/rts5139.ko] undefined      Then, I copied the _.config_ from the default kernel (of Ubuntu) present on that machine (one with Ubuntu by default) to the kernel 3.2.1's folder. Did _make menuconfig_ again, saved it without any changes. But, the same error prevailed. Also, tried with _.config.old_ but that didn't help either. Anyway, my question here is that if the kernel is _unbiased_ and _untouched_ , then why would the compilation results differ on different distributions assuming:   1. Both the machines are x bits?   2. Both the machines are latest, so is the kernel. Doesn't the kernel read the _.config_ in its own folder and decides on that basis which module to load and which not to? What has that to do with existing distribution during the compilation period?


title: "test -n && echo not empty" prints "not empty". Is that expected behaviour?

text: The title says it all: When I execute the following line               test -n && echo not empty      it prints "not empty". This occurs when you have an empty variable, and test for non-emptyness while forgetting to quote the value:               VAR=     test -n  $VAR  && echo wrong 1     test -n "$VAR" && echo wrong 2      Is this expected behaviour?


title: Ubuntu: If anyone can get a root prompt without password, isn't that compromising the gnome keyring?

text: I've been looking for this for quite a while now but couldn't find a satisfying answer. My scenario: I'm using encfs to encrypt a few directories in my home folder. To make it easier to access I set up auto mount with gnome-encfs which stores the encryption passwords in my gnome keyring. So theoretically without my user password the data is safe. But what happens if someone steals my box and logs in as root in recovery mode? He could just change my account password, log in, and all my encrypted folder would get mounted and decrypted. My question is: do I need to change the root password to prevent this from happening? People in forums keep saying that anyone with physical access to my machine can do whatever they want anyway, but that is what I set up encryption for in the first place. I don't care if they read my unencrypted data but I want the encrypted stuff to be safe. Edit: I also don't get why changing the root password is discouraged. Even if I forgot it I could still recover anything from my regular account and set up a new box.


title: How to control thinkpad_acpi via procfs, RHEL 6.4

text: I'm having trouble with the thinkpad_acpi module on my Thinkpad T400. While the processor temperature can vary, depending on the CPU activity, from 40 to 85 deg. Celsius, my fan speed remains almost constant, in the range of 2600-3000 rpm. I was expecting the fan to speed up as the temperature rises, but it's not happening. Before digging deeper into why it doesn't work as one would expect, I tried to check if manually increasing the fan speed works. According to this README, I should be able to control the fan speed by writing `level [1-7]` to `/proc/acpi/ibm/fan`, but I get the "Invalid argument" error whatever the value. I realize this is an obscure problem, but may be someone has an idea what might be _valid arguments_. Here are some of my attempts:               # cat /proc/acpi/ibm/fan     status:     enabled     speed:      2966     level:      auto     # echo 5 >/proc/acpi/ibm/fan     bash: echo: write error: Invalid argument     # echo 'level 5' >/proc/acpi/ibm/fan     bash: echo: write error: Invalid argument     # echo 'enable' >/proc/acpi/ibm/fan     bash: echo: write error: Invalid argument     # echo 'level auto' >/proc/acpi/ibm/fan     bash: echo: write error: Invalid argument


title: Create custom wordlist

text: I want to create a custom list of (scientific) words for purposes like spell checking and OCR based on my collection of scientific papers in pdf format. Using `pdftotext` I can easily create a text file which contains the wanted words for my scientific field. However the file will be polluted with   * words which are not specific for science (and which would also be contained in a common dictionary)   * words which result from improper conversion of e.g. formulas (including words which include special characters etc.) I want to get rid of the later by requiring that individual words have a minimum length, contain no special characters and appear several times in the list. Secondly I want to get rid of the former by comparing with a second word list. My questions: Does this sound like a good plan to you? Are there existing tools for this task? How would you do it?


title: Xfce: Upgrade from Squeeze to Wheezy broke xfce's user policies

text: While using Debian squeeze, I was able to allow a user shutdown in xfce by adding users to the powerdev group (see here: xfce: Allow shutdown for non- root users). Now, I upgraded my system to Debian wheezy, and some stuff in xfce doesn't seem to be running smoothly as it used to, most notably the shutdown process. Clicking on the logout icon will take me to the logout screen with "logout" enabled and "restart/shutdown" being greyed out. This thread on the xfce forum seems to mention the same problem. The same seems to be true for access to USB drives: Even though users are in the plugdev group, permission to the external volumes is denied (the do show up in thunar or whatever file managers are used, however). This thread on lists.debian.org seems to mention the same problem. The old version of xfce4 (with squeeze) was 4.6, the new version of xfce4 (with wheezy) is 4.8. Have the config files changed? Does the newer version of xfce not care about the powerdev group any more? Any hints on troubleshooting/debugging?


title: Writing triggers for mcelog

text: Just starting to look into `mcelog` for the first time (I've enabled it and seen syslog output before, but this is the first time I'm trying to do something non-default). I'm looking for information on how to write triggers for it. Specifically, I'm looking for what kinds of events `mcelog` can react to, how it decides which scripts to execute, and so on. Best I can make from the example trigger is that it sets a bunch of environmental variables before invoking the script. So does it just try to execute everything in the trigger directory (which is `/etc/mcelog` on RHEL) and let the script decide what it wants to act on? I've seen other trigger scripts with names that look like MCE events, is that convention or does that have a special function? I created a trigger called `/etc/mcelog/joel.sh` which just sends a basic email to my gmail account. A few days ago apparently the trigger went off because I got an email from the script without manually running the script. I didn't think to pipe `env` output to the `mailx` command in `joel.sh` so I don't know what hardware event triggered the script execution or why `mcelog` picked `joel.sh` as the script to execute for it. Basically, I'm looking for an answer that will give me a basic orientation with `mcelog`, it's triggering system, and how I can use it to monitor my hardware health. I'm pretty sure I can figure out the more advanced stuff once I get my bearings.


title: Using '@' for a directory name

text: Though Unix/Linux will technically allow any character in file and directory names, using punctuation is almost always fraught with peril due to the extensive use the O/S makes of punctuation for delimiters, etc. That said, I'm experimenting with something that would benefit from having a directory named just the single character **`@`** (at sign). I've encountered no problems with a few days of use but may be overlooking something. Are there commands or circumstances where this could come back to bite me?


title: Where to start profiling Linux kernel?

text: What are the standard and conventional ways of profiling the Linux kernel? I know there is `perf` tool but is there anything else?


title: First key pressed repeates forever

text: I just installed CentOS 6.4 on an old machine I acquired for a development box, but I am running into keyboard issues I can't get around. I start the machine and go to type a user name in and whatever key I press first just starts repeating forever. I have tried pressing different keys to get it to stop it but even unplugging the keyboard doesn't stop it repeating. Honestly just want to get in there and set up SSH / SVN and I will probably never log in locally again, but I can't get in to do that at all right now. I have even tried plugging the keyboard into other ports and various other things like that, but I have not managed to figure out what the problem is. I know the keyboard works fine because I used it during the install to type in the url for net install and the account information. I am even typing on it right now to ask this question. Is there something I am missing here? Should I just try a reinstall? Or get a different keyboard?


title: How much does the Linux kernel change in one year?

text: How can I get statistics about how much (in percents) the Linux kernel source code changes in one year?


title: linux mint cinnamon - AR9485 Wireless Network Adapter keeps disconnecting

text: Lately I got a DELL inspiron 15-3521, I installed the latest Linux mint cinnamon. I have been having some problems with my Ethernet card, when i start my pc everything works perfectly for about 10 to 30 minutes then I get disconnected from my wireless networking and I can't reconnect until I restart my PC. I tried disabling enabling my network but with no result. Any ideas why I keep getting disconnected? My Ethernet card is:               Atheros Communications Inc. AR9485 Wireless Network Adapter (rev 01)


title: IPTables - Port to another ip & port (from the inside)

text: I currently have a NAS box running under port 80. To access the NAS from the outside, I mapped the port 8080 to port 80 on the NAS as follow: `iptables -t nat -A PREROUTING -p tcp --dport 8080 -j DNAT --to-destination 10.32.25.2:80` This is working like a charm. However, this is working only if I am accessing the website from the outside of the network (at work, at diffrent house, etc). So when I type in `mywebsite.com:8080`, IPTables do the job correctly and everything is working fine. Now, the problem I have is, how can I redirect this port from the inside of the network ? My domain name `mywebsite.com` point to my router (my linux server) from the inside (10.32.25.1) but I want to redirect port 8080 to port 80 on 10.32.25.2 from the inside. Any clue? ### Edit #1 Attempting to help facilitate this question I put this diagram together. Please feel free to update if it's incorrect or misrepresenting what you're looking for.                                                iptables                                          |                   .---------------.         .-,(  ),-.                       v               port 80             |      .-(          )-.        port 8080________               |               |     (    internet    )------------>[_...__...°]------------->|      NAS      |      '-(          ).-'     10.32.25.2    ^   10.32.25.1      |               |          '-.( ).-'                       |                   |               |                                          |                   '---------------'                                          |                                          |                                        __  _                                        [__]|=|                                       /::/|_|


title: Can SSH passwords be sniffed out over Wi-Fi?

text: When you `ssh`, can the password you enter to connect, be intercepted if you're using untrusted public Wi-Fi (coffee shop, library, airport, etc).


title: Is it possible to show the contents of a directory without changing into it?

text: I'd like to show the contents of a folder without first changing into it. for example:               ---- Documents             |             |             L_ Essays      If I'm in `Documents`, how can I show the contents of `Essays` with a single command?


title: How to show only the last two digits of a number in LibreOffice Calc?

text: I have a spreadsheet like this in LibreOffice Calc:                    1         2     A    012345678 Henry      B    012345679 George      The first column displays some ID numbers. I need to display a shorter form of this number in another column, showing only the last two digits. This would look like this:                    3     A    78     B    79      How can I show only the last two digits of a number in LibreOffice Calc?


title: Unable to connect by FTP to a Debian AWS server (ami-aa46b4c3)

text: I've launched an AWS instance with the image `debian-6.0-squeeze-i386-server-20110323 (ami-aa46b4c3)` and I am trying to set up a FTP server. I have tried several ftp servers but nothing seems to work. I was thinking something was blocking the input traffic directly in the AWS Management Console. I configured a simple ftp server with pure-ftp, it is running but unreachable.               # ps aux | grep ftp     root      5746  0.0  0.0   5740   532 ?        Ss   14:54   0:00 pure-ftpd (SERVER)         I would appreciate any help.


title: Error in R: Unable to open connection to X11

text: I just set up a fedora distribution on my computer and am slowly trying to learn how to work from the command line. I was testing `R` which went fine, except for some reason when I tried again I suddenly seem to be unable to draw plots. I get the error:               > x = 1:5     > y = x^2     > plot(x,y)     No protocol specified     Error in X11(d$display, d$width, d$height, d$pointsize, d$gamma, d$colortype,  :        unable to start device X11cairo     In addition: Warning message:     In function (display = "", width, height, pointsize, gamma, bg,  :       unable to open connection to X11 display ''      and when I check the capabilities I see that `X11` is `FALSE`:               > capabilities()     No protocol specified         jpeg      png     tiff    tcltk      X11     aqua http/ftp  sockets          TRUE     TRUE     TRUE     TRUE    FALSE    FALSE     TRUE     TRUE        libxml     fifo   cledit    iconv      NLS  profmem    cairo          TRUE     TRUE     TRUE     TRUE     TRUE    FALSE     TRUE       Although I know nothing about whether those are connected or not it seems X11 should be on? Everywhere I searched for this people seemed to have this problem when working over an ssh connection (I haven't yet taken a look at what that is exactly :$). I hope someone who knows what this problem is about could be so nice to explain the problem to me and suggest a solution. Thanks in advance from a n00b


title: Fedora 16 Yakuake keybinding failure ( retracts but will not dropdown )

text: On fedora 16 I've installed yakuake, and when I hit F12 ( default keybind ) the terminal retracts, but on hitting F12 again it won't deploy down. Does anyone have a thought as to why F12 isn't being processed properly? One weird effect that I've seen is that when I hit F12 with a konsole open a tilde is generated on the command line. I've looked at the keybindings for kde & for konsole and nothing is bound to F12.


title: How to make my Linux tcsh prompt bold?

text: Greeting all, I am attempting to make my Linux tcsh prompt bold. However I'm failing miserably. I know about escape codes and I can successfully make echo'ed output bold, but I can't seem to do it for my prompt. For example, if I use the following command:               echo "\033[1m Hello \033[0m"      I correctly get an output line that has Hello and the text is bold text. However, if I try to change my prompt using similar logic it, fails. For example, If I attempt to change the prompt using the following command:               set prompt="\033[1m NEW-PROMPT \033[0m"      I get:               ^[[1m NEW-PROMPT ^[[0m      So it seems that my prompt is not being processes the same as echo lines? Any tips on what my problem could be? Following is a trimmed down version of my environment, which may give clues as to why I might need to use some other format for the prompt.               LANG=POSIX     LC_CTYPE=en_US.UTF-8     SHELL=/bin/csh     SSH_CLIENT=127.0.0.1 49757 22     SSH_CONNECTION=127.0.0.1 49757 127.0.0.1 22     SSH_TTY=/dev/pts/4     TERM=xterm     HOSTTYPE=i586-linux     VENDOR=suse     OSTYPE=linux     MACHTYPE=i586     SHLVL=7     HOST=psbu-jrr-lnx     CSHEDIT=emacs     CPU=i686     LESS=-M -I     LESSOPEN=lessopen.sh %s     LESSCLOSE=lessclose.sh %s %s     LESS_ADVANCED_PREPROCESSOR=no     LESSKEY=/etc/lesskey.bin     PAGER=less     MORE=-sl     MINICOM=-c on     COLORTERM=1     SSH_SENDS_LOCALE=yes     CVS_RSH=ssh     WINDOWMANAGER=/usr/bin/X11/kde     ENV=/etc/bash.bashrc     CSHRCREAD=true     LS_COLORS=no=00:fi=00:di=01;34:ln=00;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=41;33;01:ex=00;32:*.cmd=00;32:*.exe=01;32:*.com=01;32:*.bat=01;32:*.btm=01;32:*.dll=01;32:*.tar=00;31:*.tbz=00;31:*.tgz=00;31:*.rpm=00;31:*.deb=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.zip=00;31:*.zoo=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.tb2=00;31:*.tz2=00;31:*.tbz2=00;31:*.avi=01;35:*.bmp=01;35:*.fli=01;35:*.gif=01;35:*.jpg=01;35:*.jpeg=01;35:*.mng=01;35:*.mov=01;35:*.mpg=01;35:*.pcx=01;35:*.pbm=01;35:*.pgm=01;35:*.png=01;35:*.ppm=01;35:*.tga=01;35:*.tif=01;35:*.xbm=01;35:*.xpm=01;35:*.dl=01;35:*.gl=01;35:*.wmv=01;35:*.aiff=00;32:*.au=00;32:*.mid=00;32:*.mp3=00;32:*.ogg=00;32:*.voc=00;32:*.wav=00;32:     LS_OPTIONS=-N --color=tty -T 0     FULLENV=false     VISUAL=vi     SSH_AUTH_SOCK=/tmp/ssh-lkJkR5043/agent.5043     SSH_AGENT_PID=5044     WINDOWID=60817426     XTERM_VERSION=XTerm(208)     XTERM_SHELL=/bin/csh      Thanks in advance.


title: not able to mount burned ISO9660 file-system before ejecting and re-inserting the media

text: After burning an _ISO9660_ file-system(`wodim -v dev='/dev/scd0' -sao ubcd521.iso`) to a CD, I always need to first eject the CD and then re- inserted it in order to be able to mount the created CD:               root@T42:~# file -s /dev/sr0      /dev/sr0: data     root@T42:~# mount -t iso9660 /dev/sr0 /media/     mount: block device /dev/sr0 is write-protected, mounting read-only     mount: wrong fs type, bad option, bad superblock on /dev/sr0,            missing codepage or helper program, or other error            In some cases useful info is found in syslog - try            dmesg | tail  or so          root@T42:~# eject     root@T42:~# #re-inserted CD tray     root@T42:~# file -s /dev/sr0      /dev/sr0: ISO 9660 CD-ROM filesystem data 'UBCD521                        ' (bootable)     root@T42:~# mount | grep cd     /dev/sr0 on /media/cdrom0 type iso9660 (ro,noexec,nosuid,nodev,user=usr)     root@T42:~#       I'm just wondering what causes this?


title: Installing windows after ubuntu 13

text: I have installed Ubuntu 13 and now I need to install Windows 8 (dual boot). But when I try to install Windows it says "cannot install on GPT table". This ![this](http://i.stack.imgur.com/tZ1V6.png) view is shown on 'disk' on Ubuntu. I need to install Ubuntu on `/dev/sda1`. How can I fix it. Then how can I install grub without a live CD, but with USB flash memory.


title: How to enable WebGL in Chrome or Firefox?

text: I want to try out WebGL as I'm learning OpenGL currently and, well yeah, kind of interested in how WebGL looks like. I tried some demo sites like this or that. But unfortunately they don't work. I get the warning both in firefox and chromium: > This page requires a browser that supports WebGL. Browsing to the official WebGL homepage tells me the following: > Hmm. While your browser seems to support WebGL, it is disabled or > unavailable. If possible, please ensure that you are running the latest > drivers for your video card. I've found this answer on AskUbuntu, but enabling the software rendering list override does not enable WebGL for me in chromium. I'm running Sabayon Linux x86_64 with an NVIDIA GPU:                ~ # uname -a     Linux qdoe 3.9.0-sabayon #1 SMP Thu Jun 27 07:53:45 UTC 2013 x86_64 Intel(R) Core(TM) i7-3930K CPU @ 3.20GHz GenuineIntel GNU/Linux     ~ # lspci | grep VGA     02:00.0 VGA compatible controller: NVIDIA Corporation GK107 [GeForce GT 640] (rev a1)      ~ # firefox -v     Mozilla Firefox 20.0.1      ~ # chromium --version     Chromium 27.0.1453.110      Using following drivers:                ~ # equo search x11-drivers/nvidia-drivers-319.32#3.9.0-sabayon     >> @@ Package: x11-drivers/nvidia-drivers-319.32#3.9.0-sabayon branch: 5, [sabayon-limbo]      >>   Available:     version: 319.32 ~ tag: 3.9.0-sabayon ~ revision: 0     >>   Installed:     version: 319.32 ~ tag: 3.9.0-sabayon ~ revision: 0     >>   Slot:          0,3.9.0-sabayon     >>   Homepage:      http://www.nvidia.com/      >>   Description:   NVIDIA GPUs kernel drivers      >>   License:       NVIDIA-r1      ~ # lsmod | grep nvidia     nvidia               9376114  23       Any ideas how to enable WebGL in either Chrome or Firefox?


title: Shift+Ctrl+[Left|Right] to highlight text, then type, ignores the first two characters typed

text: I'm using openSuse. It was installed for me by the IT group here at work this week. I routinely use Shift+Ctrl+ some arrow key to highlight text, and I'm in the habit of simply typing in order to replace the text that has been highlighted. If I highlight the text with the mouse and start typing, everything works fine. If I highlight the text using the keyboard combination, then the first character I type deletes the highlighted text and the second does nothing, then the remainder of the characters I type are put as a replacement to the highlighted text. This behavior appears to happen regardless of application. I've seen it in Google chrome (although not the URL bar), Firefox, and in Eclipse text editors. I have no idea what's going on, but it's really annoying and slowing me down in Eclipse. I can get around in linux, but I'm no guru. Where should I look to figure out what is going on? **Update:** I'm in Gnome. I've seen the behavior in Open Office writer, Google Chrome, Firefox, Eclipse, Thunderbird. I did _not_ see it in Tomboy Notes or gedit.


title: Not using specific memory regions due to errors

text: I have just installed some new RAM (2x1GB, 667, sticks from 2x512MB, 533, sticks) into an old system (perfectly valid), and all was working fine, until now. I have been having some issues when the computer (a debian box) would crash for no apparent reason, and due to its consistent behavior at certain file sizes being accessed after a time (usually about 1.6GB) it would crash. I have just installed memtest86+ on the system, and after running it for just a few seconds (now been running all night), it is telling be that the memory at 615-616MB and 1637-1638MB are acting erroneously. Now, instead of removing the new RAM and returning the old, or buying some new RAM all together, is it possible to instruct the memory component of debian to ignore these regions (I don't mind sacrificing a few MB's of RAM for the bonus of another GB or less) so my system can continue to operate normally?


title: Install Arch Linux to external hard disk using a Virtual Machine?

text: I have an external hard disk and I want to install Arch Linux on it. Since I'm a complete beginner I want to have access to the online the documentation. As the title states, it is possible to install it from a VM so I could have access to the documentation?


title: Alsa driver update in client machine without make

text: I have a Debian 6 system and updated alsa from 1.0.23 to 1.0.25, It works as expected. Steps which I performed to compile:               ./configure     make      make install      Now , I have 100's of client machines in which I need to deploy this ALSA update. But, these machine does not have make/setup tools install. To deploy this update what is the best way? I even tried creating a package using CHECKINSTALL. So, with created package I deployed it in 5 machines, in 3 machines the driver got updated and 2 machines reports no information on soundcard. Am i missing something.


title: How to find the total number of occurrences of text and files with find command

text: I am trying to run the `find` command to find the total number of occurrences of a particular text string and also the number of files which has this text string. What I have right now is this command. `find . -name "*.txt" | xargs grep -i "abc"` This reports all the "*.txt" files which contain the text "abc". I want either one or two find command to get   1. Total number of times abc appears   2. Total number of files which has abc in it.


title: How to add a line to a file which has only root write permission and to continue the script execution

text: I am trying to learn bash scripting. I am working on a practical problem and at one point I need to add a line to a file which requires `root` permission to write. The code looks like this:               # some code     echo "add this line to the code" >> fileName     # some code      Is it possible to somehow make the script ask for the root password, validate the password, and on successful authentication modify the file? The script should then return to the user mode and continue the command execution.


title: What do brackets mean in the output of pstree?

text: What are the differences between `[]` and `{}` and `[{}]` used to enclose a process in the output of pstree? I guess `[]` is used for specifying more than one processes. For example,               init-+-NetworkManager-+-dhclient          |                |-dnsmasq          |                `-2*[{NetworkManager}]          |-accounts-daemon---{accounts-daemon}          |-acpid          ...               |-gnome-terminal-+-7*[bash---emacs]          |                |-6*[bash]          |                |-2*[bash---less]          |                |-bash-+-2*[grep]          |                |      |-less          |                |      `-locate          |                |-bash-+-less          |                |      `-pstree          |                |-bash-+-emacs          |                |      `-okular---2*[{okular}]          |                |-gnome-pty-helpe          |                `-3*[{gnome-terminal}]      I only have one `okular` process run from a shell process with `nohup` and `&`. Why do I have `okular---2*[{okular}]`? I don't understand the manpage about > Child threads of a process are found under the parent process and are shown > with the process name in curly braces, e.g.                  icecast2---13*[{icecast2}]


title: Rerunning the same command with a different parameter

text: I know that I can run the following command               ls Some{File,Folder}      And it is equivalent to running this:               ls SomeFile SomeFolder      (I also use it a lot for things like `mv place_{a,b}`) However, I was wondering if there was a different shortcut where I could do something like this:               run-command --a --whole --lot --of --flags parameter a; \          run-command --a --whole --lot --of --flags parameter b      And I only had to type `run-command --a --whole --lot --of --flags parameter {a,b}` or something similar.


title: How to convert VMDK to VDI/VHD

text: It's said that VirtualBox's `VBoxManage modifyhd --resize` command can only be used on either VDI or VHD files. Sadly, I have a VirtualBox image that is in VMDK format, and I don't know how to convert it to those other two formats.


title: How does execution of !find command work?

text: The `!find` command lets the user perform the previously executed `find`, with all its parameters. How does it work internally, where exactly has this behaviour been programmed?


title: How to connect to wifi after the installation of Scientific Linux 6.5

text: I just installed Scientific Linux 6.5, but it seems there is no way to connect to internet. How can I search and connect to wireless internet in my apartment?


title: Prevent libflashplayer.so from deleting a file?

text: I'm trying the preview release of Flash Player "Square" for Linux and noticed that video files are now being deleted from the `/tmp/` folder. Yet the files are still in use (I can see them with `lsof`):               chromium- 8948 user   25u   REG                8,5  2599793    229908 /tmp/FlashXXStJt3K (deleted)      Is there a way to prevent flash from deleting them or a way to recover them?


title: Are there any good tutorials for NetBSD and daemontools?

text: I'm looking for some good resources on running `daemontools` on a NetBSD box. I've installed the binary package via `pkg_add`, but I can't seem to find an `rc` script for starting, e.g., `svscan`. I'm mostly a Linux and FreeBSD user, and this is the sort of thing I would expect to find after an install. Did I just look in the wrong place? Should I be building from source to find those sorts of extras? Is there a good guide somewhere that covers things like this? Thanks.


title: How can I use a timecode when watching a youtube video with livestreamer?

text: I'd like to watch a youtube video via livestreamer, let's say by starting at 10 minutes into the video. How can I do that? Is that even possible? The following code bits do not work:   * `livestreamer http://www.youtube.com/watch?v=w87fOAG8fjk?t=10m`   * `livestreamer http://www.youtube.com/watch?v=w87fOAG8fjk&?t=10m`   * `livestreamer http://www.youtube.com/watch?v=w87fOAG8fjk&#t=10m`   * `livestreamer http://www.youtube.com/watch?v=w87fOAG8fjk&t=10m`   * `livestreamer http://www.youtube.com/watch?v=w87fOAG8fjk#t=10m` **Note** Just in case one is interested in the program: click here for another q&a on it.


title: Where to put system cronjobs?

text: If I need a **cronjob that runs at system level** (i.e. not specific for a certain user) how do you suggest me to create it?   1. running `crontab -e` as root   2. appending it to `/etc/crontab`   3. creating a file defining the cronjob in `/etc/cron.d/`   4. creating a file defining the cronjob in `/etc/cron.*ly/` (but only if such time interval fits my needs) What worries me mostly is: which of these solutions will be possibly **overwritten by a system update**? Additionaly I guess that if the job is long I should put it on a **separate script file** , for instance in `/root/bin/`. Do you agree?


title: how to use html tidy on Nginx

text: I just installed **HTML tidy** using the following command line:               sudo apt-get install php5-tidy      yet I have no idea how to use it because I thought it is an auto process that can do things by itself after all. I found this little piece of code instructing how to use, but not sure where to put the code!! The code is:                $config = array(                 'indent'         => true,                 'output-xhtml'   => true,                 'show-body-only' => true,                 'wrap'           => 0);              $tidy = new tidy;         $tidy->parseString($html_txt, $config, 'utf8');         $tidy->cleanRepair();              echo $tidy;      I found this info on this link: Use HTML Tidy with PHP5 under Ubuntu/Debian My purpose is to tidy both HTML and PHP files on my Ngninx server. I tried some Nginx Modules such as Mod_strip, but didn't work for me...!! any idea how to use above code and where??


title: Systemd boot time trimming

text: I just switched to systemd on debian sid and while it's a big step forward it also makes it easy to see opportunities for improvement **Boot from suspend** takes too long               $ systemd-analyze blame | head -4              13.807s systemd-suspend.service               2.167s mysql.service               1.497s apache2.service                163ms systemd-fsck@dev-disk-by\x2duuid-f9ce6b25\x2d061b\x2d453e\x2db1f7\x2d0f560cd3181c.service      As you can see, `systemd-suspend.service` takes ages. Standard boot is very quick but from suspend it's slower than sysvinit! Where should I be looking? **Mysql blocking** a faster boot               $ systemd-analyze critical-chain | head -7     The time after the unit is active or started is printed after the "@" character.     The time the unit takes to start is printed after the "+" character.          graphical.target @2.839s     └─multi-user.target @2.839s       └─exim4.service @2.773s +66ms         └─mysql.service @604ms +2.167s      A whopping 76% of my `graphical.target` is spent waiting for mysql. Is there any way to stop it blocking? **Edit:** nkts made me realise these are all running in sysvinit compat mode - I bet that's what's holding this up. How do I install systemd startup files on debian?


title: Verifying Debian/Ubuntu packages integrity when booting from a read-only DVD?

text: Is there an easy way to boot a Debian-based Linux system from a read-only medium (say a Live Linux read-only DVD) and then use Debian's .deb checksums / signatures (?) to verify that the files installed do indeed come from properly signed Debian packages? In other words: is it possible to boot a system from a known clean Live CD and then use Debian's package format as a "poor man's intrusion detection system"? If so, how should I go about it?


title: Filesystem suddenly read-only?

text: I've been storing some files on a MicroSD formatted to ext4 that I connect via USB. I tried to move a directory in it to an external hard drive, and I got `mv: error reading ‘/mnt/sd/Directory/xyz.mp3’: Input/output error`. I tried to `chmod -R 777` the mount point of the sd (as root), and I got `chmod: changing permissions of ‘sd/Directory/xyz.mp3’: Read-only file system`. I never did anything to make the filesystem read-only, and I've had no trouble with it before. The only thing that I can think of that's changed is the SD is usually `/dev/sdb1`, and it was `/dev/sdc1` this time. Running Arch Linux in Virtualbox on a Windows 7 host.


title: How to interpret badblocks output

text: The man pages for badblocks do not seem to mention what the three numbers in the output mean in particular:               Pass completed, 7 bad blocks found (7/0/0 errors)                    Pass completed, 120 bad blocks found (0/0/120 errors)      I'm _guessing_ it's "Errors while reading/writing/comparing". Can someone enlighten me?


title: Delete everything except a few extensions

text: Can I modify the `rm` command with regular expression or something to delete every file in current directory except files with extensions `*.bmp`, `*.wav` and `*.png`? It should be case insensitive because there are files like `*.BMP` or `*.bMP`. thank you


title: i915 cannot work with nomodeset?

text: I'm trying to get X to work on a ThinkPad W530. I set the BIOS to only use the integrated graphics, I attempt to boot. The display goes blank when KMS is executed and does not recover. I append "nomodeset" or "i915.modeset=0". Then it does boot, does not attempt to change resolution while in console mode, but I cannot start X. I see in dmesg:               [drm:drm_pci_agp_init] *ERROR* Cannot initialize the agpgart module.     DRM: Fill_in_dev failed.      I have the latest BIOS for my system, and I've tried the kernels: 3.7.2, 3.9.5 and 3.10-rc5. This is a Slackware 14.0 64-bit distro. It seems that the i915 module cannot work when nomodeset is used, and that there is some bug which makes the display turn blank. Is there some way around this?