reset Ethernet bonding without rebooting

I have the following Ethernet bonding configuration: old configuration:               bond0       eth0       eth1     bond1       eth2       eth3      new configuration :               bond0       eth0       eth2     bond1       eth1       eth3      I have made the change and restart `service network restart` but `cat /proc/net/bonding/bond0` and `cat /proc/net/bonding/bond1` still shows the old configuration. I had to reboot the system to be able to see the new configuration. Is there a way to do this without reboot? I am using RHEL6.5


Color of emacs margins

With the following in my .emacs I get narrow margins in text-mode buffers:               (defun my-set-margins ()       "Set margins in current buffer."       (setq left-margin-width 30)       (setq right-margin-width 30))          (add-hook 'text-mode-hook 'my-set-margins)      How can I change the color of the lines that appear to delimit these margins so that it's the same as my background color and not black like they are now? ![Current margins with black lines](http://i.stack.imgur.com/BYqNJ.png) **EDIT** I know more now and this is my question: How do I add a hook to turn of the fringes in text-mode?


Dynamic text wrapping of terminal output

I am specifically looking for is dynamic formatting of output. In every terminal emulator I can remember having used in Linux, when some program prints to the screen, the output gets formatted to fit to the terminal window so that longer lines will wrap around. If I then change the width of the window, the previous wrapped around formatting still remains. On OSX, Terminal.app acts differently. The text is still formatted for the current size of window just as on Linux terminal emulators. However if I re- size the window, the text is automatically reformatted to match the new dimensions. This is super useful when, after the running a utility, I realize that I didn't make the window wide enough to show all the output clearly. On an especially slow running utility, it can be frustrating to need to run everything all over again only to get better formatting. I could redirect the output to a program like `less`, `view` or `gview`. However this just feels like too much work to do every time I run a utility that _might_ not format well with the current window dimensions. Also, as far as I know `less` doesn't support bash style text coloration. Does anyone know of a Linux terminal emulator that has this behavior? It doesn't need to be out of the box behavior; I am willing to monkey with configuration settings to get something like this working. I have already poked around a number of terminal emulators on Linux to see if they support this, but I don't really have the time to try every single one of them. There are just too many! If truly no program exists that does this, is it because no one is trying to create this behavior? Is there some technical limitation on Linux in specific that does not allow this (don't see how this could be the case)?


replace control characters in Emacs?

This is a small text: > What\222s with All the Parentheses? In Emacs `\222` above is shown as a control character (in red). It is supposed to be `'`, but I don't understand why it is `\222` instead, even though I know the text was probably generated from OCR? I can search for the control character `\222` by               C-s C-q 2 2 2      But I can't when I try to replace it with `'` in a similar way:               M-%      C-q 2 2 2     '      So I wonder how to do the replacement? Is it unnecessary to do the replace? Thanks.


Gedit highlight shortcut

When I open Gedit in my Linux Mint 17 Cinnamon 64-bit, the syntax highlight is off by default. I can then activate it via the menu, or by saving my file with the correct file extension (e.g., every *.f95 file will automatically be shown with the Fortran 95 sytnax highlight). My question is: since I am programming in Fortran most of the time, would it be possible for me to create a new Gedit shortcut named "Gedit-Fortran" in my menu that would open it with Fortran's syntax highlight already activated? Just note that I don't want this to be the default behaviour of Gedit though: I still want to have the standard shortcut to open a blank file without any syntax highlighting. Would this be possible, maybe via some terminal command, so I can create such shortcut?


Why is 'kill -9' killing browser as well as server?

I sometimes have to use `kill -9` as a last resort to kill my rails server. Unfortunately, I have to do that often enough that I wrote a helper function in my bash_profile to do it. If I do it manually -- `ps aux | grep '[r]ails]`, grab the pid (eg. `12345`), and `kill -9 12345` -- it kills the server and leaves the browser intact. But my function kills the browser too, which I don't want to do:               function running {       ps -p $(lsof -i :3000 -t) &> /dev/null     }          function k9 {       if running       then         kill -9 $(lsof -i :3000 -t)       else         echo "Rails server is not running"       fi     }      I've confirmed that `lsof -i :3000 -t` grabs the same pid as I'm getting from `ps aux`, so what am I doing wrong?


can not create /dev/shm

I need to create `/dev/shm` on an embedded ARM system. From "Installed The Latest Changes to Current and......". I see that it can be created with `mkdir /lib/udev/devices/shm`, but I'm wondering what is supposed to be at that location? The only directory I have at that location is `/lib/modules/`, there's no `devices/` or anything. So I went ahead and just created them, empty directories. I then added:               tmpfs                   /dev/shm                tmpfs   defaults       0 0      to my `/etc/fstab` and I didn't add an `mtab` entry, since I don't have an `/etc/mtab`. I then rebooted and now, there's still no `/dev/shm` device. Any ideas how I get that device? ### EDIT #1 Oh, and a `mount -a` (after a reboot) results in:               # mount -a     mount: mounting tmpfs on /dev/shm failed: No such file or directory`


Why can't root on one machine change nfs mounted content from another machine?

On my NFS server, I have the following export defined:               #NFS exports Database     /shared -alldirs -network=192.168.1 -mask=255.255.255.0      On my NFS client:               192.168.1.7:/shared /shared nfs rw 0 0      Obviously, as root on the server, I can do whatever I want. On the client however, my regular user 'gabe' can make changes to the nfs mount (assuming I have permissions to), but root cannot. As my regular user:               gabe@client$ cd /shared     gabe@client$ ls -l     total 8     drwxrwxrwx  4 gabe  wheel   512 Mar 20 19:20 tmp     gabe@client$ cd tmp     gabe@client$ touch test.txt     gabe@client$ rm test.txt      As root:               # cd /shared/tmp     # touch test.txt     touch: test.txt: Permission denied      Again, this is all on the NFS _client_ side of things, and I suspect perhaps it has something to do with the -maproot option, but I'm too much of an NFS noob to understand exactly what. This is the first time I'm setting up NFS and I just noticed this peculiarity. I'm going to do some reading now, to see if I can figure this out, but if anyone has any insight, I would appreciate it.


How to make a btrfs snapshot writable?

According to the btrfs Readonly snapshots patch it's possible to "set a snapshot readonly/writable on the fly." So I should be able to turn my readonly snapshot (created with `btrfs snapshot -r`) writable, somehow. But neither the btrfs subvolume manpage nor any other part of that manpage seems to give a way to do that.


What happens if I do an improper shutdown of Lubuntu 13.10?

I have Lubuntu on my 7 year old PC with 512 MB RAM and and Intel Dual Pentium Processor running at 3.00 GHz. I sometimes unplug it from the electrical mains in an emergency. Please tell me if something bad will happen if I do this.


Cycle through clients on both screens in awesomewm

I am using awesomewm and have two monitors, so `Mod4+j` and `Mod4+k` cycle through windows on current screen only. Is there a way to cycle through all windows/clients on all screens to make it work like ordinary `Alt+Tab`?


OpenJDK update in RHEL 6

We need to apply the JDK updates to one of the RHEL 6 servers. How do I apply the patch if I have the RPM package available, which I have downloaded from the internet. Searched a lot on the internet but couldn't find any steps on how to apply the JDK patch. Also, what precautions should be taken before applying the new RPM update, so that the current functionality is not disturbed? The package installed in the server is: `java-1.6.0-openjdk-1.6.0.0-3.1.13.1.el6_5` I want to update it to: `java-1.6.0-openjdk-1.6.0.0-5.1.13.3.el6_5`


Transform custom tags with arguments

I want to write my diploma theses with markdown. Sadly, there is no perfect editor and so I have to improvise. For bibtex citations I want to transform my own definition with some sort of bash-filter right before I handle the input to pandoc:               <@BIBTEX_ID[|OPTIONAL_PAGE_OR_CHAPTER_NUM[|OPTIONAL_UNIT_DEFINITION]]>      to something like:               \autocite[OPTIONAL_UNIT_DEFINITION][OPTIONAL_PAGE_OR_CHAPTER_NUM]{BIBTEX_ID}      example:               <@sample>       ---> \autocite{sample}     <@sample|12>    ---> \autocite[12]{sample}     <@sample|12|c.> ---> \autocite[12][c.]{sample}      which bash/unix tool can do this job? Would it be possible to do it with sed or awk?


How can I make C-m1 emulate a right click?

On Mac OS X, you can right click by holding down control and clicking. I swapped the command and control keys with `setxkbmap -option altwin:ctrl_win`, but how do I make it right click by holding down control and clicking? I am on a Powerbook G4 with Debian XFCE. UPDATE: Chris Down's answer requires you to press control and click at _exactly_ the same time. On Mac you can **hold down** control and click.


Redirect and pipe output

`rpm -qa > file | wc -l` returns 0. What am I doing wrong? I think it is clear what my goal is, but it isn't working. Is this a job for `xargs` or `tee`?


Advice on running a headless laptop

My current laptop is falling apart, specifically the screen hinges. Once (or ideally before) they break, I'd like to run the machine as a storage device. I strongly prefer using GUIs over CLI. Any recommendations on a distro/useful tools to install before turning it into a box? Any cautionary tales about running a laptop without a screen? So far I imagine installing Ubuntu (not Server) and running Remmina to remoting in via VNC/etc.


Why does Linux purge the memory cache when it is nearly full?

Here's what the memory graph looks like on a VPS running CentOS with 512MB of RAM and nginx/php-fpm/mysqld serving (mostly static) content to a couple thousand visitors per day. ![Weekly memory graph](http://i49.tinypic.com/qnk4ef.png) (those are days on the x-axis) As you can see, it's quite jumpy in the cache and buffer area. The memory cache is purged at irregular intervals (ruling out a responsible cron job). It's usually, but not always, purged at the point where it can grow no larger. Sometimes it clears almost entirely, at other times only halfway down. I'm trying to understand the logic behind these purges. I would expect file data to be cached much longer & don't see any other programs using more memory than usual when the memory cache is cleared. Is this normal behavior, or am I missing something? UPDATE: A memory upgrade seems to have stabilized the graph. Still seeing small drops, but nowhere as significant as it was prior to the upgrade. ![After memory upgrade](http://i41.tinypic.com/30c6cuq.jpg)


What does a "OVM reboot" mean?

What does this term mean?


Distribution recommendation for USB flash disks

I'm a linux system administrator and dealing with big iron distributions like debian and redhat for a long time. I need a recommendation for a small distribution which I can install to USB flash disk. I need a general purpose distribution with an up-to-date kernel (especially ext4 / GPT support is needed) to carry some filesystem operations. Desktop environment is optional. In-Place updates like a real installation is a huge plus (I just don't want to reinstall it with every major version).


How to remove GNOME to run only Compiz

Regarding this question, I really like the idea of running Compiz without a desktop environment. I currently have Ubuntu 10.04 (with GNOME and Compiz) and want to give it a try. Now how can I configure my system to enable compiz running without GNOME (then I can remove it completely)?


How is Ubuntu based on Debian?

Linux Mint is based on Ubuntu. Ubuntu is based on Debian. Like this, there are several other linux distributions that are based on Ubuntu, Debian, Slackware, etc. What confuses me is what does this mean i.e one Linux distro based on some other. How they are made?


How to recover a file from a tcpdump?

I use               tcpdump -i wlan0 -s 0 dst 192.168.1.200 or src 192.168.1.200 -w output.pcap      to monitor for ex.: my HTTP traffic. I upload a .zip file through HTTP. How can I retrieve the .zip file from the output.pcap file? Is it possible to recover it from there?


Variable assignment in .bash_profile has no effect

I added the following to my `.bash_profile`:               JAVA_HOME=$JAVA_HOME:/usr/java/jdk1.7.0     export JAVA_HOME      However, when I `echo $JAVA_HOME` it outputs an empty string. Why weren't my changes to `.bash_profile` reflected in the shell?


How to connect to a serial port as simple as using SSH?

Is there a way to connect to a serial terminal just as you would do with SSH? There must be a simpler way than tools such as Minicom, like this               $ serial /dev/ttyS0       I know I can `cat` the output from `/dev/ttyS0` but only one way communication is possible that way, from the port to the console. And `echo` out to the port is just the same but the other way around, to the port. How can I realize two way communication with a serial port the simplest possible way on Unix/Linux?


What tool(s) should I use to test my hardware for errors?

Are there any Linux tools (command line, or Live CD) that will test hardware components for errors (hard drive, RAM, CPU, graphics card, buses) and show me some detailed output with wrong parts etc.?


Count number of lines of output from previous program

I'm trying to count the number of lines of output a certain program produces. The problem is, the program takes a long time to run, and I want to display the output to the user. **Is there a way to count the number of lines the last command outputted?** I could do `program | wc -l` but that wouldn't show the output to the user. So as far as I know, I have to do `program; program | wc -l` - but the program takes at least a minute to run, so I don't want to have to do it more than once just to show a line count at the bottom. **EDIT:**   * **Is there a way of showing the output as it happens (line by line) and then returning a count at the end?**


Possible to convert a linux installation to .VDI or ISO format?

I have an Oracle Peoplesoft installation set up on some virtual machines (they were in OVM format). I'd like to copy them over so they work in VirtualBox… would it be possible to convert them to a format VirtualBox can understand? I found a guide that lets you convert a single hard drive in Linux to ISO and then convert that to VDI, but the problem with that is that it only works on a single drive--I'd like to convert the whole filesystem. Any ideas on how to accomplish this?


What are the books about creating own *nix OS?

I want to create my own Unix OS. Is there any book that I can learn from, from start?


Access the last file (alphabetically) in a directory

I'm trying to open a file with vim from the command line, the file is in a directory filled with automatically generated files that are prepended with a time stamp. Since I don't know the time stamps off the top of my head, I would just like to open the most recent one in the directory (also the last one in the list alphabetically).               vim ./my_dir/<last_item>      Is there a way to do this?


Confusing Directory Permissions

**Environment**   * Ubuntu 14.04 LTS Desktop **Permissions**               /media/gal_db$ ls -al     drwxrwx--- 6 admin     shared_disk  4096 Aug 15 13:31 .     drwxr-xr-x 6 root      root         4096 Aug 13 12:54 ..     drwx------ 3 postgres  shared_disk  4096 Aug 15 14:28 database          /media/gal_db$ members shared_disk     gal  admin  postgres      **Remove postgres from shared_disk to limit access to filesystem**               sudo deluser postgres shared_disk      **Try logging into database as user gal**               psql -U gal         Password for user gal:         psql: FATAL:  could not access directory "pg_tblspc/16399/PG_9.3_201306121/16401": Permission denied      **Re-add postgres user to shared_disk**               sudo adduser postgres shared_disk      **Try logging into database as user gal again**               psql -U gal         Password for user gal:         psql (9.3.5)         Type "help" for help.         gal=>      Success. And confusion. **Questions**   1. Why does postgres need to be a member of shared_disk to access the database directory?   2. Isn't it enough that postgres is the owner of the database directory?


Set and Shopt - Why Two?

`set` and `shopt` are both shell builtins that control various options. I often forget which options are set by which command, and occasionally which option sets/unsets (`set +o/-o`, `shopt -s/-u`). Why are there two different commands that seemingly do the same thing (and have different arguments to do so)? Is there any easy way/mnemonic to remember which options go with which command?


Oracle Linux R6 Install Error

My Oracle Linux R6 x64 won't install. After normal install it's just blank screen. After basic video driver options install stuck on "Waiting for hardware to initialize...". Tried with different options runs only with noprobe but no drivers at all (understandably). Is there any way to run it normally? Spcecs: Asus Rampage Extreme IV Extreme - Newest BIOS, Intel i7 4930K, Graphics: Geforce 210


Options to show images when on the console

When I am on the console (the tty, the virtual terminal, which you reach with `Ctrl`+`Alt`+`F1-6`, not a terminal emulator), what options do I have to view images, tiff, whatever that's not text?


LDAP on openSUSE

I'm trying to run an LDAP server on a openSUSE 12. But I have a couple of doubts. What I whant is this: _testing.com_ with 2 OU ( _Info_ and _People_ ). So the right way would be `ou=Info,dc=testing,dc=com`. I use this http://www.padl.com/OSS/MigrationTools.html to generate a ldif file named user `user_ldap.ldif`, with a few users (this is an example =D). After I edit the `migrate_common.ph` I create the `user_lda.ldif` file                ~ # cat user_ldap.ldif      dn: uid=inxs,ou=People,dc=testing,dc=com     uid: inxs     cn: INXS     objectClass: account     objectClass: posixAccount     objectClass: top     objectClass: shadowAccount     userPassword: {crypt}$1$yQbmUggV$fNUvBGuOXru0DHQjtlu9h1     shadowLastChange: 15392     shadowMax: 99999     shadowWarning: 7     loginShell: /bin/bash     uidNumber: 1001     gidNumber: 100     homeDirectory: /home/inxs     gecos: INXS          dn: uid=nofx,ou=People,dc=testing,dc=com     uid: nofx     cn: NOFX     objectClass: account     objectClass: posixAccount     objectClass: top     objectClass: shadowAccount     userPassword: {crypt}$1$vxU/f4tt$LRHuHhLgPhqcGVA2yLUKk/     shadowLastChange: 15392     shadowMax: 99999     shadowWarning: 7     loginShell: /bin/bash     uidNumber: 1002     gidNumber: 100     homeDirectory: /home/nofx     gecos: NOFX      So I try to do this:               :~ # ldapadd -f user_ldap.ldif      SASL/DIGEST-MD5 authentication started     Please enter your password:      ldap_sasl_interactive_bind_s: Invalid credentials (49)             additional info: SASL(-13): user not found: no secret in database      When I installed the ldap-server, I created the `dn=root` with his password, so I asumed that is the password that this asking. I do not create the directory tree I was told that was created automatically from the ldapadd. Or it's false? I have a lot to learn, but need a guide or a small synthesis.


Diff command. Basic explanation

Just started with diff command. Can you please explain me,               diff thin_provisionings_controller.rb thin_provisionings_controller.rb[211]          512,513d511             include ThinProvisioningsGraphModule           So does that says to delete lines 512, 513 and add 511? As described by this article http://lowfatlinux.com/linux-compare-files-diff.html


What distro is the most similar to RHEL 5?

I'm trying to get used to work with linux for a new job, where I will be using RHEL 5, but right now don't have $179 to buy the workstation version from Red Hat store. What free distro would be the best for me to start with while I get the money for my RHEL license?


Extract files from FreeBSD 9 ISO

With FreeBSD 8 you could manually install by doing something like:               # mdconfig -f /FreeBSD-8.2-RELEASE-amd64-disc1.iso     # mount -t cd9660 /dev/md0 /cdrom     # cd /cdrom/8.*     # export DESTDIR=/mnt     # cd base; sh install.sh; cd ..     # cd catpages; sh install.sh; cd ..     # cd manpages; sh install.sh; cd ..     # cd src; sh install.sh all; cd ..     # cd kernels; sh install.sh generic; cd ..      etc.. This was very handy for remote installs and other special circumstances. FreeBSD 9 install has changed a lot and the CD directory structure is totally different so I'm wondering if anyone knows of a similar way of doing this with FreeBSD 9? Appreciate any help.


zsh: excluding files from a pattern

Say I have the following files: > >     |-- bar >     `-- foo >         |-- type_A_1 >         |-- type_A_2 >         |-- type_B_1 >         |-- type_B_2 >         |-- type_B_xx >         |-- type_B_xx >         `-- something_else >   I thought the following command               print -l foo/*~{type_B*}      would print **everything** under `foo` **except** things that start with `type_B` but it doesn't, instead it prints everything under foo:               foo/type_A_1     foo/type_A_2     foo/type_B_1     foo/type_B_2     foo/type_B_xx     foo/something_else      I also tried `print -l foo/*~type_B` and got the same thing. How does the exception wildcard `~` work in zsh?


what is "play" command/package available by default in Linux Mint and how to remove it

I'm trying install play framework on Linux Mint and setup its variable:               export PATH=$PATH:/relativePath/to/play      But command can't run because it's being overlapped by another **play** command which was installed in the system by default.               $ which play     /usr/bin/play     $ play --version     play:      SoX v14.4.1      These are definitely are not play framework related and I can't figure out how to remove this.               $ sudo apt-get remove play     Reading package lists... Done     Building dependency tree            Reading state information... Done     E: Unable to locate package play      It seems this command belongs to some package...


I have the latest stable versions of Emacs (24.3) and of Zsh (5.0.2). I can run Zsh without problem from a terminal (e.g. ITerm2), but if I try to run it from `M-x ansi-term` I get the error: `Emacs ansi-term with zsh: error in process filter. Invalid face: unspecified` This is the case even if I start `M-x ansi-term` with `bash` and then I try to switch to `zsh`. This is all on Mac OS X. Any thoughts on what may be causing this and how to overcome it?


How to find difference between two timestamps up to milliseconds?

I am new to shell scripting. The heart of my script is to find the difference between two timestamps up to milliseconds. With me I have a file with content of timestamps only as               2012-09-13 15:00:29,290 2012-09-13 15:00:29,297     2012-09-13 15:00:29,428 2012-09-13 15:00:29,447      Like this I have around 30k records, where I should not face any performance issue when I execute script. Many factors like leap year, months with 31 days etc come into picture when I am trying to write script for this. Can anyone help me on this please?


Progressbar in bash to visualize the time to wait

In a bash script sometimes you need the user to wait some seconds for a background process to finish. I usually use for example:               sleep 10      How can I add a kind of progressbar to the script, so the user knows how long to wait? I installed the command `bar` but I don't understand the manual.


Force title on GNU screen

By default, the title of a screen session is the name of the last command entered, which is fine for me, but in some cases I'd like to change it. I know the command `Ctrl`-`A` `A`, but it only changes the title until the next command, and I'd like it to stay there until I decide otherwise. **EDIT:** Here's the `preexec` function I found in my `.zshrc`               if [[ "$TERM" == "screen" ]]; then        local CMD=${1[(wr)^(*=*|sudo|-*)]}        echo -n "\ek$CMD\e\\"     fi


Implement Java/JavaFX on ARM

I am working on ARM Linux. I have found this link that says that JavaFX could work on ARM. I am confused about Embedded Java SE and JavaFx ARM. Do I need to setup a JVM for those or not? I have compiled my own kernel and built a functional root file system with **busybox** , **glibc library** and **ARM cross compiler toolchains**. Should I need to implement a JVM to get the J2SE and JavaFX platform? I just want to build a small Java based OS especially using JavaFX. I have the `glibc-2.9` library to run the framework as said by the requirement to run Embedded J2SE. But there is no tutorial about how to install or set it up to work. Can anyone help me?


Read Usenet comp.unix and more with back-then software (trn)

Is there a way to read the comp.unix Usenet discussions (and others) using the software that was used then? I'd like to read it to learn, but I can do a bit of escapism at the same time. Besides, as Usenet was so immense in popularity, probably that software wasn't bad at all. I found `trn` ("threaded read news program"), and, with `export NNTPSERVER=Aioe.org`, I get something, but not anything sensible to read. It seems, you should put newsgroups in a `.newsrc` file. Does anyone know how to do this if it is indeed possible?


How to make Cron run

I am trying to set up `cron` to run the `mysqlauditgrep` command (its the MySQL 5.6 Utilities package). The `mysqlauditgrep` command is in bash. The command I am looking to run is:               mysqlauditgrep --format=GRID /var/lib/mysql/audit.log      This command will make my audit log that has been created by mysql to be viewed in a Grid format. It is not run in the mysql shell. So I just installed Cron and set up the crontab by setting this:               00 11 * * fri root usr/bin/mysqlauditgrep mysqlauditgrep --format=GRID /var/lib/mysql/audit.log      I am new to cron so maybe I set it up wrong. I did run /sbin/service crond start after I nanoed into the crontab file. I am unable to see if the action has taken place though.


Send command to detached screen and get the output

I've been searching to find a way to send a command to a detached screen session. So far, so good. This is what I've come up with:               $ screen -S test -p 0 -X stuff 'command\n'      This command works as it should. But, I would like the output from it too, echoed straight in front of my eyes (no need for a `.log` file or something, I just want the output). Using the `screen -L` command, is not an option.


How to Find the Cause of Too Many Dropped SSH Connections?

Overview: I have a home setup, behind a home router, on which there is Proxmox Hypervisor running over 10 VMs. One of those VMs is the first point of entry after router. It is just a jump host Centos 64bit. On the router all port 22 requests are forwarded to that VM. Then through that VM I control the rest of the VMs. Problem: For the last 3 days I have been experiencing a high number of random SSH disconnects. Minutes after I ssh to the jump host or other VMs through the jump host, I get disconnected for no apparent reason. Sometimes it is after 20 minutes, sometimes 5. It seems like using vi makes it worse. I really cannot figure out what is causing it. The system is very stable most of the time. Question: I started checking the logs. I don't see anything other than disconnect received and so on. So how exactly should I proceed to check for this issue? Should I check client side logs first? `/var/log/secure` on the jump host VM? logs on hypervisor level?


shell script - reading from standard input versus a file

I have the following input file in.txt: a   b   c   a   b   c I have the following script test.sh:               # display unique rows     while read line     do        echo $line     done < $(cat "$@" | sort | uniq)           # display all rows     while read line     do        echo $line     done < $(cat "$@")       I know I can run the script using: sh test.sh in.txt I also know I can run it using standard input instead of a file. However, this only supplies input to the first while loop. How can I supply the input to both loops without typing the input twice?


How do I install GCC and make on a mac without administrator access or using Xcode?

I'd like to install gcc and make on my Macbook Air, but I don't have root access on it. I found this link through searching on google, but I have no idea how to set up the prefix's so that the actual `gcc` executable can find the libraries. I have a directory set up with node.js and git installed at `~/usr/local` and I'd like to install GCC there also. I have no idea where to start with make. Can anyone help? :D


MIC not working due to USB bandwidth

Using debian and centos, i get the same error when plugging my USB mic in. In Windows (xp thru 8.1) it works fine.               [ 304.237543] usb 2-1.6.2: USB disconnect, device number 6     [ 305.220785] usb 2-1.6.2: new full-speed USB device number 9 using ehci-pci     [ 305.331189] usb 2-1.6.2: New USB device found, idVendor=a012, idProduct=b012     [ 305.331195] usb 2-1.6.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3     [ 305.331198] usb 2-1.6.2: Product: DYNEX USB MIC Device     [ 305.331201] usb 2-1.6.2: Manufacturer: DYNEX     [ 305.331204] usb 2-1.6.2: SerialNumber: 12000002     [ 305.338744] input: DYNEX DYNEX USB MIC Device as /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.6/2-1.6.2/2-1.6.2:1.2/input/input21     [ 305.338893] hid-generic 0003:A012:B012.000A: input,hidraw3: USB HID v1.00 Device [DYNEX DYNEX USB MIC Device] on usb-0000:00:1d.0-1.6.2/input2     [ 305.366189] cannot submit urb 0, error -28: not enough bandwidth               [ 304.237543] usb 2-1.6.2: USB disconnect, device number 6     [ 305.220785] usb 2-1.6.2: new full-speed USB device number 9 using ehci-pci     [ 305.331189] usb 2-1.6.2: New USB device found, idVendor=a012, idProduct=b012     [ 305.331195] usb 2-1.6.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3     [ 305.331198] usb 2-1.6.2: Product: DYNEX USB MIC Device     [ 305.331201] usb 2-1.6.2: Manufacturer: DYNEX     [ 305.331204] usb 2-1.6.2: SerialNumber: 12000002     [ 305.338744] input: DYNEX DYNEX USB MIC Device as /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.6/2-1.6.2/2-1.6.2:1.2/input/input21     [ 305.338893] hid-generic 0003:A012:B012.000A: input,hidraw3: USB HID v1.00 Device [DYNEX DYNEX USB MIC Device] on usb-0000:00:1d.0-1.6.2/input2     [ 305.366189] cannot submit urb 0, error -28: not enough bandwidth      What i noticed is that with centos, the issue existed from the start, with debian, the mic initially worked until i allowed the update process to continue. after rebooting, i began to see this issue. I assume due to the output that this is due to a kernel change, possibly with the ehci/uhci but i'm not positive. The MIC on my webcam works (although a little delayed due to some other errors) and a line in mic works, im only having this issue with this particular USB mic. Attempting some other solutions, i completely removed pulseaudio as many blame world hunger on pulse, but even with just Alsa, the problem still remained. This furthers my belief that the issue is with the kernel and/or modules as opposed to other software. Does anyone have any thoughts?


Separate SSHD Authpriv logs into /var/log/sshd, all other authpriv logging goes to messages

Right now, sshd is using the `authpriv` facility. The level of logging is fine, but I don't want it in the syslog, I want it to go to `/var/log/sshd` (which doesn't yet exist) on Red Hat Linux/Enterprise Linux. `authpriv` is configured to go to syslog by `syslogd.conf`. Do I need to change the facility on sshd to `local2` (or any other unused local) for instance, and then direct `local2` to `/var/log/sshd` or is there a better way?


"Northbridge Error (node 0): ECC Error in the Probe Filter directory"

I've received an e-mail from a user worried that the following errors on one of his servers is indicative of a serious problem. The trouble is, the errors below are _all_ that I have to go on. I usually consider myself a decent Googler, but in this case I can only find _one_ other incident where the users encountered this error regarding "Probe Filter directory":               [1044 snapshots @ abc]$     Message from syslogd@abc at Sep  8 02:51:51 ...       kernel:[Hardware Error]: CPU:0      MC4_STATUS[Over|CE|MiscV|-|AddrV|-|Poison|CECC]: 0xdc0248d0001f010b          Message from syslogd@abc at Sep  8 02:51:51 ...       kernel:[Hardware Error]:       MC4_ADDR: 0x0000000000010f40          Message from syslogd@abc at Sep  8 02:51:51 ...       kernel:[Hardware Error]: Northbridge Error (node 0): ECC Error in the      Probe Filter directory.          Message from syslogd@abc at Sep  8 02:51:51 ...       kernel:[Hardware Error]: cache level: L3/GEN, tx: GEN, mem-tx: GEN      From what I can tell, this only happened once. Grepping around the logs for other hardware errors turns up nothing other than this one incident. The forum post which I reference above simply ends with basically telling the user not to worry about it if it only happened once and didn't cause any fatal issues. This is the same advice I got from my colleagues, who also mentioned that there are too many variables (i.e. what was running at 2:50am on September 8th?). However this user wants to be reassured that something isn't wrong with their system. What can the above errors indicate or be related to? What is the "Probe Filter directory?" What tests can I run to put the user at ease that this doesn't flag their machine for impending doom? The Linux distribution of the machine is Red Hat Enterprise Linux Server release 6.4 (Santiago).


What is the difference between shell, eshell, and term in Emacs?

In Emacs I can run a shell using following commands -               M-x term          M-x shell          M-x eshell      What is the difference between these three?


How to avoid sending EOF from a script parsing requests from and sending answers to netcat

I made a simple server using netcat and backpipe:               mkfifo backpipe     nc -l 8080 < backpipe | parseRequests.sh > backpipe      The contents of "parseRequests.sh" is just:               #!/bin/sh     if [ "$1" = "1+1" ]; then echo "2"; else echo "0"; fi      When I connected to this server in another machine using               nc 10.0.0.2 8080      The connection ended immediately with "0" returned. My question is, how can I keep the connection so that I can type many requests in the client side? If I use 'tee log.txt' instead of 'parseRequests.sh', the connection can be kept alive. I guess the 'echo' command in the "parseRequests.sh" sent an EOF signal to nc, which caused nc to quit immediately. How can I avoid this? I know I can listen to requests on one port and send answers back using another port in a loop. But I prefer to keep the same port alive for both requests and answers.


Tool to show PID and file I/O in realtime

I need to watch a program which modifies some files. I don't know which files the process is modifying_. So I'm looking for a tool that basically outputs a PID, and lista the files being accessed/modified, and what's being done to them (both read and write). The closest thing I've found so far is iotop, which is definitely on the right track.               iotop -o -b -qqq      That gets me the process and the read/write, but it _doesn't indicate the file being accessed_. Alternately, I think I could try something like               inotifywatch -r /      but that just runs out of allowed inotify watches. What is the magic tool I'm looking for?


I always need to ifdown/ifup wlan0 after reboot

I'm trying to create an ad-hoc wifi made of 5 computers (one windows pc and 4 raspberry pi loaded with a raspbian) the raspberry pi will talk through mqtt, but tha'ts not the point. The problem I have is that I always need to do the following in order to have the `wlan0` interface after each reboot:               sudo ifdown wlan0     sudo ifup wlan0      Do you know why? Here is my conf (the same on each pi except the ip adress obviously!)               ~ % ifconfig                      eth0      Link encap:Ethernet  HWaddr b8:27:eb:ff:88:99                 inet addr:192.168.1.41  Bcast:192.168.1.255  Mask:255.255.255.0               UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1               RX packets:951 errors:0 dropped:0 overruns:0 frame:0               TX packets:266 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:1000                RX bytes:66321 (64.7 KiB)  TX bytes:43663 (42.6 KiB)          wlan0     Link encap:Ethernet  HWaddr 00:0f:13:51:05:8c                 inet addr:192.168.0.2  Bcast:192.168.0.255  Mask:255.255.255.0               UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1               RX packets:0 errors:0 dropped:0 overruns:0 frame:0               TX packets:42 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:1000                RX bytes:0 (0.0 B)  TX bytes:2520 (2.4 KiB)          ~ % iwconfig     wlan0     IEEE 802.11bgn  ESSID:"mirroir"                 Mode:Ad-Hoc  Frequency:2.412 GHz  Cell: 42:B1:44:EB:D2:C1                  Tx-Power=20 dBm                  Retry  long limit:7   RTS thr:off   Fragment thr:off               Power Management:on          lo        no wireless extensions.          eth0      no wireless extensions.               ~ % more /etc/network/interfaces      auto lo     iface lo inet loopback     iface eth0 inet dhcp     allow-hotplug wlan0     auto wlan0     iface wlan0 inet static         address 192.168.0.2         netmask 255.255.255.0         wireless-channel 1         wireless-essid mirroir         wireless-mode ad-hoc         wireless-key 967136deac          ~ % sudo route add -net 192.168.0.0 netmask 255.255.255.0 wlan0          ~ % netstat -r     Kernel IP routing table     Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface     default         192.168.1.254   0.0.0.0         UG        0 0          0 eth0     192.168.0.0     *               255.255.255.0   U         0 0          0 wlan0     192.168.1.0     *               255.255.255.0   U         0 0          0 eth0      Any idea? **UPDATE:** it seems to work but not always, like 1 boot out of 10, really weird?! Regards


How to perform a multi line grep

How would you perform a grep for text that appears on two lines? For example: `pbsnodes` is a command I use that returns the utilization of a linux cluster               root$ pbsnodes     node1         state = free         procs = 2         bar = foobar          node2         state = free         procs = 4         bar = foobar          node3         state = busy         procs = 8         bar = foobar      I want to determine the number of procs that match nodes that are in state 'free'. So far I have been able to determine the "number of procs" and "the nodes in free state", but I want to combine them into one command that shows all free procs. In the above example, the correct answer would be 6 (2+4). What I have               root$ NUMBEROFNODES=`pbsnodes|grep 'state = free'|wc -l`     root$ echo $NUMBEROFNODES     2          root$ NUMBEROFPROCS=`pbsnodes |grep "procs = "|awk  '{ print $3 }' | awk '{ sum+=$1 } END { print sum }'`     root$ echo $NUMBEROFPROCS     14      How can I search for every line that reads 'procs = x', but only if the line above it reads 'state = free?


Why I can't connect to VPS after changing OS from CentOS to Ubuntu?

Recently, I've changed my VPS operating system from CentOS to Ubuntu. Unfortunately since then I can't connect to my VPS. The following message comes again and again (screenshot attached). ![enter image description here](http://i.stack.imgur.com/MZYhk.png) Why this is happening and how can I solve that?


Flash plugin of debian vulnerable?

I run Debian wheezy with Iceweasel as browser and have installed the Flash plugin similar to this description. Today I read that not only Flash on Windows and Mac also Adobe Flash Player 11.2.202.350 and earlier versions for Linux are vulnerable to exploitation. When checking my version in Iceweasel > Tools > Add-ons I was surprised to see that it is an older version, even though I did all upgrades with `apt-get`. Does Debian provide updates for the Iceweasel plugin Flash at all? Are they not automatically provided? Do I always have to manually update the plugin?


Remove GPT - Default back to MBR

I keep receiving this error: > Warning!! Unsupported GPT (GUID Partition Table) detected. Use GNU Parted I want to go back to the normal MBR. I found some advice here and did:               parted /dev/sda     mklabel msdos     quit      But when I get to the `mklabel` option it spits out a warning that I will lose all data on `/dev/sda`. Is there a way to get the normal MBR back without formatting the disk?


How can you determine which process scheduler is being used?

I.e. is it the O(1) scheduler, the CFS scheduler, or an older one?


Which process scheduler is my linux system using?

I'm not quite sure if stackoverflow or serverfault is the forum to use for this question, but ill try here. Is there some command i can use or a file i can check in order to find out which process scheduler im using on my linux system ? I am _not_ looking for the I/O scheduler, but the process scheduler, and please, do not refer to guides or howtos for what a scheduler is, what im simply asking is if there is a command or file i can run/check to see this. I could check the doc for my kernel but again im just wondering if there is a command or file i can check. I might have been a little redundant above but thats because the posts ive seen people seem to confuse process scheduler with the i/o scheduler, and they dont seem to answer the actual question, just provide links to what a scheduler is which is not what im after here, so apologies if the above comments sounded rude.


Ensure that loopback root and host are unmounted on shutdown

I'm trying to setup a Linux system that runs from an LVM-formatted image file. After some tinkering with the initramfs and boot options I managed to make it up and running by mounting the host file system to `/run/initramfs/host`, `losetup`ing the image to `/dev/loop0` and making sure the kernel and udev detect the LVM (and the root LV) in there. So far so good. The problem is that when shutting down (or rebooting, or …) the system neither the root file system nor the host are unmounted properly, because of a chicken-and-egg scenario: the root (or `/oldroot`, as it's referred to by the shutdown script) cannot be unmounted, because `/oldroot/run/initramfs/host` is still mounted, and the host cannot be unmounted, because doing so would make `/oldroot` inaccessible. Unclean shutdowns aren't the end of the world, because both file systems are journaled, so during the next boot `fsck` simply replays the journals, but obviously clean shutdowns would be better. So the question is: is it somehow possible to arrange the shutdown sequence (I _can_ modify the shutdown script), _or_ the bootup sequence (perhaps by moving the host mount point to a different place) so that both file systems can be cleanly unmounted?


How to configure pppoe client on OpenBSD?

I have an OpenBSD 5.1 installed + a cable from my ISP. I have the username/password for the PPPoE connection, but how can I configure the connection to be permanent? (I have 1 interface on the machine.) UPDATE: according to google I will need to fill out the /etc/ppp/ppp.conf file..


Knowing if a directory is modified

I have a server online and I am wondering if there's a way to know if some file on the server is modified or a new file is added to certain directories. For example, I have this public_html/myblog/files this directory contains several files. What I want is to be notified by email if one of the current files inside that directory is modified or if a new file is added to that directory. If possible to receiving a message telling me what files are new or were modified. Is this possible? I am using CentOS 6.8 thanks.


How to select optional components during FreeBSD 9.0 Install?

I am installing FreeBSD 9.0 on VMWare Player. In section 2.5.3 of the installation guide it shows that one can choose which components to install. What keys on the keyboard do I need to use to (de)select those options? I cannot seem to figure it out.


How to determine how many bytes / hr are being written to my SD card

I have a Debian embedded Linux system that uses an SD card as the RFS. What is a reliable way to determine how many bytes / hr are being written to the SD card?


Processing a Yes/No Response from Bash User

This very well may be stupidity on my part. I would like to accept Yes/No, True/False responses within my Bash script: _test.sh_               #!/bin/bash          ARGUMENT=$1          echo User passed in $ARGUMENT          OPTARG=${ARGUMENT:0:1}          if [[ "$OPTARG" -eq 0 ]] || [[ "${OPTARG^^}" == "N" ]]; then         echo Decline     elif [[ "$OPTARG" -eq 1 ]] || [[ "${OPTARG^^}" == "Y" ]]; then         echo Accept     else         echo Invalid argument     fi      Here are some sample results: **./test.sh 0**               User passed in 0     Decline      **./test.sh 1**               User passed in 1     Accept      **./test.sh 2**               User passed in 2     Invalid argument      **./test.sh No**               User passed in No     Decline      * * * Now the stumper. Why is `[[ "${OPTARG^^}" == "N" ]]` returning true for any string!? **./test.sh Yes**               User passed in Yes     Decline      **./test.sh ThisShouldNotMatch**               User passed in ThisShouldNotMatch     Decline


How to execute a command repeatedly with different arguments?

I'm on Ubuntu. I copied some arguments (separated by newline) and I can use xsel to print them out like this               $ xsel     arg1     arg2     arg3     arg4     ...      Now, I want to use each of these arguments for another command and execute that command as many times as there are arguments. So I tried               $ xsel | mycommand "constantArgument" $1      However, this executed `mycommand` only for the first argument. How can I execute it for every argument?


ext4 inode size, shown by dumpe2fs

Manpage about `mke2fs` says "mke2fs creates 256-byte inodes by default". I've formatted my small (320MB) test partition with command:               sudo mkfs -t ext4 /dev/sdc1      The defaults for the `mke2fs` are below:               [defaults]       base_features = sparse_super,filetype,resize_inode,dir_index,ext_attr       default_mntopts = acl,user_xattr       enable_periodic_fsck = 0       blocksize = 4096       inode_size = 256       inode_ratio = 16384          [fs_types]     ...       ext4 = {                features = has_journal,extent,huge_file,flex_bg,uninit_bg,dir_nlink,extra_isize                auto_64-bit_support = 1                inode_size = 256       }     ...      Then I ran `dumpe2fs` and it showed me:               ...     Inode size:           128     ...      The program version is below:               dumpe2fs 1.42.8 (20-Jun-2013)         Using EXT2FS Library version 1.42.8      Also, the superblock field `s_inode_size` = 128 (I read the superblock directly by `pread64`). So, what would be the actual inode size in my case? (I'm on Ubuntu 3.11, which runs as a guest VM in VMWare Fusion)


Samba: mount error: could not resolve address for XXX: Unknown error

I've read several guides on mounting samba shares, but no luck yet. I'm able to "login" to my samba share with the following command:               smbclient //vvlaptop/Documents      It asks for password, but there is no password so I just press Enter. It then successfully logs me in with the prompt `smb: \>`. For some reason I'm unable to mount the share. This is the command I'm using:               mount -t cifs //vvlaptop/Documents /mnt/virginia     mount error: could not resolve address for vvlaptop: Unknown error      How can I mount this device successfully?


how to install bumblebee in linux mint 17 ?

I Found Nvidia Drivers Freezes In Cinnamon or Their Cinnamon Crash or Run in Fall-back mode. As bumblebee works better, how can I install bumblebee in Linux mint 17


Checking the type of NAT

I have read that there are many types of NATs available like symmetric NAT, full-cone NAT, etc. If I am behind a NAT, is there any way to find out the type of NAT behind which I am currently working on? I setup my own Ubuntu desktop as a NAT machine using the basic iptables rules and by adding one more NIC card. I used the following rules:               $ iptables -t nat -A POSTROUTING --out-interface eth0 -j MASQUERADE     $ iptables -t filter -A FORWARD --in-interface eth1 -j ACCEPT      Is there any way I can see my NAT table?


Make errors when compiling hulahop

When I cloned hulahop I had a few possibilities to install it. I have chosen the path with `autogen.sh` I used commands:               $ sh autogen.sh # -> OK     $ ./configure   # -> OK      But `make` fails:               $ sudo make 2> errors.txt     $ cat errors.txt     hulahop.cpp:28:29: error: pyxpcom/PyXPCOM.h: No such file or directory     In file included from /usr/include/python2.6/Python.h:8,                      from hulahop-web-view.h:23,                      from hulahop.h:23,                      from hulahop.cpp:31:     /usr/include/python2.6/pyconfig.h:395:1: warning: "HAVE_LONG_LONG" redefined     In file included from /usr/include/xulrunner-1.9.2.24/nspr/prtypes.h:58,                      from /usr/include/xulrunner-1.9.2.24/nscore.h:51,                      from /usr/include/xulrunner-1.9.2.24/nsDebug.h:42,                      from /usr/include/xulrunner-1.9.2.24/nsCOMPtr.h:59,                      from hulahop.cpp:20:     /usr/include/xulrunner-1.9.2.24/nspr/prcpucfg.h:807:1: warning: this is the location of the previous definition     In file included from /usr/include/python2.6/Python.h:8,                      from hulahop-web-view.h:23,                      from hulahop.h:23,                      from hulahop.cpp:31:     /usr/include/python2.6/pyconfig.h:1031:1: warning: "_POSIX_C_SOURCE" redefined     In file included from /usr/include/sys/types.h:27,                      from /usr/include/xulrunner-1.9.2.24/nspr/obsolete/protypes.h:79,                      from /usr/include/xulrunner-1.9.2.24/nspr/prtypes.h:517,                      from /usr/include/xulrunner-1.9.2.24/nscore.h:51,                      from /usr/include/xulrunner-1.9.2.24/nsDebug.h:42,                      from /usr/include/xulrunner-1.9.2.24/nsCOMPtr.h:59,                      from hulahop.cpp:20:     /usr/include/features.h:158:1: warning: this is the location of the previous definition     In file included from /usr/include/python2.6/Python.h:8,                      from hulahop-web-view.h:23,                      from hulahop.h:23,                      from hulahop.cpp:31:     /usr/include/python2.6/pyconfig.h:1040:1: warning: "_XOPEN_SOURCE" redefined     In file included from /usr/include/sys/types.h:27,                      from /usr/include/xulrunner-1.9.2.24/nspr/obsolete/protypes.h:79,                      from /usr/include/xulrunner-1.9.2.24/nspr/prtypes.h:517,                      from /usr/include/xulrunner-1.9.2.24/nscore.h:51,                      from /usr/include/xulrunner-1.9.2.24/nsDebug.h:42,                      from /usr/include/xulrunner-1.9.2.24/nsCOMPtr.h:59,                      from hulahop.cpp:20:     /usr/include/features.h:160:1: warning: this is the location of the previous definition     hulahop.cpp: In function ‘HulahopWebView* hulahop_get_view_for_window(PyObject*)’:     hulahop.cpp:101: error: ‘Py_nsISupports’ has not been declared     hulahop.cpp:112: error: ‘do_GetService’ was not declared in this scope     make[1]: *** [hulahop.lo] Error 1     make: *** [all-recursive] Error 1      Could you help me with compilation?


Why does Eclipse think I'm typing "ctrl+a" when I'm only typing "a"?

I currently using Eclipse with Fedora 16, everything is perfect before I use `Ctrl`+`H` to search a file. In the file search tab:   * When I type 'a' Eclipse seems to get a 'ctrl + a'   * So I cannot type an 'a' for searching But in the editor everything is ok! Before I type 'a': ![befor i type 'a'](http://i.stack.imgur.com/hzaQ0.png) After I type 'a': ![after i type 'a'](http://i.stack.imgur.com/6zotL.png) But when I click the file search in toolbar, I can type everything. What's going on?


How to copy someone's else folders from public.me.com with a wget-like tool?

How can I copy a folder from http://public.me.com/ (a service related to iDisk, or MobileMe) to my local filesystem with a Unix tool (like _wget_ , **a command-line non-interactive tool** )? The problem is that the web interface is actually a complex Javascript-based thing rather than simply exposing the files. (Even _w3m_ can't browse, e.g., https://public.me.com/rudchenko.) My goal is to update the local copy from time to time non-interactively, and to put the command to download the files to a script, so that other people can run the script and download the files. A _wget_ -like ( _rsync_ -like, _git pull_ -like) tool will suit me, or a combination of mounting a network filesystem via FUSE and then using standard Unix commands to copy the directories will do. I've read in the Wikipedia articles (which I refer to above) that Apple provides WebDAV access to these services, and I've also read about _cadaver_ , a _wget_ -like WebDAV client, but I can't figure out which address I should use to access the folders at http://public.me.com/ read-only (anonymously). Perhaps Gilles' comment (that WebDAV isn't currently used) is true, but still there seems to be some WebDAV stuff behind the scene: the URL passed to the browser for downloading an archive with a directory (after pressing the "download selected files" button at the top of the web interface) looks like this:               https://public.me.com/ix/rudchenko/SEM%20Sep21%201%20TO%20PRINT.zip?webdav-method=ZIPGET&token=1g3s18hn-363p-13fryl0a20-17ial2zeu00&disposition=download      -- note that it mentions "WebDAV". (If you are curious, I tried to re-use this URL as an argument for _wget_ , but it failed:               $ LC_ALL=C wget 'https://public.me.com/ix/rudchenko/SEM%20Sep21%201%20TO%20PRINT.zip?webdav-method=ZIPGET&token=1g3s18hn-363p-13fryl0a20-17ial2zeu00&disposition=download'     --2011-11-21 01:21:48--  https://public.me.com/ix/rudchenko/SEM%20Sep21%201%20TO%20PRINT.zip?webdav-method=ZIPGET&token=1g3s18hn-363p-13fryl0a20-17ial2zeu00&disposition=download     Resolving public.me.com... 23.32.106.105     Connecting to public.me.com|23.32.106.105|:443... connected.     HTTP request sent, awaiting response... 404 Not Found     2011-11-21 01:21:48 ERROR 404: Not Found.     $       ) (I'm using a GNU/Linux system.)


How to know user type in LINUX machine

My account has been created on a LINUX machine. But, I don't know which type of user I am ( root user or normal user) and which type of access I have. Is there any command through which I can check whether I have **sudo** access or not in a linux machine if I already have an account.


Resource friendly way to indicate to user program is not hanging

I have a Perl script on a *nix system which, at one point, is processing 50,000 + lines of text. This takes some time. I am trying to find a resource friendly way to let the user know the program is not hanging while it is processing all of this text. Currently I am printing output in realtime as the text is being processed . I am flushing the output buffer then printing the output on one line with `\r`. This seems to be an unnecessary use of resources because it takes almost twice as long than when I print nothing, but as I have said, when printing nothing it looks like the program is hanging. So my question: Is there a standard or simple way to let the user know the program is indeed running while performing long running tasks?


X11 fonts have gone - applications fall back to typewriter

After removing several packages, updating within Debian/Jessie, and rebooting, several applications (windows manager, Xfce4 panel, mail client, browser) fall back to typewriter; Sans/Regular seems to have disappeared from my system. I have the list of removed packages; I can find none that is plausibly related to X11 fonts.


Merge source files with destination, replacing older ones

I'm looking for the linux equivalent of the DOS command:               xcopy from/* to/* /s/e/d/y      Which copies over all new files and only replaces old ones. I'll be running this from the terminal of a Mac OSX computer.


scripted pdf code review

## What I try to achieve I need to review a bunch of C source code spread out into dozen of directories. I already have a bash script which does the following: It searches for all source codes in the directory I'm interested in. For each code found, it generates a pdf (where the source file is) using the following command:               a2ps $source -R --columns=1 --prologue='color' --line-numbers=1 -T2 -M A4 \       --chars-per-line=100 --borders=no --encoding=iso1 -o - | \       ps2pdf -sPAPERSIZE=a4 - $dest      Then it opens this generated pdf with a PDF viewer to let me review it using sticky notes. I then save it, close it and the script do the same for the next c source code, etc. This way I can review all the source codes in an automatic way and distribute the review back in a handy pdf format. ## Where it fails I can't find a proper PDF reader which allows me to do exactly what I've mentioned above. Basically what I've tried : ### Evince Don't allow to save the sticky notes in the same file, I need to "Save as..." and evince then open the previous location used and not the location of the current pdf. This force me to manually navigates trought the directories to find the source pdf to override it. ### Xournal It don't have sticky notes and this is mandatory for me. ### Okular The sticky notes are not visible into Adobe Reader which is mandatory for me too. ### Adobe Reader 9 This old version for Linux (thanks Adobe) don't support sticky notes. ## Therefore what I need To summarize what I've said above, I need a PDF reader that is :   * able to _save_ the annotated pdf directly or at least _save as_ it in the same directory directly   * using official pdf sticky notes   * creates sticky notes that are visible into, at least, _Adobe Reader_ and _evince_ Your help is much appreciated has it could save me a lot of time! Also feel free to suggest a whole different workflow idea if it's matching my requirement.


Installing Linux over Windows 7

I have a computer with three hard drives:   1. SSD with Windows 7 installed   2. HDD with Linux Mint installed   3. HDD with no OS, formatted as NTFS drive for storing files. I have been using EasyBCD to dual boot, and when I am in Windows 7, I can only see drives 1 and 3. When I am in Linux Mint, I can only see drives 2 and 3. I got a new computer, and want to install Linux Mint on the SSD, but I am having an issue. I put Mint on a thumb drive with Universal USB Installer, and when I boot to the thumb drive, it can only see drives 2 and 3. I checked the 'DYI' partitioning section and drive 1 does not show up there either. So, my question is, how can I make drive 1 visible when I am booting to the other drives so that I can install Mint over it? edit: Here is where it gets really weird. When I try to wipe drive 1 (the SSD with Windows 7) DBAN doesn't register it


SSH not working from one specific computer

I can connect from every other computer on the LAN, as well as externally. It connects fine to other machines running SSHD. When trying ssh with verbosity, I get the following readout:               $ ssh -vvv 192.168.1.9     OpenSSH_6.2p2, OpenSSL 1.0.1e 11 Feb 2013     debug2: ssh_connect: needpriv 0     debug1: Connecting to 192.168.1.9 [192.168.1.9] port 22.     debug1: Connection established.     debug1: identity file /home/Steven/.ssh/id_rsa type -1     debug1: identity file /home/Steven/.ssh/id_rsa-cert type -1     debug3: Incorrect RSA1 identifier     debug3: Could not load "/home/Steven/.ssh/id_dsa" as a RSA1 public key     debug1: identity file /home/Steven/.ssh/id_dsa type 2     debug1: identity file /home/Steven/.ssh/id_dsa-cert type -1     debug1: identity file /home/Steven/.ssh/id_ecdsa type -1     debug1: identity file /home/Steven/.ssh/id_ecdsa-cert type -1     debug1: Enabling compatibility mode for protocol 2.0     debug1: Local version string SSH-2.0-OpenSSH_6.2     ssh_exchange_identification: read: Connection reset by peer      Any idea what I might have messed up? I don't recall changing in the SSH config files, only adding some users to groups to experiment with permissions. Even when I try not specifying an account (as above) it still hangs at "Local version string SSH-2.0-OpenSSH_6.2" for a minute before giving the final error. I'm running Ubuntu Server 12.04 x86, for what it's worth.


Is there a grep switch that reads a file for filter terms?

Assuming file a.txt has:               1a     2b     3c     4d      so               grep "1" a.txt      would return:               1a      and               grep "3" a.txt       would return:               3c      what if i want to put a criteria file named crit.txt with the following content:               1     3      is there a switch in grep say -cf for criteria file where i could do               grep -cf crit.txt a.txt      that would return:               1a     3c      or is there other tool that does the same thing, and provide me with an example on how to use the tool. The tool should be a one liner command.


Define custom DNS server when looking up host

I'm having trouble with my current web host's DNS server which doesn't correctly resolve IP addresses for Baidu.               shell_exec('host -W 2 180.76.5.168');     shell_exec('nslookup 180.76.5.168');      Is there a way I can define my own DNS server address when trying to resolve the host? Quoted output of my localhost result... > host: baiduspider-180-76-5-168.crawl.baidu.com > > Server: Wireless_Broadband_Router.home Address: 192.168.1.1 Name: > baiduspider-180-76-5-168.crawl.baidu.com Address: 180.76.5.168


USB booting to installing Linux on a new Lenovo laptop

I recently got a Thinkpad T440s with Windows 8.1 for my job, and since most of my work is done under Linux I am going to install Ubuntu on it, so that I can dual boot. The problem is that it won't boot from USB. In the BIOS, the Boot Priority Order only has the Windows Boot Manager and LAN, with USB devices appearing under "Excluded from boot priority order" lower down. After preparing a USB flash drive as a Ubuntu installer, I thought I can get the computer to boot from USB at least once by going through the PC Settings window, then Update and Recovery -> Recovery -> Advanced Start Up -> Use a Device and picking one of the USB devices, but the computer just ignores the flash drive and boots straight into Windows. On older computers I just use GRUB to pick what operating system to boot into, but with this computer I'm not sure how to best configure the start up - is Windows Boot Manager going to interfere? I tried to search on Google but nothing I could find was really of help. The techs here _won't_ help or support me, although installing Linux is allowed - and even necessary, in my case.


SSH to untrusted machine

If I SSH to a remote server, is it be possible for the admins of that machine to use my SSH session to send data back down the connection and do something to my local PC? I use DSA keys and do not allow password logins to my SSH server, and I do not allow root access. If it would still be possible despite these precautions, could you explain how it is done with code/links so I can understand? Another thing I am worried about is that if I connect to the remote server, the admins may be able to hijack my pts session and simply type `exit` to get to my PC. Again, please let me know if this is possible and if so please provide code/links I've done a bit of googling and turned up nothing so far.


Initrd : Were can I found the code for real-root-dev

I'm trying to customize my initrd on kernel 2.4. At some point, inside the file linuxrc, I have the opportunity to set my root device setting the /proc/sys/kernel/real-root-dev variable The example on docs is the one belowe:               echo 0x301 > /proc/sys/kernel/real-root-dev      > where 0x301 is for /dev/hda1 What I'm looking for is the code needed for device different form hda1. I had searched throug the web by I didn't find an answer, so I hope some of you can help me.


Apache2 not reading sites-enabled/*.conf

So I'm trying to set up my site with Apache on Ubuntu 14.04. I have created a `mydomain.com.conf` file in `sites-available/`. It looks like this; **mydomain.com.conf**               <VirtualHost *:80>         ServerName mydomain.com         ServerAlias www.mydomain.com         ServerAdmin admin@mydomain.com              DocumentRoot /var/www/mydomain.com/public_html              ErrorLog ${APACHE_LOG_DIR}/mydomain.com/error.log         CustomLog ${APACHE_LOG_DIR}/mydomain.com/access.log combined     </VirtualHost>      **000-default.conf**               <VirtualHost *:80>         ServerAdmin webmaster@localhost         #DocumentRoot /var/www              ErrorLog ${APACHE_LOG_DIR}/error.log         CustomLog ${APACHE_LOG_DIR}/access.log combined     </VirtualHost>      For some reason apache doesn't seem to read `mydomain.com.conf` at all, it will always default to the configuration in `000-default.conf`. When visting my site I get a 403 Forbidden response.   1. I've enabled the site by `a2ensite mydomain.com` and reloaded Apache.   2. `apachectl configtest` returns `Syntax OK` The `error.log` file for **`000-default.conf`** says               [Wed Sep 03 11:01:48.717652 2014] [autoindex:error] [pid 5869] [client 2.71.93.10:55718] AH01276: Cannot serve directory /var/www/: No matching DirectoryIndex (index.php,index.html,index.cgi,index.pl,index.xhtml,index.htm) found, and server-generated directory index forbidden by Options directive      while the error log & access log for `mydomain.com` is empty. My `apache2.conf` does a `IncludeOptional sites-enabled/*.conf`. The security model in `apache2.conf` looks like this;               <Directory />             Options FollowSymLinks             AllowOverride None             Require all denied     </Directory>          <Directory /var/www/>             DirectoryIndex index.php, index.html             AllowOverride None             Require all granted     </Directory>      What's wrong?


"Links" to dirs that have features of both hard and soft links?

It is not allowed to create a hard link for a dir. But the soft like will not work, if I later change the name of the dir. How would you solve the dilemma? Are there applications which can   * make soft links work after changing the dir's name? Or   * make hard links work for dirs?


what interface does lpsched provide that cups does not?

Work has a Linux stock/erp custom system that uses the Unix System V (Solaris, SCO, HP-UX) lpsched program that someone who used to work here compiled for RHEL/CentOS 5 i686 (I have no idea why or how). From a system admin point of view this is pain in the neck to install, and support on new CentOS 6+ x86_64 systems as it requires copying old binaries from old systems, and just putting up with the bugs. I see that cups provides the commands   * lp   * lpadmin   * lpc   * lpoptions   * lpq   * lpr   * lprm   * lpstat   * cancel What way can a program use lpsched that is not already provided by cups? Note that large parts of the custom software we run rely on the ability to send printer language (Kyocera prescribe) as is to the printer over the network to the printer's print queue. Essentially I'd like to remove our reliance on this messed up situation and just be able to use cups for all printing.


How to avoid emerge recalculating dependencies after adding required keywords/uses?

While `emerge --autounmask-writes` followed by a `etc-update` basically automates adding additional keywords and use flags, running `emerge` afterwards (without any other modifications) will _again_ calculate the very same dependencies, which on a slower machine may waste several redundant minutes - how can this be avoided?


tee / sudo password cache conflict?

I have a large bash script (Ubuntu 12.04). The script is designed to be invoked by a regular user; only certain commands within the script run with sudo. It is not an option to run the entire script as root. Within the script I have a lot of statements similar to these:               echo "blah blah" | sudo tee /path/to/file      and               sudo tee /path/to/file > /dev/null << 'END'     blah blah     END      The form of those statements is largely due to the script being designed to not run as root. I put a lot of work into getting those statements right. (It was a learning experience for me.) The script works well and I do not want to massively change it. In fact, I don't want to change it _at all_ because it is debugged and working in a production (sort of) environment. However, I do want to add better logging. So I added the following lines to the beginning of my bash script as per http://stackoverflow.com/a/11886837/463994               #!/bin/bash          >foo.log     exec >  >(tee -a foo.log)     exec 2> >(tee -a foo.log >&2)      However, now when I run the script it asks me for my password for every instance of the sudo/tee command examples shown above (about 50 of them!). Is there a solution for this that does not require me to significantly change the existing code? I just want to log the output of the script without changing how it runs (including without requiring password entry many times within a short span of time). Here is code showing the problem:               #!/bin/bash          sudo -k          >foo.log #truncate log file to start fresh     exec >  >(tee -a foo.log)     exec 2> >(tee -a foo.log >&2)          if [ -f fileone.txt ] ; then         echo "sudo rm fileone.txt"         sudo rm fileone.txt     fi          echo "sudo touch fileone.txt"     sudo touch fileone.txt          echo "sudo touch filetwo.txt"     sudo touch filetwo.txt          sudo touch /opt/file3.txt     echo "blah blah" | sudo tee /opt/file3.txt     sudo rm /opt/file3.txt          exit      _Expected result:_ enter password once and whole script runs _Actual result:_ have to enter password again for `echo "blah blah" | sudo tee /opt/file3.txt` and any similar statements of the form given at the top of this question. But only if the logging code at the top of the script is used. Without the logging, there is no problem.


mod_qos not loading in apache on solaris

I have installed and configured the mod_qos in my Apache 2.2.24. However, Apache passes the configtest. But when starting the server, It starts with a single process that crashes in a minute. Even after enabling debug mode, There are no errors that are logged in the log. Kindly suggest if we can add a debug mode only for qos module to see why the server is crashing?


$ curl -v https://dl.google.com/dl/cloudsdk/release/install_google_cloud_sdk.bash | bash     * STATE: INIT => CONNECT handle 0x2001f130; line 1011 (connection #-5000)     * Hostname was NOT found in DNS cache     *   Trying 74.125.236.168...     * Adding handle: conn: 0x20059b98     * Adding handle: send: 0     * Adding handle: recv: 0     * Curl_addHandleToPipeline: length: 1     * 0x2001f130 is at send pipe head!     * - Conn 0 (0x20059b98) send_pipe: 1, recv_pipe: 0     * STATE: CONNECT => WAITCONNECT handle 0x2001f130; line 1058 (connection #0)       % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current                                      Dload  Upload   Total   Spent    Left  Speed       0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0*   Trying 2404:6800:4001:c01::be...     * Connection failed     * connect to 2404:6800:4001:c01::be port 443 failed: Network is unreachable     * Failed to connect to dl.google.com port 443: Network is unreachable     * Closing connection 0     * The cache now contains 0 members     * Expire cleared     **curl: (7) Failed to connect to dl.google.com port 443: Network is unreachable**      I'm trying to install google cloud sdk using curl from cygwin. Any help is appreciated.


ALSAEQUAL runs, but sliders do not seem to affect audio

I want to have an equalizer that lets me easily adjust sound for listening to music on my laptop with headphones. I'm trying to install ALSAEQUAL since it seems that this is the preferred tool for what I need. (If I'm wrong, please let me know). I'd like to be able to adjust equalizer levels to a preferred state and have my system remember this EQ state across various applications (including web browser, MPD, VLC), as well as across reboots. When I run `alsamixer -D equal`, the ncurses equalizer interface appears, but it seems that my audio is not respondning---the sliders move, but the playback EQ levels don't seem to change at all when I adjust the sliders. (I've tried with audio playing in both VLC and MPD). How can I configure ALSAEQUAL to work properly? My `.asoundrc` file is:               pcm.!default {             type plug;             slave.pcm "plugequal";     }     ctl.equal {         type equal;     }     pcm.plugequal {         type equal;         slave.pcm "plug:dmix";     }      I am running Linux Mint 16 Cinnamon on a Lenovo Thinkpad e420.


Can I use two sets of I/O devices for two user sessions on one computer?

I want to connect a second monitor, keyboard and mouse to my PC (running Ubuntu) and let somebody else (e.g. my son) use the a different TTY while I am working. I know I can switch between TTYs using `Alt`+`F[1-6]`, and that I could potentially start several X sessions (`Alt`+`F[7-12]`), but is it possible to use them at the same time with different I/O devices? In a way I'd like to emulate the way computers used to work in the old days, when you'd have a central machine with several "terminals" attached. Linux (and Unix style OSs) are generally designed for that, so it should be possible, right?


List the commands run by rpm package

Sorry for the very basic question, maybe my Google grammar is not the best tonight. I am trying to break down an rpm package into a list of commands (not just its file contents). I would like to know what all and in which order gets executed when you run               yum install --nogpgcheck mypackage.rpm      I get the file contents by running:               rpm -q -filesbypkg -p mypackage.rpm


Parallel pausing and resuming?

I have a pretty strange thing I'm seeing as I run 8 GPG encryption jobs with GNU parallel: ![](http://i.imgur.com/1C7e1Hh.png) The command I've run is this:               find . -type f -not -iname "*.gpg" | sort |parallel --gnu -j 8 --workdir "$PWD" '         echo "Encrypting {}..." ;          gpg --encrypt --recipient "me@mail.com" "{}"     '      Why do the jobs seem to start and stop and start and stop rather than simply occupying all of the CPU time?


Editing Spec file in RPM

I'm trying to edit a spec file which always fails when I try to install it on other computer using RPM. I'm using CentOS. Here is the error.               error: Failed dependencies:     perl(ActsUtil) is needed by my_program     perl(ParseBishop) is needed by my_program      Both these 2 files are dependencies for the RPM. The thing is, these 2 files are actually provided inside the RPM package. Both these files are .pm file and located inside `/opt/mysoftware/bin`. I know it can be solved using `rpm - ivh --nodeps mysoftware`. But I dont prefer to use that method. So, I tried fixing the spec file. Here are some of the code that I've tried. 1st try               Summary:....     Name:..     Version:..     ....     ....     Provides: perl(ParseBishop), perl(ActsUtil)     ...     ...     %install     ...     ...     %changelog      2nd try               Summary:....     Name:..     Version:..     ....     ....     Provides: ParseBishop, ActsUtil     ...     ...     %install     ...     ...     %changelog      3rd try               Summary:....     Name:..     Version:..     ....     ....     Provides: ParseBishop.pm, ActsUtil.pm     ...     ...     %install     ...     ...     %changelog      4th try               Summary:....     Name:..     Version:..     ....     ....     Provides: /opt/mysoftware/bin/ParseBishop, /opt/mysoftware/bin/ActsUtil     ...     ...     %install     ...     ...     %changelog      Am I doing the "Provides" command wrong? Or my approach in solving the issue is already wrong? All guide and help are really appreciated.


Terminal editor with "project pane"

Most GUI text editors have a "project pane" that's just a directory tree that you use to choose what file you're currently editing. What's a terminal text editor (or a VIM/emacs plugin) with this feature?


Keyboard shortcut glossary for terminal apps

I would like to be able to fire up any terminal app (including ones I've never used) and see, on my second monitor (which is actually a second iPad running a terminal emulator) a glossary of keyboard shortcuts that I invoke on the terminal app I'm currently looking at. The main part of this vision is just showing a keyboard shortcut glossary for every terminal app in the universe. Does this exist? It would be just like `man` but just outputs a nicely readable keyboard shortcut glossary.


Debugging a Solaris network issue

I'm running a Solaris 11 x86 file server. The file-server part is ZFS + Samba. It's been up running for three or four years now without major problems. The Samba shares start out visible to other PCs on the network. I can read from the file server reliably. I can ping the server. I can ping other PCs from the server. I can ping the default gateway from the server. Starting a few weeks ago, when I attempt to write to the file server, the shares disappear after a few seconds (or maybe after a few hundred megabytes). The issue is apparently with the network. The server is still alive, though. If I hook up a mouse and keyboard and monitor I can still interact with the server. It doesn't seem like the problem is with the hard drives or with Samba. Tried:   * zpool status   * fmadm faulty   * svcadm restart samba No errors. No faulty devices. Samba doesn't appear to be the problem. After the problem happens, I cannot ping the default gateway from the file server anymore. I cannot ping other machines from the file server anymore. I cannot ping the server from other machines. **Network Debugging Steps** I've tried:   * ifconfig skge0 down/ifconfig skge0 up.   * Power cycling the switch that the Solaris box is plugged into   * Power cycling the router that the Solaris box is plugged into The Solaris box appears to think it's still connected to the network. Resetting the Solaris box (init 6) will bring the shares back, but only until I attempt to write them again. **I tried netstat -rn** before and after the problem. Everything looks pretty normal. Below is "after":               Routing Table: IPv4     Destination           Gateway           Flags  Ref     Use     Interface      -------------------- -------------------- ----- ----- ---------- ---------      default              10.1.10.1            UG       27        456 skge0          10.1.10.0            10.1.10.254          U         6    2536350 skge0          127.0.0.1            127.0.0.1            UH        2        252 lo0                 Routing Table: IPv6       Destination/Mask            Gateway                   Flags Ref   Use    If        --------------------------- --------------------------- ----- --- ------- -----      ::1                         ::1                         UH      2       4 lo0         "Before" has 27 instead of 17 in the "Ref" column for the 1st entry. "After" has slightly higher numbers for "Use" - probably normal. **I tried netstat -an** before and after the problem, too. This one may have more of a clue. There are a number of UDP connections that are present before the problem that all vanish. Before:               UDP: IPv4        Local Address        Remote Address      State     -------------------- -------------------- ----------         --truncated entries that are present in both before/after--     10.1.10.254.40504    10.1.10.1.53         Connected     10.1.10.254.39900    10.1.10.1.53         Connected     10.1.10.254.40129    10.1.10.1.53         Connected     10.1.10.254.37892    10.1.10.1.53         Connected     10.1.10.254.61658    10.1.10.1.53         Connected      After, those five entries are gone, but one new one is present:               UDP: IPv4        Local Address        Remote Address      State     -------------------- -------------------- ----------         --Again, truncated--     10.1.10.254.53920    10.1.10.1.53         Connected      I can't find any information about what port 53920 is used for. On the gateway side, port 53 appears to be used for DNS - not sure if this is a clue or not. **Doesn't seem terribly helpful** Down in the TCP portion, there are a whole bunch of entires that are "ESTABLISHED" _before_ that are either gone in _after_ or they've transitioned to either TIME_WAIT or FIN_WAIT_1. This seems to jive with what I already know. There's only one reference to IP of the computer that I used to crash the network: Before:               TCP: IPv4        Local Address        Remote Address    Swind Send-Q Rwind Recv-Q    State     -------------------- -------------------- ----- ------ ----- ------ -----------     10.1.10.254.445      10.1.10.132.53487    64512      0 128480      0 ESTABLISHED      After:               TCP: IPv4        Local Address        Remote Address    Swind Send-Q Rwind Recv-Q    State     -------------------- -------------------- ----- ------ ----- ------ -----------     10.1.10.254.445      10.1.10.132.53487    64256      0 128480      0 ESTABLISHED      The only difference is in the Swind (send window?) column. It's strange that the state is still listed as established. **I did the netstat -an experiment again** The only difference before and after, was related to the IP address of the PC I used to crash the share. Before:               TCP: IPv4        Local Address        Remote Address    Swind Send-Q Rwind Recv-Q    State     -------------------- -------------------- ----- ------ ----- ------ -----------     10.1.10.254.445      10.1.10.132.53613    380416      0 128480      0 ESTABLISHED      After:               10.1.10.254.445      10.1.10.132.53613    65280       0 128480      0 ESTABLISHED      Again, the only difference is in the Swind column - the number got smaller. **I've reached the end of what I know** about this kind of thing. netstat seems to be telling me what I already know. Short of buying another network card and just trying it, or reinstalling Solaris, I've got no idea. Can anybody clue me in as to the next step here? **Edit** I'm buying another network card and just trying it. It's going to take about a week to get here, so I'll keep poking at this in the meantime.


Change the default desktop manager on Scientific Linux

I am trying to boot into KDE from the login screen and failed and also changed the `/etc/sysconfig/desktop`                DESKTOP=”KDE”      DISPLAYMANAGER=”KDE”      Still Scientific Linux boots into Gnome.


PHP appears to be encountering segfault when using finfo_file method

I have encountered a strange bug. When trying to determine mime type of file using Fileinfo (http://www.php.net/manual/en/function.finfo-file.php) extension, PHP (or Apache? see below.) is appearing to be crashing. Code:               <?php     $finfo = finfo_open(FILEINFO_MIME_TYPE, null);     $info = finfo_file($finfo, "index.php");      When opening from web (through apache2), segfault is reported in error log:               [Wed Oct 23 14:32:25 2013] [notice] child pid 29084 exit signal Segmentation fault (11)      When executing from cli e.g. `php -q test.php`, output is okay.               php -v     PHP 5.5.4-pl0-gentoo (cli) (built: Oct 18 2013 19:11:02)     Copyright (c) 1997-2013 The PHP Group     Zend Engine v2.5.0, Copyright (c) 1998-2013 Zend Technologies         with Zend OPcache v7.0.3-dev, Copyright (c) 1999-2013, by Zend Technologies          /usr/sbin/apache2 -v     Server version: Apache/2.2.25 (Unix)     Server built:   Sep 20 2013 14:16:11      Any clues?


how to swap ctrl and capslock using xmodmap?

I know this xmodmap script can swap ctrl and capslock:               remove Lock = Caps_Lock     remove Control = Control_L     keysym Caps_Lock = Control_L     keysym Control_L = Caps_Lock     add Lock = Caps_Lock     add Control = Control_L      I don't quite understand it. So I tried this:               remove Lock = Caps_Lock     remove Control = Control_L     add Lock = Control_L     add Control = Caps_Lock      And this script doesn't work.   Could some explain this(why the 1st script works and the other one doesn't) in simple words?


I fail to fetch GPG keys over HKPS with "gpgkeys: HTTP fetch error 1: unsupported protocol" error

I'm trying to fetch some GPG keys over keys.gnupg.net and hkps.pool.sks- keyservers.net and both fails with:               gpg: requesting key 1F41B907 from hkps server hkps.pool.sks-keyservers.net     gpgkeys: HTTP fetch error 1: unsupported protocol      I'm using Debian testing. `gpg --version` yields `gpg (GnuPG) 1.4.16`


Why is swap used when a lot of memory is still free?

In the below 2.6.18 Linux Kernel (Red Hat) server, there is a lot of free memory, but I see some swap is used. I always thought of swap as an overflow when memory has been depleted. Why would it swap with about 7GB (50%) free memory? Swappiness is 60 (default). Meminfo output:               MemTotal:     16436132 kB     MemFree:       7507008 kB     Buffers:        534804 kB     Cached:        2642652 kB     SwapCached:      39084 kB     Active:        6001828 kB     Inactive:      2532028 kB     HighTotal:           0 kB     HighFree:            0 kB     LowTotal:     16436132 kB     LowFree:       7507008 kB     SwapTotal:     2097144 kB     SwapFree:      1990096 kB     Dirty:             236 kB     Writeback:           0 kB     AnonPages:     5353644 kB     Mapped:          45764 kB     Slab:           330660 kB     PageTables:      34020 kB     NFS_Unstable:        0 kB     Bounce:              0 kB     CommitLimit:  10315208 kB     Committed_AS: 14836360 kB     VmallocTotal: 34359738367 kB     VmallocUsed:    264660 kB     VmallocChunk: 34359472735 kB     HugePages_Total:     0     HugePages_Free:      0     HugePages_Rsvd:      0     Hugepagesize:     2048 kB


can I get the shell to decide ls or less depending on filetype?

Very often I find myself looking through directories using 'ls', then when I find the file I want, I use 'less' to look at the file.               So for example to find a mysql log file I might type     ls /var          then:     ls /var/log/          and then:     ls /var/log/mysql          and finally:     less /var/log/mysql/mysql.log      (its a bit of a contrived example, but hopefully you know what I am doing) I find it annoying that I need to decide if the command should be ls or less. Why can't 'less' determine if it has been given a directory and act as 'ls' ? Is there a command that I can use instead of less that will act as ls or less depending on the file type ? Or is there a common alias that people use ?


What is the meaning of "1-" in the output of ps?

This is the output of the command `ps -ef | grep java` on one of our machines.               jboss     1965  1935  1  2013 ?        04:41:05 java XXXXXXXXXXXXXXXXX       jboss     2170  2141  0  2013 ?        00:42:57 java XXXXXXXXXXXXXXXXX     jboss     2708  2679  7  2013 ?        1-04:38:51 java XXXXXXXXXXXXXXXXX     tomcat    6845     1  1  2013 ?        03:28:03 XXXXXXXXXXXXXXXXX     jboss    24651 24622  0  2013 ?        03:03:27 XXXXXXXXXXXXXXXXX     tomcat   32533     1  0  2013 ?        00:12:08 XXXXXXXXXXXXXXXXX      (XXXs added to hide the guilty!) What is the meaning of the `1-` on the third line?


Windows 7 guest fails to boot on Fedora 20 host

In `virt-manager` Windows boots (in safe mode) up to loading `classpnp.sys`. CPU usage then stays at 100%. In VirtualBox I get a blue-screen-of-death right after loading `classpnp.sys` and then it reboots. The image worked fine on Fedora 19. I checked Fedora 20 known bugs and Google but could not find anything. Any ideas?


XTerm not closing using -e option

I have an tcl script running in MWM and it starts xterm terminals with:                .menu.utils.m add command -label {Xterm} -command {             exec xterm -sb -T "Xterm" -sl 10000 -e su - int &       }      Doing this, the terminals can't be closed using Alt+F4 or the Menu bar. Is there a way to fix this?


Process overwrite access restriction

I want to run a program so that it can only **create new** files and not **overwrite** existing ones. Does something like this exist?               $ fsaccess --can read,write --not overwrite --command bash -c 'echo "stuff" > filetim; echo "Woohoo I did it"'      Now if filetim doesn't exist, then the command should run just fine, but if filetim did exist then fsaccess would exit with a message like               Killed child! Command tried to overwrite a file. It does not have permission to do that!


Why is it possible to leave CHROOT with this sftp config?

I'm trying to create the user lenny, that has read and write permissions in the folder `/home/lenny/` and has no shell but only access via SFTP. I'm doing the following:               useradd lenny     mkdir /home/lenny     usermod -d /home/lenny lenny     passwd lenny     chown lenny:lenny /home/lenny     chmod 755 /home/lenny     usermod -s /bin/false myuser      I then modified `/etc/ssh/sshd_config`:               Subsystem sftp internal-sftp`            Match User lenny     ChrootDirectory /home/lenny     ForceCommand internal-sftp      Now when I do `sftp lenny@server` I can leave the CHROOT easily by doing `cd /` and `ls -la`, I see everything! Why is that??? I don't get it, configuration should be okay, or am I wrong?


Is there a tool or method for magnifying existing PostScript or PDF files for printing - not just for display

Almost all my printing, including web pages and emails works fine and has done so for years, but ... When I print web pages and emails, I routinely run into a few that print in something like 1 point type and are unreadable. I usually print them to a file first anyway, so I have the generated PostScript or PDF files available (until I delete them after they're printed). For these cases, it doesn't seem to matter whether I print to a PostScript or PDF file or direct to the printer. I can select any of these options. When this happens, I have some workarounds like copying and pasting the original content into LibreOffice writer or into kate, but these don't always have the desired effect. Sometimes writer hangs completely and has to be killed and while using kate always works, the formatting can be ugly and, of course, all graphic elements are lost. Is there any tool/method which can magnify the print file for printing? I imagine ghostscript can do things like this, but I have no idea how to use it. Programs all seem to have zoom options that work on the display, but have no effect on what prints. This is a generic question, but I will detail my system particulars in case it makes a difference. kubuntu precise (12.04) 64-bit on a notebook   Firefox 25.0.1   Thunderbird 24.1.1   HP LaserJet 1020 and HP LaserJet p1006


Where to install mininet

I read some posts and parts of FHS to understand which directory I should install packages in. As far as I could understand `/opt` is for independent packages and `/usr/local` is for packages that are not maintained by distro repo's. I want to install a network emulator called "mininet" on my Debian wheezy, so that all users can use it. It has an install.sh script which installs both types of packages: maintained by repo & not maintained by repo. As the first step of the installation I can indicate where I want my base directory to be. Now my question is which directory I should indicate as the base directory? should it be: "`/usr/local`", "`/usr/local/mininet`", "`/usr/local/bin`", "`/usr/local/bin/mininet`", "`/opt`" or some other directory? I would appreciate if you could explain your answer too Thank you. EDIT: Should I specify the name of the package in the path like we do when installing in `/opt` (e.g. `/usr/local/mininet/`) or I shouldn't?


What's the purpose of `rm -P`?

I was reading the man page for `rm` when I came across this option:               -P    Overwrite regular files before deleting them.  Files are overwritten            three times, first with the byte pattern 0xff, then 0x00, and            then 0xff again, before they are deleted.      I guess `-P` is meant for thoroughly deleting a file, but wouldn't setting all the bytes to `0xff` or `0x00` be enough? Why does it have to toggle between the two three times?


How to handle binary data in Linux

One of the my servers gives me data with `Content-Type: application/binary`, i.e data that I am getting looks like some alien data. Now I need to convert that data into plain data, but I am not aware of any way to do that. I am trying to do this using the command line. After googling, I found one way: I need to delete the first 10 char and last 8 char from my data and then use `gunzip` with that. Then I will get the original data. But when I try to delete those characters, as it is binary output, it cuts more than that or less than 10+8 characters. Actually `echo` is not able to print the data properly. So, please, does anyone know how to handle binary data?


How to check/test .tar.bz archives?

I've been using tar with its "--use-compress-prog=pbzip2" function to archive my files then compress them with pbzip2 to get an "*.tar.bz" archive. Afterwards I checked the resulting file with pbzip2's "-t" switch, and it passed the test. However, to great surprise, I got "file incomplete" or other integrity errors when trying to extract the archive! Is it because there might be something wrong with the tar file, but not when it was compressed by pbzip2? If so, is there a way to check the tar file itself? If not, what other problem might this be? Also, are there ways to recover data from tar files with errors? I am afraid I might have already lost some important data through this process... The point is, I would like to know a method to test the integrity of my archives after they are created.