How to setup SVN over VPN?

I'm looking on how to implement a SVN connection over a VPN on my CentOs server. I need to see up this VPN to work with the team in the office from outside.   1. required packages ( yum ... )   2. configuration files I have to mod ( /etc/... )   3. a basic configuration example I don't have any particular requirement I just need to set up this service in order to get it work. ( so any suggested kind of VPN that can suit this is accepted ).


deleted user is still an option in gnome login in Debian 6

I'm running Debian 6.0.8. I misnamed the original username I wanted, so I made a new user with the proper username. On the gnome log on screen, I see two users of the same name (the login screen displays the users "human" name). I knew the second user was the correct user name so I clicked on it. Once inside gnome, I went to System > Administration > Users and deleted the misnamed user. However, upon reboot, the old, wrongly-named user was still listed there and I clicked on it without thinking. The user directory was apparently gone because the desktop never loaded its icons and I got several errors about not being able to write to or find certain user directories. I rebooted to get to the correct user and ran `userdel -r <bad_username>` and first I got an error that the user's home directory didn't exist. After I created it to see if that would get the command to work, I got the error that the user doesn't exist. So I guess the user doesn't exist unix-wise, but the Gnome login screen still presents that user as an option. It's annoying because it's the first option, and the actual name displayed is my name, the same as the user with the correct username. So if I don't think about it, I wind up clicking on the wrong username. How can I prevent Gnome from displaying this non-existent user as a login option?


How to disable live shell session command history under AIX 5-6?

It's okay that there are history files logging the commands that has been used. That't not the problem. The problem is that when 2 admins are logged in to an AIX server then it could be bad: If admin #A uses               rm FILENAME      then if admin #B hits the up arrow he gets the               rm FILENAME      command which is not a very good thing. So how can the termial be forced to only write the command history if the ssh session ended? (UPDATE#2: or solution could be that that each session has it's uniq command history, and thus we can't see each others command, only when they sign out for ex.) UPDATE#1               4:root@SERVER:/root # echo $SHELL     /usr/bin/ksh     4:root@SERVER:/root # oslevel -s     6100-05-01-1016     4:root@SERVER:/root #


Calling a script in ~/.profile stops my logging in

I placed a call to a bash script in my `~/.profile`. The script executes a CLI program to dim my screen at login. However, Gnome doesn't continue to log me in to my standard desktop after running the script. Is there a way to make the `~/.profile` script call non-blocking? I'm happy to provide more details that might help you answer this. My distro is Linux Mint. **Edit** Contents of `.profile.`               # ~/.profile: executed by the command interpreter for login shells.     # This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login     # exists.     # see /usr/share/doc/bash/examples/startup-files for examples.     # the files are located in the bash-doc package.          # the default umask is set in /etc/profile; for setting the umask     # for ssh logins, install and configure the libpam-umask package.     #umask 022          # Me     bash /home/eoin/repos/scripts/autostart.sh          # if running bash     if [ -n "$BASH_VERSION" ]; then         # include .bashrc if it exists         if [ -f "$HOME/.bashrc" ]; then         . "$HOME/.bashrc"         fi     fi          # set PATH so it includes user's private bin if it exists     if [ -d "$HOME/bin" ] ; then         PATH="$HOME/bin:$PATH"     fi      And my script `/home/eoin/repos/scripts/autostart.sh`:               #!/bin/bash     bash ~/repos/scripts/redshift/redshift.sh      Which in turn calls another script :-P               #!/bin/bash     redshift -v


How do I get pacman to use my custom PKGBUILDs when updating?

I customized a `PKGBUILD` for Apache, ran `makepkg` and installed it with `pacman -U httpd.tar.xz`, which worked fine. A few months later I upgraded my system with `pacman -Syu` which used the system-default configuration for Apache which broke my web server. How do I tell pacman to always use my custom compilation settings so I don’t have to manually upgrade every time a new version is released?


How to find bash in a portable way

When we write shell scripts we do this:               #!/bin/bash      But What if bash is in `/usr/bin/`? How can we find it in a portable way inside script? I did this, but it gives error:               #!which bash


Problems installing Chrome in SLED 11

I'm trying to install Google Chrome on my OS, but when I execute the `.rpm`, I got this error:               google-chrome-stable-35.0.1916.153-1.x86_64 requires libX11.so.6 (64bit), but this requirement cannot be provided.


Awesome wibox: remove tag label

Currently, I have both the gajim and skype windows visible as both icons (in systray) and window labels (in mytasklist). How can I remove that latter so that it is not shown since I do not need two instances of the same thing cluttering my wibox.


Determine if a package is provided by an installed packagein Arch Linux

I am trying to script the installation of optional "dependencies" depending on what other packages are installed in an Arch Linux system. I can use `pacman -Q` to tell me if a package has been installed either directly or as a dependency, but this fails if the package is "installed" via provides in the PKGBUILD. How can I determine if a package that provides a package has been installed? The specific issue I have is I want to install `kile` if both `kdebase-workspace` and `texlive-core` are installed. The issue is that I cannot pick up that the AUR `texlive-dummy` package is providing `texlive- core`.


Remove all files except for last file of each month

Consider a directory with MySQL backup files with timestamps as part of the filename:               -rw-rw-r-- 1 ubuntu ubuntu 35856184 Nov 16 16:00 db_2013-11-16_1600.sql     -rw-rw-r-- 1 ubuntu ubuntu 35856915 Nov 16 17:00 db_2013-11-16_1700.sql     -rw-rw-r-- 1 ubuntu ubuntu 35857565 Nov 16 18:00 db_2013-11-16_1800.sql     -rw-rw-r-- 1 ubuntu ubuntu 35858254 Nov 16 19:00 db_2013-11-16_1900.sql     -rw-rw-r-- 1 ubuntu ubuntu 35860276 Nov 16 20:00 db_2013-11-16_2000.sql     -rw-rw-r-- 1 ubuntu ubuntu 35861583 Nov 16 21:00 db_2013-11-16_2100.sql     -rw-rw-r-- 1 ubuntu ubuntu 35863630 Nov 16 22:00 db_2013-11-16_2200.sql     -rw-rw-r-- 1 ubuntu ubuntu 35864868 Nov 16 23:00 db_2013-11-16_2300.sql     -rw-rw-r-- 1 ubuntu ubuntu 35866095 Nov 17 00:00 db_2013-11-17_0000.sql     -rw-rw-r-- 1 ubuntu ubuntu 35887731 Nov 17 01:00 db_2013-11-17_0100.sql     -rw-rw-r-- 1 ubuntu ubuntu 35888871 Nov 17 02:00 db_2013-11-17_0200.sql     -rw-rw-r-- 1 ubuntu ubuntu 35888871 Nov 17 03:00 db_2013-11-17_0300.sql     -rw-rw-r-- 1 ubuntu ubuntu 35889319 Nov 17 04:00 db_2013-11-17_0400.sql      These actually go on since September 2012! I need to delete all backups except for the last backup of each month. That is, these files should be left:               db_2012-09-30_2300.sql     db_2012-10-31_2300.sql     db_2012-11-30_2300.sql     db_2012-12-31_2300.sql     db_2013-01-31_2300.sql     db_2013-02-28_2300.sql     db_2013-03-31_2300.sql     db_2013-04-30_2300.sql     db_2013-05-30_2300.sql     db_2013-06-30_2300.sql     db_2013-07-31_2300.sql     db_2013-08-31_2300.sql     db_2013-09-30_2300.sql     db_2013-10-31_2300.sql     db_2013-11-20_0700.sql # Because this month has not finished yet!      I could write a Bash/Python script to create lists of each month, remove the last item from the list and then delete one-by-one the remaining files. Alternatively, the script could move the last files from each month to a temp directory, remove everything, then put the files back. _However_ I wonder if there is some way to simply tell `rm` (or rm with `find` and `awk` and `sort`) to ignore the last file of the month. **Is there such a magic spell?** I do recognise that life would be easier if I could just save _the first file_ from each month (which would be only a 1 hour difference from saving the _last_ file from each month) but that is not acceptable to others in the organization who fail to see that this essentially provides the same protection.


How to create mandos server-client pair?

I needed something like this post and found a post by Mandos developer. I read all literature and also tried to post, but it seems they have negligible activity in their mailinglist. So I am asking here. What I am trying to do is to create a pair of Mandos server-client as their FAQ states that ".. you could have two computers be the Mandos server for each other." without any conflicts. However, when I tried with dm-crypt with LUKS, it did not work like it should even after I configured and tweaked as stated here Has anyone managed to achieve something like above scenario with Mandos? Appreciate if there is any documentation regarding successful implementation of Mandos server-clinet pair?


What does ":>" do here?

I saw some postinst script                   # setting wget options         :> wgetrc         echo "noclobber = off" >> wgetrc         echo "dir_prefix = ." >> wgetrc         echo "dirstruct = off" >> wgetrc         echo "verbose = on" >> wgetrc         echo "progress = dot:default" >> wgetrc         echo "tries = 2" >> wgetrc      What does the `:>` do here ?


Using ACL's over read only/remote filesystem

I would like to define local ACL's to be used over a remotely mounted filesystem. The filesystem is mounted via autofs and sshfs FUSE. The idea is that we could setup a jailed user on a jump server with access to read files on other servers in the environment and use standard commands without alot of exposure and certainly without granting ssh access.   Problem is sshfs will always run as the same user so files within the path on the remote system would be exposed regardless of the user that they were exposed for. I've explored coding the security check right into sshfs but before I go down that road I'd like to see if any other package can add ACL support to an otherwise read only filesystem. Edit: @peterph How would you set your ACL's for the NFS share when the remote filesystem is read only? sshfs was really easy to take apart, so I added the ACL check right into sshfs itself a few days after writing this. Users get jailed on login via OpenSSH and jailkit, and access the read only sshfs automount as a non-privileged user from there. Every dir/file stat or read generates a syslog event. Been working like a charm and the users have no rights off of the one jailed box.


What is a solid iptables configuration for my desktop?

On my desktop, I want to configure iptables pretty strictly. I see no reason why I need to allow anything except for internet traffic that I initiated. And maybe even that could be limited to only a few ports. What are the basic rules that can close off my desktop? I only need:   * To browse the internet   * Download email Any recommended set of rules?


Checking if line in file exist

I have a bash script which asks a user for the number of CPU cores and saves it to variable named `$cores`. Now I want to add this variable to `.bashrc`, so I ask user how much CPU cores he has and then if he wants to save this value to `.bashrc`. Now the question, how I can check if `$cores` already exist in `.bashrc` so the script won't ask the user again?


rhosts changes and re-initializing

I'm having trouble using the r-commands between my servers to do a tape backup. I've been making changes in the .rhosts file, but I'm not sure if the OS reads that file everytime it's called, or just when it's booted, or some other time. After I modify the .rhosts file, do I need to do anything to then have it be used with the next r-command? Note: _No tags for it, but I'm using Tru64._


Stereo "tone-generator" for linux?

Is there something like a stereo (separate left-and right-channel) tone- generator for Linux? Where you can set volume and tone/pitch for each channel, and preferably also set the wave-form (sine, square, sawtooth, ...) and invert one channel (as opposed to the other). If not, any ideas for a good places to start to make one? I guess the simplest would be to adapt existing programs like synths... But if that work poorly, are there any libraries (like SDL?) that can be used as bases for such a program?


ping timeout differences between OS X and Linux/other OSs

This function I wrote should exemplify the idiosyncrasy between OSX and Linux `ping` commands, in particular their `-W` timeout option:               # Checks if a host is up-and-running and responding to pings          function my_function_is_network_host_up() {            local -ri N_ARGUMENTS=1       if ! check_n_arguments "${FUNCNAME}" "${N_ARGUMENTS}" "${@}"; then return; fi            local -r NETWORK_HOST=$1            local -ri n_requests=1            local -i wait_for_reply=1 # Seconds       if [[ $my_global_os_type == 'OSX' ]]; then         ((wait_for_reply *= 1000)) # Milliseconds       fi            ping -c "$n_requests" \            -W "$wait_for_reply" \            -q \            "$NETWORK_HOST" \            &> /dev/null            return $?          }      Are real sysadmins (I am but a _beginner_ ) using a better Bash function to be able to check hosts independently from the machine they have just hopped onto? My typical usage:               hs=(...);     for h in "${hs[@]}"; do         if my_function_is_network_host_up $h; then             do_stuff         fi     done      or just:               my_function_is_network_host_up $h && do_stuff      * * * ### Background **OSX**               Time in milliseconds to wait for a reply for each packet sent.  If a reply arrives later, the packet is not printed as replied, but considered as replied when calculating statistics.      **Linux**               Time to wait for a response, in seconds. The option affects only timeout in absense of any responses, otherwise ping waits for two RTTs.


Building pango-1.32.6 for use in building gtk3 from git

I'm trying to build pango-1.32.6 to use when building gtk+3 from git, but I'm getting the following error:               checking for CAIRO... yes     checking which cairo font backends could be used... none     configure: Disabling cairo support     configure: error: *** Could not enable any backends.     *** Must have at least one backend to build Pango.      This sounds like an unmet cairo dependency to me. Does anyone know what version it is?


acpi_listen returns different result in Ubuntu than Arch Linux

Ubuntu is able to detect my Lenovo "Mic Mute" button with `acpi_listen`, but when I try it on Arch Linux, there is no output available. Model: `Thinkpad X220 4290LY9` Tried to add `acpi_osi=Linux` in kernel cmdline, but mic mute still has no output from `acpi_listen`. After adding `acpi_osi` option, the led of my output mute button, no longer toggles, but it still functions.


Unable to delete directory

On my OS X host, I am having trouble deleting the directory "foo".               mymac:.Trashes joe$ ls     foo     mymac:.Trashes joe$ ls foo/     Ảnh011.jpg  Ảnh012.jpg  Ảnh013.jpg     mymac:.Trashes joe$ ls -l foo/     ls: Ảnh011.jpg: No such file or directory     ls: Ảnh012.jpg: No such file or directory     ls: Ảnh013.jpg: No such file or directory     mymac:.Trashes joe$ rm -rf foo/     rm: foo/: Directory not empty     mymac:.Trashes joe$ sudo rm -rf foo/     Password:     rm: foo/: Directory not empty      As you can see, there are some files under the directory "foo" which I can only run `ls` on; running `ls -l` returns an error. I cannot delete the individual files or the directory. Using "Empty Recycle Bin" did not work either. I have also tried 'Disk Utility' -> 'Verify Disk' and 'Repair Disk'. Edit: As requested, here are more info               mymac:.Trashes joe$ ls -del foo/     drwxrwxrwx  2 joe  staff  16384 13 May 11:19 foo/     mymac:.Trashes joe$ ls -del foo     drwxrwxrwx  2 joe  staff  16384 13 May 11:19 foo     mymac:.Trashes joe$ LC_ALL=C     mymac:.Trashes joe$ ls -ABeli foo/     total 1812     18972612676 -rwxrwxrwx  1 joe  staff  305951 13 May 11:19 Ảnh011.jpg     19123958587 -rwxrwxrwx  1 joe  staff  309745 13 May 11:19 Ảnh012.jpg     18511775654 -rwxrwxrwx  1 joe  staff  310907 13 May 11:19 Ảnh013.jpg     mymac:.Trashes joe$ find foo/     foo/     foo//Ảnh011.jpg     foo//Ảnh012.jpg     foo//Ảnh013.jpg


Preload movie on RAM

My current computer is unable to run FullHD movies smoothly and I was already resigned to the idea, because it seemed a graphics card issue, mine not being powerful enought to do the work (which is still very probable). But recently a friend of mine bought a SSD and put it in a similar specs laptop and he is now able to run FullHD movies. Now I have the doubt about it being a r/w speed problem and not a GPU problem. The question now, since I'm curious, I dont have a SSD and I have time to waste to run experiments. Is it possible to load the file on RAM and read it from there hoping the RAM reading speed will be similar to that of the SSD?


Per Socket network Buffer queues utilization

Is there a way to get a per-socket send and receive Queues utilization on Solaris similar to the way that Linux' `netstat` displays it? Example on Linux:               Proto Recv-Q Send-Q Local Address               Foreign Address             State     tcp        0      0 0.0.0.0:19072               0.0.0.0:*                   LISTEN     tcp        0      0 0.0.0.0:19008               0.0.0.0:*                   LISTEN


Use apt get install without inserting the DVD?

I installed Debian 7 using a DVD version, so every time I'm trying to install something using apt-get, the system ask me to mount the DVD. Is there a way to avoid that (inserting every time the dvd).


Automatically start named pipe reader on startup?

I'm trying to run a script with root access from PHP. I can't do that because Apache's user, `www-data`, don't have root access because of security reasons. To fix that, I was advised to use a named pipe. I first tried to add sudo permission to `www-data`, but was told that was definitely not good due to security risks (plus, I tried to add it but it didn't work). This is where my problem is. If I understand this correctly, I will need a script that automatically starts on system boot, and constantly waits in the background trying to read from a named pipe. The script, a.k.a. pipe reader, has to be run as root so it gets root access. Then, from PHP, I just send some data through the pipe to the pipe reader, which then is passed on to the main script I'm trying to execute from PHP. This way, since the reader is run as root, the main script will be run with root access. What I refer to as "main script" is a bash script that creates a user, and it needs root to work. It's the script I'm trying to run from PHP with root access. Is this the best approach to my issue? Have I understood it correctly? Update: I'm running Ubuntu 12.04.1.


What is ionice `none: prio 0` equivalent to?

The ionice manual states that: > Note that before kernel 2.6.26 a process that has not asked for an io > priority formally uses "none" as scheduling class, but the io scheduler will > treat such processes as if it were in the best effort class. The priority > within the best effort class will be dynamically derived from the cpu nice > level of the process: io_priority = (cpu_nice + 20) / 5. > > For kernels after 2.6.26 with CFQ io scheduler a process that has not asked > for an io priority inherits CPU scheduling class. The io priority is derived > from the cpu nice level of the process (same as before kernel 2.6.26). I am post 2.6.26, but that still leaves some open questions (I'm assuming CFQ):   1. What is the inheritance mapping for the scheduled class? Does TS SCHED_OTHER = Best Effort (io class 2)?   2. When using the ionice -p command to get the value, it returns `none: prio 0`. However, the formula mentioned in the ionice man would suggest that the same process (cpu nice of zero) would be `best-effort: prio 4` since (0 + 20) / 5 = 4. So my assumption at this point is that `none: prio 0` = `best-effort: prio 4`, but I'm hoping someone can cite some kernel source in order to prove that this is authoritatively true.


Comment all lines in a text file?

In a text file I need to comment out all lines by adding a ";" as first character of each line. What is a good way to do this? I thought of Vim's visual block mode, but I couldn't find a "select all" option and marking several hundred lines manually also isn't great ;-) Any idea? I have nano, vi and vim at hand, I would prefer one of those for this task.


concatenating multiple files with multiple headers

Im trying to concatenate multiple files with multiple headers to have one file with all the information in it for example. ### File 1:               Numbers     1     2     3          Letters     A     B     C      ### File 2:               Numbers     4     5     6          Letters     D     E     F      ### Will be merged to create File 3:               Numbers     1     2     3     4     5     6          Letters     A     B     C     D     E     F      So far I've tried cat and had file2 added to the end then attempted to grep all data under each header but long story short it failed. I've tried paste and if the amount of data in each file is the same then its not too bad as it has each files info tabbed next to the last but will create chaos if any file has more entries than another under a header. Any one got any ideas how to solve this sort of issue?


How can I highlight matches using GNU grep?

I have seen on some Linux, that `grep` is configured to highlight the match, and print the matching file. How can I configure `grep` to highlight matches?


How to get the id of a very short child process if the parent is known?

I'm looking for a way to get the PID of a short child process in Linux. The process is instant from a human perspective. I know the parent process which will spawn the child process. Is there a way to log information about all the processes that are created by a specific parent process? I'm not looking for a way to retroactively figure out the PID of the child but a way to log it once it happens.


Problem with keyboard and mouse in gdm3 and lightdm

Linux anarki 3.2.0-2-amd64 #1 SMP Fri Jun 1 17:49:08 UTC 2012 x86_64 GNU/Linux          Distributor ID: LinuxMint     Description:    Linux Mint Debian Edition     Release:        1     Codename:       debian      When my laptop boots I need to enter a harddrive password. I also have to manually skip the memory test during POST with the escape key so I know my keyboard works. After booting into Linux I get to GDM3 or LightDM (tried both) login screen but my keyboard and mouse won't work. This includes a mouse and keyboard that have been connected via USB. When I unplug the USB keyboard and mouse and plug them in again, they work, but not the internal keyboard and trackpad, because I can't unplug/plug those. The numlock and capslock keys don't even light up when I press them. CTRL-ALT-F1 does not work. I have found problem descriptions on the internet from 2011, with solutions like renaming /var/run/udev or /run/udev. There also was a proposed solution of removing the keyboard and mouse settings from xorg.conf because that is handled by evdev now, but all of these solutions didn't work. The problem does not occur when I start in recovery mode. The keyboard works fine in the terminal, but as soon as I start X by doing startx or starting gdm3 or lightdm the keyboard and mouse cease to work. In the scenario of going through the recovery boot option the screen also stays blank when I start X. I will be browsing through stackexchange looking for other possible solutions to try out.


printing special characters in awk output

I have a large file that contains lot MQ messages with RFH2 header. Each message in the file is separated by a blank line. Now I need to split this large file into small files each containing single message with RFH2 header. I tried with the below awk command `awk '{RS=""} {print $0}' inputfile` This prints the first line without the control characters which is not useful. The first MQ RFH header line starts like `RFH ^B^C^X^A^Q^C3MQSTR ^D¸` followed by message data. The awk output only prints the text `RFH`. If the input file has 50 messages after running this command I get 50 files having only the text `RFH` in them. I am expecting 50 files with RFH2 header and data. I could not give you the real file input because it has sensitive data. The file starts with               RFH ^B^C^X^A^Q^C3MQSTR ^D¸X<jms>     .........some text of many lines.....          RFH ^B^C^X^A^Q^C3MQSTR ^D¸X<jms>     ........some text of many lines.....          RFH ^B^C^X^A^Q^C3MQSTR ^D¸X<jms>     ...      And the output files should have               RFH ^B^C^X^A^Q^C3MQSTR ^D¸X<jms>     .........some text of many lines


Make screenshots of Ti-calculator screen

I want to connect a TI-84 Plus Calculator to my PC and take screenshots of the calculator display. Under windows this is possible using the TI-connect software. However is there also a way to do this under linux?


Why are underscores not allowed in usernames in some distros (Debian for example)

So why has the underscore been considered a bad character for user names in Debian (and possibly other distributions) while it has been removed from `adduser`'s NAME_REGEX in Ubuntu?


How can I ensure only the root user have the right to halt/reboot the system?

CentOS Linux by default allows all users to have permission to "halt" & "reboot" the system by using the commands `halt` and `reboot`. How can I configure my system so that only the root user has the right to `halt`/`reboot` the system?


Opening a usable xterm window through bash script

I often have projects for which I need multiple terminal windows open at different locations, and setting up my workspace each time I want to work on this project takes a long time, so I'd like to be able to automate it with a script. I've only been able to get as far as this:               xterm -hold -e "cd SOMEDIRECTORY && DO STUFF"      But the problem with that is that it just executes the command and doesn't allow me to do anything else in that window. I'd like to be able to have the window open up to a certain directory, execute some commands there, and then allow me to do my own thing in that directory. How can I achieve this?


set gnome terminal background/text color from bash script

I would like to setup my gnome terminal's background(`#002b36`) and foreground color in ubuntu 13, using bash script. I tried `gconftool` but couldn't succeed.               GCONFTOOL-2(1)                  User Commands                                                    GCONFTOOL-2(1)          NAME            gconftool-2 - GNOME configuration tool      My `gnome terminal` version is               $ gnome-terminal --version     GNOME Terminal 3.6.1      ![enter image description here](http://i.stack.imgur.com/kfpAA.png) ## Currently I'm using ubuntu terminal preferences UI to achieve this. ![enter image description here](http://i.stack.imgur.com/bw0y7.png)


remove apostrophes and other marks files from apostrophes

How to remove apostrophes and other marks such as (Parkinson’s and Parkinson's ) from all text files in a directory and save the changes in each one of the files as in the directory


How to restrict one user files to another user

On my machine there are user accounts. My question is how to restrict access to ones user files. Meaning no one else can access my files at all. How can I setup this restriction? How many root users are possible for one Linux machine? **Edit:** I'm One of the user of my system with name `TOM`(actually my system has two users `TOM` and `JERRY`),I installed all the packages by using `root`. **for installing process**               yum install`<package name>`      **Restriction:** No one else access my package and file which are containing in `TOM` user


Run a process to particular/dedicated pid only

I have a c program executable or shell script which I want to run very often. If I want to stop/pause or to notify something I will send signal to that process. So every time I have to check the `pid` of that process and I have to use `kill` to send a signal. Every time I have to check pid and remembering that upto system shutdown, really bad. **I want that process has to run on particular`pid` only** like `init` always run on 1. Is there any C api for that? and Also needed script for bash program.


How to detect SLES version?

What patchlevel does this SLES machine has? 10.2 or 10.4?               SERVER:~ # cat /etc/issue     SUSE LINUX Enterprise Server 10.2     Kernel \r (\m), \l     SERVER:~ #           SERVER:~ # cat /etc/SuSE-release      SUSE Linux Enterprise Server 10 (x86_64)     VERSION = 10     PATCHLEVEL = 4     SERVER:~ #       UPDATE:               SERVER:/etc # rpm -V sles-release     S.5....T  c /etc/issue     S.5....T  c /etc/issue.net     S.5....T  c /etc/motd          SERVER:/etc # zypper sl     # | Enabled | Refresh | Type | Name                                                | URI                                                                        --+---------+---------+------+-----------------------------------------------------+-----------------------------------------------------------------------     1 | No      | No      | YaST | SUSE Linux Enterprise Server 10 SP2                 | cd:///?devices=/dev/hda                                                    2 | Yes     | Yes     | YaST | SUSE Linux Enterprise Server 10 SP2-20110317-171027 | nfs://123.123.123.123/usr/sys/inst.images/Linux/SuSE/SLES10_x86_64/10.2          SERVER:/etc # uname -r     2.6.16.60-0.91.1-smp      UPDATE #2:               SERVER:/etc # cat /etc/issue.rpmnew          Welcome to SUSE Linux Enterprise Server 10 SP4  (x86_64) - Kernel \r (\l).      UPDATE #3               SERVER:/etc #           SERVER:~ # rpm -qi glibc     Name        : glibc                        Relocations: (not relocatable)     Version     : 2.4                               Vendor: SUSE LINUX Products GmbH, Nuernberg, Germany     Release     : 31.95.1                       Build Date: Mon Sep 19 16:43:25 2011     Install Date: Sun Mar 18 08:01:27 2012      Build Host: macintyre     Group       : System/Libraries              Source RPM: glibc-2.4-31.95.1.src.rpm     Size        : 5141247                          License: BSD 3-Clause; GPL v2 or later; LGPL v2.1 or later     Signature   : DSA/SHA1, Mon Sep 19 16:45:00 2011, Key ID a84edae89c800aca     Packager    : http://bugs.opensuse.org     URL         : http://www.gnu.org/software/libc/libc.html     Summary     : Standard Shared Libraries (from the GNU C Library)     Description :     The GNU C Library provides the most important standard libraries used     by nearly all programs: the standard C library, the standard math     library, and the POSIX thread library.  A system is not functional     without these libraries.     Distribution: SUSE Linux Enterprise 10     SERVER:~ #


what's the purpose of ssh-agent?

I've read the official definition: _ssh-agent is a program to hold private keys used for public key authentication (RSA, DSA, ECDSA). The idea is that ssh-agent is started in the beginning of an X-session or a login session, and all other windows or programs are started as clients to the ssh-agent program. Through use of environment variables the agent can be located and automatically used for authentication when logging in to other machines using ssh(1)._ **"..a program to hold private keys.."** \- IMHO - ssh keys are generated by user with ssh-keygen command and simply& straightforward stored in ~/.ssh - why do I need some daemon to hold these keys? How exactly does it hold them anyways - aren't they just stored in .ssh? **"are started as clients to the ssh-agent program"** \- I don't get it. Where would one need that? I usually just use ssh as this:                ssh -i ~/.ssh/private_key_name username@hostname      What exactly does manual means by "clients" - what clients? Don't you just run ssh command from terminal to connect - what other clients are there and why can't they just use a path to that ssh private file, just like ssh command?


Why's my FreeBSD OpenJDK port update failing (and how do I fix it)?

Makes good progress for the first half hour or so, then dies at:               cd bsd_amd64_compiler2/product && ./test_gamma     Using java runtime at: /usr/local/openjdk7/jre     Error occurred during initialization of VM     java/lang/NoClassDefFoundError: java/lang/invoke/AdapterMethodHandle     gmake[4]: *** [product] Error 1     gmake[4]: Leaving directory `/usr/ports/java/openjdk7/work/openjdk/build/bsd-amd64/hotspot/outputdir'     gmake[3]: *** [generic_build2] Error 2     gmake[3]: Leaving directory `/usr/ports/java/openjdk7/work/openjdk/hotspot/make'     gmake[2]: *** [product] Error 2     gmake[2]: Leaving directory `/usr/ports/java/openjdk7/work/openjdk/hotspot/make'     gmake[1]: *** [hotspot-build] Error 2     gmake[1]: Leaving directory `/usr/ports/java/openjdk7/work/openjdk'     gmake: *** [build_product_image] Error 2     *** [do-build] Error code 1      I'm really at a loss. Previous versions built fine. Doing my updates via the portsnap fetch/update then portmaster -a path. OpenJDK, Apache, and Ruby are the only updates of note this time around. Searching only came up with a couple hits (of the "oh, this is broke" followed by "oh it works now" with no explanation on _how_ it was made to work)...


Setting same gtk/openbox theme in both 64 bit native and 32 bit chroot environment

I'm running Arch Linux and have setup a 32bit chroot environment inside a 64bit native install per their wiki instructions. I've installed the Zukitwo and Zukitwo-Openbox themes via the Arch Linux AUR, which install to `/usr/share/themes/Zukitwo`. I'm setting my theme via `obconf` (for openbox) and `lxappearance` (for gtk apps). For some reason, when setting gtk theme with `lxappearance` in the 64bit native environment, my 32bit chroot apps default to the Raleigh theme (looks like Win 3.1). If I enter the chroot and use `lxappearance` to set the same theme (which I've installed in the chroot as well), the 64bit native environment applications switch to Raleigh theme. Since this should just be making changes to, as far as I know, `~/.config/gtk-3.0/settings.ini`, why might my theme not be consistent between the two environments? If it helps, here is the script that starts the 32bit chroot at boot (removed stop case to minimize post length):               #!/bin/bash          dirs=(/dev /dev/pts /dev/shm /tmp /home)          case $1 in         start)             for d in "${dirs[@]}"; do               mount -o bind $d /opt/arch32/$d             done             mount -t proc none /opt/arch32/proc             mount -t sysfs none /opt/arch32/sys             ;;              stop) [... removed ...]     esac      `/home` gets mounted, so the two should just be bound in the chroot and they're sharing the same home directory, right? (Using `diff` on settings.ini in ~/.config/gtk-3.0/settings.ini and /opt/arch32/home/username/.config/gtk-3.0/settings.ini reveals no differences.)


Package a Linux system and app into an installable .iso? Kickstart?

I have written a Python web app that has a number of dependancies. In addition to providing install instructions, I would like to package this up into an .iso for ease of installation. Something similar to what Fully Automated Nagios does. What is the best way to approach this? Is Kickstart what I'm looking for?


How to block yum from upgrading obsoleted package?

Is there any way to prevent yum from upgrading a package obsoleted by another? I have created a custom repo containing some packages, among them **`openh323-devel`**. In current versions of CentOS, **`openh323`** is marked as being obsoleted by OPAL, but I don't want to compile other software (namely YATE) against OPAL. I have **`openh323-devel`** installed, but every time I do `yum update`, it wants me to upgrade it to OPAL. Is there any way I can tell **`yum`** that I permanently don't want to use OPAL (or any other superseding package for that matter) in a manner similar to apt pinning? Of course, I can `--exclude` specific packages, but that's not what I want.


How can I save/restore window positions when I undock/dock my laptop?

I have a laptop with a docking station that has a large monitor connected to it. When the laptop is docked, I use the monitor as my primary display, and the laptop screen as a secondary display. When I undock, the laptop screen becomes my primary display, and all the windows move over to it. When I dock the laptop, the monitor automatically becomes the primary display again, but the windows all stay on the laptop screen. I have to drag each one over to the monitor and resize it. **How can I get my windows to automatically resume the positions and sizes they had just before I undocked (assuming they're still open)?** All I've been able to find are answers talking about restoring programs when you log in. That's not what I'm looking for. I'm using Gnome 3 on Arch Linux.


Mounting and modifying a loopback file without sudo/root, is it possible?

I'm trying to adapt a tutorial into an easy to use script http://qt- project.org/wiki/RaspberryPi_Beginners_guide. I'm trying to reduce the need for sudo/root as much as possible (preferably, only for the final `dd` step). My questions are:   1. Can I mount the ext4 file system without sudo/root privileges in any way?   2. Can I mount it in a way so that users/groups on the FS are ignored in some way (so I can run make install without sudo)? The Filesystem is currently mounted loopback from an offset of a file (i.e. `-o loop,offset=62914560`). This file is the image that will be copied onto the SD card used to boot the Raspberry Pi.


How to run new background command sequentially if I already have a nohup background command running?

Say I already have a background running command1               nohup command1 &      Now I want to submit command2 into background, But I don't want command2 to run immediately. I want command2 to start running after command1 is finished. How can I achieve this?


Is here an editor for linux terminal like there is for MS-DOS?

I know that there is an editor built into MS-DOS, so you can create batch (.bat) files. But is there something like that for Linux Mint 12 terminal?


xterm doesn't switch directory when it is moved

Recently I was very frustrated with xterm not behaving as expected. This is what I was doing:   1. open xterm   2. run the following commands:              $ mkdir test_01     $ cd test_01/     $ echo 'a' > a     $ cat a      The output will be:              a        3. open another xterm (don't close the first one)   4. run the following commands:              $ mv test_01/ test_01_old     $ mkdir test_01     $ cd test_01     $ echo 'b' > a     $ cat a      The output will be:              b        5. now in the original xterm run the command:              $ cat a      The output will be:              a      **Why does this happen?** At this stage, both xterms report the same directory with the `pwd` command (which is `/home/user_1/test_01`).


Changing drives in FTP

I am using RHEL6 and I connect to FileZilla FTP Server in Windows 2008 Server which has more than 10 drives. I have access to all of them but for my user `C:\` is Home Directory. I want to change to other drives, such as `D:\ Y:\ S:\` etc. When I type `lcd d:\` it outputs > no such file or directory How I can change Windows drives with my Linux command-line FTP client (`ftp`)?


Ubuntu 12.04 hotspot wifi network not visible to Android 4.1.2

I'm running Ubuntu 12.04 LTS on my notebook, and I've got a Motorola Razr which I updated to Android 4.1.2. Before updating, I connected my smartphone to my hotspot wifi very quickly, but after the update it no longer works. Android 4.1.2 can't see the hotspot created by Ubuntu; it sees all other wifi networks and can connect to them, but not mine. What could be wrong?


How do I identify why my login hangs for 20 seconds at startup?

I've done something (I can't remember what) and now when I log in, just after entering my details, I see the background with my mouse cursor and nothing happening. Then, after about 20 seconds (presumably a timeout) the hard drive keeps loading and I get my desktop. I tried install `bootchart2`: `apt-get install bootchart2 pybootchartgui` I followed their instructions here and added the following line to `/etc/default/grub`: `initcall_debug printk.time=y quiet init=/sbin/bootchartd ...` when I run update-grub I get the following error message: `/usr/sbin/grub-mkconfig: 12: /etc/default/grub: initcall_debug: not found`


How can I configure two mails for two different users in Ubuntu

I am struggling with configuring `two mails for two different users` in Ubuntu. Like if I login with `User1` then whenever I use the command mail, it should send mail from `user1@gmail.com`. And when User2 logins with its credentials then it should send mail from `user2@gmail.com`. Currently I've changed my `/etc/ssmtp/ssmtp.conf` for my Gmail id. But when I send mail from a different user, the same mail id is been used. Can anyone please provide any pointer or links?


Wrapping a shell script with tee

There is a bash script which prints some logs and allows some arguments. The script prints the logs to STDOUT. Let's say the script's name is `AAA.sh` I'd also like to make the script to print the logs to `STDOUT` and a `file`. This can be done with `tee`.               $ AAA.sh -a -b --c=d | tee 2012-07-03-080000.log      But my team often forgets to pipe the output to `tee`. We should save the logs to file. So I'd like to wrap the script with `tee`. What I want to do is               $ WrapAAAwithTee.sh -a -b --c=d      Then AAAwithTee.sh should print the log to STDOUT and a log file.   How can I wrap the AAA.sh?


What are possible reasons for erratic NTP synchronistation?

On a Ubuntu 10.04 system I noticed following strange NTP sync events:               Jul  3 02:19:51 hst ntpd[1432]: no servers reachable     Jul  3 02:36:55 hst ntpd[1432]: synchronized to 91.189.94.4, stratum 2     Jul  3 02:53:48 hst ntpd[1432]: time reset -10.407942 s     Jul  3 02:53:48 hst ntpd[1432]: kernel time sync status change 6001     Jul  3 02:53:48 hst dovecot: dovecot: Fatal: Time just moved backwards by 10 seconds. This might cause a lot of problems, so I'll just kill myself now. http://wiki.dovecot.org/TimeMovedBackwards     Jul  3 02:58:37 hst ntpd[1432]: synchronized to 91.189.94.4, stratum 2     Jul  3 02:58:37 hst ntpd[1432]: kernel time sync status change 2001     Jul  3 03:08:15 hst ntpd[1432]: no servers reachable     Jul  3 03:16:49 hst ntpd[1432]: synchronized to 91.189.94.4, stratum 2     Jul  3 03:17:01 hst CRON[28221]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)     Jul  3 03:18:04 hst ntpd[1432]: time reset +10.403648 s     Jul  3 03:22:41 hst ntpd[1432]: synchronized to 91.189.94.4, stratum 2      Where 91.189.94.4 europium.canonical.com and the only server line in `ntp.conf` is:               server ntp.ubuntu.com      The update at 2:36 seems pretty bogus because it is canceled out 25 minutes later. What could be possible reasons for this? I can think of:   * remote NTP server just provides the wrong time   * network problems (could a high latency introduce such drifts?)   * leap second induced bug (this should induce a crash instead, right?) If the first alternative was the problem how can I protect against this? Is NTPD smart enough to consult multiple NTP servers (when multiple `server` lines are available in `ntp.conf`) and detect if different answers deviate too much from each other?


Cannot type keyword symbols in Linuxmint

I found that in my linuxmint 13.10, when I want to type a @(Shift + 2), the screen displays " (Shift + ' in windows). However, today the biggest problem is there is no ways to type |. Therefore, I would like to ask how can I change the keyboard settings?


How to add tcp6 on raspbian?

You have no necessity to install any additional packages. Everything should work fine. Thus check whether files /proc/net/tcp6, /proc/net/tcp exist. If they are absent, just add them. sir you gave this answer at given link:why dstat failed with --tcp option? can you please tell me about how to add tcp6 on raspbian. actually i am using raspberry pi for my thesis. thanks in advance.


wget not able to log into ftp

I am trying to use wget for downloading files from a ftp repository. The FTP repository has a login and password. I have to go through a proxy server which does not have a login and password. When I try to use the normal, `wget -r -c ftp://login:pass@download.site.co.in/` I find that it tries to login to the proxy server itself rather than the ftp server causing it to hang at that stage. using `--ftp-user` and `ftp-password` has the same effect. How can I get around this?


Convert links of downloaded website

I downloaded a website using:               wget -c --mirror -p http://www.somewebsite.com      for offline viewing and I just remembered that I forgot the --convert-links option! They are all on my hard drive right now. Is there a way to do --convert-links without redownloading the whole website?


Dual boot Ubuntu 14.04 and CentOS 7.0

Problem in installing Ubuntu after CentOS 7.0: I have a laptop with a hard disk around 170Gb. After installing CentOS 7.0 I tried to install the Ubuntu 14.04 alongside with the CentOS 7.0. The Ubuntu installer could not recognise the existing CentOS 7.0 and I could not shrink the exisitng drive. Will change of installation sequence helps (remove the CentOS 7.0 and install Ubuntu first)?


SSH window forwarding with Xming

I have installed fedora 17 on the old desktop computer and put it to DMZ of my NAT network - i.e. whole computer is accessible via public ip address to the internet and could be called "server". I've allowed SSH connections on firewall - everything works perfect, but there is one huge problem. Both me and my friend abroad have Windows 7, so we are using putty + xming to forward windows. My computer (on the same LAN as "server") works without any problem (setting putty like this http://www.geo.mtu.edu/geoschem/docs/images/putty_4.jpg). Friend, however, he can't open any window (xming is running and putty is configured same as in my computer). He can login using putty, I can see him in `who` output, he can run console programs (e.g. nano), but he cannot start any GUI program. We tried `firefox`, `firefox &`, `gedit` and `gedit &`. But after issuing the command, nothing happened - just new command prompt and no process created at all... without any error message... I've also tried it using his account (from my computer) and everything worked... any ideas, what could cause the problem? is it possible, that some firewall could allow SSH traffic but block X11 forwarding?


Issue while we install EPEL Packages on CentOS 6

I Just try to install system requirements of http://magento.com/resources/system-requirements , But facing the issues below attached the same. For my every install EPEL package, there was a issue of "No Package xxx available", I've Enabled EPEL Repository by,               ## RHEL/CentOS 6 64-Bit ##     # wget http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm     # rpm -ivh epel-release-6-8.noarch.rpm      ![No Package Available while we try to install EPEL package](http://i.stack.imgur.com/4y4EZ.png)


How to configure Unison for real peer-to-peer?

I have a handful of devices, and am considering keeping them in sync with Unison. The devices are not running all the time, they are switched off a few hours per day, not necessarily at the same time. None of the devices is running 24 hours a day. So I need **real peer-to-peer** , for instance see how a change (marked as `*`) propagates from A to B,C,D even though none has been running during all syncs:               A-on*   B-on    C-off   D-off     A-on*   B-on*   C-off   D-off     A-off*  B-on*   C-off   D-off     A-off*  B-on*   C-on    D-off     A-off*  B-on*   C-on*   D-off     A-off*  B-off*  C-on*   D-off     A-off*  B-off*  C-on*   D-on     A-off*  B-off*  C-on*   D-on*      Unfortunately, the Unison user manual recommends a **star topology** for more than 2 machines: > **Using Unison to Synchronize More Than Two Machines**   >   >  Unison is designed for synchronizing pairs of replicas. However, it is > possible to use it to keep larger groups of machines in sync by performing > multiple pairwise synchronizations. > > If you need to do this, the most reliable way to set things up is to > organize the machines into a “ **star topology** ,” with one machine > designated as the “hub” and the rest as “spokes,” and with each spoke > machine synchronizing only with the hub. The big advantage of the star > topology is that it eliminates the possibility of confusing “ **spurious > conflicts** ” arising from the fact that a separate archive is maintained by > Unison for every pair of hosts that it synchronizes. Despite that, is there any way to achieve real peer-to-peer with Unison?


Shell script time output over java enviroment

I am running a script from java program using sshxcute API. Script contains:               #!/bin/sh     data=`stat -c%y filename`     echo $data      Script running on bash gives output:               2014-03-08 13:26:29.335545828 -0800      Script running through java program gives output:               2014-03-08 21:26:29.335545828 +0000      I think the -0800 is getting added. I need output in first format. Anyone have any idea how to resolve the issue?


dd outputting: "function not implemented" when trying to write to /dev/sg11

I'm trying to use the following command:               dd if=/dev/urandom of=/dev/sg11 bs=16K count=1      But when executing it, I get the following error:               dd: writing `/dev/sg11': Function not implemented      When I try with `dd if=/dev/urandom of=/dev/sg11 bs=16K count=1 conv=fsync`, then I get a `cannot allocate memory` error, which becomes a `Function not implemented` error when I up the bs size. What causes this issue and how can I fix it? UPDATE: Sometimes it will tell me `cannot allocate memory`, and then it will again tell me that `function not implemented` for the same bs value.


liveCDs detecting wrong video card

I just replaced my video / graphics card with a new model, the AMD firepro m6100. None of my ubuntu 13.10 based liveCDs are able to run correctly (manually running startx from tty1 fails, so that's probably part of it). I suspect the root of the problem is that Dell (supposedly) changes the hardware ID for their hardware. I need to find a way around this so I can not only run a live environment but also repair my broken GRUB install, and eventually get my system running with the new video card. lspci - in the live environment - spits out the following:               1:00.0 VGA compatible controller: ... [AMD/ATI] Saturn XT [Radeon HD 8950M] (prog-if 00 [VGA Controlle...     Subsystem: Dell Device 04a4     Flags: bus master, fast devsel, latency 0, IRQ 51     Memory at d0000000 (64-bit, prefetchable) [size=256M]     Memory at e0000000 (64-bit, prefetchable) [size=8M]     I/O ports at 7000 [size=256]     Memory at e4100000 (32-bit, non-prefetchable) [size=256K]     Expansion ROM at e4140000 [disabled] [size=128K]     ...     Capabilities: [100] Vendor Specific Information: ID=0001 Rev=1 Len=010     ...     Kernel driver in use: radeon


How to run java service as a non-root user on CentOs 6

I have a script that starts a Java application as a service on CentOS 6:               #!/bin/sh     # chkconfig: - 80 20          SERVICE_NAME=cn4server     PATH_TO_JAR=/usr/local/share/myserver/cn4server.jar     PID_PATH_NAME=/usr/local/share/myserver/cn4server-pid     case $1 in         start)             echo "Starting $SERVICE_NAME ..."             if [ ! -f $PID_PATH_NAME ]; then                 nohup java -jar $PATH_TO_JAR /tmp 2>> /dev/null >> /dev/null &                             echo $! > $PID_PATH_NAME                 echo "$SERVICE_NAME started ..."             else                 echo "$SERVICE_NAME is already running ..."             fi         ;;         stop)             if [ -f $PID_PATH_NAME ]; then                 PID=$(cat $PID_PATH_NAME);                 echo "$SERVICE_NAME stoping ..."                 kill $PID;                 echo "$SERVICE_NAME stopped ..."                 rm $PID_PATH_NAME             else                 echo "$SERVICE_NAME is not running ..."             fi         ;;         restart)             if [ -f $PID_PATH_NAME ]; then                 PID=$(cat $PID_PATH_NAME);                 echo "$SERVICE_NAME stopping ...";                 kill $PID;                 echo "$SERVICE_NAME stopped ...";                 rm $PID_PATH_NAME                 echo "$SERVICE_NAME starting ..."                 nohup java -jar $PATH_TO_JAR /tmp 2>> /dev/null >> /dev/null &                             echo $! > $PID_PATH_NAME                 echo "$SERVICE_NAME started ..."             else                 echo "$SERVICE_NAME is not running ..."             fi         ;;     esac       It works well, but it runs as a root. How can I change the script to run the Java application on behalf of another user?


I am running Ubuntu:               #lsb_release -a     No LSB modules are available.     Distributor ID: Ubuntu     Description:    Ubuntu 12.04.4 LTS     Release:    12.04     Codename:   precise     Kernel info:          3.8.0-38-generic #56~precise1-Ubuntu SMP Thu Mar 13 16:23:47 UTC 2014 i686 i686 i386 GNU/Linux      The source that I am having is : **linux-lts-raring-3.8.0** When I am trying to make my first driver I get the following errors:               make -C /usr/linux-lts-raring-3.8.0 SUBDIRS=/home/drdr/Documents/drivers/first_driver modules     make[1]: Entering directory `/usr/linux-lts-raring-3.8.0'            WARNING: Symbol version dump /usr/linux-lts-raring-3.8.0/Module.symvers                is missing; modules will have no dependencies and modversions.            Building modules, stage 2.       MODPOST 1 modules     /bin/sh: 1: scripts/mod/modpost: not found     make[2]: *** [__modpost] Error 127     make[1]: *** [modules] Error 2     make[1]: Leaving directory `/usr/linux-lts-raring-3.8.0'     make: *** [default] Error 2      Then I went to scripts/mod/ in my source directory I typed make:               root@drdr:/usr/linux-lts-raring-3.8.0/scripts/mod# make modpost     cc     modpost.c   -o modpost     In file included from modpost.c:18:0:     modpost.h:12:23: fatal error: elfconfig.h: No such file or directory     compilation terminated.     make: *** [modpost] Error 1      **Update** I found a related file mk_elfconfig.c. Is there a way to generate elfconfig.h from this;               root@drdr:/usr/linux-lts-raring-3.8.0/scripts/mod# ls -ld mk_elfconfig.c      -rw-r--r-- 1 root root 1234 Feb 19  2013 mk_elfconfig.c      Why I am getting this error? I believe the version of the source code and what is running are the same. The Makefile and source code for the driver is given here **Update** after copying config- from /boot to my source code as .config: I did               root@drdr:/home/drdr/Documents/drivers/linux-lts-raring-3.8.0#make oldconfig      scripts/kconfig/conf --oldconfig Kconfig     #     # configuration written to .config     #          root@drdr:/home/drdr/Documents/drivers/linux-lts-raring-3.8.0# make prepare     scripts/kconfig/conf --silentoldconfig Kconfig       SYSHDR  arch/x86/syscalls/../include/generated/uapi/asm/unistd_32.h       SYSHDR  arch/x86/syscalls/../include/generated/uapi/asm/unistd_64.h       SYSHDR  arch/x86/syscalls/../include/generated/uapi/asm/unistd_x32.h       SYSTBL  arch/x86/syscalls/../include/generated/asm/syscalls_32.h       HOSTCC  arch/x86/tools/relocs       WRAP    arch/x86/include/generated/asm/clkdev.h       CHK     include/generated/uapi/linux/version.h       UPD     include/generated/uapi/linux/version.h       CHK     include/generated/utsrelease.h       UPD     include/generated/utsrelease.h       CC      kernel/bounds.s       GEN     include/generated/bounds.h       CC      arch/x86/kernel/asm-offsets.s       GEN     include/generated/asm-offsets.h       CALL    scripts/checksyscalls.sh     root@drdr:/home/drd/Documents/drivers/linux-lts-raring-3.8.0#       But still same error in driver compilation:               root@drdr:/home/drdr/Documents/drivers/first_driver# make     make -C /usr/linux-lts-raring-3.8.0 SUBDIRS=/home/drdr/Documents/drivers/first_driver modules     make[1]: Entering directory `/usr/linux-lts-raring-3.8.0'            WARNING: Symbol version dump /usr/linux-lts-raring-3.8.0/Module.symvers                is missing; modules will have no dependencies and modversions.            Building modules, stage 2.       MODPOST 1 modules     /bin/sh: 1: scripts/mod/modpost: not found     make[2]: *** [__modpost] Error 127     make[1]: *** [modules] Error 2     make[1]: Leaving directory `/usr/linux-lts-raring-3.8.0'     make: *** [default] Error 2


power management of USB-enclosed hard drives

With a typical USB hard drive enclosure, is the full range of drive power management functionality available? **edit** : moved this into a separate question: ~~In what may be an unrelated matter: is it possible to suspend a PC without unmounting an attached USB-powered drive, and then remounting it on resume? This is the behaviour I'm currently seeing (running Ubuntu linux 10.10).~~ **/edit** Are there certain models or brands that provide more complete control over this aspect of drive operation? My Friendly Neighbourhood Computer Store carries (part of) the Vantec Nexstar product line.


undelete a just deleted file on ext4 with extundelete

Is there a simple option on `extundelete` how I can try to undelete a file called `/var/tmp/test.iso` that I just deleded? (it is not so important that I would start to remount the drive read-only or such things. I can also just re-download that file again) I am looking for a simple command whith that I could try if I manage to fast- recover it. I know, it is possible with remounting the drive **in read-only** : (see How do I simply recover the only file on an empty disk just deleted?) But is this also possible somehow **on the still mounted disk?**


how to run perl cgi script on apache

I Successfully installed Apache web server in my local machine. My question is how to run perl cgi script on this server Actully I don't have any Idea that's why posted question here. my sample cgi script is               #!/perl/bin/perl -w     use strict;     use warnings;     print "Content-type: text/html\n\n";     print "
This is first!
\n";       Where to store this script by which extention either .cgi or .pl? What are the necessary should follow to execute this script . Please let me know I know this is very basic question. I could not found any better link on google so i posted.


Print line after nth occurrence of a match

I am looking to display the line 4598 in the following file. Effectively I want to display the line AFTER the nth occurrence of a match. In this case, the line after the 3rd occurrence of `<Car>`. How do I go about this?               <Car>     10456     </Car>     <Car>     70192     </Car>     <Car>     4598     </Car>


Quicktime-like video trimming in Linux?

One thing I loved about Quicktime 10 in Mac OS X (despite all its other shortcomings) was the ability to very easily trim a video file. I.e., I open the video in Quicktime drag two sliders to indicate the segment I want to cut from the video, then click Save As. All of this can happen very quickly. I really want to recreate this ease in Linux (I am running the latest Fedora but would love a distro-adnostic solution), but so far the best I can do was to clip videos in OpenShot or Kdenlive. The problem there is that I need to _export_ the segment resulting in re-encoding which takes much longer. Is there a way to easily trim/clip videos in Linux? Thanks!


How can I forward a already forwarded ssh key into tmux?

I'm connecting through SSH from a machine where my keys are stored, forwarding to a second machine, and then try to use the keys from within tmux. I appear to "loose" the forwarding when entering tmux. How can "forward again" so that I can use my keys from within tmux?               $ ssh [server] -o ForwardAgent=yes     $ git pull       # Succeeds.     $ /bin/bash     $ git pull       # Still succeeds, despite new shell.     $ exit     $ tmux attach     $ git pull       # Permission denied (publickey)


Python 2.7 on Samsung ChromeBook

I notice that there is a `/usr/bin/python` which is symlinked to `/usr/local/bin/python2.7` on Samsung Chromebook (`GOOGLE_RELEASE=4319.79.0`). But there is no file there and hence the directory entries show up in red. Is there some way of installing / activating Python?


What would be the "apt-cache show" equivalent on RHEL *without* requiring sudo/su?

How can I query the _local_ package cache of `yum` on RHEL (and derivatives) without requiring superuser privileges? **Note:** I am not interested in running an update of the package cache up front. All I am interested in is to query what the local package cache _already_ knows. * * * **Edit:** it turns out the problem wasn't the `yum` operation (`search`) itself in this case, but rather the fact that some of the files underneath `/etc/yum.repos.d/` were unreadable due to some fellow admin putting them there this way.


tee + cat: use an output several times and then concatenate results

If I call some command, for instance an `echo` I can use the results from that command in several other commands with `tee`. Example:               echo "Hello world!" | tee >(command1) >(command2) >(command3)      With cat I can collect the results of several commands. Example:               cat <(command1) <(command2) <(command3)      I would like to be able to do both things at the same time, so that I can use `tee` to call those commands on the output of something else (for instance the `echo` I've written) and then collect all their results on a single output with `cat`. It's important to keep the results in order, this means the lines in the output of `command1`, `command2` and `command3` should not be intertwined, but ordered as the commands are (as it happens with `cat`). There may be better options than `cat` and `tee` but those are the ones I know so far. I want to avoid using temporary files because the size of the input and output may be large. How could I do this? PD: another problem is that this happens in a loop, that makes harder handling temporary files. This is the current code I have and it works for small testcases, but it creates infinite loops when reading and writing from the auxfile in some way I don't understand.               somefunction()     {       if [ $1 -eq 1 ]       then         echo "Hello world!"       else         somefunction $(( $1 - 1 )) > auxfile         cat <(command1 < auxfile) \             <(command2 < auxfile) \             <(command3 < auxfile)       fi     }      Readings and writings in auxfile seem to be overlapping, causing everything to explode.


Create a Filter for Postfix on Virtual Mails

This is what I am trying to do: I have a server using Postfix on a Ubuntu precise 64bits and I have a table list of emails in /etc/postfix/virtual, like this:               artz@mydomain.com  artz@gmail.com     artz2@mydomain.com artz@yahoo.com      Now I want to put a filter that get all mails sent and add some prefix to the subject or add something else to the end of the mail. In the file /etc/postfix/master.cf I put:               filter    unix  -       n       n       -       10      pipe       flags=Rq user=filter argv=/home/filter/filtro.php -f ${sender} -- ${recipient}      I created the user filter and put the file /home/filter/filtro.php:               #!/usr/bin/php     <?php     $myFile = "/home/filter/testFile.txt";     $fh = fopen($myFile, 'a');     fwrite($fh, "\n-----------------------\n");     fwrite($fh, json_encode($_SERVER['argv']) );     ?>      It was just to see if it´s working. But it´s not. Anyone can see a light for my problem? Thanks!


What are the two sections of this dmidecode output?

I ran dmidecode on my system to verify certain processor information. However, I am not sure what the two sections of the output indicate.               $ sudo dmidecode -t processor     # dmidecode 2.11     SMBIOS 2.7 present.          Handle 0x0004, DMI type 4, 42 bytes     Processor Information         Socket Designation: CPU 1         Type: Central Processor         Family: Other         Manufacturer:                           ID: 00 00 00 00 00 00 00 00         Version:                                                         Voltage: 3.3 V 2.9 V         External Clock: Unknown         Max Speed: 2000 MHz         Current Speed: Unknown         Status: Unpopulated         Upgrade: Other         L1 Cache Handle: 0x0005         L2 Cache Handle: 0x0006         L3 Cache Handle: 0x0007         Serial Number: To Be Filled By O.E.M.         Asset Tag: To Be Filled By O.E.M.         Part Number: To Be Filled By O.E.M.         Core Count: 1         Core Enabled: 1         Thread Count: 1         Characteristics:             64-bit capable          Handle 0x0035, DMI type 4, 42 bytes     Processor Information         Socket Designation: P0         Type: Central Processor         Family: E-Series         Manufacturer: AuthenticAMD              Signature: Family 11, Model 15, Stepping 15         Flags:             MSR (Model specific registers)             CX8 (CMPXCHG8 instruction supported)             APIC (On-chip APIC hardware supported)             SEP (Fast system call)             ACPI (ACPI supported)         Version: AMD E-450 APU with Radeon(tm) HD Graphics         Voltage: 1.4 V         External Clock: 100 MHz         Max Speed: 1650 MHz         Current Speed: 1650 MHz         Status: Populated, Enabled         Upgrade: None         L1 Cache Handle: 0x002D         L2 Cache Handle: 0x002E         L3 Cache Handle: Not Provided         Serial Number: Not Specified         Asset Tag: Not Specified         Part Number: Not Specified         Core Count: 2         Core Enabled: 2         Thread Count: 2         Characteristics:             64-bit capable      The second section (`Handle 0x0035`) seems to be the processor information. What is the first section (`Handle 0x0004`) ? I have looked at the manpage, and some Google results as well, none of which were helpful.


How to rsync just the current folder?

I want to sync some files from a remote server to my local computer. How can I make rsync to just copy the files with a certain file extension in the directory but no subdirectories? I assumed this to be an easy task, but embarassingly I'm not getting it for nearly 2 hours. So could someone give me an example? I did various experiments with something like the following command:               rsync -a --include=what? --exclude=what? -e ssh me@server.com:/test /test


Conntrack TCP Timeout for state stablished not working

Im using a private IP address and I want to keep alive SNAT entries in my Router (Gateway) for at least two hours (some windows apps of my network are using TCP keepalive set to 2 hours). Gateway is a Linux machine so i set `nf_conntrack_tcp_timeout_established` and `nf_conntrack_generic_timeout` values to 7400 seconds:               echo 7400 > /proc/sys/net/netfilter/nf_conntrack_tcp_timeout_established     echo 7400 > /proc/sys/net/netfilter/nf_conntrack_generic_timeout      Now, when a TCP connection is stablished shortly after i can see the new value:               # cat /proc/net/ip_conntrack     tcp      6 7399 ESTABLISHED src=192.168.0.192 dst=108.168.176.194     sport=51826 dport=5222 src=108.168.176.194 dst=95.63.14.117 sport=5222      dport=51826 [ASSURED] use=1      But few seconds later i read the value again and now the value has returned to 60 seconds:               tcp      6 39 ESTABLISHED src=192.168.0.192 dst=108.168.176.194      sport=51826 dport=5222 src=108.168.176.194 dst=95.63.14.117 sport=5222      dport=51826 [ASSURED] use=1


Forcing broswers to use a different host and port when viewing websites over ssh-tunnels

I've setup an ssh tunnel to a network that has a website I need to view. However, when requesting the page my browsers sends the host `localhost` and url `http://localhost:1234` in the HTTP headers. Is there a way to spoof this information, if there's a browser specific way of doing it that works for chromium or firefox, that will be useable. SSH Setup:               Host mytunnel         User myname         HostName host.example.com          ExitOnForwardFailure true         LocalForward 1234 host.example.com:80      The only way I can think of now is setting up a virtual machine that runs a DNS server and sets up the tunnels on the right ports.


Regarding getting Date - n days Date

Suppose I have a particular date stored in a variable (date_m) . I want ((date_m)-25) date. For eg: I have 15/09/2014 stored in my variable , then I want 21/08/2014 returned if I subtact 25 from the date stored in variable.


Is setting CentOS user home-dir as NGINX server block root secure for vsftpd?

This is what I did:   1. CentOS 6.2 server   2. installed nginx   3. installed vsftpd   4. in vsftpd.conf I set `chroot_local_user=YES`   5. created a new user "bleh"   6. created directory `/home/bleh/public_html/`   7. in virtual.conf I set location / { root to `/home/bleh/public_html/`   8. and finally did `chmod 755 /home/bleh/` Is this safe? Is this acceptable? I ran into all sorts of permission problems when I tried to use `/var/www/` as root. The above worked and the server is delivery data.


There are stopped jobs (on bash exit)

I get the message `There are stopped jobs.` when i try to exit a bash shell sometimes. Here is a reproducible scenario in python 2.x:   * `ctrl`+`c` is handled by the interpreter as an exception.   * `ctrl`+`z` 'stops' the process.   * `ctrl`+`d` exits python for reals. Here is some real-world terminal output:               example_user@example_server:~$ python     Python 2.7.3 (default, Sep 26 2013, 20:03:06)      [GCC 4.6.3] on linux2     Type "help", "copyright", "credits" or "license" for more information.     >>>       `ctrl+z`               [1]+  Stopped                 python     dylan@development:~$ exit     logout     There are stopped jobs.      Bash did not exit, I must `exit` again to exit the bash shell.   * **Q:** What is a 'stopped job', or what does this mean?   * **Q:** Can a stopped process be resumed?   * **Q:** Does the first `exit` kill the stopped jobs?   * **Q:** Is there a way to exit the shell the first time? (without entering `exit` twice)


Why does my laptop suspend twice/thrice?

The `awesome` WM doesn't suspend automatically when closing the lid, so I followed some instructions to get it working. I simply added a file `/etc/acpi/local/lid.sh.post` with the following contents:               #!/bin/sh     pm-suspend      Suspending works now, but after I open the lid and press the power button it shows the desktop for a fraction of a second before suspending again! The second time I press the power button it resumes properly. After that, any time I suspend I have to press the power button and wait _three_ times before it resumes properly. I've tried suspending four times in a row, and it doesn't seem to get any worse. Solved! If anybody else wants it, I made a script to do this in one command.


RaspberryPi drops Wifi connection

I am using Airlink Fully compatible Wireless N 150 Ultra Mini-USB Adapter (AWLL5099) with my RaspPi to get internet. I am also bridging this WiFi connection with an Ethernet cable to provide internet to my XBox 360. However, the WiFi drops out every 30-45 minutes. I am unsure why this is happening. The following is my /etc/network/interfaces setup:               auto lo     iface lo inet loopback          auto wlan0     iface wlan0 inet dhcp          auto eth0     iface eth0 inet dhcp          auto br0     iface br0 inet dhcp     bridge_ports wlan0 eth0      EDIT: Using hatesnakeslovepython's answer works! My connection no longer drops. I was using bridge_utils previously which is what introduced my problem. Exactly what the problem is I am not sure, but using the iptables setup fixed it.


Search for a file inside a tar.gz file without extracting it and copy the result to another folder

I need to search for a file inside a `tar.gz` file without extracting it. After that, I need to copy the file that was searched (if ever there is) to another folder. So far I have this, but the copy part of this line gives me an error.               gunzip -c file.tar.gz | tar tvf - | grep filename | -exec cp {} /folder/another_folder \;      Or is there a better way to search for a file inside a `tar.gz` file without extracting it?


Detect if HDMI Monitor is switched off

I have a Monitor connected to my machine through HDMI.   Now if anyone were to switch off the Monitor, through either the Soft Buttons on it, or by removing it's Power Cord, I wish to be notified and run a Shell Script. I tried many ways to identify when a monitor is switched on or off (It's always connected). The only technique that comes close is: `# ddccontrol -p` When the external monitor is connected, this returns all kinds of details about the monitor. I could write a script to parse the output for that. However this seems like a unreliable technique for un-supervised usage. Is there any way through which I could obtain a Yes/No answer to whether the Monitor is Switched On/Off? EDIT: It would be preferable if I can get a message on status change. Since this will be running continuously for days, I do not wish to poll for the status of the monitor. Instead in case it is switched off, I would like to be informed through a message.


Comparable editor for gedit with less dependencies?

I want to leave Gnome and install awesome on debian squeeze or wheezy, but I really can't work without gedit. Is there any text editor like gedit capable of editing columns, highlighting nearly any language, and building texfiles straight from the editor? The wealth of features is important to me because I want to use it as a central "IDE". I've tried Eclipse, but didn't care for it.


How do I know all IP related to the wireless LAN in ubuntu 14.04?

How I know all IP on my LAN Wireless using ubuntu 14.04


How Does X build its modelist?

I have an embedded board running Linux 3.0.35 and X.Org 1.14.4. I'm modifying an existing framebuffer driver to support a new connector type. I'm reading the EDID, creating a new modelist using the fb_ functions, and can see the correct mode list in /sys/class/graphics/fb0/modes. However, the X server only seems to pick up these modes at start. If I start X with a monitor connected, it will see the correct mode list and xrandr will allow me to switch modes. However, if I start X without a monitor, after I connect it the framebuffer driver presents the correct modelist but not xrandr. The latter only shows the default mode I set if no monitor is detected. Given the version of kernel and X server I'm using, is there a standard way to notify the X server to reload its mode list? Do most X drivers expect to read the EDID over i2c themselves and generate their own mode list? Or do I need to do something with say a udev rule executed on monitor hotplug to run a script that uses xrandr to clear the mode list and add new ones based on the modes found in the framebuffer driver? Any other suggestions? Thanks.


Tricks and tips for finding information in man pages

Does anyone have any tricks and tips for finding information in man pages?


What does "0x0030: 061c 0dd8 4745 5420 2f20 4854 5450 2f31" mean in tcpdump?

I am trying to learn `tcpdump`. I ran the following command:-               tcpdump -i eth0 -lnXs1600 host google.com and port 80       and got the following results:-               2:23:45.781779 IP 10.16.30.28.42957 > 173.194.36.65.http: Flags [S], seq 3301439566, win 5840, options [mss 1460,sackOK,TS val 212804497 ecr 0,nop,wscale 5], length 0             0x0000:  4500 003c dbdf 4000 4006 64ad 0a10 1e1c  E..<..@.@.d.....             0x0010:  adc2 2441 a7cd 0050 c4c7 f84e 0000 0000  ..$A...P...N....             0x0020:  a002 16d0 a18e 0000 0204 05b4 0402 080a  ................             0x0030:  0caf 2391 0000 0000 0103 0305            ..#.........     12:23:45.782354 IP 173.194.36.65.http > 10.16.30.28.42957: Flags [S.], seq 3225093944, ack 3301439567, win 32768, options [mss 1460,nop,wscale 0,nop,nop,TS val 102501848 ecr 212804497,sackOK,eol], length 0             0x0000:  4500 0040 d258 4000 3f06 6f30 adc2 2441  E..@.X@.?.o0..$A             0x0010:  0a10 1e1c 0050 a7cd c03b 0738 c4c7 f84f  .....P...;.8...O             0x0020:  b012 8000 4be5 0000 0204 05b4 0103 0300  ....K...........             0x0030:  0101 080a 061c 0dd8 0caf 2391 0402 0000  ..........#.....     12:23:45.782513 IP 10.16.30.28.42957 > 173.194.36.65.http: Flags [.], ack 1, win 183, options [nop,nop,TS val 212804497 ecr 102501848], length 0             0x0000:  4500 0034 dbe0 4000 4006 64b4 0a10 1e1c  E..4..@.@.d.....             0x0010:  adc2 2441 a7cd 0050 c4c7 f84f c03b 0739  ..$A...P...O.;.9             0x0020:  8010 00b7 0af9 0000 0101 080a 0caf 2391  ..............#.             0x0030:  061c 0dd8                                ....     12:23:45.783359 IP 10.16.30.28.42957 > 173.194.36.65.http: Flags [P.], seq 1:374, ack 1, win 183, options [nop,nop,TS val 212804498 ecr 102501848], length 373             0x0000:  4500 01a9 dbe1 4000 4006 633e 0a10 1e1c  E.....@.@.c>....             0x0010:  adc2 2441 a7cd 0050 c4c7 f84f c03b 0739  ..$A...P...O.;.9             0x0020:  8018 00b7 2113 0000 0101 080a 0caf 2392  ....!.........#.             0x0030:  061c 0dd8 4745 5420 2f20 4854 5450 2f31  ....GET./.HTTP/1             0x0040:  2e31 0d0a 486f 7374 3a20 676f 6f67 6c65  .1..Host:.google             0x0050:  2e63 6f6d 0d0a 5573 6572 2d41 6765 6e74  .com..User-Agent             0x0060:  3a20 454c 696e 6b73 2f30 2e31 3270 7265  :.ELinks/0.12pre             0x0070:  3520 2874 6578 746d 6f64 653b 204c 696e  5.(textmode;.Lin             0x0080:  7578 3b20 3830 7832 342d 3229 0d0a 4163  ux;.80x24-2)..Ac             0x0090:  6365 7074 3a20 2a2f 2a0d 0a41 6363 6570  cept:.*/*..Accep             0x00a0:  742d 4c61 6e67 7561 6765 3a20 656e 0d0a  t-Language:.en..             0x00b0:  436f 6e6e 6563 7469 6f6e 3a20 4b65 6570  Connection:.Keep             0x00c0:  2d41 6c69 7665 0d0a 436f 6f6b 6965 3a20  -Alive..Cookie:.             0x00d0:  5052 4546 3d49 443d 3066 3366 3864 3864  PREF=ID=0f3f8d8d             0x00e0:  3538 6535 6534 6333 3a46 463d 303a 544d  58e5e4c3:FF=0:TM             0x00f0:  3d31 3337 3234 3332 3939 373a 4c4d 3d31  =1372432997:LM=1             0x0100:  3337 3234 3332 3939 373a 533d 4e7a 776e  372432997:S=Nzwn             0x0110:  5a72 5a51 2d70 5f75 515a 666e 3b20 4e49  ZrZQ-p_uQZfn;.NI             0x0120:  443d 3637 3d52 5a7a 3556 3072 5f4e 7849  D=67=RZz5V0r_NxI             0x0130:  3470 3631 4875 354d 684a 7653 5235 5074  4p61Hu5MhJvSR5Pt             0x0140:  6149 4a4f 6d72 6c32 7844 5f42 356c 4c78  aIJOmrl2xD_B5lLx             0x0150:  6a65 756a 592d 4379 7562 4353 6b55 6a4c  jeujY-CyubCSkUjL             0x0160:  656f 5a49 5757 5334 5f78 2d6d 5551 6e6e  eoZIWWS4_x-mUQnn             0x0170:  3831 5067 586a 426e 7771 386f 365a 3775  81PgXjBnwq8o6Z7u             0x0180:  3953 6459 776e 5453 7155 706e 5946 7842  9SdYwnTSqUpnYFxB             0x0190:  347a 795a 3036 6e75 6355 5f47 582d 4e78  4zyZ06nucU_GX-Nx             0x01a0:  475f 6544 310d 0a0d 0a                   G_eD1....      I want to know what does `0x0030: 061c 0dd8 4745 5420 2f20 4854 5450 2f31` stand for in the line `0x0030: 061c 0dd8 4745 5420 2f20 4854 5450 2f31 ....GET./.HTTP/1` Any help would be highly appreciated.


Is my volume group dead?

I have a notebook with Scientific Linux 6.4, also a Desktop PC with SL 6.4. The PC didn't booted in a day, saying KERNEL PANIC :) So I tried to get the disk from the PC to the notebook (VolGroup is the notebooks VG, VGSTUFF is the PC's):               [root@localhost ~] vgdisplay       --- Volume group ---       VG Name               VGSTUFF       System ID                    Format                lvm2       Metadata Areas        1       Metadata Sequence No  14       VG Access             read/write       VG Status             resizable       MAX LV                0       Cur LV                6       Open LV               0       Max PV                0       Cur PV                1       Act PV                1       VG Size               465,26 GiB       PE Size               4,00 MiB       Total PE              119106       Alloc PE / Size       108417 / 423,50 GiB       Free  PE / Size       10689 / 41,75 GiB       VG UUID               XXXX            --- Volume group ---       VG Name               VolGroup       System ID                    Format                lvm2       Metadata Areas        1       Metadata Sequence No  4       VG Access             read/write       VG Status             resizable       MAX LV                0       Cur LV                3       Open LV               3       Max PV                0       Cur PV                1       Act PV                1       VG Size               465,26 GiB       PE Size               4,00 MiB       Total PE              119106       Alloc PE / Size       119106 / 465,26 GiB       Free  PE / Size       0 / 0          VG UUID               XXXX          [root@localhost ~] find /dev | grep -i VGSTUFF     [root@localhost ~]       **QUESTION** : But even after I do a pvscan/vgscan... the /dev entry doesn't gets created. WHY? I can see the volumegrpu in the vgdsiplay.. I just want to run an FSCK on the LV's on the VG from the PC, because maybe that would fix the kernel panic on the PC. (ps.: there were times when we just unplugged the PC from the power, maybe that caused the corruption..)


Mount cifs Network Drive: write permissions and chown

I have access to a cifs network drive. When I mount it under my OSX machine, I can read and write from and to it. When I mount the drive in ubuntu, using:               sudo mount -t cifs -o username=${USER},password=${PASSWORD} //server-address/folder /mount/path/on/ubuntu      I am not able to write to the network drive, but I can read from it. I have checked the permissions and owner of the mount folder, they look like: > 4.0K drwxr-xr-x 4 root root 0 Nov 12 2010 Mounted_folder I cannot change the owner, because I get the error: > chown: changing ownership of `/Volumes/Mounted_folder': Not a directory When I descend deeper into the network drive, and change the ownership there, I get the error that I have no permission to change the folder´s owner. What should I do to activate my write permission?


How do I know if a partition is ext2, ext3, or ext4?

I just formatted stuff. One disk I format as ext2. The other I want to format as ext4. I want to test how they perform. Now, how do I know the kind of file system in a partition?


How to disable a shell keyword?

Using `enable` builtin command we can disable a shell builtin command, for example `echo`, as follow:               enable -n echo      But how can we disable a shell keyword like `time`? If we try:               enable -n time      we will get the following "answer":               bash: enable: time: not a shell builtin      **Note** : I know how to run the `time` that's in `/usr/bin`, so I just want to know if it is possible to accomplish what I asked in the title.


Delete ghost files with special characters

I have read several ways to delete files with special characters, but none of them works for me in one special folder in my cache system. I have no idea how the files got there, and why they turned into ghost files. if i do: "ls -li" in my cache\1\a folder I get the following list (partial screen dump): * * *               335413265 -rw-r--r-- 1 www-data www-data 58734 Jul 30 08:18 1ah17.xml     335413267 -rw-r--r-- 1 www-data www-data 63256 Aug  2 22:12 1ah1.xml             ? ?????????? ? ?        ?            ?            ? 1ah2.xml             ? ?????????? ? ?        ?            ?            ? 1ah+-+cyan12.xml             ? ?????????? ? ?        ?            ?            ? 1ah+-+cyan1.xml             ? ?????????? ? ?        ?            ?            ? 1ah+-+cyan30.xml             ? ?????????? ? ?        ?            ?            ? 1ah+-+cyan31.xml             ? ?????????? ? ?        ?            ?            ? 1ah+-+gr%C3%B8n1.xml             ? ?????????? ? ?        ?            ?            ? 1ah+-+gr%C3%B8n5.xml             ? ?????????? ? ?        ?            ?            ? 1ah+-+gr%C3%B8n6.xml             ? ?????????? ? ?        ?            ?            ? 1ah+-+r%C3%B8d1.xml             ? ?????????? ? ?        ?            ?            ? 1ah+-+sort2.xml     335413265 -rw-r--r-- 1 www-data www-data 58734 Jul 30 08:18 1ah+-+sort3.xml             ? ?????????? ? ?        ?            ?            ? 1ah+-+sort8.xml     242562822 -rw-r--r-- 1 www-data www-data 61613 Aug  2 07:35 1amp+operations+in+c     rimping+tool+number+of+pins%3A+-1.xml      * * * So I get a lot of files without an inode number. If I do a "find" in the folder I get a lot of errors saying that it can't read the ghost files. How can I get rid of these files and/or the entire folder?


How to install SMS Servers and Phone Servers?

If we want our servers to email, we know that we should install sendmail or qmail. If we want our servers to send sms or robot calling (e.g voice confirmation [insecure method] ), what should we install on our servers?   I'm a kid. Help me.


Keyboard Shortcut To Send Text Strings To Program

How can I configure a shortcut key to send a text string to the current program? The purpose is to type common entries quicker (email address, street address, phone number, username, favorite quote, etc). I don't need any further automation than just entering the text. Gentoo Linux (3.2.12-gentoo) Xfce Desktop Environment (Version 4.8)


Broadcast port to other computers after SSH reverse tunnelling

I have been reading on how to reverse tunnel and I am using this command: `ssh -f -N -T -R25565:localhost:25565 dns.mindfulhacker.tk` To forward my Minecraft server. My other server can connect to my Minecraft server but clients cannot connect to it by using the IP: `dns.mindfulhacker.tk:255565` How can I forward my tunnel so it works like this? Both servers run Ubuntu Server 12.04 LTS and clients will be running Windows. (If the clients used Linux I would allow them to SSH Tunnel it back.)


Why do most distros (other than Debian) recommend/require a full reinstall when upgrading to a new version?

Having spent most of my Linux life using Debian, I'm been having a look at other distros and am really surprised at extent to which they don't provide a smooth upgrade between versions. Debian is infinitely upgradeable, and I've upgraded through a few major stable versions now. I'm talking about well-supported distros like Fedora (and derivatives), even Ubuntu and derivatives. Even stable server-oriented distros like CentOS. Is it because Debian's package management system and package upgrade scripts are just far more advanced than anything other distros have to offer? Or is reinstalling from scratch on a major version upgrade just a better idea overall, regardless of distro?


UTF-8 works in gnome-terminal only after selecting already selected encoding

Running Centos 6.3. In gnome-terminal UTF-8 works, but only after I've chosen (the already chosen) UTF-8 encoding in gnome-terminal settings. How do I force gnome-terminal to respect its own encoding setting?


ncq disabled on usb drive with ncq capabilities

I've recently purchased a Gigabyte BRIX paired with WD10JFCX 1TB Drive which is encased in an USB3.0 box. On it I run Ubuntu LTS 14.04 When I look at `/sys/block/sdb/devices/queue_depth` it reads 1 meaning NCQ is disabled. Whenever I try to set this value (as root) to anything but one, I get a 'permission denied' error message. Since the permissions on the path are set to 444 I've changed this to 744 which results in an Input/Output Error like this (the device is currently mounted):               echo 32 > /sys/block/sdb/device/queue_depth     -su: echo: write error: Input/output error      I've not found USB drives to not have NCQ capabilities so I'm a bit oblivious to what is going on. Should I rewrite some part of udev rules ?


wc -L reports a line-length of 8 for a tab-char. bug or feature?

`-L` is a useful feature of `wc`, or so I thought. It prints the length of the longest line. For some reason it expands a single-byte tab-char to a length of 8.   Is there some way to set this to not "expand" the tab? and what might be the rationale behind this expansion?               echo -n $'\t' | wc -L      outputs `8` wc (GNU coreutils) 7.4   GNU bash, version 4.1.5


How to disable the Forward/Back buttons on my mouse

My mouse has an unfortunate feature. On the left side, right where my thumb sits ever so gently when I'm using it, there are two buttons that are so sensitive a mere brush will make them click. I'm talking of course about the pesky forward/back buttons which, if pressed in a browser, can make watching that hour-long youtube video that much harder. Is there a way for me to disable them? Would this be handled by X?


shell script problem with using the operators

I am comparing two strings using the `levenshtein distance` algorithm. I got the PHP implementation of the algorithm from here. I am calling this php implementation from my shell script as below.               levenshtein_return=$(php levensh.php "String1" "String2")      The `levenshtein_return` variable contains the value as 1 now as there is a single character difference. Now, before inserting the value as such in database tables, I need to perform some arithmetic operations using this variable. I am trying to implement as,               table_value=$( expr( 1/ ( 1 + $levenshtein_return ) ) )      However, if I use the above syntax I am getting an error as,               line 52: syntax error near unexpected token `1'      How can I change the expr statement so that I can get the actual value for the `table_value` variable?


What does eno1 and lo mean

I have tried using google for this and cant seem to find much results. When running cmd in bash               netstat -i      I am returned something which looks like this               Kernel Interface table     iface    MTU ...     eno1     1500     lo       50000      I ran this cmd with the intentions to find what type of network adapters(hardware) I have.(should return wireless adapter + more) I am unable to tell what these mean. Is this the correct command for this.


bash completion on posix mode

I would like to use an interactive posix bash shell but the autocompletion feature doesn't work. When i type the tab character it simply prints a tab. The tab completion only works when i'm on a non posix interactive shell or on a posix interactive shell with emacs input mode. I find emacs input mode very awkward and i am used to vi input mode. The problem only arises when i am on posix mode and vi input mode in which case the tab key only prints a tab space on my shell. Also, the same problem arises when i invoke bash with the sh command. Here is my /etc/inputrc :               # do not bell on tab-completion     set bell-style audible          set meta-flag on     set input-meta on     set convert-meta off     set output-meta on          # Completed names which are symbolic links to     # directories have a slash appended.     set mark-symlinked-directories on          set editing-mode vi     set keymap vi-insert     set mark-modified-lines on          $if mode=emacs          # for linux console and RH/Debian xterm     "\e[1~": beginning-of-line     "\e[4~": end-of-line     # commented out keymappings for pgup/pgdown to reach begin/end of history     #"\e[5~": beginning-of-history     #"\e[6~": end-of-history     "\e[5~": history-search-backward     "\e[6~": history-search-forward     "\e[3~": delete-char     "\e[2~": quoted-insert     "\e[5C": forward-word     "\e[5D": backward-word     "\e[1;5C": forward-word     "\e[1;5D": backward-word          # for rxvt     "\e[8~": end-of-line     "\eOc": forward-word     "\eOd": backward-word          # for non RH/Debian xterm, can't hurt for RH/DEbian xterm     "\eOH": beginning-of-line     "\eOF": end-of-line          # for freebsd console     "\e[H": beginning-of-line     "\e[F": end-of-line     $endif


rsync is very slow (factor 8 to 10) compared to cp on copying files from nfs-share to local dir

I have a freshly installed ubuntu-server which is ought to be the new backup- server for our VM-storage. The server has 4 nics, 2 of them 10Gbit (in fact an intel x540-T2 with the newest driver available) which ar eused to connect to the SAN. I have the nfs-share mounted localy and compared speed-differences while copying a directory with ~30 files, around 15 vm-images and corresponding logfiles. The Images are between 8 GB and 600 GB in size. Using:               cp -rf /mnt/nfs-share /backup-storage/      bmon shows consequently around 600 MiB/s. Using               rsync -av /mnt/nfs-share /backup-storage/      bmon shows some packets in the first seconds, halts for about 30 seconds and than builds up to about 60-75 MiB/s. CPU is around 60%. What should/could I change to use `rsync` with the same performance as cp?


M-x ansi-term colors in Emacs 24.x

I have noticed that some colors in `LS_COLORS` don't work when running a shell inside `M-x-ansi-term` in Emacs. For exmaple;               di 00 94       is supposed to turn on bold on light blue on directories on `LS_COLORS` (see a list of the codes here), but `ansi-term` in Emacs does not show it in color. In fact, only the simple colors listed on that website seem to work under `ansi-term` in Emacs, while they work perfectly well on my regular gnome terminal. Is there a way to get `ansi-term` to recognize the so called **extra** colors? Where/how can I look up the colors supported by `ansi-term` in Emacs?


zsh: What does the command "time + number" do in zsh

When I type time + number in zsh:               # atupal at local in /tmp/atupal/setup/bin [10:01:49]     $ time 1     /tmp/atupal/setup/bin/lib/python2.7     # atupal at local in /tmp/atupal/setup/bin/lib/python2.7 [10:01:54]     $ time 2     /tmp/atupal/setup     # atupal at local in /tmp/atupal/setup [10:01:59]     $ time 3     /tmp/atupal/setup/app     # atupal at local in /tmp/atupal/setup/app [10:02:03]     $ time 3     /tmp/atupal/setup/bin     # atupal at local in /tmp/atupal/setup/bin [10:02:04]     $ time 3     /tmp/atupal/setup/bin/lib/python2.7     # atupal at local in /tmp/atupal/setup/bin/lib/python2.7 [10:02:05]     $       But when I type `time 10` is says `command not found: 10` My zsh version is :zsh 5.0.2-4 And my `uname` result:`Linux 3.12.5-1-ARCH #1 SMP PREEMPT Thu Dec 12 12:57:31 CET 2013 x86_64 GNU/Linux`


Calibre in Debian 7.3 KDE doesn't have cover browser?

Can someone please help me to activate the **cover browser** of Calibre in Debian 7.3 KDE desktop (32 bit architecture)? I've tried toggling the arrow button in the bottom-right corner but unlike the other buttons, it yields nothing, not even a tool-tip when I hover over it. I've tried also clicking `Preferences > Look&feel > Cover Browser tab` but there's nothing usable there. Please see the pictures below. ![missing cover browser](http://i.stack.imgur.com/IhNFQ.png) ![enter image description here](http://i.stack.imgur.com/Wu6IQ.png) **NOTE:** I'm using version 0.8.51.


Are there awk versions that provide syntax for computing aggregations?

From time to time I find myself writing awk scripts that compute some simple statistics. For example computing a histogram, the average of a value, the standard deviation or even the variance ... Doing that again and again with helper arrays/variables and for-loops in the `END` clause etc. feels a little bit tedious and error-prone. In Dtrace there is a quite awesome syntax for such tasks which they call aggregations. It is similar to the concept/API of Accumulators in the Boost C++ library. Thus my question: are there awk variants which provide similar concepts/syntax that allow for convenient and iterative computation of such statistics? An imaginative example of such syntax:               $ someawk '{ @time[$1] = avg($2) }' measurements.log     prog1    150     prog2    200     ....      (where the 1st column contains the program name, the 2nd the runtime of one measurement, `measurements.log` contains multiple measurements for each program and the aggregate function `avg` computes the average)


How to use comma as tmux's prefix

Under screen, I used: `bindkey , command` to use the comma as the prefix instead of `Ctrl``a`. If I do `set -g prefix` in tmux, it complains saying: `unkown key` At first, I believed that tmux did not support single keys as prefix, However, I managed to use `\` as a prefix successfully! How can I do so for the `,`? [Edit] Apparently this works under tmux 1.6, haven't tried it though. Thx jasonwryan for the hint :)


Compiling and running Snapper for Ubuntu

I am trying to get snapper working in my Mint 14. (The version from launchpad is old and not compatible with Ubuntu 12.10. The OpenSuSe's build project failed to build it, too). So I try my luck with manual compile. Following the Snapper Development page, I've downloaded repo and installed the dependencies. After `make` finally I've got this error:               (...)     make[2]: Entering directory `/home/adam/tmp/snapper/server'       CXXLD  snapperd     snapperd.cc:125: error: undefined reference to 'boost::thread::interrupt()'     /usr/include/boost/thread/pthread/shared_mutex.hpp:129: error: undefined reference to 'boost::this_thread::disable_interruption::disable_interruption()'     /usr/include/boost/thread/pthread/shared_mutex.hpp:137: error: undefined reference to 'boost::this_thread::disable_interruption::~disable_interruption()'      (...) I've noticed another quesion that suggests adding `-lboost_thread-mt` to linker invocation. Simple enough... and compilation finished successfully. But after that and `sudo make install` whatever way I try invoke the snapper I get error `Failure (org.freedesktop.DBus.Error.NoReply)`. And I'm stuck here. Can anyone help me?


aptitude search output

Can someone please explain this situation to me? I do an aptitude search and I get the following output:               i package  ...     p package:i386 ...      When I start up synaptic I see package but not package:i386 Also can someone clarify what the p and I stand for?