title: How to install git for CentOS?

text: I tried several suggestions from this answer but none of them worked.               [root@308321 sugar-dev]# yum install git     Loaded plugins: fastestmirror     Loading mirror speeds from cached hostfile      * base: mirror.ubiquityservers.com      * epel: www.gtlib.gatech.edu      * extras: mirrors.usinternet.com      * updates: mirrors.serveraxis.net     Setting up Install Process     Resolving Dependencies     --> Running transaction check     ---> Package git.x86_64 0:1.8.2.1-1.el5 will be installed     --> Processing Dependency: perl-Git = 1.8.2.1-1.el5 for package: git-1.8.2.1-1.el5.x86_64     --> Processing Dependency: perl(Term::ReadKey) for package: git-1.8.2.1-1.el5.x86_64     --> Processing Dependency: perl(Git) for package: git-1.8.2.1-1.el5.x86_64     --> Processing Dependency: perl(Error) for package: git-1.8.2.1-1.el5.x86_64     --> Processing Dependency: libssl.so.6()(64bit) for package: git-1.8.2.1-1.el5.x86_64     --> Processing Dependency: libexpat.so.0()(64bit) for package: git-1.8.2.1-1.el5.x86_64     --> Processing Dependency: libcurl.so.3()(64bit) for package: git-1.8.2.1-1.el5.x86_64     --> Processing Dependency: libcrypto.so.6()(64bit) for package: git-1.8.2.1-1.el5.x86_64     --> Running transaction check     ---> Package compat-expat1.x86_64 0:1.95.8-8.el6 will be installed     ---> Package git.x86_64 0:1.8.2.1-1.el5 will be installed     --> Processing Dependency: libcurl.so.3()(64bit) for package: git-1.8.2.1-1.el5.x86_64     ---> Package openssl098e.x86_64 0:0.9.8e-17.el6.centos.2 will be installed     ---> Package perl-Error.noarch 1:0.17015-4.el6 will be installed     ---> Package perl-Git.x86_64 0:1.8.2.1-1.el5 will be installed     --> Processing Dependency: perl(:MODULE_COMPAT_5.8.8) for package: perl-Git-1.8.2.1-1.el5.x86_64     ---> Package perl-TermReadKey.x86_64 0:2.30-13.el6 will be installed     --> Finished Dependency Resolution     Error: Package: perl-Git-1.8.2.1-1.el5.x86_64 (epel)                Requires: perl(:MODULE_COMPAT_5.8.8)     Error: Package: git-1.8.2.1-1.el5.x86_64 (epel)                Requires: libcurl.so.3()(64bit)      You could try using --skip-broken to work around the problem      You could try running: rpm -Va --nofiles --nodigest     [root@308321 sugar-dev]# yum -y install git --disablerepo=updates     Loaded plugins: fastestmirror     Loading mirror speeds from cached hostfile      * base: mirror.ubiquityservers.com      * epel: www.gtlib.gatech.edu      * extras: mirrors.usinternet.com     Setting up Install Process     Resolving Dependencies     --> Running transaction check     ---> Package git.x86_64 0:1.8.2.1-1.el5 will be installed     --> Processing Dependency: perl-Git = 1.8.2.1-1.el5 for package: git-1.8.2.1-1.el5.x86_64     --> Processing Dependency: perl(Term::ReadKey) for package: git-1.8.2.1-1.el5.x86_64     --> Processing Dependency: perl(Git) for package: git-1.8.2.1-1.el5.x86_64     --> Processing Dependency: perl(Error) for package: git-1.8.2.1-1.el5.x86_64     --> Processing Dependency: libssl.so.6()(64bit) for package: git-1.8.2.1-1.el5.x86_64     --> Processing Dependency: libexpat.so.0()(64bit) for package: git-1.8.2.1-1.el5.x86_64     --> Processing Dependency: libcurl.so.3()(64bit) for package: git-1.8.2.1-1.el5.x86_64     --> Processing Dependency: libcrypto.so.6()(64bit) for package: git-1.8.2.1-1.el5.x86_64     --> Running transaction check     ---> Package compat-expat1.x86_64 0:1.95.8-8.el6 will be installed     ---> Package git.x86_64 0:1.8.2.1-1.el5 will be installed     --> Processing Dependency: libcurl.so.3()(64bit) for package: git-1.8.2.1-1.el5.x86_64     ---> Package openssl098e.x86_64 0:0.9.8e-17.el6.centos.2 will be installed     ---> Package perl-Error.noarch 1:0.17015-4.el6 will be installed     ---> Package perl-Git.x86_64 0:1.8.2.1-1.el5 will be installed     --> Processing Dependency: perl(:MODULE_COMPAT_5.8.8) for package: perl-Git-1.8.2.1-1.el5.x86_64     ---> Package perl-TermReadKey.x86_64 0:2.30-13.el6 will be installed     --> Finished Dependency Resolution     Error: Package: perl-Git-1.8.2.1-1.el5.x86_64 (epel)                Requires: perl(:MODULE_COMPAT_5.8.8)     Error: Package: git-1.8.2.1-1.el5.x86_64 (epel)                Requires: libcurl.so.3()(64bit)      You could try using --skip-broken to work around the problem      You could try running: rpm -Va --nofiles --nodigest     [root@308321 sugar-dev]# yum install git --disableexcludes=main --skip-broken     Loaded plugins: fastestmirror     Loading mirror speeds from cached hostfile      * base: mirror.ubiquityservers.com      * epel: www.gtlib.gatech.edu      * extras: mirrors.usinternet.com      * updates: mirrors.serveraxis.net     Setting up Install Process     Resolving Dependencies     --> Running transaction check     ---> Package git.x86_64 0:1.8.2.1-1.el5 will be installed     --> Processing Dependency: perl-Git = 1.8.2.1-1.el5 for package: git-1.8.2.1-1.el5.x86_64     --> Processing Dependency: perl(Term::ReadKey) for package: git-1.8.2.1-1.el5.x86_64     --> Processing Dependency: perl(Git) for package: git-1.8.2.1-1.el5.x86_64     --> Processing Dependency: perl(Error) for package: git-1.8.2.1-1.el5.x86_64     --> Processing Dependency: libssl.so.6()(64bit) for package: git-1.8.2.1-1.el5.x86_64     --> Processing Dependency: libexpat.so.0()(64bit) for package: git-1.8.2.1-1.el5.x86_64     --> Processing Dependency: libcurl.so.3()(64bit) for package: git-1.8.2.1-1.el5.x86_64     --> Processing Dependency: libcrypto.so.6()(64bit) for package: git-1.8.2.1-1.el5.x86_64     --> Running transaction check     ---> Package compat-expat1.x86_64 0:1.95.8-8.el6 will be installed     ---> Package git.x86_64 0:1.8.2.1-1.el5 will be installed     --> Processing Dependency: libcurl.so.3()(64bit) for package: git-1.8.2.1-1.el5.x86_64     ---> Package openssl098e.x86_64 0:0.9.8e-17.el6.centos.2 will be installed     ---> Package perl-Error.noarch 1:0.17015-4.el6 will be installed     ---> Package perl-Git.x86_64 0:1.8.2.1-1.el5 will be installed     --> Processing Dependency: perl(:MODULE_COMPAT_5.8.8) for package: perl-Git-1.8.2.1-1.el5.x86_64     ---> Package perl-TermReadKey.x86_64 0:2.30-13.el6 will be installed     --> Finished Dependency Resolution          Packages skipped because of dependency problems:         compat-expat1-1.95.8-8.el6.x86_64 from base         git-1.8.2.1-1.el5.x86_64 from epel         openssl098e-0.9.8e-17.el6.centos.2.x86_64 from base         1:perl-Error-0.17015-4.el6.noarch from base         perl-Git-1.8.2.1-1.el5.x86_64 from epel         perl-TermReadKey-2.30-13.el6.x86_64 from base     [root@308321 sugar-dev]# git     -bash: git: command not found     [root@308321 sugar-dev]#               [root@308321 sugar-dev]# uname -a     Linux 308321.oliveyou.net 2.6.32-220.2.1.el6.x86_64 #1 SMP Fri Dec 23 02:21:33 CST 2011 x86_64 x86_64 x86_64 GNU/Linux


title: Features that Linux kernel has and Windows does not?

text: What are the significant technical features the Linux kernel has that the Windows does not? Something that I might _find on a kernel feature list_ , which is conceptually an advantage, or significantly different to, Windows. Perhaps something from access policies, networking, file management, etc...? I'm not looking for speed or memory benchmarks, but technical or architectural features that underpin the major difference between the two operating systems. EDIT: Yes. The Wikipedia comparison mentioned in the comment gives answers like I'm looking for. It seems fairly technical and maybe someone can write a small comment if the differences have practical _implications to the user_ (or performance). Here is a summary from the article: (why does Linux have many modules, while Windows only mentions one solution?)                                    Linux                                   Windows     Virtualization:      cgroups, chroot, KVM, ...               Hyper-V     Security:            POSIX ACL                               ACL     Profiling:           OProbe, kprobe, ...                     Event tracing     Soft/Hard-Realtime:  Yes                                     No      Moreover the site mentions that Linux has the following while it's not sure if Windows can do it:   * Capability-based security   * In-kernel key management keyctl   * Audit-API fanotify   * Sandbox SELinux, KVM, seccomp   * Synflood protection Syncookies Does it matter if Linux has more filesystems supported? Can you not have a Windows module? What does it mean that Linux has more ciphers and hash algorithms supported? Is it superior in performance as compare to a "Windows addon solution"? That's the summary I see in the Wiki. It's too technical for me to understand :/ Do you see something with implications for the user here? :)


title: Can't access XAMPP on Centos from other Windows PCs

text: I have a server with Centos 6 on it and I have installed XAMPP on it. I have this server on static IP address. But I can't access this server's IP address from other PCs. I tried to access XAMPP on another PC with a static IP address with Windows OS, and it works perfectly. Even accessing it from the server itself and it's open. But I can't access the server IP from any other PC. I can ping the server. I can access SSH using Putty on the server and login. But I can't open the localhost of the server from any other computer on the network.


title: Unix files system related puzzle

text: There was a question in one of quiz conducted one year back. I was attempting to solve this question and got stuck. All the other were programming related but this one was a Unix file permissions related Stuff. Following is the scenario. You will be given a login and a password to a SSH server. `ssh your- username@server-addr` Your task is to look for a file named `/home/abc/chekme` and retrieve the contents. When logged in to the ssh remote server doing an `ls -l` shows 0 files, which shows that the login given has no permissions but on doing `ls -l` for the above mentioned file it can be seen that Read permission is given to the root user and a group and the name of the group is `chekme`. I can't read the file because I don't have the permission and am not a member of that group. On exploring the `/etc/group` file I found out that there is a group named `chekme` and only one user is added to that group. The user name is `guest` From here I tried changing my guid to that of the group, adding myself to the group, doing a `su` as the user `guest` but none of it worked since the first two required `root` access and `su` to guest required the password of that user. How do I proceed now ? Actual question with login creds : > File : /home/hacker-weekly/abacus > > So, you have to read the file '/home/hacker-weekly/abacus' and submit the > file content here. > > If you haven't got your login credentials, get it by clicking on the button > 'Get Login Credential' below. Then you can login into the machine by running > following command: > > ssh "your-username"@"server-addr" > > Hint: Think all about file permission in a UNIX-based system. > > Login credentials Server: ec2-175-41-164-254.ap- > southeast-1.compute.amazonaws.com Username: ashwinscongo Password: ab12d6H The group name is abacus, the user in that group is guest. Tried /etc/passwrd, couldn't make out anything.


title: s3fs complains about SSH key or SSL cert - how to fix?

text: I downloaded and installed s3fs 1.73 on my Debian Wheezy system. The specific steps I took were, all as root:               apt-get -u install build-essential libfuse-dev fuse-utils libcurl4-openssl-dev libxml2-dev mime-support     ./configure --prefix=/usr/local     make     make install      The installation went well and I proceeded to create a file `/usr/local/etc/passwd-s3fs` with my credentials copied from past notes (I'm pretty sure those are correct). That file is mode 0600 owner 0:0. Piecing together from the example on the web page and the man page, I then try a simple mount as a proof of concept to make sure everything works:               $ sudo -i     # s3fs mybucketname /mnt -o url=https://s3.amazonaws.com -o passwd_file=/usr/local/etc/passwd-s3fs      In short: it doesn't. The mount point exists with reasonable permissions, and I get no error output from s3fs. However, nothing gets mounted on /mnt, `mount` has no idea about anything of the sort, and if I try `umount` it says about the directory "not mounted". The system logs say `s3fs: ###curlCode: 51 msg: SSL peer certificate or SSH remote key was not OK`, but **how do I find out which SSL certificate it is talking about or in what way was it not OK?** Firefox has no complaints when I connect to that URL but also redirects me to https://aws.amazon.com/s3/. **How do I get s3fs to actually work?**


title: cd to a directory and execute many commands

text: I have following script.               #!/bin/bash     mount /dev/sda6 /mnt/gentoo     set +e     cd /mnt/gentoo && mount -t proc none /mnt/gentoo/proc \      && mount --rbind /dev /mnt/gentoo/dev \      && mount --rbind /sys /mnt/gentoo/sys \      && chroot /mnt/gentoo /bin/bash \      && source /etc/profile  \      && export PS1="(chroot)$PS1"       What I am trying to accomplish here is to change to a directory `/mnt/gentoo` and execute few commands. This works ok first time when none of the path were mounted. But if I run it after mounting has been successfully performed on some paths, it does not continue and stops on first failure. I want all commands to be executed even if mount is failing due to 'already mounted' error. How can I do this? Also is there a better way than combining all these commands together in one line?


title: LXDE use WinKey to open AND close main menu (LXPANEL)

text: I was able to set `Winkey` to open the menu. But I expect that pressing it again would close the menu which is not happening. This issue is almost the same as this: GNOME: Use WinKey (Super_L) as a main menu toggle except this is for _LXDE_ and not _GNOME_.


I installed Nagios 3.4.4 on Ubuntu server 12.10. Installation was successful but now I'm not able to view maps and trends.When I try, I get the following error   **`/nagios/cgi-bin/statusmap.cgi was not found on this server`** Why is this happening.What should be done for this.


title: Why can't I use strace with rsh?

text: If I run rsh, it works, but prints some strange “Connection refused” messages at the beginning:               $ rsh localhost pwd     connect to address 127.0.0.1 port 544: Connection refused     Trying krb4 rsh...     connect to address 127.0.0.1 port 544: Connection refused     trying normal rsh (/usr/bin/rsh)     /home/service      But if I run rsh under strace, it doesn't connect to the server at all:               $ strace -c rsh localhost ulimit -n     connect to address 127.0.0.1 port 544: Connection refused     Trying krb4 rsh...     connect to address 127.0.0.1 port 544: Connection refused     trying normal rsh (/usr/bin/rsh)     rcmd: socket: Permission denied     % time     seconds  usecs/call     calls    errors syscall     ------ ----------- ----------- --------- --------- ----------------      28.39    0.000113           2        58           read      27.64    0.000110          16         7           write      16.83    0.000067           1        47           open      15.33    0.000061           2        27           munmap      11.81    0.000047           1        80           mmap       0.00    0.000000           0        58           close       0.00    0.000000           0         1           stat       0.00    0.000000           0        45           fstat        ..........................................        ..........................................        ..........................................      Here is an extract from `strace rsh localhost ulimit -n`:               connect(3, {sa_family=AF_INET, sin_port=htons(544), sin_addr=inet_addr("127.0.0.1")}, 16) = -1 ECONNREFUSED (Connection refused)     write(2, "Connection refused\n", 19)    = 19     connect(3, {sa_family=AF_INET, sin_port=htons(544), sin_addr=inet_addr("127.0.0.1")}, 16) = -1 ECONNREFUSED (Connection refused)     write(2, "Connection refused\n", 19)    = 19      **Questions**   1. What is causing `port 544: Connection refused`?   2. Why does it show the error `rcmd: socket: Permission denied`? It should show some integer value (the output of `ulimit -n` on the remote machine).


title: In Dolphin file manager Fedora 17, what is the shortcut to create folder?

text: In Dolphin file manager Fedora 17, what is the shortcut to create the new folder. E.g. Ctrl + Shift + N creates new folder in Windows 7


title: Unable to connect to remote host using ssh

text: I have recently installed Fedora in my system. But I am facing some problem in ssh login from remote machine. I am able to login in that system but every time its requires me to login using GUI in that system. So if I reboot that system then after rebooting I won't be able to login until I go to that system and enter the password in GUI login. Here I have notice that system connection checkbox is disabled in my system. So why is this option disabled in my system? ![enter image description here](http://I.stack.imgur.com/vwxfG.png) Any help and suggestion will be appreciated. **Edit 1:** 1) yeah sshd is running in both system 2) here is the output of `ssh -v login@machine' command               [root@localhost src]# ssh -v login@192.168.1.100     OpenSSH_5.6p1, OpenSSL 1.0.0j-fips 10 May 2012     debug1: Reading configuration data /root/.ssh/config     debug1: Reading configuration data /etc/ssh/ssh_config     debug1: Applying options for *     debug1: Connecting to 192.168.1.100 [192.168.1.100] port 22.     debug1: Connection established.     debug1: permanently_set_uid: 0/0     debug1: identity file /root/.ssh/id_rsa type -1     debug1: identity file /root/.ssh/id_rsa-cert type -1     debug1: identity file /root/.ssh/id_dsa type -1     debug1: identity file /root/.ssh/id_dsa-cert type -1     debug1: Remote protocol version 2.0, remote software version OpenSSH_5.6     debug1: match: OpenSSH_5.6 pat OpenSSH*     debug1: Enabling compatibility mode for protocol 2.0     debug1: Local version string SSH-2.0-OpenSSH_5.6     debug1: SSH2_MSG_KEXINIT sent     debug1: SSH2_MSG_KEXINIT received     debug1: kex: server->client aes128-ctr hmac-md5 none     debug1: kex: client->server aes128-ctr hmac-md5 none     debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent     debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP     debug1: SSH2_MSG_KEX_DH_GEX_INIT sent     debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY     debug1: Host '192.168.1.100' is known and matches the RSA host key.     debug1: Found key in /root/.ssh/known_hosts:23     debug1: ssh_rsa_verify: signature correct     debug1: SSH2_MSG_NEWKEYS sent     debug1: expecting SSH2_MSG_NEWKEYS     debug1: SSH2_MSG_NEWKEYS received     debug1: Roaming not allowed by server     debug1: SSH2_MSG_SERVICE_REQUEST sent     debug1: SSH2_MSG_SERVICE_ACCEPT received     debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password     debug1: Next authentication method: publickey     debug1: Trying private key: /root/.ssh/id_rsa     debug1: Trying private key: /root/.ssh/id_dsa     debug1: Next authentication method: password     login@192.168.1.100's password:      debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password     Permission denied, please try again.


title: Script command without output

text: Is there something similar to `script` that records **ONLY** the commands and not any output from them to a file?


title: ssh-agent forwarding for a Vagrant VM

text: I'm currently looking at setting up a Vagrant environment on my Mac machine, so that I can run `vagrant up` and it will then install `rbenv` and `ruby` and all I need. Then I have a Bash script that will fetch all my repos from github. The only thing is that my new vagrant vm has to now generate a ssh key and then link it to my Github account. This can be cumbersome. Especially since I would like to share my Vagrant file with all those that have access to our repos so that they could do the same. So I thought I could try forwarding my hosts ssh to the VM so that the VM can forward my host ssh to Github. Following this article: Githubs walkthrough, I set my hosts ssh config:               Host localhost         ForwardAgent yes      and set in my vagrant file               Vagrant.configure("2") do |config|       config.ssh.forward_agent = true       ...     end      and when I log into my VM and run the following command I get this error:               $ ssh -T git@github.com`     Permission denied (publickey)      Is there anyone that has tried a similar setup? The VM is a precise64 box. EDIT: **`env`** :               vagrant@precise64:~$ env     TERM=xterm-256color     SHELL=/bin/bash     SSH_CLIENT=10.0.2.2 53068 22     SSH_TTY=/dev/pts/0     LC_ALL=en_US     USER=vagrant     LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36:     RBENV_ROOT=/opt/rbenv     SSH_AUTH_SOCK=/tmp/ssh-aDGJQD2812/agent.2812     MAIL=/var/mail/vagrant     PATH=/opt/rbenv/shims:/opt/rbenv/bin:/opt/rbenv/bin/rbenv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/opt/vagrant_ruby/bin     PWD=/home/vagrant     SHLVL=1     HOME=/home/vagrant     LOGNAME=vagrant     SSH_CONNECTION=10.0.2.2 53068 10.0.2.15 22     LC_CTYPE=UTF-8     LESSOPEN=| /usr/bin/lesspipe %s     LESSCLOSE=/usr/bin/lesspipe %s %s     _=/usr/bin/env


title: Recover atime after vim

text: I've `vim`ed a file, and only afterwards realised that I need the `atime` (last access time) for the file. **Is there any way to recover the`atime` for a file after accessing it inadvertently?** The filesystem is mounted as so:               UUID=XXXX /home           ext4    defaults        0       2      I'm interested in a distro-neutral solution, however barring that I am currently using Ubuntu Server 12.04.


title: The difference between \e and ^[

text: Gilles wrote: > character 27 = 033 = 0x1b = `^[` = `\e` Demizey wrote: > ^[ is just a representation of ESCAPE and \e is interpreted as an actual > ESCAPE character Then I also found this line from a TechRepublic article > Make sure you write the key sequence as \e[24~ rather than ^[[24~. This is > because the ^[ sequence is equivalent to the [Esc] key, which is represented > by \e in the shell. So, for instance, if the key sequence was ^[[OP the > resulting bind code to use would be \e[OP. But I have been using mappings that use ^[ instead of \e. So are they interchangeable? When do I need use one instead of the other?


title: How to kill a process running in specific script

text: I have two script files running simultaneously. I just need to kill the `java` process running in one script without affecting the `java` process in the another one.


title: How to run a specific program as root without a password prompt?

text: I need to run something as sudo without a password, so I used `visudo` and added this to my `sudoers` file:               MYUSERNAME ALL = NOPASSWD: /path/to/my/program      Then I tried it out:               $ sudo /path/to/my/program     [sudo] password for MYUSERNAME:       Why does it ask for a password? How can I run/use commands as root with a non- root user, without asking for a password?


title: How to make sudo accept password automatically without prompting for it?

text: I created a user named shut so that whenever one logs in using that username the machine would shut down. For that I placed the below command in the end of the .profile.               exec sudo shutdown -h now      But this didn't serve the purpose. When the user shut logs in, rather than the machine shutting down, the login screen is coming back. So the user isn't able to log in but at the same time getting back the same login screen. The reason I feel is that because password for the user shut isn't provided , the machine isn't shutting down. And because of exec, the login screen is coming back (which is fine). Now to solve my work, I need a way so that it would automatically take my password when the above sudo command executes. I checked `man sudo` and I think `-A` option has to be used. Following that man page, I ran               SUDO_ASKPASS=/home/ravbholua/pass.txt          export SUDO_ASKPASS      Then to check whether it's working, I ran               ravbholua@ravbholua-Aspire-5315:~$ sudo -A pwd          sudo: unable to run /home/ravbholua/pass.txt: Permission denied      From this output, it means this path file has to run and provide my password as output to sudo. What earlier I thought, it would take the password from this file named pass.txt, so I entered my password in this file. But no!!!!!!! Any suggestions please!


title: How can I add sudo permission for copying?

text: my sudoers file:               cat /etc/sudoers     ...     USERHERE ALL = NOPASSWD: /bin/cp /home/USERHERE/foo/in.csv /home/anotheruser/in.csv     ...      it looks OK too:               USERHERE@notebook:~/foo$ sudo -l     Matching Defaults entries for USERHERE on this host:         env_reset, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin          User a may run the following commands on this host:         (root) NOPASSWD: /bin/cp /home/USERHERE/foo/in.csv /home/anotheruser/in.csv         (ALL : ALL) ALL     USERHERE@notebook:~/foo$      but when I try it prompts for password, why?               USERHERE@notebook:~$ sudo /bin/cp /home/USERHERE/foo/in.csv /home/anotheruser/in.csv     [sudo] password for USERHERE:      Using Ubuntu 12.04


title: No password to run command as root for fixed command?

text: Is it possible to define a rule in sudoers to allow one user to run one well defined command as root, without password or other authentication except being the right user? Are there alternatives to solve this (or something very similar)? Use suid permission bit? Maybe make use of ssh keys somehow?


title: I'm not getting privileges, edited /etc/sudoers

text: I want to run any program without asking root password. Because I'm the only person who use the system. So I googled and edited `/etc/sudoers`. What I did:               # chmod 640 /etc/sudoers     # vim /etc/sudoers      Added a line like below:               # User privilege specification     root    ALL=(ALL:ALL) ALL     sgg ALL=(ALL:ALL) ALL      saved and closed the file. Rebooted system. But no change/improvement. Am I want to change any other lines? or Is there any way? EDIT: 1.I changed permissions `/etc/sudoers` to `0440`. `ls -l /etc/sudoers` result is               -r--r----- 1 root root 772 May  4 19:43 /etc/sudoers      2.I run `# visudo`. File content is               Defaults        env_reset     Defaults        mail_badpass     Defaults        secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"          # Host alias specification          # User alias specification          # Cmnd alias specification          # User privilege specification     root    ALL=(ALL:ALL) ALL     sgg ALL=NOPASSWD:ALL          # Members of the admin group may gain root privileges     %admin ALL=(ALL) ALL          # Allow members of group sudo to execute any command     %sudo   ALL=(ALL:ALL) ALL      But still it asking for password when I run `sudo ls`. **System Info** : `Ubuntu 14.04 x86_64 3.13.0-24-generic`


title: sudo: password prompted even when NOPASSWD is set

text: ~/bin$ cat setbrightness      id     echo $1 > /sys/class/backlight/intel_backlight/brightness          ~/bin$ whoami     rag               ~/bin$ sudo -l     Matching Defaults entries for rag on this host:         env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin          User rag may run the following commands on this host:         (root) NOPASSWD: /home/rag/bin/setbrightness         (ALL : ALL) ALL      EDIT: /etc/sudoers               Defaults    env_reset     Defaults    mail_badpass     Defaults    secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"          # Host alias specification          # User alias specification          # Cmnd alias specification     Cmnd_Alias   SETBRIGHTNESS = /home/rag/bin/setbrightness          # User privilege specification     root    ALL=(ALL:ALL) ALL     rag ALL=NOPASSWD:SETBRIGHTNESS          # Members of the admin group may gain root privileges     %admin ALL=(ALL) ALL          # Allow members of group sudo to execute any command     %sudo   ALL=(ALL:ALL) ALL          # See sudoers(5) for more information on "#include" directives:          #includedir /etc/sudoers.d      Run command               ~/bin$ sudo /home/rag/bin/setbrightness 3000     [sudo] password for rag:      Can someone please point out why the password is prompted when running `sudo` for that command?


> **Possible Duplicate:**   >  How to run a specific program as root without a password prompt? I installed fedora 15. I use `sudo visudo` to modify sudoers file and add the following line:               USERNAME  ALL=(ALL)       NOPASSWD: ALL      I then logout and login. I try doing any sudo command like `sudo gvim &`... but I am still getting prompted for password. **How do you get NOPASSWD sudo option to work in Fedora 15?**   * Is my syntax wrong?   * Is there some Fedora 15 thing that is preventing this to work? * * * UPDATE: After seeing answers below talking about "the order of your sudoers file" I decided to copy the full sudoers file in here. I took the liberty of removing most white space lines, all comments lines, and all lines containing the string "Default":               root    ALL=(ALL)   ALL     USERNAME    ALL=NOPASSWD:ALL,/bin/mount,/bin/umount          %wheel  ALL=(ALL)   ALL


title: Device in fstab not mounting at boot

text: The following is in my `/etc/fstab` file:               UUID=596ac80a-5571-41dc-a00e-b3270ecfe7c4 / ext3 errors=remount-ro 0 1           /dev/sdb1 /home/teamspeak/ts3/files/virtualserver_1/channel_527 ext3  nofail,auto,noatime,rw,user 0 0          tmpfs   /var/log   tmpfs   nofail,defaults,noatime,mode=0755,size=5M   0  0      but `/dev/sdb1` doesn't mount at boot time (if I write `mount` it doesn't show up in the list) , but it does if I then write `mount -a` EDIT It is an usb device, and option nofail needs to be present cause it prevents the machine to halt if plugged out and reboot. Tried _netdev option with no luck. right after boot `dmesg | tail` outputs               [    8.774931] sd 2:0:0:0: [sdb] Assuming drive cache: write through     [    8.775036]  sdb: sdb1     [    9.115231] sd 2:0:0:0: [sdb] Assuming drive cache: write through     [    9.115336] sd 2:0:0:0: [sdb] Attached SCSI removable disk      then, after `mount -a` it adds:               [ 2037.473279] kjournald starting.  Commit interval 5 seconds     [ 2037.475895] EXT3 FS on sdb1, internal journal     [ 2037.475916] EXT3-fs: mounted filesystem with ordered data mode.


title: iptables applied in local machine, Can't access remote ssh

text: I want to SSH to **192.168.1.15** server from my machine, my ip was **192.168.1.99**. Source destination was UP, with IP **192.168.1.15**. This is a LAN, there are 30 machines connected to the network and working fine, I'm playing around the local machines cos i need to apply the same rules in production VPS. I have applied the below iptables in my machine 192.168.1.99. Now i can't receive any packets from outside and i can't send any packets outside, while applying the below chain               iptables -P INPUT DROP     iptables -P OUTPUT DROP     iptables -P FORWARD DROP      After the above CHAIN i have added the below rules and it want to allow ssh from machine to **192.168.1.15** to access the **192.164.1.15** but still i can't access **192.168.1.15**.               iptables -A INPUT -p tcp -i eth0 --dport 22 -m state --state NEW,ESTABLISHED -j ACCEPT     iptables -A OUTPUT -p tcp -o eth0 --sport 22 -m state --state ESTABLISHED -j ACCEPT     iptables -A OUTPUT -o eth0 -p tcp --dport 22 -m state --state NEW,ESTABLISHED -j ACCEPT     iptables -A INPUT -i eth0 -p tcp --sport 22 -m state --state ESTABLISHED -j ACCEPT      Any one please check whether my rules are right. Still i can't access the machine 15.


title: fedora 19: unable to update or install - "Could not resolve host..."

text: I cannot update as no mirror is found:               [root@localhost ~]# yum update     Loaded plugins: langpacks, refresh-packagekit     Could not get metalink https://mirrors.fedoraproject.org/metalink?repo=fedora-19&arch=i386 error was     14: curl#6 - "Could not resolve host: mirrors.fedoraproject.org; Name or service not known"     http://www.mirrorservice.org/sites/dl.fedoraproject.org/pub/fedora/linux/releases/19/Everything/i386/os/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: www.mirrorservice.org; Name or service not known"     Trying other mirror.     ftp://ftp.mirrorservice.org/sites/dl.fedoraproject.org/pub/fedora/linux/releases/19/Everything/i386/os/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: ftp.mirrorservice.org; Name or service not known"     Trying other mirror.      I can ping this and every other address that fails:               [root@localhost ~]# ping www.mirrorservice.org     PING www.mirrorservice.org (212.219.56.184) 56(84) bytes of data.     64 bytes from www.mirrorservice.org (212.219.56.184): icmp_seq=1 ttl=50 time=19.6 ms     64 bytes from www.mirrorservice.org (212.219.56.184): icmp_seq=2 ttl=50 time=19.6 ms     64 bytes from www.mirrorservice.org (212.219.56.184): icmp_seq=3 ttl=50 time=19.7 ms     64 bytes from www.mirrorservice.org (212.219.56.184): icmp_seq=4 ttl=50 time=20.1 ms     ^C     --- www.mirrorservice.org ping statistics ---     4 packets transmitted, 4 received, 0% packet loss, time 3004ms     rtt min/avg/max/mdev = 19.607/19.788/20.104/0.189 ms      ### UPDATE #1 Here's the output from the following command:               $ URLGRABBER_DEBUG=1,debug.log yum update


title: Gentoo Gnome 3.2 Wireless "Connecting..."

text: I recently updated my Gentoo with GNOME 2.x to GNOME 3.2. My NetworkManager applet refuses to connect to my network; however, it does not give an error as it simply hangs as "Connecting..." I checked `/var/log/messages` and it seems that NetworkManager is simply not performing Step 5 of 5 to connect to the network. I am given an IP Address lease when it completes step 4... But step 5 is never started.


title: Defining color codes in rxvt-unicode

text: Using some of `node.js` tools like `mocha` in my `urxvt` terminal, I have some problems with coloured output. Some of the text that are using colour code 90 as you can see here will be disappeared in terminal. `tput colors` output is: 256 And using this command:               (x=`tput op` y=`printf %76s`;for i in {0..256};do o=00$i;echo -e ${o:${#o}-3:3} `tput setaf $i;tput setab $i`${y// /=}(x=`tput op` y=`printf %76s`;for i in {0..256};do o=00$i;echo -e ${o:${#o}-3:3} `tput setaf $i;tput setab $i`${y// /=}$x;done)$x;done)      It seems I have all available colours. But when I try to echo something like this:               echo '\e[0;90m shahin \e[m '      There will be a just an empty line printed! Is there anyway to define this colour code manually? Thank you all! Update: I think some images will describe the situation much better. Here is an image of echo command in `finalterm` terminal: ![enter image description here](http://i.stack.imgur.com/WkJcY.png) And here I put the result from `urxvt`: ![enter image description here](http://i.stack.imgur.com/lAILA.png) And here is the result of this `perl` script that is running on the same `urxvt`: ![enter image description here](http://i.stack.imgur.com/I7iue.png)


title: How does the path enviroment variable work in linux?

text: I'm confused how does the enviroment path work under linux, I'm a Linux Mint 15 user. First, I read about editing the `/home/.bashrc` file and doing a `PATH=$PATH:/directory`,   but I also knew about some path stuff managed in `/etc/bash.bashrc`   and so any software installed and in `/usr/local/bin` would be reachable from anywhere i the shell. So, how does the path variable work under linux and where is actually placed?


title: chcon: can't apply partial context to unlabeled file while installing nagios with SELinux

text: I'm setting up Nagios core on CentOS with SELINUX=enforcing. I try to run               chcon -R -t httpd_sys_content_t /usr/local/nagios/sbin/      as suggested in the manual, but I get this error messages:               chcon: can't apply partial context to unlabeled file `cmd.cgi'     chcon: can't apply partial context to unlabeled file `trends.cgi'     chcon: can't apply partial context to unlabeled file `histogram.cgi'     chcon: can't apply partial context to unlabeled file `avail.cgi'     chcon: can't apply partial context to unlabeled file `history.cgi'     chcon: can't apply partial context to unlabeled file `status.cgi'     chcon: can't apply partial context to unlabeled file `tac.cgi'     chcon: can't apply partial context to unlabeled file `showlog.cgi'     chcon: can't apply partial context to unlabeled file `notifications.cgi'     chcon: can't apply partial context to unlabeled file `extinfo.cgi'     chcon: can't apply partial context to unlabeled file `statuswml.cgi'     chcon: can't apply partial context to unlabeled file `outages.cgi'     chcon: can't apply partial context to unlabeled file `statuswrl.cgi'     chcon: can't apply partial context to unlabeled file `statusmap.cgi'     chcon: can't apply partial context to unlabeled file `config.cgi'     chcon: can't apply partial context to unlabeled file `summary.cgi'      Any ideas how to avoid these errors?


title: How to delete the second column from this input?

text: INPUT     bix.hu.         42433   IN  A   193.239.149.1     bix.hu.         42433   IN  MX  10 deneb.iszt.hu.     bix.hu.         42433   IN  NS  ns.iszt.hu.     bix.hu.         42433   IN  NS  ns.iszt.hu.     bix.hu.         42433   IN  NS  ns-s.nic.hu.     bix.hu.         42433   IN  NS  ns-s.nic.hu.     bix.hu.         42433   IN  SOA ns.iszt.hu. hostmaster.iszt.hu. 2011053000 28800 7200 604800 14400          OUTPUT     bix.hu.         IN  A   193.239.149.1     bix.hu.         IN  MX  10 deneb.iszt.hu.     bix.hu.         IN  NS  ns.iszt.hu.     bix.hu.         IN  NS  ns.iszt.hu.     bix.hu.         IN  NS  ns-s.nic.hu.     bix.hu.         IN  NS  ns-s.nic.hu.     bix.hu.         IN  SOA ns.iszt.hu. hostmaster.iszt.hu. 2011053000 28800 7200 604800 14400      using bash, sed, awk, etc. How?? actually it's just an output from:               dig -t any bix.hu | egrep -v "^;;|^;|^$" | sort      I just don't want the TTL column.. [because I want to sha256sum the output, and in this way I can check that the DNS settings are modified or not, but if the TTL keeps decreasing it ruins the sha256sum] - it will be just a checker script..


title: How to use "fuser" to get process list for nested folder while using with parent folder as argument?

text: I am using `fuser` command to get the list of processes accessing a folder. However if the process is working on a file present in a inner folder, executing `fuser` command on the parent does not provide details of the process working on inner folder. Is there any way I can pull the process details of the inner folders as well while executing `fuser` on the parent? I am working with Solaris 5.8. Below is the code which I tried:               ~: pwd     /home/ah388          ~: ls     sasuser.v91/          ~: cd sasuser.v91/     ~/sasuser.v91: cat kk.sh     while [ 1 ]; do     echo "" > /dev/null     done;          ~/sasuser.v91: ./kk.sh &     **[1] 15140**          ~/sasuser.v91: ls     a/      kk.sh*          ~/sasuser.v91: cd a     ~/sasuser.v91: ls     kk.sh*          ~/sasuser.v91/a: ./kk.sh &     **[2] 15271**          ~/sasuser.v91/a: cd          ~: fuser -u sasuser.v91     **sasuser.v91:    15140c(ah388880) --> What about 15271 Process**          ~: jobs     [1]-  Running                 ./kk.sh &  (wd: ~/sasuser.v91)     [2]+  Running                 ./kk.sh &  (wd: ~/sasuser.v91/a)


title: CentOS | [root@hostname] does not show anymore?

text: For some reason I logged into my CentOS6 server and at the beginning of every line it normally shows               [root@hostname]#       Now it shows               -bash-4.1#      What does this mean? **And how to I get it back to normal???** I'm very new to CentOS...


title: Bluetooth auto-connect not going through

text: I finally got Bluetooth working on my late 2011 8,3 MacBook Pro running 11.10-amd64 Ubuntu. However, I'm having some weird problems that I've noticed were pretty global across what I was doing. Essentially, my Bluetooth device will be able to connect, but it won't actually get used or utilized for anything unless I intervene to make stuff happen. My device will connect initially to my computer, then drop the connection and go into pairing mode, as if it can't see anything it's automatically connected to. I'll see the device connect and then disconnect every so often on my computer, apparently as it looks for the computer. It seems like some kind of handshake is failing. If I wait until my device connects to the computer for the short period that it does and quickly use `blueman` to "Setup..." the device (ie: connect it as a "Headset Service" and "Audio Sync," then it works. It connects just fine and I can use it. However, the connection isn't automatic and persistent unless I intervene and force it into connecting as a A2DP headset. Is there something I could do to try and determine what's going wrong here? I'd simply like the computer to automatically connect to the device as soon as it's detected, so that when I start my operating system, things "just work™."


title: Program stall under user but runs under root

text: I am running `R` job under a normal user `john` and `root`. Interestingly, the program stalls under `john` user but runs quickly under `root`. Using `strace`, I found that when `john` runs the `R`, the process stalls for its child process. I guess the linux do not let the child process continue and the parent (main program) stays stalled infinitely. Is there any limitation on the number of fork/clone that a normal linux user can do? Any idea why this happens? Thank you in advance. Anyway, here on this post I've described my start-point of problem. _**Further information_** Last lines of `strace` for `john` user (where program stalls):               lseek(255, -82, SEEK_CUR)               = 1746     clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7fa12fd4f9d0) = 13302     rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0     rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0     rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0     rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0     rt_sigaction(SIGINT, {0x43d060, [], SA_RESTORER, 0x311b432900}, {0x452250, [], SA_RESTORER, 0x311b432900}, 8) = 0     wait4(-1,  <unfinished ...>      Last lines of `strace` for `root` (where program runs completely):               lseek(255, -82, SEEK_CUR)               = 1746     clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7f81d8e239d0) = 13244     rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0     rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0     rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0     rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0     rt_sigaction(SIGINT, {0x43d060, [], SA_RESTORER, 0x311b432900}, {0x452250, [], SA_RESTORER, 0x311b432900}, 8) = 0     wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 1}], 0, NULL) = 13244     rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0     --- SIGCHLD (Child exited) @ 0 (0) ---     wait4(-1, 0x7fff54a591dc, WNOHANG, NULL) = -1 ECHILD (No child processes)     rt_sigreturn(0xffffffffffffffff)        = 0     rt_sigaction(SIGINT, {0x452250, [], SA_RESTORER, 0x311b432900}, {0x43d060, [], SA_RESTORER, 0x311b432900}, 8) = 0     rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0     read(255, "\n### Local Variables: ***\n### mo"..., 1828) = 82     rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0     rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0     rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0     rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0     rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0     read(255, "", 1828)                     = 0     exit_group(1)


title: What is a free open source webmail software with pgp support?

text: I've a virtual server not a ksm but with lighttpd and mysql and postfix. Can I use it to replace my existing free webmail and what is a good software? I also want to use pgp if it's possible?


title: Gnome and Cinnamon loads in fallback (classic) mode only

text: So I have been using linux mint for a while now. A few months ago my Gnome shell crashed and I was unable to use the full 3d features and loaded into fallback mode only. From that day (around 2 months ago) I still have only fallback mode (both Gnome and cinnamon). I installed Linux mint maya, and Ubuntu 12.04 both as windows file and complete installation in an external hard drive. and for many times I sitll cannot fix this problem. ps I made sure to download all the drivers for my graphics card. what could the problem be?


title: Restore /etc/ configuration files from the default

text: Is there a way to replace `/etc` configuration files from a package, overwriting my local changes? I've tried `apt-get install --reinstall mypackage` but it doesn't update the files. How can I do this?


title: Limit disk buffer usage in SLES 11SP2 to allow more efficient memory overcommit on esxi host

text: When running VMs on an ESXi host, you can overcommit the memory. Example: host == 20GB physical RAM The amount of RAM allocated to each VM is   * VM1 == 10gb   * VM2 == 10gb   * VM3 == 10gb   * VM4 == 10gb The result is even though there is only 20GB of ram available, We have actually allocated 40GB of it. There is no problem with this if each machine uses and average of 5GB of "active" memory (inactive memory is swapped out in a few different manners). The issue is, VM1 does a big file operation, the kernel writes an additional 5GB to it's RAM. As this is just written, the esx host considers it as active memory, and starts swapping out memory from the other running VMs (thus hitting their performance). Flushing the cache after a big operation (using is not a great option as the host has already started penalising the other VMs.) The above is a simplification (the actual problem VM has 32GB of RAM assigned), but essentially: **tl;dr** How do I limit the max size of the disk cache on a linux kernel.


title: sed edit text block: not greedy match

text: I wish I can grab **the first** html comment in a file using sed. Using `'/<!--/,/-->/` and having more than one comment block it will match all the content between the first and the last comment block too! Any advice? Here a sample:               <!--           First comment block          -->          Content          <!--          Second comment block          -->      The expected output should be:               <!--           First comment block          -->      It should work with single line comments too.               <!-- First comment block -->


title: What is the KDE equivalent of a Nautilus script?

text: I have just begun to use KDE, and I can't find any info about the KDE equivalent of a Nautilus script. What I need to be able to do is select some files, right click, and apply a number of commands to all of them, as with a Nautilus script.


title: Use an existing wampserver from a windows partition on linux mint

text: I dual boot Windows 7 and Linux Mint 14. I have wampserver installed on Win 7 and have a couple of websites already set up there. Is it possible to use that same installation apache/mysql/php installation on linux mint?


title: How to remove LUKS auto-unlock?

text: Unfortunately my drive **unlocks automatically**. This makes the whole encryption useless. How do I turn off this annoying _feature_ on a specified drive (e.g. `/dev/x`) ? The `cryptsetup` command I've found is **not documented**. I'm afraid this could erase the whole drive!               cryptsetup luksRemoveKey /dev/x      ![enter image description here](http://i.stack.imgur.com/j2Omr.png)


title: OpenBSD Atheros AR8151 no Ethernet media present

text: I installed OpenBSD 5.5 on an ASRock AD525PV3. The board uses the mentioned Atheros LAN. It shows `alc0` on **ifconfig** , but the media only has Ethernet manual, and I can't use the LAN. Is there a way to put it to work?


title: How does this awk align the spacing?

text: Can someone please tell me what does this do?               cat infile|     awk '      {      for(i=3;i<=NF;i++){ $2=$2" "$i }       printf "%-4s %s\n", $1,$2 ;      }' > outfile.txt          `infile` contains:               1 John Smith       2 Bill Johnson       ...     5000 George Heiz        I see that the result is that `outfile.txt` has all the lines aligned but I don't understand how   Specifically what does this part `for(i=3;i<=NF;i++){ $2=$2" "$i }` do?


title: How can i run a piece of code in background?

text: Can I run a piece of code in background instead of using another script.               [sesiv@itseelm-lx4151 ~]$ cat ./testback2     #!/bin/bash     start_time=$(date +%s)          for i in {1..5}     do     ./testscript &     done     wait                  finish_time=$(date +%s)             seconds=$((finish_time - start_time))             hours=$((seconds / 3600))             seconds=$((seconds % 3600))             minutes=$((seconds / 60))             seconds=$((seconds % 60))             echo "Time Taken :"             echo "$hours hour(s) $minutes minute(s) $seconds second(s)"          [sesiv@itseelm-lx4151 ~]$ ./testback2     sleeping 22436     sleeping 22438     sleeping 22440     sleeping 22442     sleeping 22435     Time Taken :     0 hour(s) 0 minute(s) 3 second(s)      i tried something like below but it gives the parent process id.I was expecting 5 different child process ids like above.But the timing here is 3 soeconds only.               #!/bin/bash     start_time=$(date +%s)     fun() {     echo "$1 $$"     sleep 3     }               for i in {1..5}     do     fun sleeping &     done     wait                  finish_time=$(date +%s)             seconds=$((finish_time - start_time))             hours=$((seconds / 3600))             seconds=$((seconds % 3600))             minutes=$((seconds / 60))             seconds=$((seconds % 60))             echo "Time Taken :"             echo "$hours hour(s) $minutes minute(s) $seconds second(s)"          output :     sleeping 22028     sleeping 22028     sleeping 22028     sleeping 22028     sleeping 22028     Time Taken :     0 hour(s) 0 minute(s) 3 second(s)      NOTE:this is the `testscript` code               #!/bin/bash     fun() {     echo "$1 $$"     sleep 3     }          fun sleeping


title: Determining network interface names in NetBSD

text: Does anyone know if there is a way to determine what a network interface will be called in NetBSD if you know which NIC/driver you will be using before hand? I'm trying to automate parts of a NetBSD set-up for a variety of different machines and would like to write an /etc/ifconfig.xx file but never know what the 'xx' part will be. I know that, for example, my Intel NIC uses 'wm' as the suffix, but where does NetBSD get that information from?


title: stdin, stderr, redirection and logs

text: Is there a difference between those two lines ?               /home/user/script.sh >> /home/user/stdout_and_error.log  2>&1     /home/user/script.sh 2>&1 >> /home/user/stdout_and_error.log        knowing that I would like to put the stdout and execution errors of the script in the log file. If there are no differences, what if I would like to log the logging itself?


title: zsh: Echoing every statement?

text: I have an odd problem with zsh when I switch between shells in a particular way: ### Option 1 (works well): I start a `zsh` shell. I switch to `tcsh` with `/bin/tcsh`, and I switch back to `zsh` with `/bin/zsh` If I then run:               > ls      I get:               ./  ../ file1 file1 file3      ### Option 2 (problematic): I start a `zsh` shell. I switch to `tcsh` with: `exec env -i HOME=$HOME TERM=$TERM DISPLAY=$DISPLAY /bin/tcsh`. and I then switch back to `zsh` with `/bin/zsh`. If I then enter any commands, the `zsh` shell echoes the command and then the result. Using the same example as before:               > ls          2;ls --color=yes -aF1;./ ../ file1 file2 file3      In other words, zsh shows `2;COMMAND 1;` and then the output, which is of course very different from what I was getting with **Option 1**. What's even more strange is that this only happens within `ansi-term` or `multi-term` terminals in Emacs, and not under `gnome-terminal`. What else can I do to diagnose the problem? Any thoughts on what may be causing this? # Update: My `.cshrc` prompt is               set prompt = "> "


title: Why does my Mountain Lion computer have Apache 2.2.22 shut down almost as soon as it starts?

text: [Sun Apr 21 17:29:00 2013] [notice] caught SIGTERM, shutting down     [Sun Apr 21 17:30:15 2013] [warn] Init: Session Cache is not configured [hint: SSLSessionCache]     httpd: Could not reliably determine the server's fully qualified domain name, using Christoss-MacBook-Pro.local for ServerName     [Sun Apr 21 17:30:16 2013] [notice] Digest: generating secret for digest authentication ...     [Sun Apr 21 17:30:16 2013] [notice] Digest: done     [Sun Apr 21 17:30:18 2013] [notice] Apache/2.2.22 (Unix) DAV/2 mod_ssl/2.2.22 OpenSSL/0.9.8r configured -- resuming normal operations     [Sun Apr 21 17:31:06 2013] [error] [client ::1] File does not exist: /Users/jonathan/project/fathers/public_html/blajeny.com     [Sun Apr 21 17:37:13 2013] [error] [client ::1] File does not exist: /Users/jonathan/project/fathers.tgz/public_html/     [Sun Apr 21 17:37:14 2013] [error] [client ::1] File does not exist: /Users/jonathan/project/fathers.tgz/public_html/favicon.ico     [Sun Apr 21 17:44:41 2013] [notice] caught SIGTERM, shutting down      I'm not completely sure how to parse this. I wouldn't expect the 404's to shut down the server. Is there anything that jumps out about what is wrong here?


title: How to start a cron job without reboot?

text: I use a cron job to call `offlineimap` every 2 minutes:               */2 * * * * /usr/bin/offlineimap > ~/Maildir/offlineimap.log 2>&1      I needed to kill the cron job to fix a problem. How can I then restart the cron job (without rebooting)? I found this 'solution' online:               mylogin@myhost:~$ sudo /etc/init.d/cron restart     Rather than invoking init scripts through /etc/init.d, use the service(8)     utility, e.g. service cron restart          Since the script you are attempting to invoke has been converted to an     Upstart job, you may also use the stop(8) and then start(8) utilities,     e.g. stop cron ; start cron. The restart(8) utility is also available.     cron stop/waiting     cron start/running, process 26958      However, using `ps -ef | grep ...`, I don't see the job... What's wrong?


title: Bash way to check if a process is already running in the background (and skip re-execution based on that)?

text: Can I make a bash command line that only runs a certain command if the process is not already running (in the background)? How do I check*, if a command is already running? (so I can add the next command with `&&` in between them so the next one only executes if the first one is true). *: test, determine, discover, find out


title: How to install Skype on Linux Mint

text: I downloaded the installer from the website. When I run it, I get the following error: > Your system has broken dependencies. This application cannot continue until > it is fixed. To fix it, run "gksudo synaptic" or "sudo apt-get install -f" > in a terminal window. I tried both options. When tried to fix the broken packages in synaptic I get > Some packages could not be retrieved, do you want to proceed? I said yes. Then               >E: Unable to correct missing packages     W: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/t/tiff/libtiff5_4.0.2-1ubuntu2.1_i386.deb       404  Not Found [IP: 91.189.92.201 80]     W: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/g/gnutls26/libgnutls26_2.12.14-5ubuntu4.2_i386.deb       404  Not Found [IP: 91.189.92.201 80]     W: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/m/mysql-5.5/mysql-common_5.5.29-0ubuntu0.12.10.1_all.deb       404  Not Found [IP: 91.189.92.201 80]     W: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/m/mysql-5.5/libmysqlclient18_5.5.29-0ubuntu0.12.10.1_i386.deb       404  Not Found [IP: 91.189.92.201 80]


title: How can I retrieve screen unlock times in Gnome on later Red Hat variants?

text: The `last` command only retrieves the login times. I'm interested in the times that the screen was unlocked. Any indirect means of getting this are also welcome.


title: filtering rsyslog log on the server side

text: Hi I'm trying to filter usb messages, specifically of new connections. all of my clients are configured to send to a central server their 'kern.*' log. problem is I'm getting to much "junk" logs and they accumulate very fast (few gigs a minute). I'm trying to figure out a way to filter these, either on the client/server side. any suggestion is very much appreciated!


title: What is SUnreclaim memory?

text: In `/proc/meminfo` we find among others:               Slab:             276188 kB     SReclaimable:     244112 kB     SUnreclaim:        32076 kB      From what I could find out all three numbers refer to slab memory. But what exactly is `SUnreclaim` (and `SReclaimable`)? How is it related to (kernel) memory leaks? Today I had to reboot my computer because it ran very slow and processes kept being killed. I noticed that `SUnreclaim` was around 7 GB (total RAM is 8 GB) which I suspect to be the cause. Would there have been any other solution than a reboot?


title: Is there a way to mix between two RTMP streams (depending on which is up) using something like FFMPEG?

text: (Apologies about the question title, not quite sure how to word it) So I'm working on a turnkey streaming solution / server for a local LAN party, using the fantastic nginx-rtmp to handle incoming RTMP streams from our main PC's and deliver (hopefully) an uninterrupted signal to Twitch and other such streaming services. One of the main things I'd like to achieve is having the server switch to, say, a local webcam (or another stream) if we're not sending anything to it, which would perfect the zero-downtime approach that I'm aiming for. I've looked into using ffmpeg for this, with arguments along the line of:               ffmpeg -i "rtmp://127.0.0.1/in/stream" -i "rtmp://127.0.0.1/webcam/stream" -vcodec copy -acodec copy rtmp://127.0.0.1/out/stream      but ffmpeg refuses to start outputting unless it's receiving both inputs, and stops completely if it loses one. Problem is that I can't think of any alternatives, short of:   * hooking into nginx-rtmp's on_publish_done hook and firing a script or something to trigger a webcam stream to start after a short delay (and then just stopping that stream using the control interface), or   * having another system running something like Open Broadcaster Software and handling the mixing If anyone's got any ideas, no matter how silly, I'd really appreciate it, because I'm stumped!


title: WebGL support on VirtualBox guest

text: I've managed to install a Debian 7.3 as guest on virtualbox 4.3.6 VM with guest additions, and I'm not able to make work webGL. While I'm able to see openGL working (tried with `glxinfo` and `glxgears` from the command line), I'm not able to make work webGL on Firefox/Chrome/Iceweasel (didn't try other browsers). For checking if webgl is ok I'm used to surf to http://get.webgl.org/; a couple of notes stating the point at which I'm arrived:   * setting webgl.force-enabled to true in the `about:config` firefox page (and later all fore-related stuff to true);   * checked up that the guest additions installation process went allright (I had to install the right kernel headers module);   * enabled 3D acceleration for that VM;   * in the host machine (Ubuntu 12.04) webGL works well. So, at this point: is it possible to make webGL work in a debian guest OS (or generally in a guest OS, because maybe this isn't supported)? I think that more simple the solution, less custom it is and so less subject to weird errors. Here follows a couple of links at which I'm arrived to:   * https://groups.google.com/forum/#!topic/webgl-dev-list/VBmcmEMXAL0;   * http://web.archiveorange.com/archive/v/uC2UCk1UQ9htmqyPXtt0. # Update 1 Tried also with Ubuntu 13.10 guest, same result. # Update 2 Result of `glxinfo`:               name of display: :0     display: :0  screen: 0     direct rendering: Yes     server glx vendor string: Chromium     server glx version string: 1.3 Chromium     server glx extensions:         GLX_ARB_multisample, GLX_EXT_texture_from_pixmap, GLX_SGIX_fbconfig,          GLX_ARB_get_proc_address     client glx vendor string: Chromium     client glx version string: 1.3 Chromium     client glx extensions:         GLX_ARB_multisample, GLX_EXT_texture_from_pixmap, GLX_SGIX_fbconfig,          GLX_ARB_get_proc_address     GLX version: 1.3     GLX extensions:         GLX_ARB_multisample, GLX_EXT_texture_from_pixmap, GLX_SGIX_fbconfig,          GLX_ARB_get_proc_address     OpenGL vendor string: Humper     OpenGL renderer string: Chromium     OpenGL version string: 2.1 Chromium 1.9     OpenGL shading language version string: 1.20     OpenGL extensions:         GL_EXT_draw_range_elements, GL_EXT_framebuffer_object,          GL_EXT_compiled_vertex_array, GL_ARB_depth_texture,          GL_ARB_fragment_program, GL_ARB_multisample, GL_ARB_multitexture,          GL_ARB_occlusion_query, GL_ARB_point_parameters, GL_ARB_point_sprite,          GL_ARB_shadow, GL_ARB_texture_border_clamp, GL_ARB_texture_compression,          GL_ARB_texture_cube_map, GL_ARB_texture_env_add,          GL_ARB_texture_env_combine, GL_EXT_texture_env_combine,          GL_ARB_texture_env_crossbar, GL_ARB_texture_env_dot3,          GL_EXT_texture_env_dot3, GL_ARB_texture_mirrored_repeat,          GL_IBM_texture_mirrored_repeat, GL_ARB_texture_non_power_of_two,          GL_ARB_transpose_matrix, GL_ARB_vertex_buffer_object,          GL_ARB_pixel_buffer_object, GL_ARB_vertex_program, GL_ARB_window_pos,          GL_EXT_blend_color, GL_EXT_blend_minmax, GL_EXT_blend_func_separate,          GL_EXT_blend_subtract, GL_EXT_texture_env_add, GL_EXT_fog_coord,          GL_EXT_multi_draw_arrays, GL_EXT_secondary_color, GL_EXT_shadow_funcs,          GL_EXT_stencil_wrap, GL_EXT_texture_cube_map, GL_EXT_texture_edge_clamp,          GL_EXT_texture_filter_anisotropic, GL_EXT_texture_lod_bias,          GL_EXT_texture_object, GL_EXT_texture3D, GL_IBM_rasterpos_clip,          GL_NV_texgen_reflection, GL_NV_texture_rectangle,          GL_EXT_texture_rectangle, GL_ARB_texture_rectangle, GL_NV_vertex_program,          GL_NV_vertex_program1_1, GL_SGIS_generate_mipmap,          GL_SGIS_texture_border_clamp, GL_SGIS_texture_edge_clamp,          GL_ARB_shading_language_100, GL_ARB_shader_objects, GL_ARB_vertex_shader,          GL_ARB_fragment_shader, GL_EXT_texture_sRGB, GL_EXT_framebuffer_blit,          GL_EXT_blend_equation_separate, GL_EXT_stencil_two_side,          GL_CR_state_parameter, GL_CR_cursor_position, GL_CR_bounding_box,          GL_CR_print_string, GL_CR_tilesort_info, GL_CR_synchronization,          GL_CR_head_spu_name, GL_CR_performance_info, GL_CR_window_size,          GL_CR_tile_info, GL_CR_saveframe, GL_CR_readback_barrier_size,          GL_CR_server_id_sharing, GL_CR_server_matrix,  GL_EXT_stencil_two_side          96 GLX Visuals         visual  x   bf lv rg d st  colorbuffer  sr ax dp st accumbuffer  ms  cav       id dep cl sp  sz l  ci b ro  r  g  b  a F gb bf th cl  r  g  b  a ns b eat     ----------------------------------------------------------------------------     0x021 24 tc  0  32  0 r  y y   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None     0x0d7 24 tc  0  32  0 r  y y   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None     0x0d8 24 tc  0  32  0 r  y y   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None     0x0d9 24 tc  0  32  0 r  y y   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None     0x0da 24 tc  0  32  0 r  y y   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None     0x0db 24 tc  0  32  0 r  y y   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None     0x0dc 24 tc  0  32  0 r  y y   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None     0x0dd 24 tc  0  32  0 r  y y   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None     0x0de 24 tc  0  32  0 r  y y   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None     0x0df 24 tc  0  32  0 r  y y   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None     0x0e0 24 tc  0  32  0 r  y y   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None     0x0e1 24 tc  0  32  0 r  y y   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None     0x0e2 24 tc  0  32  0 r  y y   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None     0x0e3 24 tc  0  32  0 r  y y   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None     0x0e4 24 tc  0  32  0 r  y y   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None     0x0e5 24 tc  0  32  0 r  y y   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None     0x0e6 24 tc  0  32  0 r  y y   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None     0x0e7 24 tc  0  32  0 r  y y   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None     0x0e8 24 tc  0  32  0 r  y y   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None     0x0e9 24 tc  0  32  0 r  y y   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None     0x0ea 24 tc  0  32  0 r  y y   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None     0x0eb 24 tc  0  32  0 r  y y   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None     0x0ec 24 tc  0  32  0 r  y y   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None     0x0ed 24 tc  0  32  0 r  y y   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None     0x0ee 24 tc  0  32  0 r  y y   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None     0x0ef 24 tc  0  32  0 r  y y   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None     0x0f0 24 tc  0  32  0 r  y y   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None     0x0f1 24 tc  0  32  0 r  y y   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None     0x0f2 24 tc  0  32  0 r  y y   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None     0x0f3 24 tc  0  32  0 r  y y   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None     0x0f4 24 tc  0  32  0 r  y y   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None     0x0f5 24 tc  0  32  0 r  y y   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None     0x0f6 24 tc  0  32  0 r  y y   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None     0x0f7 24 tc  0  32  0 r  y y   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None     0x0f8 24 tc  0  32  0 r  y y   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None     0x0f9 24 tc  0  32  0 r  y y   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None     0x0fa 24 tc  0  32  0 r  y y   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None     0x0fb 24 tc  0  32  0 r  y y   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None     0x0fc 24 tc  0  32  0 r  y y   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None     0x0fd 24 tc  0  32  0 r  y y   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None     0x0fe 24 tc  0  32  0 r  y y   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None     0x0ff 24 tc  0  32  0 r  y y   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None     0x100 24 tc  0  32  0 r  y y   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None     0x101 24 tc  0  32  0 r  y y   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None     0x102 24 tc  0  32  0 r  y y   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None     0x103 24 tc  0  32  0 r  y y   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None     0x104 24 tc  0  32  0 r  y y   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None     0x105 24 dc  0  32  0 r  y y   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None     0x106 24 dc  0  32  0 r  y y   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None     0x107 24 dc  0  32  0 r  y y   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None     0x108 24 dc  0  32  0 r  y y   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None     0x109 24 dc  0  32  0 r  y y   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None     0x10a 24 dc  0  32  0 r  y y   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None     0x10b 24 dc  0  32  0 r  y y   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None     0x10c 24 dc  0  32  0 r  y y   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None     0x10d 24 dc  0  32  0 r  y y   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None     0x10e 24 dc  0  32  0 r  y y   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None     0x10f 24 dc  0  32  0 r  y y   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None     0x110 24 dc  0  32  0 r  y y   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None     0x111 24 dc  0  32  0 r  y y   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None     0x112 24 dc  0  32  0 r  y y   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None     0x113 24 dc  0  32  0 r  y y   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None     0x114 24 dc  0  32  0 r  y y   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None     0x115 24 dc  0  32  0 r  y y   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None     0x116 24 dc  0  32  0 r  y y   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None     0x117 24 dc  0  32  0 r  y y   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None     0x118 24 dc  0  32  0 r  y y   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None     0x119 24 dc  0  32  0 r  y y   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None     0x11a 24 dc  0  32  0 r  y y   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None     0x11b 24 dc  0  32  0 r  y y   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None     0x11c 24 dc  0  32  0 r  y y   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None     0x11d 24 dc  0  32  0 r  y y   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None     0x11e 24 dc  0  32  0 r  y y   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None     0x11f 24 dc  0  32  0 r  y y   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None     0x120 24 dc  0  32  0 r  y y   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None     0x121 24 dc  0  32  0 r  y y   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None     0x122 24 dc  0  32  0 r  y y   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None     0x123 24 dc  0  32  0 r  y y   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None     0x124 24 dc  0  32  0 r  y y   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None     0x125 24 dc  0  32  0 r  y y   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None     0x126 24 dc  0  32  0 r  y y   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None     0x127 24 dc  0  32  0 r  y y   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None     0x128 24 dc  0  32  0 r  y y   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None     0x129 24 dc  0  32  0 r  y y   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None     0x12a 24 dc  0  32  0 r  y y   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None     0x12b 24 dc  0  32  0 r  y y   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None     0x12c 24 dc  0  32  0 r  y y   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None     0x12d 24 dc  0  32  0 r  y y   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None     0x12e 24 dc  0  32  0 r  y y   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None     0x12f 24 dc  0  32  0 r  y y   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None     0x130 24 dc  0  32  0 r  y y   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None     0x131 24 dc  0  32  0 r  y y   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None     0x132 24 dc  0  32  0 r  y y   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None     0x133 24 dc  0  32  0 r  y y   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None     0x134 24 dc  0  32  0 r  y y   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None     0x046 32 tc  0  32  0 r  y y   8  8  8  8 .  .  0 24  8 16 16 16 16  0 0 None          96 GLXFBConfigs:         visual  x   bf lv rg d st  colorbuffer  sr ax dp st accumbuffer  ms  cav       id dep cl sp  sz l  ci b ro  r  g  b  a F gb bf th cl  r  g  b  a ns b eat     ----------------------------------------------------------------------------     0x021 24 tc  0  24  0 r  y .   8  8  8  0 .  .  0 24  8  0  0  0  0  1 1 None     0x0d7 24 tc  0  24  0 r  y .   8  8  8  0 .  .  0 24  8  0  0  0  0  1 1 None     0x0d8 24 tc  0  24  0 r  y .   8  8  8  0 .  .  0 24  8  0  0  0  0  1 1 None     0x0d9 24 tc  0  24  0 r  y .   8  8  8  0 .  .  0 24  8  0  0  0  0  1 1 None     0x0da 24 tc  0  24  0 r  y .   8  8  8  0 .  .  0 24  8  0  0  0  0  1 1 None     0x0db 24 tc  0  24  0 r  y .   8  8  8  0 .  .  0 24  8  0  0  0  0  1 1 None     0x0dc 24 tc  0  24  0 r  y .   8  8  8  0 .  .  0 24  8  0  0  0  0  1 1 None     0x0dd 24 tc  0  24  0 r  y .   8  8  8  0 .  .  0 24  8  0  0  0  0  1 1 None     0x0de 24 tc  0  24  0 r  y .   8  8  8  0 .  .  0 24  8  0  0  0  0  1 1 None     0x0df 24 tc  0  24  0 r  y .   8  8  8  0 .  .  0 24  8  0  0  0  0  1 1 None     0x0e0 24 tc  0  24  0 r  y .   8  8  8  0 .  .  0 24  8  0  0  0  0  1 1 None     0x0e1 24 tc  0  24  0 r  y .   8  8  8  0 .  .  0 24  8  0  0  0  0  1 1 None     0x0e2 24 tc  0  24  0 r  y .   8  8  8  0 .  .  0 24  8  0  0  0  0  1 1 None     0x0e3 24 tc  0  24  0 r  y .   8  8  8  0 .  .  0 24  8  0  0  0  0  1 1 None     0x0e4 24 tc  0  24  0 r  y .   8  8  8  0 .  .  0 24  8  0  0  0  0  1 1 None     0x0e5 24 tc  0  24  0 r  y .   8  8  8  0 .  .  0 24  8  0  0  0  0  1 1 None     0x0e6 24 tc  0  24  0 r  y .   8  8  8  0 .  .  0 24  8  0  0  0  0  1 1 None     0x0e7 24 tc  0  24  0 r  y .   8  8  8  0 .  .  0 24  8  0  0  0  0  1 1 None     0x0e8 24 tc  0  24  0 r  y .   8  8  8  0 .  .  0 24  8  0  0  0  0  1 1 None     0x0e9 24 tc  0  24  0 r  y .   8  8  8  0 .  .  0 24  8  0  0  0  0  1 1 None     0x0ea 24 tc  0  24  0 r  y .   8  8  8  0 .  .  0 24  8  0  0  0  0  1 1 None     0x0eb 24 tc  0  24  0 r  y .   8  8  8  0 .  .  0 24  8  0  0  0  0  1 1 None     0x0ec 24 tc  0  24  0 r  y .   8  8  8  0 .  .  0 24  8  0  0  0  0  1 1 None     0x0ed 24 tc  0  24  0 r  y .   8  8  8  0 .  .  0 24  8  0  0  0  0  1 1 None     0x0ee 24 tc  0  24  0 r  y .   8  8  8  0 .  .  0 24  8  0  0  0  0  1 1 None     0x0ef 24 tc  0  24  0 r  y .   8  8  8  0 .  .  0 24  8  0  0  0  0  1 1 None     0x0f0 24 tc  0  24  0 r  y .   8  8  8  0 .  .  0 24  8  0  0  0  0  1 1 None     0x0f1 24 tc  0  24  0 r  y .   8  8  8  0 .  .  0 24  8  0  0  0  0  1 1 None     0x0f2 24 tc  0  24  0 r  y .   8  8  8  0 .  .  0 24  8  0  0  0  0  1 1 None     0x0f3 24 tc  0  24  0 r  y .   8  8  8  0 .  .  0 24  8  0  0  0  0  1 1 None     0x0f4 24 tc  0  24  0 r  y .   8  8  8  0 .  .  0 24  8  0  0  0  0  1 1 None     0x0f5 24 tc  0  24  0 r  y .   8  8  8  0 .  .  0 24  8  0  0  0  0  1 1 None     0x0f6 24 tc  0  24  0 r  y .   8  8  8  0 .  .  0 24  8  0  0  0  0  1 1 None     0x0f7 24 tc  0  24  0 r  y .   8  8  8  0 .  .  0 24  8  0  0  0  0  1 1 None     0x0f8 24 tc  0  24  0 r  y .   8  8  8  0 .  .  0 24  8  0  0  0  0  1 1 None     0x0f9 24 tc  0  24  0 r  y .   8  8  8  0 .  .  0 24  8  0  0  0  0  1 1 None     0x0fa 24 tc  0  24  0 r  y .   8  8  8  0 .  .  0 24  8  0  0  0  0  1 1 None     0x0fb 24 tc  0  24  0 r  y .   8  8  8  0 .  .  0 24  8  0  0  0  0  1 1 None     0x0fc 24 tc  0  24  0 r  y .   8  8  8  0 .  .  0 24  8  0  0  0  0  1 1 None     0x0fd 24 tc  0  24  0 r  y .   8  8  8  0 .  .  0 24  8  0  0  0  0  1 1 None     0x0fe 24 tc  0  24  0 r  y .   8  8  8  0 .  .  0 24  8  0  0  0  0  1 1 None     0x0ff 24 tc  0  24  0 r  y .   8  8  8  0 .  .  0 24  8  0  0  0  0  1 1 None     0x100 24 tc  0  24  0 r  y .   8  8  8  0 .  .  0 24  8  0  0  0  0  1 1 None     0x101 24 tc  0  24  0 r  y .   8  8  8  0 .  .  0 24  8  0  0  0  0  1 1 None     0x102 24 tc  0  24  0 r  y .   8  8  8  0 .  .  0 24  8  0  0  0  0  1 1 None     0x103 24 tc  0  24  0 r  y .   8  8  8  0 .  .  0 24  8  0  0  0  0  1 1 None     0x104 24 tc  0  24  0 r  y .   8  8  8  0 .  .  0 24  8  0  0  0  0  1 1 None     0x105 24 tc  0  24  0 r  y .   8  8  8  0 .  .  0 24  8  0  0  0  0  1 1 None     0x106 24 tc  0  24  0 r  y .   8  8  8  0 .  .  0 24  8  0  0  0  0  1 1 None     0x107 24 tc  0  24  0 r  y .   8  8  8  0 .  .  0 24  8  0  0  0  0  1 1 None     0x108 24 tc  0  24  0 r  y .   8  8  8  0 .  .  0 24  8  0  0  0  0  1 1 None     0x109 24 tc  0  24  0 r  y .   8  8  8  0 .  .  0 24  8  0  0  0  0  1 1 None     0x10a 24 tc  0  24  0 r  y .   8  8  8  0 .  .  0 24  8  0  0  0  0  1 1 None     0x10b 24 tc  0  24  0 r  y .   8  8  8  0 .  .  0 24  8  0  0  0  0  1 1 None     0x10c 24 tc  0  24  0 r  y .   8  8  8  0 .  .  0 24  8  0  0  0  0  1 1 None     0x10d 24 tc  0  24  0 r  y .   8  8  8  0 .  .  0 24  8  0  0  0  0  1 1 None     0x10e 24 tc  0  24  0 r  y .   8  8  8  0 .  .  0 24  8  0  0  0  0  1 1 None     0x10f 24 tc  0  24  0 r  y .   8  8  8  0 .  .  0 24  8  0  0  0  0  1 1 None     0x110 24 tc  0  24  0 r  y .   8  8  8  0 .  .  0 24  8  0  0  0  0  1 1 None     0x111 24 tc  0  24  0 r  y .   8  8  8  0 .  .  0 24  8  0  0  0  0  1 1 None     0x112 24 tc  0  24  0 r  y .   8  8  8  0 .  .  0 24  8  0  0  0  0  1 1 None     0x113 24 tc  0  24  0 r  y .   8  8  8  0 .  .  0 24  8  0  0  0  0  1 1 None     0x114 24 tc  0  24  0 r  y .   8  8  8  0 .  .  0 24  8  0  0  0  0  1 1 None     0x115 24 tc  0  24  0 r  y .   8  8  8  0 .  .  0 24  8  0  0  0  0  1 1 None     0x116 24 tc  0  24  0 r  y .   8  8  8  0 .  .  0 24  8  0  0  0  0  1 1 None     0x117 24 tc  0  24  0 r  y .   8  8  8  0 .  .  0 24  8  0  0  0  0  1 1 None     0x118 24 tc  0  24  0 r  y .   8  8  8  0 .  .  0 24  8  0  0  0  0  1 1 None     0x119 24 tc  0  24  0 r  y .   8  8  8  0 .  .  0 24  8  0  0  0  0  1 1 None     0x11a 24 tc  0  24  0 r  y .   8  8  8  0 .  .  0 24  8  0  0  0  0  1 1 None     0x11b 24 tc  0  24  0 r  y .   8  8  8  0 .  .  0 24  8  0  0  0  0  1 1 None     0x11c 24 tc  0  24  0 r  y .   8  8  8  0 .  .  0 24  8  0  0  0  0  1 1 None     0x11d 24 tc  0  24  0 r  y .   8  8  8  0 .  .  0 24  8  0  0  0  0  1 1 None     0x11e 24 tc  0  24  0 r  y .   8  8  8  0 .  .  0 24  8  0  0  0  0  1 1 None     0x11f 24 tc  0  24  0 r  y .   8  8  8  0 .  .  0 24  8  0  0  0  0  1 1 None     0x120 24 tc  0  24  0 r  y .   8  8  8  0 .  .  0 24  8  0  0  0  0  1 1 None     0x121 24 tc  0  24  0 r  y .   8  8  8  0 .  .  0 24  8  0  0  0  0  1 1 None     0x122 24 tc  0  24  0 r  y .   8  8  8  0 .  .  0 24  8  0  0  0  0  1 1 None     0x123 24 tc  0  24  0 r  y .   8  8  8  0 .  .  0 24  8  0  0  0  0  1 1 None     0x124 24 tc  0  24  0 r  y .   8  8  8  0 .  .  0 24  8  0  0  0  0  1 1 None     0x125 24 tc  0  24  0 r  y .   8  8  8  0 .  .  0 24  8  0  0  0  0  1 1 None     0x126 24 tc  0  24  0 r  y .   8  8  8  0 .  .  0 24  8  0  0  0  0  1 1 None     0x127 24 tc  0  24  0 r  y .   8  8  8  0 .  .  0 24  8  0  0  0  0  1 1 None     0x128 24 tc  0  24  0 r  y .   8  8  8  0 .  .  0 24  8  0  0  0  0  1 1 None     0x129 24 tc  0  24  0 r  y .   8  8  8  0 .  .  0 24  8  0  0  0  0  1 1 None     0x12a 24 tc  0  24  0 r  y .   8  8  8  0 .  .  0 24  8  0  0  0  0  1 1 None     0x12b 24 tc  0  24  0 r  y .   8  8  8  0 .  .  0 24  8  0  0  0  0  1 1 None     0x12c 24 tc  0  24  0 r  y .   8  8  8  0 .  .  0 24  8  0  0  0  0  1 1 None     0x12d 24 tc  0  24  0 r  y .   8  8  8  0 .  .  0 24  8  0  0  0  0  1 1 None     0x12e 24 tc  0  24  0 r  y .   8  8  8  0 .  .  0 24  8  0  0  0  0  1 1 None     0x12f 24 tc  0  24  0 r  y .   8  8  8  0 .  .  0 24  8  0  0  0  0  1 1 None     0x130 24 tc  0  24  0 r  y .   8  8  8  0 .  .  0 24  8  0  0  0  0  1 1 None     0x131 24 tc  0  24  0 r  y .   8  8  8  0 .  .  0 24  8  0  0  0  0  1 1 None     0x132 24 tc  0  24  0 r  y .   8  8  8  0 .  .  0 24  8  0  0  0  0  1 1 None     0x133 24 tc  0  24  0 r  y .   8  8  8  0 .  .  0 24  8  0  0  0  0  1 1 None     0x134 24 tc  0  24  0 r  y .   8  8  8  0 .  .  0 24  8  0  0  0  0  1 1 None     0x046 32 tc  0  32  0 r  y .   8  8  8  8 .  .  0 24  8  0  0  0  0  1 1 None


title: How to permanantly disable /var/log/lastlog?

text: When I delete files such as `/var/log/lastlog`, `/var/log/utmp` and `/var/log/wtmp` the files will be recreated. How do I disable the recreation of those files?


title: Grub2 failing to update

text: I recently replaced a disk containing my `/home` partition only. Upon attempting to upgrade my kernal package (Debian Squeeze) I get the following error:               /usr/sbin/grub-probe: error: Couldn't find PV pv1. Check your device.map.      Google searching suggested this solution:               root@debian1:~# mv /boot/grub/device.map /boot/grub/device.map_orig     root@debian1:~# grub-mkdevicemap     root@debian1:~# update-grub      The first two commands succeed without error, yet the third command `update- grub` fails with the same error mentioned above. I've checked my `/boot/grub/device.map` file, and it seems to match the ids listed when I run `ls -l /dev/disk/by-id/`. Any idea how to resolve this?


title: KDE / LightDM - disable multiple users being logged in / 'switch user'

text: How can I disable the 'switch user' function in the kde start menu, so that only one user can be logged in at the same time?


title: Renaming the files and move to other path

text: I need to rename the files given below and move to some other path               1234551abcde20140718023216001.txt.809047512.2014_07_07_13:47:44     000001abcde20140718023216001.txt.34568.001.2014_07_07_13:50:44     44444abcded20140718023216001.txt.1111111.2014_07_07_13:47:44      expected Result               1234551abcde20140718023216001.txt.809047512     000001abcde20140718023216001.txt.34568.001     44444abcded20140718023216001.txt.1111111      only I need to remove the timestamp attached every time with the filenames,and move it to other directory in AIX please help me to write the script.I am new to Unix as I am able to rename single single files but not all,and moving to other path also had issue. For your reference I had tried.               #!/usr/bin/ksh     file1=`echo 1234551abcde20140718023216001.txt.809047512.2014_07_07_13:47:44 | awk -F "." '{for(i=1;i<NF;i++) if ($i!= 1) f=f?f FS $i:$i;print f;f=""}'`     echo $file1


title: pcregrep fails due to segmentation fault

text: I am extracting the HTML source of a web page using the below command.               curl http://www.linkedin.com/pub/ramesh-venkataraman/63/621/b42 -s |  w3m -dump -T text/html > foo.txt      The `foo.txt` has the contents of the web page without any HTML tags. Now, I know in my webpage there is a particular section which always starts with a keyword. For example, after the above command, I run the below command to extract from the substring from that particular value.               pcregrep -M 'Skills & Expertise(\n|.)*' foo.txt > foo1.txt      The above command works perfectly fine. Now, the problem is when the page becomes very large, I am getting `Segmentation fault` error. I believe `Segmentation fault` occurs because the grep command tries to do a greedy match and it is failing. Is there an efficient way to replace the above `pcregrep` command so that I do not get the `Segmentation fault` error?


title: Computer doesn't wake from sleep mode

text: I have a laptop with Linux Slackware 14, KDE 4.8.5, kernel 3.9.0-rc6. When I close the lid and pull out the power cord, the machine goes into sleep mode. When I wake it, plugging the cord back in and opening the lid, the LEDs turn on, but the screen doesn't. The system responds via ssh. Maybe, it's Intel video driver? What is going on? How can I fix it? ### EDIT #1 Here is some additional info regarding my system:   * /var/log/pm-suspend.log   * /usr/lib/pm-utils/sleep.d/99video Here's info about my video card:               lspci | grep VGA     00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor        Family Integrated Graphics Controller (rev 09)      ### EDIT #2 Looking at the output in the log `pm-suspend.log` there is mention of an illegal instruction at line #48 of the `99video` script. Here are the contents of that section of the script:               reset_brightness()     {             for bl in /sys/class/backlight/* ; do                     [ -f "$bl/brightness" ] || continue                     BR="$(cat $bl/brightness)"                     echo 0 > "$bl/brightness"                     echo "$BR" > "$bl/brightness"             done     }


title: List of packages managed by DKMS

text: How do I get a list of packages (and their versions) managed by DKMS so I can easily add/remove them?


title: RedHat RPM file collision

text: Let's assume I have two RPM packages named _1.rpm_ and _2.rpm_. Both of them want to put a file _test_ into _/usr/bin_ , but both of them use a different version of _test_. Of course I would like to have both RPMs installed on the same machine. What would be official behavior of RedHat (let it be RHEL5) in described situation?


title: Get the current volume level in OS X Terminal CLI?

text: I would like to check the current volume level from the CLI on my Mac. I know I can set it like this:               osascript -e 'set volume <N>'      But that doesn't seem to work when trying to get the current volume level.               $ osascript -e 'get volume'     4:10: execution error: The variable volume is not defined. (-2753)


title: stop/start gui on debian

text: I would like to start Debian without the GUI and then just type commands in to launch the desired programs ( **which are located on my local machine** ), eg               $ chromium-browser &      I already do a similar thing when `ssh`ing in to other machines on the LAN - it is handy if I need to visualise csv data for example in `soffice`. i currently have gnome desktop and Debian 7 installed. I have found some instructions for disabling the GUI on startup with Debian, however I am reluctant to try them out for fear of being locked out of using the web browser once I do this (I will need it to seek help using the browser if I get stuck). I was wondering if I could temporarily test out the method of starting the GUI on one of the other terminals (eg `ctrl+alt+f1`) to see if there are any problems? Will this work? Will it be equivalent to starting the GUI when booting without a GUI? If this is feasible, please could someone provide full instructions for:   * enabling the GUI on terminal `f1` so that i can run gui programs (without showing the full desktop interface)   * turning off the desktop interface GUI on bootup obviously I will need to run X11 to load GUI programs - that's fine, but I'm looking to boot up into text mode and then just execute GUI programs as needed. **doing some tests on an ubuntu 12.04 virtualbox vm (hopefully not too different to debian 7?)...**               $ ps aux | grep gdm     # *blank*     $ ps aux | grep kdm     # *blank*     $ ps aux | grep lightdm     root      1225  0.0  0.0 270664  3500 ?        Ssl  12:43   0:00 lightdm     root      1234  1.9  2.2 236564 112276 tty7    Ss+  12:43   0:01 /usr/bin/X :0 -auth /var/run/lightdm/root/:0 -nolisten tcp vt7 -novtswitch -background none     root      1382  0.0  0.0 156772  3572 ?        Sl   12:43   0:00 lightdm --session-child 12 19     $ sudo update-rc.d lightdm disable     update-rc.d: warning: /etc/init.d/lightdm missing LSB information     update-rc.d: see <http://wiki.debian.org/LSBInitScripts>      Disabling system startup links for /etc/init.d/lightdm ...      Removing any system startup links for /etc/init.d/lightdm ...        /etc/rc0.d/K20lightdm        /etc/rc1.d/K20lightdm        /etc/rc2.d/K80lightdm        /etc/rc3.d/K80lightdm        /etc/rc4.d/K80lightdm        /etc/rc5.d/K80lightdm        /etc/rc6.d/K20lightdm      Adding system startup for /etc/init.d/lightdm ...        /etc/rc0.d/K20lightdm -> ../init.d/lightdm        /etc/rc1.d/K20lightdm -> ../init.d/lightdm        /etc/rc6.d/K20lightdm -> ../init.d/lightdm        /etc/rc2.d/K80lightdm -> ../init.d/lightdm        /etc/rc3.d/K80lightdm -> ../init.d/lightdm        /etc/rc4.d/K80lightdm -> ../init.d/lightdm        /etc/rc5.d/K80lightdm -> ../init.d/lightdm     $ sudo shutdown -r 0      and the gui is back up and running again after the reboot! so this clearly did not have the desird effect. however:               $ sudo /etc/init.d/lightdm stop      kills the gui. moving to tty2 (by pressing `ctrl+alt+f2`) and attempting to open firefox:               $ firefox &     Error: no display specified      so attempting to specify a display:               $ export DISPLAY='0.0'     $ firefox &     Error: cannot open display: 0.0      and now i'm stuck. i can still get the gui back on `ctrl+alt+f7` by entering the following into tty2:               $ sudo /etc/init.d/lightdm start      but this is not what i want. i just want to be able to run firefox without showing all the other desktop things such as the clock and the menu bars, etc. **trying out some of the things ingoldilocks' answer**               $ sudo /etc/init.d/lightdm stop     $ echo "#!/bin/bash" > ~/.xinitrc     $ echo "exec firefox" >> ~/.xinitrc     $ xinit      this does exactly what i want `:)`


title: Enhancing Dolphin location bar

text: I am using Dolphin 4.11.1. Right now its location bar looks like this: ![dolphin location bar](http://i.stack.imgur.com/ZQuli.jpg) Can I somehow enable a "path trail" feature which is on in gnome nautilus by default? For example, if I move to the home directory, Wallpapers folder still remains in the location bar and I can click on it to return. Here's how it looks: ![enter image description here](http://i.stack.imgur.com/5r4LQ.png)


title: Linux Mint Taskbar and Icons are gone

text: I have linux mint cinnamon 13. I installed it today. Well my problem is that my panel and my icons are gone. There is absolutely nothing but my desktop background. But I'm still able to switch to F1 + Ctrl + Alt. Also when I click on "print" on my keyboard it makes a photo but nothing pops up. So how can I get my taskbar, icons etc. back?


title: Automatically create matching braces in vim

text: How do I automatically create matching braces in vim? It should work as follows: If I input an open brace the closing one should appear automatically and the cursor should be placed in between. To jump out of the brace pair the combination `Ctrl-j` is used. There are plenty of plugins providing automatic brace insertion. But they   * either use a different key combination than `Ctrl-j` to jump out of the brace pair or   * interfere with the UltiSnips key bindings. The following works as expected               :inoremap ( ()<Esc>:let leavechar=")"<CR>i     :imap <C-j> <Esc>:exec "normal f" . leavechar<CR>a      But with these settings the UltiSnips snippets don't work any more. So I used UltiSnips to insert the closing brace:               inoremap ( (<C-R>=UltiSnips_Anon('($1)$0', '(')<CR>      This almost works. The matching brace is inserted and I can skip the closing one with `Ctrl-j`. This, however, works only if there is a space in front of the open brace.               main () // works, the closing parentheses is added     main(   // fails without a space      My solutions either require a different key binding to jump over the closing brace or require a space in front of the open one. How to fix this? Note: I used parentheses as an example. It should work with parentheses, braces, brackets and less-than signs and not interfere with the UltiSnips plugin.


title: How to redirect http requests to local Apache server on internet connection lost?

text: I have a little Linux (Ubuntu based) server with 2 network cards, which acts as a router, dhcp, dns server, firewall, etc. One network card is connected to the LAN, while the other is connected to my ISP. When the Internet link is down, I would like to redirect all http requests to my local Apache server, which would display a little webpage informing my LAN users, that their LAN connection is OK, the server itself is OK, only the ISP link is currently down. How would I do that?   1. I found no reliable way to detect if the Internet connection is down, other than periodically pinging a bunch of external hosts that are known to be up most of the time. (The status of the interface is UP all the time).   2. What tool should I use for redirection? Iptables? Something else?


title: How to speed up X over SSH on a slow network connection?

text: Are there any specific recommendations on speeding up X applications over ssh on a slow network connection? In this specific case, I am accessing a server located in west coast from a laptop in east coast and that too on a not too fast DSL connection. Any settings for ssh? Any tips in general?


title: Zsh: dirs in reverse order

text: I am a bit confused about how `dirs` works. The documentation says: > dirs > > With no arguments, print the contents of the directory stack. Directories > are added to this stack with the `pushd` command, and removed with the `cd` > or `popd` commands. **Q1.** I never use `popd` nor `pushd`, but I noticed that `dirs`keeps track of the directories where I have been (which to me means, that `cd` **_adds_** , not removes, directories to the stack) **Q.2** After a long session using `cd`, it's common for `dirs` to print a long list of directories, but this list prints the most recent directory first and it ends with the last directory, so if I have a long list, the screen scrolls, and I can't easily see the most recent set of directories (which are typically the ones I am most interested in). How can I print the list of directories in reverse order? I tried `dirs | sort -r`, but this does not sort the entries correctly, e.g. I get               20 /foo20/bar     2  /foo2/bar     19 ...     18     ...     16     11     10     1     0      The unsorted originals look like               1 /foo/bar     2 /foo2/bar     3  ...     ..       9     10     11     ..     20     21     ..     30


title: In bash shell, how to insert the previous line inside the current line?

text: In bash, how to expand the `!!` in command line while interactively editing the command inside shell? I am working in `vi` edit mode. When typing a new command line, I want to introduce the previous line and expand it. **I would like the expansion to occur before I execute the command.**


title: bash prompt with abbreviated current director including dot files?

text: I have the following in my .bash_profile (from a similar question here:               PROMPT_COMMAND='pwd2=$(sed "s:\([^/]\)[^/]*/:\1/:g" <<<$PWD)'     PS1='\u@\h:$pwd2\$ '      However, if the current directory is within a .dir (such as ~/.vim/bundle/) then the prompt just displays a .:               chris@DeathStar:/U/c/./bundle$      I would like it instead to retain 1 char for all dirnames unless it has a dot, in which case it would show two, like this:               chris@DeathStar:/U/c/.v/bundle$      Even better would be if I also have the home directory represented by a `~` like this:               chris@DeathStar:~/.v/bundle$      Any ideas?


title: FreeBSD + ZFS + Encryption ? Alternatives ? Suggestions?

text: I would like to create a dedicated physical server which will work as a NAS & fileserver inside my LAN (as well as through VPN). However I need to fully encrypt the drives (both the system ones and the data ones, as I think I'll use two zpools). Since ZFS encryption is not supported in version 28 which is what FreeBSD supports (and OpenIndiana, Nexenta, ...) the only possibility seems to be to use ZFS. Now I'm thinking whethever adding a Geli layer on top of ZFS could lead to data loss. Some posts on the internet (though not many) seems to point this problem out. In particular, ZFS seems to be a far superior filesystem than any other in the Unix/Linux world (for instance ext4, xfs as well as btrfs) considering the integration of raid(z) and checksumming. Now adding Geli on top of that seems to me just like adding LUKS on top of a RAID setup, though I did never experienced Geli and don't know its reliability. Performance is not a main issue, though I'd rather not have a 1MB/s transfer on my LAN (>20MB/s will be acceptable though). I never got outside my Linux world so I don't have experiences with freeBSD or the Solaris derivatives. I'd rather not use Solaris Express 11 because of the paid (expensive) support problem. This will be a computer at home. I'll be willing to learn them if necessary.   The server will need to do basics NAS tasks (in particular samba/cifs file sharing, I don't need the ones integrated with the newer ZFS versions). After considering the encryption layer, **will Geli + ZFS be more or less reliable than LUKS + LVM + ext4**? I asked in another post on superuser and they suggested Freebsd / Solaris(es) because of ZFS, though we did not talk about encryption. Don't know if OpenIndiana and the likes support a block encryption method like LUKS or Geli. Furthermore will it be easy to add a disk to the array, grow the raid(z) and the filesystem as we do in Linux (for instance here)?


title: Could not get a command to work with bash -c

text: I am trying to execute a command to find out which process is listening on a particular port and i cannot get it to work if the command is passed as an argument to bash using `bash -c`               netstat -tnlp 2>/dev/null | grep ':10301'      tcp        0      0 0.0.0.0:10301           0.0.0.0:*               LISTEN      4755/nc      I can get it working if i do the below and it shows nc is listening on that port               netstat -tnlp 2>/dev/null | grep ':10301'  | grep LISTEN | awk '{print $7}' | cut -d'/' -f1 | xargs -i -n1 cat /proc/{}/cmdline     nc-kl10301      but if do it using bash -c               bash -c "netstat -tnlp 2>/dev/null | grep ':10301'  | grep LISTEN | awk '{print $7}' | cut -d'/' -f1 | xargs -i -n1 cat /proc/{}/cmdline"     cat: /proc/tcp        0      0 0.0.0.0:10301           0.0.0.0:*               LISTEN      4755/cmdline: No such file or directory