What is the difference between 32-bit PAE and 64-bit kernels?

I ask this only in regards to memory addressing. I know that a PAE kernel allows the OS to access more memory than a standard 32-bit kernel, however, what are the other implications? What specific differences are there between a 64-bit kernel and a 32-bit PAE kernel? According to Wikipedia, a processes address space remains at 32-bits, meaning it can only access a maximum of 4GB of memory. The OS however can access a 64GB address space, allocating 4GB chunks to processes. To me it seems like this is a big distinction that seems to be ignored by many people.


Where is the dhclient.conf under Fedora 14?

I wanted to put this in the dhclient.conf file: supersede domain-name "foo.org foo2.org"; but there is no dhclient.conf file...where is it? (Fedora14/GNOME)


Change font color and shadow from titlebar in window manager

I'm trying Linux Mint Debian Edition XFCE, and want to use a specific theme; only drawback - the font color and font shadow are unreadable, how can I change them? Also the active/inactive color window separation is very hard to distinguish. I added a screenshot for demonstration. ![enter image description here](http://i.stack.imgur.com/XkCek.png) (seems that stackexchange doesn't zooms in the image when clicking, so you have to use the "right-click>view image" option, I apologize)


How to install/upgrade svn on SLE?

My SUSE (SUSE Linux Enterprise Server 11 (x86_64)) got installed old svn. I want to upgrade it but if I download package for Packages for SLE 11 and try to install it `via zypper install subversion-1.7.5-83.1.x86_64.rpm` I get               Problem: nothing provides libserf-1.so.0 needed by subversion-1.7.5-83.1.i586      Solution 1: do not ask to install a solvable providing subversion = 0:1.7.5-83.1      Solution 2: break subversion by ignoring some of its dependencies      Is it ok to choose either 1 or 2 or cancel installation process and do it different way?


Safely uninstall a package in Gentoo

I wanted to uninstall a specific package in Gentoo and browsed through the emerge man page. I found the `\--unmerge` option: > **WARNING: This action can remove important packages!** Removes all matching > packages. This does no checking of dependencies, so it may remove packages > necessary for the proper operation of your system.Its arguments can be atoms > or ebuilds. For a dependency aware version of **--unmerge** , use > **--depclean** or **--prune**. However, I'd like emerge to check whether the package I want to uninstall is required by any other installed package in the system. `\--depclean` and `\--prune` don't provide that functionality:   * `\--depclean` removes packages that were installed as dependencies, but are not needed anymore   * `\--prune` "removes all but the highest installed version of a package from your system" Is there no dependency-checking version of `\--unmerge`?


ed: set first line as the default current line

I am trying to use `ed` to edit the first line of a large file, but I have to wait for `ed` to read all lines. Is there any way I could stop `ed` from reading the whole file and start editing immediately, with the current line being the first line?


Can git configuration be set across multiple repositories?

Git seems to support configuration values at three levels:   * Per-system global settings (stored in `/etc/git-core`)   * Per-user global settings (stored in `~/.gitconfig`)   * Per-repository local settings (stored in `$REPO/.git/config`) These options cover most of the basis but I'm looking for a way to handle a fourth level. I have a (very) large collection of repositories for which I need to use a different value for `user.email` than my usual. These repositories are often created and manipulated through automated scripts, and setting up per repository local settings is cumbersome. All of the repositories in question are located under a certain path prefix on my local system. Is there a way to set a configuration value somewhere that will be inherited by all repositories under that path? (Sort of like `.htaccess` settings inherit all the way up the file system.) Perhaps there would be a way to set conditional values in the global config file? What other arrangements could be made in a UNIX environment to cope with a set of repositories like mine?


Unix & Linux pranks

Which harmless pranks do you know that would be great to play on your collegues?


Adding KDE to Ubuntu

I seem to have installed KDE on Ubuntu 13.04 desktop, by issuing `sudo apt-get install kompare`. The reason was rather esoteric - I wanted to use the Kompare utility, that's all. My Ubuntu is otherwise using the Ubuntu default Unity desktop framework. Have I just destabilized my desktop? Can I safely revert this installation?


Ripping DVD in Debian Wheezy

I need to rip a DVD, to watch it later on a tablet or laptop. How can I do it? I would like to use a tool from the standard repositories. So far I tried only `k3b`, but it crashed.


How does yum work?

After I installed Fedora 20 on my new computer, I could not use 'yum install' because I just got a long string of error messages. I first posted this question on this site: "How can I get yum and the internet browser to work after fresh Fedora 20 installation" which gives the full details of the errors I got early on. After nearly six weeks of frustration I finally found the answer in:               http://qandasys.info/fedora-19-unable-to-update-or-install-could-not-resolve-host/          Answer by Stramash November 4, 2013 at 2:24 pm          Resolved this by adding nameserver 8.8.8.8 above my router’s address in resolv.conf that was obtained by DHCP.      I had also asked, here: "I have to do this edit every time I log on, and I would like to make it permanent." and soon found an answer in: https://lists.fedoraproject.org/pipermail/users/2011-August/403189.html So I did this edit: vi /etc/sysconfig/network-scripts/ifcfg-p20p1 changing the line: `PEERDNS=yes` to `PEERDNS=no` Although this all works, I am not sure why. What I would, please, like is to read a detailed description of what yum does to locate an installation package, the files associated with this process, and how they can be modified or configured if necessary, for instance as a flow chart or list.


make terminal real transparent

I want to make terminal transparent.To do this I have to select option Transparent background and move the slider under Background tab from the menu - Edit -> Profile Preferences. It becomes transparent but only the desktop wallpaper is shown in the background. But I want to see actual open applications or windows on the background. How do I do this? I'm using Linux `[CentOS]` machine ![My Desktop][1] ![after making changes in terminal ][2]


Can't do anything on startup until terminating Kate in Kubuntu

When my Kubuntu starts i can't do anything until starting System Activity and killing Kate. I can not start any program or for example run Dolphin file manager. After terminating Kate a message is shown: ![enter image description here](http://i.stack.imgur.com/Ys45p.png) Afterwards everything is OK. How may i solve this problem?


How do I stop the "Green double-underlined links pop-up ads" adware in Chromium?

**Summary:** In the Chromium web browser (Debian), can you tell me how get rid of whatever is causing the behaviour called "Green Double-Underlined Links pop-up ads"? I'd like to **stop** the behaviour, not just block it with some kind of blocker. How can I prevent my laptop from being affected by this problem in the future? The problem is awful, and is really getting on my wick. (Not your fault of course). :-) In the meantime, is is safe for me to continue to use my computer, and to use the Internet? Thanks. **Full details:**   1. About a week ago (starting about 12Aug14) I started getting green double- underlined links appearing under numerous words and phrases in web page text. Also, at the same time, intrusive adverts started appearing everywhere, on web pages. These aren't the usual ads on web pages but are new and extremely intrusive. The green double-underlined links are also very intrusive and misleading.  I could tell that something new was going on.   2. The site http://malwaretips.com/blogs/green-double-underlined-ads-removal/ says that on Windows, the above problem is caused by ADWARE, and tells you how to remove it from Windows, but NOT from Linux. However, the site IS informative about what the adware is, and how it gets onto Windows.    3. I don't know if the double-underline problem etc is caused in Linux in the same way as Windows, but I followed 2 of the principles in the above removal guide:  a) Checked for any new Chromium plugins that I don't think should be there. I did this by opening a new tab and entering "chrome://plugins". I've got 9 plugins BUT NONE OF THEM SEEM TO BE NEW. b) Looked at what packages I've recently installed, to see if they look as though they might have secretly installed this adware at the same time. The 4 lines from the output below are my recently installed packages. I used the following command to list them:              cat /var/log/dpkg.log | grep "\ install\ "        014-08-03 21:17:12 install mencoder:i386 <none> 2:1.0~rc4.dfsg1+svn34540-1+b2       2014-08-05 20:01:42 install libgpac2:i386 <none> 0.5.0~dfsg0-1       2014-08-05 20:01:43 install gpac-modules-base:i386 <none> 0.5.0~dfsg0-1       2014-08-05 20:01:44 install gpac:i386 <none> 0.5.0~dfsg0-1        I DON'T ACTUALLY KNOW IF ANY OF THESE PACKAGES COULD HAVE ADDITIONALLY INSTALLED THE ADWARE, _IF_ that's how the problem occurs in Linux.   4. I've got just one Chromium extension, which is Adblock Plus v1.7.4, which has been there for some time.   5. Excuse my noddy wording, but I'm wondering if the double-underline etc behaviour is being caused by a program on the Internet (remote from my laptop), and not actually a program that's on my hard drive.   6. I would be very grateful if you could tell me how to stop this awful problem.


Permisions overwritten when files are transfered via FTP. What to do?

Got my web server up and running using apache2 with the ability to ftp to `/var/www` folder. However, if I make an update to `.html` and copied over the file via ftp, the file's permisions become more restrictive such that apache produces an error to the web client that file is not readable because of insufficient permision (or something to that effect). I then have to `ssh` in and modify the permisions to the associated files (`sudo chmod 755 *`) while in `/var/www`. **Is there an easier to do this?**


command to find processor speed on zlinux machine

I have the following system :               $ uname -a     Linux <machine-name-snip> 2.6.18-92.el5 #1 SMP Tue Apr 29 13:16:58 EDT 2008 s390x s390x s390x GNU/Linux          $ cat /etc/redhat-release     Red Hat Enterprise Linux Server release 5.2 (Tikanga)      I need to find the cpu frequency, after a little bit of reading and referring to a links I tried                cat /proc/cpuinfo      vendor_id       : IBM/S390      # processors    : 2      bogomips per cpu: 6396.31      features        : <some features>      processor 0: version = FF,  identification = <some id>,  machine = 2827      processor 1: version = FF,  identification = <some other id>,  machine = 2827      now I am not sure how to convert this bogomips per cpu into the cpu speed. I have already referred to this link, but I am not sure how I should convert the bogomips to cpu speed.               /sys/devices/system/cpu/cpu0/ -- > does not return cpu frequency for me to use this in order to get a response      Edit 1: I have tried all the answers mentioned below in most of cases either the command is not found, or the output does not contain any information regarding the cpu frequency. I am guessing there must be something wrong with the installation of the machine as a lot of the below mentioned commands are not found.


Where is the virtual memory stored on hard drive?

If a process wants to access a memory address that is not in physical memory, the OS outsources a page frame from physical memory to the hard drive for later use. Where on the hard drive is this data / instruction stored? Is it stored on the swap partition?


What is ALSA in the Linux kernel?

What is ALSA? I read the Wikipedia page but couldn't understand it. All I understand is that it is a module in the kernel that has something to do with sound. What happens if you don't include it in the kernel, does it mean that the speakers won't work or something. I am asking because I am trying to install a version of Linux but I don't know if the kernel should include ALSA


Need suggestions to choose distro for Samsung Notebook 3

I am using Samsung Notebook Series 3 Laptop, Which has the following configuration. Model:NP305E5Z-S01N RAM : 4gb Processor : AMD A4 1.96ghz Detailed specification here http://configlist.com/samsung-np305e5z-s01in- specification-amd-a4-1-gb-graphics/ In which i want to install any Linux distro desktop version, I have tried installing Ubuntu which stucks on installation. Anyone tried out any distro on this model which runs successfully?


Need to Break RAID 1 on Linux Server

On one of our server Hardware RAID1(mirroring) is configured. Now we need to break the RAID1 and simply use the other Hard disk separated from RAID to extend the LVM on that server. Can some one tell me what will be outcome of this action. Because I have not done this before although this is test server but still I want to be careful. If needed extra information I will add to Question. df -h output               Filesystem            Size  Used Avail Use% Mounted on     /dev/mapper/ddf1_array0p2                            48G  3.4G   42G   8% /     /dev/mapper/VolGroup00-LogVol00                            49G  4.2G   42G  10% /home     /dev/mapper/VolGroup00-LogVol01                           190G  122G   58G  68% /u001     /dev/mapper/ddf1_array0p1                            99M   12M   82M  13% /boot     tmpfs                 2.0G     0  2.0G   0% /dev/shm     /dev/sdc1             230G  173G   46G  80% /mnt      We will add extra space to LVM LogVol01


Cannot type accented capital letters in kde-konsole

If i try to type a capital letter with accent (e.g. `Ř`) in kde-konsole, I get the following result: `ˇR` - the letter and the accent as two characters. The normal behaviour is that after pressing `ˇ` character, it is not output immediately but another character is expected. In the konsole tho, the character is output immediately. In other applications, it works fine. I am using gnome and in it the kde-console application. Any directions how to solve this?


SELinux: Can I disable copying of certain files?

Please excuse me if this is too basic and you're tempted to throw an RTFM at me. I want to prevent users from copying certain files while granting them read access to the same files. I thought this was impossible until I came across this example in the SELinux Wiki:                allow firefox_t user_home_t : file { read write };      So I was thinking, is it possible to give the files in question a mode of 0700 for instance, and use SELinux to grant read access only to the application that the users will normally be using to read the files? Again, I'm sorry if this is too basic, it's just that I'm on a tight schedule and I want to give an answer to my boss one way or the other (if it's possible or not) as soon as possible and I know nothing about SELinux so I'm afraid reading on my own to determine whether it's possible or not would take me too much time. Please note that I'm not averse to reading _per se_ and would hugely appreciate pointers to the relevant documentation if it exists. So basically, my question is, is there a way to do this in SELinux or am I wasting my time pursuing such an alternative? P.S. I'm aware that granting read access can allow users who are really intent on copying the files to copy and paste them from within the application they'll read them with; I'm just looking for a first line of defense. * * * **EDIT** To better explain my use case:   * The files in question are a mixture of text and binaries.    * They need to be read by proprietary commercial software: they are simulation models for an electronics simulation software.   * These models are themselves proprietary and we don't want the users simulating with them leaking them out for unauthorized use.    * The software only needs to read the models and run a few scripts from these files; it will not write their contents anywhere.   * In short, I want only the simulation software to have read and execute access to these files while preventing read access for the users.


Booting Linux minimally

I am trying to boot just linux itself. It's mostly for the learning experience. I got a small HDD with _only one ext4 partition_ looking like this:               /bin/bash                  /dev/console     /boot/vmlinuz              /boot/grub/grub.cfg     /boot/grub/i386-pc/*.mod      `bash` is version 3.0 statically linked, `vmlinuz` is version 3.16.2, and `grub` is version 2.00rc1. `grub.cfg` looks like this:               insmod linux     insmod search      insmod ext2     insmod part_msdos     set timeout=5          menuentry 'Linux' {         set the_root_uuid=a0225737-71c9-4d60-81e2-275dc078c3c1         search --fs-uuid $the_root_uuid --set=root         linux /boot/vmlinuz root=$root ro init=/bin/bash     }      when booting I get the following:               kernel panic: VFS could not open device root (hd0,msdos1), or unknown block(0,0) error -6      _What am I missing?_


How does -exec actually work

I am confused on the `-exec` command. E.g. in this case: `find . -type f -name "*.c" -exec cat {} \;>all_c_files.txt` It seems that I get `cat file1 file2 file3 ... fileN` While in this case: `find . -type f -name "*.txt" -exec cp {} OLD \;` I get:               `cp file1 OLD`       `cp file2 OLD`       `cp file3 OLD`       ...       `cp fileN OLD`        Similar case e.g. in: `find . -type f -name "*.txt" -exec printf "Text file: %s\n" {} \;` Seems to do:               printf "Text file: file1"       printf "Text file: file2"       printf "Text file: file3"       ...       printf "Text file: fileN"        So how does `exec` work? I mean am I right that it behaves differently in these example?


PulseAudio: Sound works after first pacat call

I've got a strange problem with PulseAudio and a gstreamer python script (pygst). The script below works only if I execute a               cat /dev/urandom | pacat       before. I've absolutely no idea what can cause this. Anyone else? Script snippet:               self.pipeline = gst.Pipeline("RadioPipe")     self.player = gst.element_factory_make("playbin", "player")     self.pipeline.add(self.player)     pulse = gst.element_factory_make("pulsesink", "cardname0")     self.player.set_property("audio-sink", pulse)     self.player.set_property('uri', self.mp3stream)     self.pipeline.set_state(gst.STATE_PLAYING)      System:               pi@raspberrypi ~ $ uname -a     Linux raspberrypi 3.6.11+ #538 PREEMPT Fri Aug 30 20:42:08 BST 2013 armv6l GNU/Linux           pi@raspberrypi ~ $ dpkg -l | egrep "pulse|alsa" | awk '{ print $2 " - " $3}'     alsa-base - 1.0.25+3~deb7u1     alsa-utils - 1.0.25-4     gstreamer0.10-alsa:armhf - 0.10.36-1.1     gstreamer0.10-pulseaudio:armhf - 0.10.31-3+nmu1     libpulse0:armhf - 2.0-6.1     pulseaudio - 2.0-6.1     pulseaudio-module-x11 - 2.0-6.1     pulseaudio-utils - 2.0-6.1


Understanding quotes in a bash conditional instruction

My friend is messing around with Bash scripts and he wanted me to take a look at them (he had another friend do it for him). One of the commands is               if [ "`pidof transmmission-gtk`"=0 ];      what exactly is the significance of the ``` (backquote) before the pidof, especially when it's itself wrapped within double quotes? For reference it's for the disper resolution package. I don't really use bash that much so that's why I ask.


the return built-in

According to the Open Group, > [t]he return utility shall cause the shell to stop executing the current > function or dot script. If the shell is not currently executing a function > or dot script, the results are unspecified. However, if you run the following snippet               func () {         ( return 1 )         return 0     }     func     echo $?      the output is `0` (I tried bash and dash, with the same result). So, it seems that `return` does not cause the shell to stop executing the current function, which would contradict the POSIX standard. Am I missing something?


How do I find out what action or command or script is assigned to a hardware button?

I'm trying to assign a correct rotation on my tablet. http://superuser.com/questions/340516/assigning-a-rotation-script-to-a- hardware-button One way to do this is using gnome keyboard shortcuts. However, there is an action that is already assigned to that button. I'd like to remove that action but I'm not sure how to change the key binding. When I add a key binding in gnome, it just adds another action to the button instead of replacing it.


Fluxbox, how to launch some applications in a specific workspace at startup

I would like to launch some applications at startup, but I want them to be in a specific workspace. I can edit the fluxbox startup-script to launch those applications, but I don't know how to specify in which workspace it must be launched.


Advertising local HTTP services via Avahi/Zeroconf on Debian

I have a Debian server on local network for home media center/NAS purposes. It is running multiple services such as Plex, or Ajenti, which I can access like so:               http://debian.local:32400/web for Plex     https://debian.local:8000/ for Ajenti      However I would like to access these services like so:               http://plex.local for Plex     https://ajenti.local for Ajenti      Is this possible to configure via avahi alone, or what other simple solution would you suggest?


controlling a process from a different session

So, I ssh into my remote computer and launch a process... time passes... my ssh session breaks. I log in again, and of course, I don't have access to the original process now. I can see it still if I `ps -ax` but I can't do nothing about it other than kill it. Which, sometimes, may not be advisable, such as when the original process is, say, vacuuming a sqlite3 database. So, can I get control of that process from a previous broken ssh session? If yes, how?


Why does sendmail work differently in different shells?

The following code works when I directly run it in `bash` shell:               SUBJECT="SUBJECT-"`date`;     MAIL_FROM="abc@site.com";     MAIL_TO="abc@site.com";     MAIL_CC="abc@site.com";     MAIL_FILE="/path/of/html/body.html";     (echo -e "Subject: $SUBJECT\nMIME-Version: 1.0\nFrom: $MAIL_FROM\nTo:$MAIL_TO\nCc:$MAIL_CC\nContent-Type: text/html\nContent-Disposition: inline\n\n";/bin/cat $MAIL_FILE) | /usr/sbin/sendmail -f  $MAIL_FROM $MAIL_TO;      But when I try to run it within a script like below... Contents of mail.sh:               #!/usr/bin/ksh          SUBJECT="SUBJECT-"`date`;     MAIL_FROM="abc@site.com";     MAIL_TO="abc@site.com";     MAIL_CC="abc@site.com";     MAIL_FILE="/path/of/html/body.html";     (echo -e "Subject: $SUBJECT\nMIME-Version: 1.0\nFrom: $MAIL_FROM\nTo:$MAIL_TO\nCc:$MAIL_CC\nContent-Type: text/html\nContent-Disposition: inline\n\n";/bin/cat $MAIL_FILE) | /usr/sbin/sendmail -f  $MAIL_FROM $MAIL_TO;      I get the following results... `$ sh mail.sh #Mail sent but the body is in text format containing "-e Subject: SUBJECT-Wed Jan 30 04:45:42 EST....."` and the HTML code rendered as text. `$ bash mail.sh # Mail is received with mail body containing correct HTML format.` So it seems that `echo -e` is recognized by bash. But when I use "#!/usr/bin/bash" and run the script as `$ sh mail.sh` I still get a mail in text format. Why is this so..? _Thanks in advance for your suggestions._


"Cannot find -lgdbm" when making xemacs in FreeBSD10

I have been trying to install xemacs 21.4.22 in FreeBSD10 x64. Once I run `./configure` and try to run `make` it gives me this error with `libgdm.so` library               [eddyraz@laptop-eddyraz] ~/proyectos/xemacs/xemacs-21.4.22% sudo make     Password:     cd ./lib-src && make   CC='cc' CFLAGS='-g -O3 -Wall -Wno-switch -Winline -Wmissing-prototypes -Wsign-compare -Wshadow -Wpointer-arith' LDFLAGS='' CPPFLAGS='' all     cc -g -O3 -Wall -Wno-switch -Winline -Wmissing-prototypes -Wsign-compare -Wshadow -Wpointer-arith -I. -I../src -I/usr/home/eddyraz/proyectos/xemacs/xemacs-21.4.22/lib-src -I/usr/home/eddyraz/proyectos/xemacs/xemacs-21.4.22/src  -DHAVE_CONFIG_H /usr/home/eddyraz/proyectos/xemacs/xemacs-21.4.22/lib-src/ellcc.c  -Xlinker -z -Xlinker nocombreloc -Xlinker -R/usr/local/lib -lgdbm -lncurses -lpq -lldap -llber -lm -lutil -lgcc -lc -lgcc /usr/lib/crtend.o /usr/lib/crtn.o -o ellcc     /usr/bin/ld: cannot find -lgdbm     cc: error: linker command failed with exit code 1 (use -v to see invocation)     *** Error code 1          Stop.     make[1]: stopped in /usr/home/eddyraz/proyectos/xemacs/xemacs-21.4.22/lib-src     *** Error code 1          Stop.     make: stopped in /usr/home/eddyraz/proyectos/xemacs/xemacs-21.4.22      I have checked in `/usr/local/lib` and found `libgdm`.               [eddyraz@laptop-eddyraz] ~/proyectos/xemacs/xemacs-21.4.22% cd /usr/local/lib     [eddyraz@laptop-eddyraz] /usr/local/lib% ls -l | grep libgdm     [eddyraz@laptop-eddyraz] /usr/local/lib% ls -l | grep libgdbm     -rw-r--r--   1 root  wheel     86310 17 jun 16:57 libgdbm.a     -rwxr-xr-x   1 root  wheel       971 17 jun 16:57 libgdbm.la     lrwxr-xr-x   1 root  wheel        12 17 jun 16:57 libgdbm.so -> libgdbm.so.4     -rwxr-xr-x   1 root  wheel     42032 17 jun 16:57 libgdbm.so.4     [eddyraz@laptop-eddyraz] /usr/local/lib%       Why does `make` error with `cannot find -lgdbm`?


Spaces as line breaks from inline for loop command

Someone care to enlighten me as to why the spaces in the first command seem to be interpreted as line breaks? Also occurs substituting print for echo.               $for l in $( find *.txt -exec head -1 {} \; ); echo $l;                    9.16.11     09:20     9.19.11     18.41     9.21.11     07:15               $find *.txt -exec head -1 {} \;                    9.16.11                 09:20     9.19.11                 18.41     9.21.11                 07:15


How to prevent the Linux kernel from waking a secondary HDD from sleep

Is there a way to instruct the (Linux) kernel not to wake up a secondary hdd after a system sleep/wake-up cycle? I'm asking because in my laptop I have an SSD as a primary drive containing the system root and a secondary HDD where I keep a backup system and files I access sporadically. Since the laptop usually goes through many daily sleep/wake-up cycles (I mean Suspend to RAM, not hibernation) for many days, I would like to put the secondary HDD to sleep manually and instruct the kernel to keep it asleep across system sleep/wake-up cycles.


Disable glob qualifiers in zsh

Is there a way to disable glob qualifiers with zsh? It seems like a useful feature, but it gets in the way of normal parentheses. I use `ag` to search files, and `ag mymethod(param)` causes zsh to complain about `missing end of name`, and I'd rather not have to quote my arguments. Since I never really use glob qualifiers, I figured I'd just disable them, but my Googling hasn't turned up any results.


Remove icons in gnome application menu

How can you hide unwanted apps from the gnome app menu? I've installed alacarte/main menu, unticked the apps but they still appear. I've also checked in `/usr/share/applications` and viewed one the apps I don't want to appear and it says `NoDisplay=true` but still it shows.


Debian stable dual monitor problem

I installed Debian wheezy with XFCE 4.8 on my new laptop, updated the kernel to 3.13 from backports. When I connect the laptop to my monitor, I can see only a part of the screen on the monitor with a very low resolution. On my old laptop, I used to fix that using XFCE display settings or ARandR but now both don't detect the new monitor even though its obviously working. I didn't install any proprietary drivers. I don't have xorg.conf. Here is the output of xrandr:               xrandr: Failed to get size of gamma for output default     Screen 0: minimum 1920 x 1080, current 1920 x 1080, maximum 1920 x 1080     default connected 1920x1080+0+0 0mm x 0mm        1920x1080       0.0*       Here is the (hopefully) relevant output of lspci:               00:02.0 VGA compatible controller: Intel Corporation Haswell Integrated Graphics Controller (rev 06)     01:00.0 3D controller: NVIDIA Corporation Device 1292 (rev a1)


How would you assign read-only permissions to run ls -l /proc/{pid}/fd for processes you don't own

How would you assign read-only permissions to run               ls -l /proc/{PID}/fd       for PIDs (processes) you running as another user. Ideally, you wouldn't be able to do anything else and you would not have any additional privileges other than be able to read these paths for all other users on the machine -- I'm guessing this isn't possible unless you are root.


Keymaping for re-indent source code in Vim

I have key mapping in my _~/.vimrc_ file that re-indents edited source code on the fly. It looks like as follows:               " press F4 to fix indentation in whole file; overwrites marker 'q' position     noremap <F4> mqggVG=`qzz     inoremap <F4> <Esc>mqggVG=`qzza      Short explanation:               mq      place marker 'q' at cursor position     ggVG    select all text     =       re-indnet text     `q      return cursor back to position stored in 'q' marker     zz      center the display over the cursor     a       return to insert mode if called from it      It basically works, but has two shortcomings. The first one is that it overwrites the _q_ marker. I used this marker to store cursor position. I choose _q_ because it is very unlikely that I would use this letter as a marker. Despite this, is there any more clever approach to achieve this, without destroying _q_ marker? The second one occurs in the insert mode, when the cursor is on the beginning of a line. In such condition, `F4` re-indents as expected, but also moves cursor one position right. I tried to fix it by using `<C-o>` instead of `<Esc>`, but it looks like `<C-o>` is applicable only to editor _:commands_ , not to move commands. How can I fix it?


extract snapshot of git repository at a given time

I have cloned a xorg git repository:               git clone git://anonscm.debian.org/pkg-xorg/driver/xserver-xorg-video-intel      and I need to extract all files as they looked after commit 45c09bfe58c37bbf7965af25bdd4fa5c37c0908f I know how to extract one file of a specified version, i.e.               git show 45c09bfe58c37bbf7965af25bdd4fa5c37c0908f:src/intel_driver.h > intel_driver.h      but how can I extract the whole structure (all files) ?


Busybox exits instantly printing 'SIGUSR1'

I was tinkering with my router these days. It runs on MIPS core and the OS is based on Linux. But the builtin busybox is very limited. I managed to export a binary of busybox compiled for MIPS through telnet. After changing chmod to executable, when I try to run the binary with command './busybox-mips', it instantly prints 'SIGUSR1' on the terminal and terminates. What is wrong here? How can I successfully run this new Busybox binary?


Why isn't "REISUB" working on Debian?

I'm using Debian 'Jessie'. Sometimes my computer freezes, and then I can't use `Ctrl`+`Alt`+`Supr` to reboot, `Ctrl`+`Alt`+`Backspace` to kill the X Window System nor `Ctrl`+`Alt`+`F1` to open a new shell. I've read in several sites that in a computer freeze you can use the basic kernel commands that are used pressing `Alt`+`Sysreq` (holding `Alt`+`Sysreq` and pressing REISUB one key) But in my computer that 'trick' isn't working when it's frozen. Has the kernel frozen as well? I heard that one of the best things of Linux was that you never had to turn off the computer by holding the power button, but It's not being true for me :/


How do I edit a file and preserve its access control list / SELinux security context?

I'm on CentOS 6.2, and have a file with the _alternate access method_ character displayed as a dot.               ls -l myfile     -rwxr-x---. 1 me mygroup   172 Aug 13 10:03 myfile               ^                This dot.      From the help displayed for ls with _info coreutils 'ls invocation'_               Following the file mode bits is a single character that specifies     whether an alternate access method such as an access control list     applies to the file.  When the character following the file mode     bits is a space, there is no alternate access method.  When it is     a printing character, then there is such a method.          GNU `ls' uses a `.' character to indicate a file with an SELinux     security context, but no other alternate access method.          A file with any other combination of alternate access methods is     marked with a `+' character.      So this file has some _SELinux security context_ assigned to it. Using _getfacl_ and _getfattr_ those commands show:               getfacl myfile     # file: myfile     # owner: me     # group: mygroup     user::rwx     group::r-x     other::---          getfattr -m - myfile     # file: myfile     security.selinux          getfattr -n security.selinux myfile     # file: myfile     security.selinux="unconfined_u:object_r:usr_t:s0"      I've backed up the original file with:               cp --preserve=all myfile myfile.ORIG      And then edited the original:               vi myfile     :wq      Which blows away whatever context it had:               ls -l myfile     -rwxr-x---  1 me mygroup   172 Aug 13 10:06 myfile               ^                The dot is gone.          getfattr -n security.selinux myfile     myfile: security.selinux: No such attribute          getfacl myfile     # file: myfile     # owner: me     # group: mygroup     user::rwx     group::r-x     other::---      What's the recommended process for editing this file and preserving its extended attributes and alternate access method setting?


Why can't tr read from /dev/urandom on OSX?

A colleague suggested creating a random key via the following command:               tr -dc A-Za-z0-9_\!\@\#\$\%\^\&\*\(\)-+= < /dev/urandom | head -c 32 | xargs      It gave me the error: > tr: Illegal byte sequence I'm concerned that I do not have `/dev/urandom` on my system. I tried googling to figure out how to install this file, but I have come up empty. I tried `locate urandom` and also came up empty. (well actually, it found the man page, but that doesn't help) How do I make `urandom` available on my Mac OSX system? (Lion)


How can I extract the numbers in the file using sed or any other tool?

I have a file that has this format > [ 2014/05/01 10:48:26 | 13963 | DEBUG ] It took 11.16837501525879 seconds to > complete the process So I have thousands of lines like this and I would like to "extract" the `11.16837501525879` part   I tried:                sed -e 's/^.* (\d+\.\d*)/\1/g' logfile.txt > out.txt        but I get:               sed: -e expression #1, char 21: invalid reference \1 on `s' command's RHS        What can I do here?


Sort input file by the results of a regex

I'd like to sort a file based on the results of a regex expression. For example, if I have the following property declarations in Obj-C               @property (nonatomic, strong) id <AlbumArtDelegate, UITextFieldDelegate> *albumArtView; // 1     @property (nonatomic, strong, readonly) UIImageView *profileView;  // 2     @property (nonatomic, strong, readwrite) UIButton *postFB;          // 3     @property (nonatomic, assign) UIButton *saveButton;      // 4      By default they will sort in order [4, 1, 2, 3], but I would like to sort them in order of the actual property names, [1, 3, 2, 4]. I can write a regular expression to tease out just the property name, is it possible for me to sort by the results of that expression? Is there any built-in Unix tool that will do this for me? I'm working in Xcode, so VIM/emacs solutions won't help. Also, the reason I'd like to do this using a regex is so that I can expand my sorting algorithm to work in other situations. Use it to sort method declarations, import statements, etc.


is star faster than GNU and BSD tar?

I made serveral runs (create a tarball) on OS X Mavericks with BSD tar, GNU tar and star. star is always the winner. System is iMac (Mid 2010) only running Terminal.               root@time var> du -sh log/     164M    log/     root@time var> du -sk log/     167624  log/     root@time var> time gtar cf gnutar_test.tar log/          real    0m1.806s     user    0m0.013s     sys 0m0.231s     root@time var> time star cf star_test.tar log/     star: 16726 blocks + 0 bytes (total of 171274240 bytes = 167260.00k).          real    0m1.729s     user    0m0.012s     sys 0m0.249s     root@time var> time tar cf bsdtar_test.tar log/          real    0m2.595s     user    0m0.019s     sys 0m0.277s     root@time var> uname -a     Darwin time.home 13.1.0 Darwin Kernel Version 13.1.0: Thu Jan 16 19:40:37 PST 2014; root:xnu-2422.90.20~2/RELEASE_X86_64 x86_64      I heard from star (from RHEL book), because he supports SELinux and extended ACL attributes. It seems that star is also faster. What are your results? Is star really faster?


What is the difference/relation between kernel name and OS name? Are they always the same thing? For example, I am puzzled at the outputs:               -bash-4.1$ uname -s     Linux     -bash-4.1$ uname -o     GNU/Linux      What is difference between "GNU/Linux" and "Linux"?


Linux EXT 4: How to list files that occupy a block group? I believe a file can span multiple block groups. Given a block group, how do i enumerate the paths of all files contained in it?


How to grep including single quote in a file

I have this line from `file.php`:               'user' => '',      What would be the appropriate command using grep to query the exact line?


Remove prefix from subject header in index view

I subscribed to several mailing lists that prefix the `Subject:` header with a fixed string like `[list-foo]`. This clutters my index view and limits the usable space. I'd like to strip this `[list-foo]` header from the index view. What's the best way to achieve that? Maybe a regular expression can be hooked into the `index_format` setting? I don't necessarily need to strip the prefix permanently, it's sufficient to not display it in the index. It may still show up in the pager and be included in responses. I know that Claws-Mail has a function that does exactly this. It's called _Simplify Subject RegExp_. If this is not possible using mutt I guess one option would be to permanently change the headers using a mail filter like maildrop (which I use for sorting, though not for header manipulation). Feel free to also add a solution that uses maildrop to strip the prefix from the headers.


Recursive scp without following links or creating a giant tar file?

So I did a recursive scp on my remote fileserver (in another state) and it created an infinite loop of links on my remote web directory... http://www.linuxquestions.org/questions/linux-general-1/recursive-scp-w-o- following-links-658857/ says that I can can try creating a giant tar file. There is a problem with this though - I'm running the recursive scp on a Linux machine in my office, and I'm copying the files all to my external hard drive, which is in FAT32 format (because I need something that's readable by both UNIX and Windows). FAT32 doesn't support large filesizes. So I would have to try something different. There's also a rsync option but the Linux machine in my office is very primitive (it's igel) so it doesn't have rsync...


How do I batch-export all the content contained in symbolic links? (and then delete them all)

So as an alternative to Recursive scp without following links or creating a giant tar file? (this could be an emergency since the remote files could be deleted any time soon), I'm thinking of deleting all my symbolic links. But then I would like to batch-export them all somewhere so that I can restore them once I'm done with the scp file copying.


CDC ACM doesn't working in a custom linux kernel

I've a cubieboard2 running arch linux with a custom linux kernel. In the cubieboard2 I plugged in my usb-serial device (like an arduino), the device is recognized as CDC ACM. My linux kernel has the CDC options enabled in the configuration, as I saw in this page, but, I can't use the serial port `/dev/ttyACM0` using the applications `minicom` or `pyserial`. Minicom just says that it can't open the serial port. Pyserial is able to open the port, but when I try reading it the result is: > SerialException: device reports readiness to read but returned no data > (device disconnected or multiple access on port?) Yet in `pyserial` if I try to write a byte the result is other: > SerialException: write failed: [Errno 5] Input/output error. Other weird things happen when I close the serial port, it changes its name, in other words, when I close the `/dev/ttyACM0` it changes to `/dev/ttyACM1`. I've tried my device in my laptop and it works fine with both, `pyserial` and `minicom`. cubieboard2 info:               $ uname -a     Linux alarm 3.4.61-rt77-ARCH+ #10 SMP PREEMPT RT Thu Apr 17 13:58:20 BRT 2014 armv7l GNU/Linux      my kernel config file: http://pastebin.com/raw.php?i=6LfsRyek My guess is that it's missing having some kernel option enabled, but I don't know which. Any idea?


Idle terminal safe character

I'm using iTerm2 on a Mac to do Linux work. In order to avoid losing terminal connections, I turned on "When idle, sent Ascii code". The default is 0. This works like a charm to keep connections alive, but there is a serious problem. This turns out to be sending ^@ to the terminal, which is OK most of the time, but in `vi` it will insert recently entered text. What can I send that's safe?


How do back-references match in sed?

I found a one-line `sed` command on this site which removes duplicate entries in `$PATH`. There is one concept that I can't get my mind around. It uses saved matches in the match section to detect the duplicate, and then replaces the match with `\1\2`. In the example below, I can't understand why `\1` **is not always** `1111`. The test case obviously shows that the `\1` match progresses further down the pattern space, but I can't understand why. `sed` script (`sed_cmd`):               p  #debug     :b     s/[:;]\([^:;]*\)\([:;].*\)[;:]\1/;y\1yx\2x/p     s/[yx]//g   #debug remove the field indicators for the next pass     s/;/:/g     #debug     tb     s/^\([^:]*\)\(:.*\):\1/\1\2FixedFirst/     aDone      Test command + output:               echo "0000:1111:2222:3333:4444:1111:2222:3333:0000" | sed -f sed_cmd     0000:1111:2222:3333:4444:1111:2222:3333:0000     0000;y1111yx:2222:3333:4444x:2222:3333:0000     0000:1111;y2222yx:3333:4444x:3333:0000     0000:1111:2222;y3333yx:4444x:0000     0000:1111:2222:3333:4444FixedFirst     Done


Remote SSH Tunnel not working with certificates

I need reverse port forwarding via SSH to my server, such that on the server I can connect to a localhost port, which then is forwarded using the SSH tunnel to my local server. My local system is windows, remote system Linux. When opening the tunnel using plink with standard password authentication, it works pretty good:               >plink.exe -R *:62050:127.0.0.1:9000 username@host.com      Result on remote machine looks good and forwarding also works fine.               [user@host ~]$ netstat -an | grep 62050     tcp        0      0 127.0.0.1:62050             0.0.0.0:*                   LISTEN     tcp        0      0 ::1:62050                   :::*                        LISTEN      I however want to use that as a pre-debug command in my IDE to establish the tunnel, so I want to use my private key:               >plink.exe -R *:62050:127.0.0.1:9000 user@host.com -i C:\Users\abcdefg\.ssh\id_my.ppk      Connection also works great, I am not asked for a password and connection succeeds. However, there is no port opened:               [user@host ~]$ netstat -an | grep 62050      just returns an empty result. I can make the same observations when using the putty graphical interface. Remote tunnelling works like a charm using plain password auth, as soon as I am introducing a private key file, the connection is established, but the reverse tunnel is not. How can I solve this?


New user can't access their home

So I'm adding a new user on a machine to give a family member some remote storage. After setting up their login and home directory. Here's the stat                 File: `/home/heather'       Size: 4096        Blocks: 8          IO Block: 4096   directory     Device: 831h/2097d  Inode: 89128961    Links: 3     Access: (0755/drwxr-xr-x)  Uid: ( 1002/ heather)   Gid: ( 1004/ heather)     Access: 2014-09-09 17:57:37.059406231 -0400     Modify: 2014-09-09 17:37:32.449432887 -0400     Change: 2014-09-09 17:57:22.939336208 -0400      But they are not able to access it from either local or ssh               $ echo ~     /home/heather     $ cd ~     bash: cd: /home/heather: Permission denied      Unless I'm missing something big, the permissions seem fine. Please note I've only ever run single-user setups before, I can't find anything similar to this after a good 20 minutes of searching, please don't crucify me if I've overlooked something simple.


Cron: My crontabs don't seem to be doing anything at all

I think I'm missing something. I've set up some crontabs to handle rsyncs over ssh in my office to handle some backups, but they don't seem to be running OR logging, for that matter. Am I missing something? Here are my crontabs: `0 2 * * * idealm /usr/bin/local/rsync -avz --rsync-path=/usr/bin/rsync -e ssh /Ideal\ Machinery\ Database/* i@192.168.0.210:~/db_backup >> /home/idealm/Work/cron_log.txt` ^ from the Mac Mini Server to the SME Server `0 2 * * * i /usr/bin/rsync -avz --rsync-path=/usr/local/bin/rsync -e ssh /home/e-smith/files/ibays/drive-i/files/Warehouse\ Pics/Converted\ Warehouse\ Pictures/* idealm@192.168.0.194:/ideal_img >> /home/i/cron_log.txt` ^ from the SME Server to the Mac Mini Server `0 2 * * * i /usr/bin/rsync -rvz -e ssh /home/e-smith/files/ibays/drive-i/files/Warehouse\ Pics/* fm-backup@[remote server]:/home/fm-backup/img_all/ >> /home/i/cron_log.txt 0 2 * * * i /usr/bin/rsync -rvz -e ssh ~/db_backup/* fm-backup@[remote server]:~/db_backup/ >> /home/i/cron_log.txt` ^ From the SME Server to a remote server running Ubuntu 10.10 (where [remote server] is the censored address) The thing is, when I run these jobs from bash, everything works perfectly - cron just doesn't seem to be working. Any suggestions?


What to do to run GUI Java app in chrooted environment?

In my case Java app is JDownloader. I prepared chroot environment as explained here: http://www.0x61.com/forum/post5240333.html#p5240333 and here: http://interreality.org/~reed/java-chroot.html and here: http://www.elstel.com/openroot/ So, I have java installed, added group and user, JDownload files copied, but when I try to run it (as regular user under chroot; I run chroot as root, but once I am in chroot, I switch to chroot regular user): > java -Xmx512m -jar JDownloader.jar I got some positive messages like loading skins by JDownloader > 10 4/6/11 2:15:17 PM - FINER [jd.JDClassLoader()] -> Look and Feel JAR > loaded: /mnt/jd/libs/laf/syntheticaSilverMoon.jar but that's end of the story -- app does not show up. No matter if I use chroot to run chroot environment or openroot, the outcome is the same. When I run JDownload as chroot-root I got a little more output but at then end exception occurs: > 10 4/6/11 2:39:23 PM - FINER [jd.config.DatabaseConnector()] -> Loading > database > > 10 4/6/11 2:39:23 PM - FINER > [jd.config.DatabaseConnector(checkDatabaseHeader)] -> Checking database > > 10 4/6/11 2:39:23 PM - INFO [jd.Main(main)] -> init Splash > > ------------------------ Thread: 11 ----------------------- > > 11 4/6/11 2:39:25 PM - INFO > [jd.gui.swing.laf.LookAndFeelController(setUIManager)] -> Use Look & Feel: > de.javasoft.plaf.synthetica.SyntheticaSimple2DLookAndFeel > > 11 4/6/11 2:39:25 PM - SEVERE [jd.controlling.JDLogger(exception)] -> SEVERE > Exception occurred java.lang.reflect.InvocationTargetException > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) I have the same Jave installed in chroot and normal system, I can run the same JDownloader in normal system, no problems here. **QUESTION** -- what I am missing here? How to run GUI Java app? Thank you in advance.


Most efficient way to run 2 while loops

Currently I use two different `while` loops to start my window manager, dwm, and the status bar that prints system info to it. My solution at the moment is to run them consecutively in the same script, like so:               while true; do             $HOME/Scripts/dwm-status             sleep 2s         done &     while true; do         dwm >/dev/null     done      I have also seen it run as a nested `while` loop, like this:               while true; do             while true; do                 $HOME/Scripts/dwm-status                 sleep 2s             done &             dwm >/dev/null         done The second seems to cause CPU spikes. In terms of efficiency (least call on resources etc.,) what is the best approach to run these two loops and why?


Awk to output read file

I havent stepped into `awk` yet but it is on my plate for learning this coming year. I asked a previous question that led me to `awk` and it works. However, I am unsure how to input all file types and output the exact named file type in `awk`. Example:   * finds all `.xml` files   * locates `file.xml`   * does `awk` script   * saved out as `file.xml` I researched `awk` in bash and found this but I don't think it will solve the issue of the current awk code printing back out to an `.xml` file. For me to currently run the script I have to do `gawk -f file.sh < file.xml`. My goal would be to search for all `.xml` files, run code, and save in same location new `.xml` file. **EDIT: I was able to get it to output back to xml after a few more searches with this:**               gawk -f awk.sh < file.xml > file.xml


Connect to linux device without SSH

Is there any way to connect to a device without using SSH? I've broken the keyboard on my Nokia N900 and want to get access to it. It must be possible?


KDE theme manager in pure OpenBox WM?

I've setup a pure OpenBox system with no specific desktop environment like Gnome, KDE, or Xfce, etc... It works well, and I have been able to customise the desktop's appearance with software like ObConf (for OpenBox themes) and LXAppearance (for GTK themes). However, I have recently installed DigiKam which is a KDE application, and its GUI does not follow what I've setup for OpenBox and GTK. Question: How can I customise the theme in Digikam (and other KDE apps that I might use) in my system? Is there a standalone equivalent to ObConf and LXAppearance for KDE? Or is there another way to do it? Thanks.


With Irssi you can /rmreconns to abort timed-out conections. Is there a command to force it to reconnect *now*?

I have an IRC server running on my personal computer, and I use an ssh tunnel to connect to it from a more reliable box (i.e. one where my daughter can't reach the power button). Occasionally the power will be cut from my box, causing the connection to drop. Irssi tries to reconnect to that server after a specified period - alternatively I can `/rmreconns` to stop it from reconnecting, and then manually `/connect` again. When I run `/connect` it seems to connect to my server _twice_. Once with the manual connection, and once when it reconnects on its own. I find it really annoying to do `/rmreconns`, and then `/connect localhost port` Is there a command I can run to force it to reconnect **now**? I haven't been able to find one, but I may be looking in the wrong place.


General Linux support for IPv6 ready?

From an end user perspective, what needs to be, and have been done, by developers to support IPv6 in the Linux kernel and Linux distributions? In other words, when (and if) someday the worlds switches to IPv6, can I turn on my Linux machine and everything will just work? Has the development been done, and is there anything I should do as an end user to prepare for the transition? Thanks.


Fail2ban block with IPtables doesn't work on Debian Lenny. [moved ssh port]

I've recently decided to do some security maintenance. I saw my logs, and there were some tries against my SSH server. At first, I moved away the SSH port from the default 22. After it, I read something about Fail2ban, BlockHosts and DenyHosts. I took a look at the first: it is simple to configure, everything is understandable; but when I tried to "probe its protection", the **tests are failed**. Everything seems to be good, but I can still access the server. I also tested the IPtables: `# iptables -I INPUT -j DROP` - after that my SSH connection was lost (so, what I wanted). Then `# iptables -I INPUT -s 84.x.y.z -j DROP`, which worked too. But, what rules did the Fail2ban do, that doesn't work: (`$ sudo iptables -L`)               Chain INPUT (policy ACCEPT)     target     prot opt source               destination             fail2ban-apache  tcp  --  anywhere             anywhere            multiport dports www,https     fail2ban-ssh  tcp  --  anywhere             anywhere            multiport dports ssh     fail2ban-ssh-ddos  tcp  --  anywhere             anywhere            multiport dports ssh          Chain FORWARD (policy ACCEPT)     target     prot opt source               destination                  Chain OUTPUT (policy ACCEPT)     target     prot opt source               destination                  Chain fail2ban-apache (1 references)     target     prot opt source               destination             RETURN     all  --  anywhere             anywhere                      Chain fail2ban-ssh (1 references)     target     prot opt source               destination             DROP       all  --  84.x.y.z           anywhere                 RETURN     all  --  anywhere             anywhere                      Chain fail2ban-ssh-ddos (1 references)     target     prot opt source               destination             RETURN     all  --  anywhere             anywhere      Kernel modules loaded: (`$ lsmod | grep ip`)               iptable_nat             4680  0     nf_nat                 15576  1 iptable_nat     nf_conntrack_ipv4      12268  3 iptable_nat,nf_nat     nf_conntrack           55540  4 xt_state,iptable_nat,nf_nat,nf_conntrack_ipv4     xt_multiport            2816  2     iptable_filter          2624  1     ip_tables              10160  2 iptable_nat,iptable_filter     x_tables               13284  5 xt_state,xt_tcpudp,iptable_nat,xt_multiport,ip_tables     ipv6                  235396  24      Versions:   * Debian Lenny 5.06, kernel 2.6.26-2-686   * IPtables 1.4.2-6   * Fail2ban 0.8.3-2sid1   * `openssh-server` 1:5.1p1-5 Test #1 step by step:   1. Configure Fail2ban to low bantime. 60 secs. Then reload.   2. Attempt to login (with SSH), directly with wrong passwd.   3. For the 6th time enter the correct passwd (max tries is only 4 here). I logged in. I can also access the web page hosted by that server.   4. `iptables -L` shown me as its mentioned above. So the ban was active, when I connected, commanded my server. Test #2 step by step:   1. Stop Fail2ban. Create an `at` script, to remove the below wrote ban rule in the future. (`iptables -D INPUT 1`)   2. Create a ban rule: `iptables -I INPUT 1 -s 84.x.y.z -j DROP`   3. I couldn't type in anything else, the SSH connection is unuseable. I couldn't access the web page. So, what I wanted from iptables.   4. After the `at` script, I can access my server. I don't see the solution, what should I do to make my IPtables ban (made by Fail2ban) work?


at daemon creates empty tasks

I have problem with `atd` daemon. If `at` is called by non-root, it creates task, but it is empty (content of `/var/spool/atd`). I do not remember what I have done before it broke that way. What else information should I provide and what what should I try to do?


how do I wipe a server that I don't have physical access to?

I have a Godaddy dedicated server that I would like to cancel. Before I do that I'd like to do a clean format on the server to make sure that the next person who gets the server isn't able to undelete anything (I don't know how thorough Godaddy is when it comes to reformatting before giving the disk to someone else.) I of course don't have physical access to the machine, so whatever I do I'd have to do via ssh. I'm not really sure what I can actually do.


What's the difference between gunzip and unzip?

What is the difference between gunzip and unzip? Tried to search but couldn't find anything relevant with this.


EMC storage + powercf command + powerpath

When I run `powercf -q` on my Solaris machine, what changes does this command do on the EMC storage, or on Solaris file system? From manual page:                DESCRIPTION      During system boot on Solaris  hosts,  the  powercf  utility      configures  PowerPath  devices by scanning the HBAs for both      single-ported and multiported storage  system  logical  dev-      ices.  (A multiported logical device shows up on two or more      HBAs with the same storage system subsystem/device identity.      The  identity  comes  from the serial number for the logical      device.) For each storage system logical device found in the      scan  of  the HBAs, powercf creates a corresponding emcpower      device entry in the emcp.conf file, and it saves  a  primary      path and an alternate primary path to that device.


IPMI does not start up during kickstart-installation

I am in the process of further automating our system-installation on new servers. Main problem here is that the network-devices do not appear in the order we expect them (i.e. first onboard network card is sometimes eth2, eht3 or even eth4). This depends on the used hardware (in our case which Dell PowerEdge server model is used). I built a table with the mappings from model to network-card. This is important during kickstart-installation of our CentOS 5 servers, since I want to automate the setup of the network-cards (fixed IPs) during kickstart-installation. My idea was to install Dell-OMSA, and then query `omreport chassis info` to get the model. This works great after kickstart has completed, but fails during kickstart- install. I found and removed the following obstacles:   * During installation the very first CentOS 5.8-kernel is used, while the files that get installed already contain the newest patched kernel (way around: install the "old" kernel during installation, so the dell_rbu-driver is there)   * The **dell_rbu** kernel could not be loaded due to missing depmod. (way around: do depmod after the old kernel is installed) Now I traced down one remaing problem: For OMSA there needs to be a functioning IPMI interface. If I start up ipmi (`service ipmi start`) I get an error that **/dev/ipmi0** does not exist (after some impi-modules are loaded). Any idea what could be going wrong at this stage?


Setting a shell variable in a null coalescing fashion

I'm really fond of "null coalescing", where you can set a variable to the first "non-null" value in a list of things. Many languages support this, for example: **C#:**               String myStr = string1 ?? string2 ?? "default";      **JavaScript:**               var myStr = string1 || string2 || "default";      ...etc. I'm just curious if this can be done in Bash to set a variable? **pseudo:**               MY_STR=$ENV{VAR_NAME}??$ANOTHER_VAR??"default";


New terminator window on remote server

Is there a way to open a new terminator pane on a remote server when connected by ssh? I am looking for something similar to what can be done (according to this answer) by tmux but using terminator instead. I want to ssh to a remote machine using and then if I split the terminator window, the new shell will open on the remote machine.


Solaris 11 randomly crashed

I have a Solaris 11 machine that randomly crashed this morning. After physically restarting the machine, I noticed that all of the drives were marked with a `Sense Key: Soft_Error` both in dmesg and in `/var/adm/messages`. Since all the drives on the machine were tagged with the same Soft Error, does this mean that the HBA is faulty? Anyone have any ideas/suggestions?               root@solaris-machine:/var/log# iostat -E     sd0       Soft Errors: 1 Hard Errors: 0 Transport Errors: 0     Vendor: ATA      Product:       Revision: SN02 Serial No:      Size: 500.11GB <500107862016 bytes>     Media Error: 0 Device Not Ready: 0 No Device: 0 Recoverable: 1     Illegal Request: 12 Predictive Failure Analysis: 0     sd2       Soft Errors: 1 Hard Errors: 0 Transport Errors: 0      Vendor: ATA      Product:      Revision: 0004 Serial No:       Size: 3000.59GB <3000592982016 bytes>     Media Error: 0 Device Not Ready: 0 No Device: 0 Recoverable: 1     Illegal Request: 0 Predictive Failure Analysis: 0      sd4       Soft Errors: 1 Hard Errors: 0 Transport Errors: 0     Vendor: ATA      Product:      Revision: 0004 Serial No:      Size: 3000.59GB <3000592982016 bytes>     Media Error: 0 Device Not Ready: 0 No Device: 0 Recoverable: 1      Illegal Request: 0 Predictive Failure Analysis: 0      sd5       Soft Errors: 1 Hard Errors: 0 Transport Errors: 0      Vendor: ATA      Product:      Revision: 0004 Serial No:      Size: 3000.59GB <3000592982016 bytes>     Media Error: 0 Device Not Ready: 0 No Device: 0 Recoverable: 1      Illegal Request: 0 Predictive Failure Analysis: 0                         Jan 23 10:45:02 solaris-machine scsi: [ID 107833 kern.warning] WARNING: /scsi_vhci/disk@g5000c5004dfae642 (sd4):     Jan 23 10:45:02 solaris-machine      Error for Command: <undecoded cmd 0xa1>    Error Level: Recovered     Jan 23 10:45:02 solaris-machine scsi: [ID 107833 kern.notice]        Requested Block: 0                         Error Block: 0     Jan 23 10:45:02 solaris-machine scsi: [ID 107833 kern.notice]        Vendor: ATA                                Serial Number:             Jan 23 10:45:02 solaris-machine scsi: [ID 107833 kern.notice]        Sense Key: Soft_Error     Jan 23 10:45:04 solaris-machine scsi: [ID 107833 kern.warning] WARNING: /scsi_vhci/disk@g5000c5004dfc8db2 (sd2):     Jan 23 10:45:04 solaris-machine      Error for Command: <undecoded cmd 0xa1>    Error Level: Recovered     Jan 23 10:45:04 solaris-machine scsi: [ID 107833 kern.notice]        Requested Block: 0                         Error Block: 0     Jan 23 10:45:04 solaris-machine scsi: [ID 107833 kern.notice]        Vendor: ATA                                Serial Number:             Jan 23 10:45:04 solaris-machine scsi: [ID 107833 kern.notice]        Sense Key: Soft_Error     Jan 23 10:45:04 solaris-machine scsi: [ID 107833 kern.notice]        ASC: 0x0 (<vendor unique code 0x0>), ASCQ: 0x1d, FRU: 0x0     Jan 23 10:45:04 solaris-machine scsi: [ID 107833 kern.warning] WARNING: /scsi_vhci/disk@g5000c5004dfd4ce3 (sd5):     Jan 23 10:45:04 solaris-machine      Error for Command: <undecoded cmd 0xa1>    Error Level: Recovered     Jan 23 10:45:04 solaris-machine scsi: [ID 107833 kern.notice]        Requested Block: 0                         Error Block: 0     Jan 23 10:45:04 solaris-machine scsi: [ID 107833 kern.notice]        Vendor: ATA                                Serial Number:     Jan 23 10:45:04 solaris-machine scsi: [ID 107833 kern.notice]        Sense Key: Soft_Error     Jan 23 10:45:04 solaris-machine scsi: [ID 107833 kern.notice]        ASC: 0x0 (<vendor unique code 0x0>), ASCQ: 0x1d, FRU: 0x0     Jan 23 10:45:07 solaris-machine scsi: [ID 107833 kern.warning] WARNING: /pci@0,0/pci15d9,664@1f,2/disk@0,0 (sd0):     Jan 23 10:45:07 solaris-machine      Error for Command: <undecoded cmd 0xa1>    Error Level: Recovered     Jan 23 10:45:07 solaris-machine scsi: [ID 107833 kern.notice]        Requested Block: 0                         Error Block: 0     Jan 23 10:45:07 solaris-machine scsi: [ID 107833 kern.notice]        Vendor: ATA                                Serial Number:     Jan 23 10:45:07 solaris-machine scsi: [ID 107833 kern.notice]        Sense Key: Soft_Error     Jan 23 10:45:07 solaris-machine scsi: [ID 107833 kern.notice]        ASC: 0x0 (no additional sense info), ASCQ: 0x0, FRU: 0x0


Sync files from a mac to a flash drive - automatically?

I have a flash drive, let's name it `FLASH`. I want, when on my mac, when `FLASH` is plugged (and automatically mounted), execute a specific script and make `~/Documents` to be automatically copied to `/Volumes/FLASH/Documents` (mac mounts drives at `/Volumes`). This same drive, `FLASH`, (with this new `Documents` folder added before with the mac situation), when plugged in an Ubuntu machine, I want it to automatically copy `FLASH/Documents` to `~/Documents` (or automatically execute an script, after mounting). How should I do this in these different scenarios? I don't want to use third party applications for this, I prefer using core/builtin tools available in both platforms.


Mirror localhost:3280/some/long/url to localhost:3000

I have a webservice running on localhost 3280 that exposes Elasticsearch server under `/some/long/url`. I would like to access Elasticsearch from localhost's port 3000. Can I do this with port-forwarding, mirroring, proxy? What's the best way? Edit: I meant the service is running on 3280 and would like to access it from 3000 that is closed.


Deny flash plugin access to (a particular) webcam

I recently bought an external webcam to play around with OpenCV. It works great out of the box in Debian, but I realized that when I browse any site that contain flash content (youtube, soundcloud), the activity LED on the webcam flashes and in that time other applications (like Cheese) cannot access the webcam. Naturally I denied webcam access in the flash player context menu and chose the other, built-in, camera for use with the plugin, but the problem still persists. I think (although I'm not entirely sure) it all started the first time I set flash plugin to use this webcam, I don't think it happened before that. But still purging `flashplayer-nonfree` and reinstalling it doesn't change anything. Is there a way to keep flash plugin from activating this particular webcam while keeping it available to other applications? Or perhaps there is a way to revert the situation to the state **before** I first touched the flash settings, but **after** I plugged in the camera (assuming my memory serves me right)? I'm using an updated Debian squeeze and an Microsoft LifeCam Studio webcam. The browser I am talking about is Chrome v. 21.0.1180.57. **edit:** This only persists while using chrome, when I switched to iceweasel, this wasn't happening. I guess that shows this can be chrome-related.


how to enable BEEPsound in RHEL?

On my new RHEL 6.4 machine, the beep sound is disabled. How can I enable it?


Listing with `ls` and regular expression

How can I list files with a filename ending with last character and with `.txt` extension ? I have tried `ls *+([[:digit:]]).txt` but this is true for `abc12.txt` and `abc2.txt`. But I need to get only `abc2.txt`. How can I do that? Is there any sort form of `:digit:` that will do this?


ssh input from text file

These two question is driving me crazy and I don't have good expertise of ssh. (but I suspect it is to do with redirection only) The questions are, > You want to pass multiple lines of input from a file called `abc.txt` to the > `ssh` command. Complete the command required to do this `$ssh _ _ abc.txt` (that is only two characters) (a details explanation would be helpful) AND > You want to pass multiple lines of input from a file called Remote.txt to > `ssh` but all leading tabs in the subsequent input should be stripped. > Complete the command to do this `$ssh _ _ _ Remote.txt`


urxvt: scroll just one line

I can scroll a chunk of output with `Shift`+`PageUp` (or `PageDown`), but is there a way to scroll just one line up and down? Often, you'd like to read something that is small enough to fit in one screen, but the scrolling is so heavy handed it is impossible to get the whole text chunk within one screen anyway!


Get list of packages that provide (APT)

How can I generate a list of packages that the specific package provides using the apt-family?


Network Simulator NS-2 in Linux Mandriva 2008 - nam error: "Cannot connect to existing nam instance"

Theme begins here - http://superuser.com/questions/525110/installing-network- simulator-ns-2-allinone-on-linux-mandriva There is a certain emulator- **NS-2**. It can be used to describe the network topology, configuration of source and destination of traffic, all connection parameters (bandwidth, delay, packet loss probability, and many other parameters of the simulated system). I installed it on **Linux Mandriva 2008** and it works. But I not possible to achieve visualization -this is due with **Xorg**. I'm trying to implement a simple example (I repeat the code again) - **ns-simple.tcl** :               #Create a simulator object     set ns [new Simulator]          #Define different colors for data flows (for NAM)     $ns color 1 Blue     $ns color 2 Red          #Open the NAM trace file     set nf [open out.nam w]     $ns namtrace-all $nf          #Define a 'finish' procedure     proc finish {} {             global ns nf             $ns flush-trace             #Close the NAM trace file             close $nf             #Execute NAM on the trace file             exec nam out.nam &             exit 0     }          #Create four nodes     set n0 [$ns node]     set n1 [$ns node]     set n2 [$ns node]     set n3 [$ns node]          #Create links between the nodes     $ns duplex-link $n0 $n2 2Mb 10ms DropTail     $ns duplex-link $n1 $n2 2Mb 10ms DropTail     $ns duplex-link $n2 $n3 1.7Mb 20ms DropTail          #Set Queue Size of link (n2-n3) to 10     $ns queue-limit $n2 $n3 10          #Give node position (for NAM)     $ns duplex-link-op $n0 $n2 orient right-down     $ns duplex-link-op $n1 $n2 orient right-up     $ns duplex-link-op $n2 $n3 orient right          #Monitor the queue for link (n2-n3). (for NAM)     $ns duplex-link-op $n2 $n3 queuePos 0.5               #Setup a TCP connection     set tcp [new Agent/TCP]     $tcp set class_ 2     $ns attach-agent $n0 $tcp     set sink [new Agent/TCPSink]     $ns attach-agent $n3 $sink     $ns connect $tcp $sink     $tcp set fid_ 1          #Setup a FTP over TCP connection     set ftp [new Application/FTP]     $ftp attach-agent $tcp     $ftp set type_ FTP               #Setup a UDP connection     set udp [new Agent/UDP]     $ns attach-agent $n1 $udp     set null [new Agent/Null]     $ns attach-agent $n3 $null     $ns connect $udp $null      But I get error message.               [root@localhost ...]# startx -- :1     xauth:  creating new authority file /root/.serverauth.20336               X Window System Version 1.3.0     Release Date: 19 April 2007     X Protocol Version 11, Revision 0, Release 1.3     Build Operating System: Linux_2.6.12-12mdksmp Mandriva     Current Operating System: Linux localhost 2.6.22.9-desktop-1mdv #1 SMP Thu Sep 27 04:07:04 CEST 2007 i686     Build Date: 01 October 2007             Before reporting problems, check http://wiki.x.org             to make sure that you have the latest version.     Module Loader present     Markers: (--) probed, (**) from config file, (==) default setting,             (++) from command line, (!!) notice, (II) informational,             (WW) warning, (EE) error, (NI) not implemented, (??) unknown.     (==) Log file: "/var/log/Xorg.1.log", Time: Sat Dec 29 18:59:34 2012     (==) Using config file: "/etc/X11/xorg.conf"     Using vt 8     (**) RADEON(0): RADEONPreInit     (II) Module already built-in     (II) Module already built-in     (II) Module already built-in     (**) RADEON(0): RADEONScreenInit d0000000 0     (**) RADEON(0): Map: 0xd0000000, 0x01000000     (**) RADEON(0): RADEONSave     (**) RADEON(0): RADEONSaveMode(0x823a6a0)     (**) RADEON(0): Read: 0x00000006 0x00030047 0x00000000     (**) RADEON(0): Read: rd=6, fd=71, pd=3     (**) RADEON(0): RADEONSaveMode returns 0x823a6a0     (**) RADEON(0): RADEONInitMemoryMap() :     (**) RADEON(0):   mem_size         : 0x04000000     (**) RADEON(0):   MC_FB_LOCATION   : 0xd3ffd000     (**) RADEON(0):   MC_AGP_LOCATION  : 0xffffffc0     (**) RADEON(0): RADEONModeInit()     1024x768       78.75  1024 1040 1136 1312   768  769  772  800 (16,16) +H +V     1024x768       78.75  1024 1040 1136 1312   768  769  772  800 (16,16) +H +V     (**) RADEON(0): Pitch = 8388736 bytes (virtualX = 1024, displayWidth = 1024)     (**) RADEON(0): dc=7875, of=15750, fd=350, pd=2     (**) RADEON(0): RADEONInit returns 0x823b050     (**) RADEON(0): RADEONRestoreMode()     (**) RADEON(0): RADEONRestoreMemMapRegisters() :     (**) RADEON(0):   MC_FB_LOCATION   : 0xd3ffd000     (**) RADEON(0):   MC_AGP_LOCATION  : 0xffffffc0     (**) RADEON(0):   Map Changed ! Applying ...     (**) RADEON(0):   Map applied, resetting engine ...     (**) RADEON(0): Updating display base addresses...     (**) RADEON(0): Memory map updated.     (**) RADEON(0): Programming CRTC1, offset: 0x00000000     (**) RADEON(0): Wrote: 0x0000003c 0x0001015e 0x00000000 (0x0000bf00)     (**) RADEON(0): Wrote: rd=60, fd=350, pd=1     (**) RADEON(0): GRPH_BUFFER_CNTL from 20005c5c to 20055c5c     (**) RADEON(0): RADEONSaveScreen(0)     (**) RADEON(0): Setting up initial surfaces     (**) RADEON(0): Initializing fb layer     (**) RADEON(0): Setting up accel memmap     (**) RADEON(0): Initializing backing store     (**) RADEON(0): Setting up final surfaces     (**) RADEON(0): Initializing Acceleration     (**) RADEON(0): EngineInit (16/16)     (**) RADEON(0): Pitch for acceleration = 128     (**) RADEON(0): EngineRestore (16/16)     (**) RADEON(0): Initializing DPMS     (**) RADEON(0): Initializing Cursor     (**) RADEON(0): Initializing color map     (**) RADEON(0): Initializing DGA     (**) RADEON(0): Initializing Xv     (**) RADEON(0): RADEONScreenInit finished     (EE) AIGLX: Screen 0 is not DRI capable     (**) RADEON(0): RADEONSaveScreen(2)      Run **ns** :               [root@localhost ...]# export DISPLAY=localhost:1     [root@localhost ...]# ns ns-simple.tcl     CBR packet size = 1000     CBR interval = 0.0080000000000000002     [root@localhost ...]# **nam: couldn't connect to display "localhost:1"**      I tried to rebuild the **nam** , as they say here, my `remote-create-animator` function looks like this -               AnimControl instproc remote-create-animator {trace_file args} {         catch "array set opts $args"         AnimControl instvar PORT_FILE_         if [catch {set f [open $PORT_FILE_ RDONLY]}] {             error "Cannot read server port from $PORT_FILE_"         }         set port [read $f]         close $f                  puts -nonewline "Cannot connect to existing nam instance. "         puts "Starting a new one..."         $self local-create-animator $trace_file [join $args]              #if [catch {set sock [socket localhost $port]}] {         #   puts -nonewline "Cannot connect to existing nam instance. "         #   puts "Starting a new one..."         #   $self local-create-animator $trace_file [join $args]         #} else {         #   if {$trace_file == ""} {         # puts "A nam instance already exists. Use nam <trace file> to view an animation"         #       close $sock         #   } else {         #   global tcl_platform         #   if {$tcl_platform(platform) == "windows"} {         #       if [regexp {^(\\\\|[A-Za-z]:[/\\])} $trace_file] {         #           set tf $trace_file  ;# Absolute pathname         #       } else {         #           set tf [pwd]/$trace_file    ;# Relative pathname         #       }         #   } else {         #       if [regexp {^[~/]} $trace_file] {         #           set tf $trace_file  ;# Absolute pathname         #       } else {         #           set tf [pwd]/$trace_file ;# Relative pathname         #       }         #   }         #   puts $sock "CA $tf [join $args]"         #   flush $sock         #   close $sock         #   }         #}     }      But nothing has changed. Message now is - `"Cannot connect to existing nam instance. Starting a new one..."` And all .. How to get the picture? I would be very grateful for the information! Thanks!


Why buffers equals to used memory?

I'm using Ubuntu 11.10, virtualized by OpenVZ. That output of `free -m` shows that buffers is always equal to used.                            total       used       free     shared    buffers     cached     Mem:          2048       1079        968          0          0          0     -/+ buffers/cache:       1079        968     Swap:            0          0          0      Is that the reason I can't run a java virtual machine, although there's 968mb of free memory?


How to set ssh access for user on debian?

I set groups:               usermod -G ssh username      and then I've checked account info:               id username      the result is:               uid=1000(username) gid=1001(username) groups=100(username)      Anyway if I try to login using ssh I get an error: Permission denied, please try again. What I'm doing wrong? **UPDATE1:** if I run /usr/sbin/sshd -d the result is:               debug1: sshd version OpenSSH_5.5p1 Debian-6+squeeze1     debug1: read PEM private key done: type RSA     debug1: Checking blacklist file /usr/share/ssh/blacklist.RSA-2048     debug1: Checking blacklist file /etc/ssh/blacklist.RSA-2048     debug1: private host key: #0 type 1 RSA     debug1: read PEM private key done: type DSA     debug1: Checking blacklist file /usr/share/ssh/blacklist.DSA-1024     debug1: Checking blacklist file /etc/ssh/blacklist.DSA-1024     debug1: private host key: #1 type 2 DSA     debug1: rexec_argv[0]='/usr/sbin/sshd'     debug1: rexec_argv[1]='-d'     Set /proc/self/oom_adj from 0 to -17     debug1: Bind to port 22 on 0.0.0.0.     Bind to port 22 on 0.0.0.0 failed: Address already in use.     debug1: Bind to port 22 on ::.     Bind to port 22 on :: failed: Address already in use.     Cannot bind any address.      **UPDATE2:** The log is:               Dec 29 22:06:44 p148401 sshd[32456]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=changed_host  user=username     Dec 29 22:06:47 p148401 sshd[32456]: Failed password for username from 8*.*.*.* port 52765 ssh2      **UPDATE3:**               root@p148401:/etc/init.d# sudo service ssh stop     Stopping OpenBSD Secure Shell server: sshd.     root@p148401:/etc/init.d# /usr/sbin/sshd -d     debug1: sshd version OpenSSH_5.5p1 Debian-6+squeeze1     debug1: read PEM private key done: type RSA     debug1: Checking blacklist file /usr/share/ssh/blacklist.RSA-2048     debug1: Checking blacklist file /etc/ssh/blacklist.RSA-2048     debug1: private host key: #0 type 1 RSA     debug1: read PEM private key done: type DSA     debug1: Checking blacklist file /usr/share/ssh/blacklist.DSA-1024     debug1: Checking blacklist file /etc/ssh/blacklist.DSA-1024     debug1: private host key: #1 type 2 DSA     debug1: rexec_argv[0]='/usr/sbin/sshd'     debug1: rexec_argv[1]='-d'     Set /proc/self/oom_adj from 0 to -17     debug1: Bind to port 22 on 0.0.0.0.     Server listening on 0.0.0.0 port 22.     debug1: Bind to port 22 on ::.     Server listening on :: port 22.      And doesn't respond anymore...needs to restart ..and ssh config is here http://codepad.org/8bynXZQC


Home key not working in terminal

I am using GNOME Terminal 2.7.3 and zsh 4.3.9 (x86_64-unknown-linux-gnu) `Home` and `End` are not working. Nothing happens and nothing gets displayed when I press them. but they work when I press `shift + Home` (Scrolls to the beginning of shell output.) and also work in other GUI programs. I googled and tried the following. No change :(                 885  bindkey "\e[1~" beginning-of-line       886  bindkey "\e[H" beginning-of-line       887  bindkey "\e1~" beginning-of-line       888  bindkey "\eH" beginning-of-line       889  bindkey "\e[0H" beginning-of-line      PS: When I am in the last tab and press `Ctrl + pagedown` I get `;5~` printed on the screen. Does that give any clue?


Dual Screen with res wider than 1680px in Fedora 14

I want to work in dual screen mode with the monitors not mirroring, but extending each other and I want the total resolution to be 3360x1050. When I try to apply dual screen (that is uncheck "Same image in all monitors" option) it says "required virtual size 3360x1050 does not fit available size 1680x1680". Additionally, When I try to detect my monitors both are pink monitors, that is the monitors seem to not be detected as separate monitors So the question seems to be two-fold: How do I detect the monitors as separate monitors? and How do I increase the available size?


Execute and renice a process in one command

Does anyone know if it's possible to execute and renice a process in one command, i.e. without having to look up the command in the list of processes using the ps command and then renice that particular pid.


How do I configure the network interfaces persistently in CentOS so it will survive a reboot?

I configured a network interface with the following commands:               ifconfig eth0 up     ip addr add 192.168.9.1/28 dev eth0     route add default gw 192.168.0.1      This works. However, when I reboot the machine I lose all the configurations made. How can I make sure this is persistent? I'm using CentOS 6.3.


Need help deciphering unix statement

I need help deciphering what is being said here:               export IP=`/sbin/ifconfig | grep 'inet addr:'|grep -v '127.0.0.1'|         cut -d: -f2 | awk '{print $1}'`      I know it is to set IP as an environment variable, but other than that, what does everything else mean? Is there a manual on this? Thank you.


How do I modify the search index in Ubuntu 11.04?

I'm loving (parts) of this new Unity interface; in particular the searching with the windows key (just like Windows 7!). But how do I:   1. Tell it what programs I'd like to be able to return   2. Tell it where I'd like file searches to be performed I presume 2 has something to do with indexing, but I do not know the indexing backend, and the "official" documentation is pretty useless for a power user (vs a l33t user that contributes patches ;))


FreeBSD 9 and Windows 7 Dual Boot

I have two hard drives installed on my machine. I installed Windows 7 on one hard drive and FreeBSD 9 on the other. I used GPT for FreeBSD. My question is: how can I install a boot manager so that I can dual boot? (In FreeBSD 8, `sysinstall` asks for a boot manager but `bsdinstall` doesn't?)


How can I use GNOME's keyboard settings in Fluxbox?

My GNOME keyboard settings do two main things:   * Switch CMD and CTRL (I'm on a Macbook)   * Give me a third level (for special characters) This is really the only functionality I'm missing in Fluxbox. Any way to activate it without running GNOME?


Renaming a whole folder content

I'm on OSX 10.9.2 (BASH 3.5) and I wanted to rename a whole folder content names. So I run a script and somehow ended with this:               s01eDavid.Letterman.2014.02.27.Stupid.Human.Tricks.x264-SWOLLED.mp4     s01eDavid.Letterman.2014.03.07.Lenny.Marcus.HDTV.x264-BATV.mp4     s01eDavid.Letterman.2014.03.24.Jimmy.Carter.HDTV.x264-SWOLLED.mp4     s01eDavid.Letterman.2014.03.25.Emma.Watson.720p.HDTV.x264-SWOLLED.mkv      (There is extra S01e at the beggining of each sentence while there was supposed to be the S01e01 , S01e02.....) How can I remove/rename those files to make it look like that?:               s01e1 David.Letterman.2014.02.27.Stupid.Human.Tricks.x264-SWOLLED.mp4     s01e2 David.Letterman.2014.03.07.Lenny.Marcus.HDTV.x264-BATV.mp4     s01e3 David.Letterman.2014.03.24.Jimmy.Carter.HDTV.x264-SWOLLED.mp4     s01e4 David.Letterman.2014.03.25.Emma.Watson.720p.HDTV.x264-SWOLLED.mkv      Thanks!


How to properly collect an array of lines in zsh

I thought the following would group the output of `my_command` in an array of lines:               IFS='\n' array_of_lines=$(my_command);      so that `$array_of_lines[1]` would refer to the first line in the output of `my_command`, `$array_of_lines[2]` to the second, and so forth. However, the command above doesn't seem to work well. It seems to also split the output of `my_command` around the character `n`, as I have checked with `print -l $array_of_lines`, which I believe prints elements of an array line by line. I have also checked this with:               echo $array_of_lines[1]     echo $array_of_lines[2]     ...      In a second attempt, I thought adding `eval` could help:               IFS='\n' array_of_lines=$(eval my_command);      but I got the exact same result as without it. Finally, following the answer on List elements with spaces in zsh, I have also tried using parameter expansion flags instead of `IFS` to tell zsh how to split the input and collect the elements into an array, i.e.:               array_of_lines=("${(@f)$(my_command)}");      But I still got the same result (splitting happening on `n`) With this, I have the following questions: **Q1.** What are **"the proper"** ways of collecting the output of a command in an array of lines? **Q2.** How can I specify `IFS` to split on newlines only? **Q3.** If I use parameter expansion flags as in my third attempt above (i.e. using `@f`) to specify the splitting, does zsh ignore the value of `IFS`? Why didn't it work above?


Do BSD and SunOS have multithreaded architectures?

I'm interested in operating systems that have a multithreading architecture, like Mach and BeOS; not ones that depend on libraries like POSIX to be multithreading. Do BSD and SunOS have a multithreading architecture?


force copying a corrupted home directory

I have a home directory in a disk that has a lot of corrupted files. I am trying to save most files as possible. I am trying to create a backup of my home directory on an external drive using               tar -cvf backup /home/myHome      and also have tried               rsync -vfh /home/myHome /media/backup      Both methods stop when they found a corrupt file. Is there a way to force one or the other to continue copying and ignore bad files, copying everything that is possible to copy and show me a log at the end of the files that were not copied? Thanks.


iptables server behind NAT accessible from outside as well as inside the nat

I have 2 machines with a KVM running on each machine - so two kvms with the below networking               Host 1: 192.168.10.100 (eth2)             10.10.100.1 (virbr1)     KVM 1 (NAT with Host 1): 10.10.100.128 (eth0 inside kvm)          Host 2: 192.168.10.101 (eth2)             10.10.100.1 (virbr1)     KVM 2 (NAT with Host 2): 10.10.100.128 (eth0 inside kvm)      The KVM's are hosting a server, on port 6000. I would like the KVM's to operate both as clients and servers. For example KVM1 could choose to communicate as a client with the server on KVM2 or itself. In this case KVM1 would connect to 192.168.10.101 or 192.168.10.100 (itself) For this I have the below iptables rules set up, but I am unable to have a KVM communicate with the server running on itself. Can someone help me figure out the missing link? Both KVM1 and KVM2 have the below rules set up (the below are full rules as they appear on my box): In the default Table I have set up forwarding to the KVM's network:               Chain INPUT (policy ACCEPT 0 packets, 0 bytes)      pkts bytes target     prot opt in     out     source               destination       114  7254 ACCEPT     udp  --  virbr1 *       0.0.0.0/0            0.0.0.0/0            udp dpt:53         0     0 ACCEPT     tcp  --  virbr1 *       0.0.0.0/0            0.0.0.0/0            tcp dpt:53       314  103K ACCEPT     udp  --  virbr1 *       0.0.0.0/0            0.0.0.0/0            udp dpt:67         0     0 ACCEPT     tcp  --  virbr1 *       0.0.0.0/0            0.0.0.0/0            tcp dpt:67     6810K 1271M ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            tcp dpt:22        43  2723 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            tcp dpt:8000       475 60252 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            tcp dpt:8443       270 15588 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            tcp dpt:111     35125 4776K ACCEPT     udp  --  *      *       0.0.0.0/0            0.0.0.0/0            udp dpt:111       720  112K ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            tcp dpt:4001         0     0 ACCEPT     udp  --  *      *       0.0.0.0/0            0.0.0.0/0            udp dpt:4001         6   328 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            tcp dpt:564         6   500 ACCEPT     udp  --  *      *       0.0.0.0/0            0.0.0.0/0            udp dpt:564     14532 5776K ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            tcp dpt:2049         0     0 ACCEPT     udp  --  *      *       0.0.0.0/0            0.0.0.0/0            udp dpt:2049         0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            tcp dpt:4002     19070 1526K ACCEPT     udp  --  *      *       0.0.0.0/0            0.0.0.0/0            udp dpt:4002     2900K  852M ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0            ctstate RELATED,ESTABLISHED         0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            tcp dpt:6500flags: 0x17/0x02         0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            tcp dpt:6550flags: 0x17/0x02      7294  379K ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            tcp dpt:9000         0     0 REJECT     all  --  eth0   *       0.0.0.0/0            0.0.0.0/0            reject-with icmp-port-unreachable     8574K 1767M ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0          Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)      pkts bytes target     prot opt in     out     source               destination       934  642K ACCEPT     all  --  *      *       0.0.0.0/0            10.10.100.0/24       state NEW,RELATED,ESTABLISHED        88  7740 ACCEPT     all  --  *      virbr1  0.0.0.0/0            10.10.100.0/24       state RELATED,ESTABLISHED       533 39866 ACCEPT     all  --  virbr1 *       10.10.100.0/24       0.0.0.0/0         0     0 ACCEPT     all  --  virbr1 virbr1  0.0.0.0/0            0.0.0.0/0         4   240 REJECT     all  --  *      virbr1  0.0.0.0/0            0.0.0.0/0            reject-with icmp-port-unreachable         0     0 REJECT     all  --  virbr1 *       0.0.0.0/0            0.0.0.0/0            reject-with icmp-port-unreachable          Chain OUTPUT (policy ACCEPT 8939K packets, 2177M bytes)      pkts bytes target     prot opt in     out     source               destination      In the NAT Table I have set up Port forwarding in PREROUTING and MASQUERADE all packets leaving the virtual interface from the kvm:               Chain PREROUTING (policy ACCEPT 116K packets, 20M bytes)      pkts bytes target     prot opt in     out     source               destination         0     0 DNAT       tcp  --  *      *      !10.10.100.128        0.0.0.0/0            tcp dpt:8080 to:10.10.100.128:8080         0     0 DNAT       tcp  --  *      *      !10.10.100.128        0.0.0.0/0            tcp dpt:6002 to:10.10.100.128:6002         0     0 DNAT       tcp  --  *      *      !10.10.100.128        0.0.0.0/0            tcp dpt:6001 to:10.10.100.128:6001         0     0 DNAT       tcp  --  *      *      !10.10.100.128        0.0.0.0/0            tcp dpt:6000 to:10.10.100.128:6000          Chain INPUT (policy ACCEPT 114K packets, 20M bytes)      pkts bytes target     prot opt in     out     source               destination        54 16928 ACCEPT     all  --  *      *       10.10.100.128        0.0.0.0/0          Chain OUTPUT (policy ACCEPT 7539 packets, 410K bytes)      pkts bytes target     prot opt in     out     source               destination          Chain POSTROUTING (policy ACCEPT 7537 packets, 410K bytes)      pkts bytes target     prot opt in     out     source               destination         2   104 MASQUERADE  all  --  *      virbr1  0.0.0.0/0            0.0.0.0/0         0     0 MASQUERADE  tcp  --  *      *       10.10.100.0/24      !10.10.100.0/24       masq ports: 1024-65535         0     0 MASQUERADE  udp  --  *      *       10.10.100.0/24      !10.10.100.0/24       masq ports: 1024-65535         0     0 MASQUERADE  all  --  *      *       10.10.100.0/24      !10.10.100.0/24      With the above rules, KVM1 can talk to server running on KVM2 but not with the server running on itself. This is because of the PREROUTING rule above that negates any source packet with the KVM's address. If I change the above PREROUTING rule to:               Chain PREROUTING (policy ACCEPT)     target     prot opt source               destination     DNAT       tcp  --  anywhere             anywhere             tcp dpt:x11 to:10.10.100.128:6000      In this case the problem is new. Any request from KVM1 to KVM2 is routed internally back to KVM1!


What is the purpose of .bashrc and how does it work?

I found the `.bashrc` file and I want to know the purpose/function of it. Also how and when is it used?


Recover Firefox bookmarks after Linux Mint 16 reinstallation

I had Linux Mint 16 KDE installed alongside Xubuntu 13.10. I messed up partitions and had to reinstall Mint and both the OSs were booting fine after reinstallation. Now as expected all of my firefox bookmarks were erased. Is there any way to recover those firefox bookmarks? Thanks in advance. Regards, Sriram.


What does Unix programming mean, exactly?

I thought I understood what the term _Unix programming_ meant, but now, after reading about it in a kernel/C programming context, I feel like I need to clarify the meaning of this term. It is not clear to me if it means:   1. Shell programming,   2. Unix programming tools,   3. a particular way/pattern of programming Unix command-line tools (e.g, to agree with the pipeline way of "Unix shell programming"), or   4. something else.


tmux session lost in unknown pts, cause and possible solution?

I was trying to re-attach to a long-running tmux session to check up on a python web-application. However `tmux attach` claims that there is no running session, and `ps` shows a `tmux` process (first line), but with a question mark instead of the `pts` number. What does this mean---is this tmux session permanently lost, and what could have caused it? Is there still a way to look at the current state of the python process, spawned in the tmux session and running in `pts/19` (second line)?               [mhermans@web314 ~]$ ps -ef | grep mhermans     mhermans 16709     1  0 Mar04 ?        00:26:32 tmux     mhermans  8526 16710  0 Mar04 pts/19   00:20:04 python2.7 webapp.py     root      9985  6671  0 10:18 ?        00:00:00 sshd: mhermans [priv]     mhermans 10028  9985  0 10:18 ?        00:00:00 sshd: mhermans@pts/16     mhermans 10030 10028  0 10:18 pts/16   00:00:00 -bash     mhermans 16247 10030  6 10:28 pts/16   00:00:00 ps -ef     mhermans 16276 10030  0 10:28 pts/16   00:00:00 grep mhermans     mhermans 16710 16709  0 Mar04 pts/19   00:00:00 -bash     mhermans 16777 16709  0 Mar04 pts/21   00:00:00 -bash


Ignore DNS from DHCP server in Ubuntu

I set static `DNS` in `/etc/resolvconf/resolv.conf.d/base` file:               nameserver 8.8.8.8     nameserver 8.8.4.4      But my PC still obtains DNS from DHCP, this is my `/etc/resolv.conf`:               nameserver 192.168.100.2      nameserver 8.8.8.8     nameserver 8.8.4.4      How to ignore obtained `DNS` from `DHCP` server?


How do I concatenate all the files in a given directory in order of date, where I want the newest file on top?

And with the oldest file on bottom? Also, if I do this, is it also possible to strip out the redundant headers contained within each HTML file? I'm seeing myself concatenate a lot of HTML files up, and it would be nice to reduce the file size of the ultimate file a bit.


How do I preserve the history file of cygwin bash across independent sessions?

So my home directory does have a .bash_history file, but it refuses to grow any bigger for some reason. I've already changed the `.bashrc` settings to set the history size to 99999 and the history file size limit to something similar.


Is encrypting your web browsing via SSH to localhost useful?

For example, if I did an `ssh -X` to localhost and invoked Firefox, would that be enough to be considered safe browsing, like if done on some public wifi?


How to fix this mysql permission problem?

I'm trying like mad to get `rails dbconsole` to work (Rails 3.2.6, if that helps). The problem is that when I run the command, I get:               gems/railties-3.2.6/lib/rails/commands/dbconsole.rb:81:in `exec': Permission denied -     /usr/local/bin/mysql (Errno::EACCES)      I am using OS X Lion, and the usual way of running `mysql` at the command line works - it just doesn't work through `rails dbconsole`. The permissions on the `/usr/local/bin/mysql` are:               $ ls -la /usr/local/bin/mysql     lrwxr-xr-x  1 root  admin  16 Mar 13 20:27 /usr/local/bin/mysql -> /usr/local/mysql      The user I am calling these commands from is in the 'Admin' group (as evidenced in the Preferences -> Users dialog) Any ideas on how to fix this? What could be the cause of `mysql` being able to run at the command line but not through another program (ruby/rails in this case). And while I'm at this permissions problem, could you point me to a decent article/book/method that will help me to understand the permissions system and help troubleshoot such problems in future?


Expand ~, . and `..`

Since `~`, `.` and `..` are special directories, why are they handled differently in the following example?               $ echo ~     /home/tim     $ echo ..     ..     $ echo .     .        1. `~` is expanded into the dir, but the other two are not.   2. The other two are expanded literally, but `~` isn't.


For cygwin, how do I export the output in a terminal into a file?

I'd like to be able to export the output (and error messages) of my cygwin terminal in a file, especially since I have to click a lot of buttons in order to "mark" the stuff in the cygwin terminal (and it's desirable to minimize the amount of clicking I do).