GDM not showing when I boot my FreeBSD system

I've installed FreeBSD 9.1 in a VirtualBox VM, and did some basic setup. After that, I had installed Gnome2 via `sudo pkg_add -r gnome2`. Along the way, there were some errors. Mostly it was (I think) the package manager complaining about dependencies. They were piling up faster then they were getting resolved (sometimes a package that was reported as a broken dependency would get installed), and when there was around a dozen of them, the installation had stopped without any errors. I had simply executed the command again, waited for 20 more minutes, and then got greeted with an "installation successful" message. **I restarted the system only to end up with GDM not starting and a regular text prompt ready.** In trying to solve this I had:   1. added `gnome_enable="YES"` to `/etc/rc.conf` (Why wasn't it there by default?)   2. added `proc /proc procfs rw 0 0` to `/etc/fstab` (I'm not even sure how this is related, but it was supposed to help... I suppose Gnome2 checks fstab for something.) But I still have no luck, and GDM still doesn't show itself. However, RC (`rc.conf`, or whatever is executing it) _does_ report that it is starting GDM: ![enter image description here](http://i.stack.imgur.com/nBTtI.png) When I tried to execute `/usr/local/etc/rc.d/gdm start`, it displayed this error message and supposedly failed: ![enter image description here](http://i.stack.imgur.com/tHrlH.png) **What should I do to start a Gnome2 graphical session in FreeBSD? How can I check whether I have everything I need installed and configured correctly?**


How-to diff distributions?

I am using a Raspberry Pi. There seem to be all kinds of linux distributions, all in .img Format that I use Win32DiskImager for to burn to SD-card. How do I find out, which files were changed(some people say, this image was made off distribution X, so I could use dist. X as one file and his as the other and compare) and how to figure out whether a custom distribution is malicious or not? I would like to figure differences out under windows 7. The Distros are always Linux, though.


Wireless Connectivity and Fedora 15 Boot Up

I'm currently running Fedora 15 and recently I've noticed that if I am in an area which does not have a wireless network or a secured wireless network which I cannot automatically connect to, Fedora 15 boots up very slowly, sometimes hanging on the screen with the Fedora logo. Is there a way to fix this?


"make test" failed while compiling Python

I compiled Python 3.4.1 on an emulated Debian 7 ARM system. `make test` failed on test_multiprocessing_fork:               FAIL: test_semaphore_tracker (test.test_multiprocessing_fork.TestSemaphoreTracker)     ----------------------------------------------------------------------     Traceback (most recent call last):       File "/root/sources/python3-3.4.1/Lib/test/_test_multiprocessing.py", line 3667, in test_semaphore_tracker         _multiprocessing.sem_unlink(name2)     AssertionError: OSError not raised      Another test, test_io, simply freezes the `make test`. **What could be the problem?** My only guess is I missed some prerequisite. According to `./configure`, I do not have these header files in my system:               minix/config.h     conio.h     direct.h     ieeefp.h     io.h     process.h     sys/devpoll.h     sys/audioio.h     sys/bsdtty.h     sys/event.h     sys/kern_control.h     sys/loadavg.h     sys/lock.h     sys/mkdev.h     sys/modem.h     sys/sys_domain.h     sys/termio.h     libutil.h     bluetooth.h     bluetooth/bluetooth.h     util.h     sys/endian.h     time.h that defines altzone


Omit the target dir from find results

How can I prevent `find` from returning the directory I use as the root to start searching from in the results? e.g.:               $ find targetDir -name 'target*'     targetDir/target1     targetDir/target2     targetDir/subDir/target3      instead of:               $ find targetDir -name 'target*'     targetDir     targetDir/target1     targetDir/target2     targetDir/subDir/target3


How to set up server networking on Debian?

I'm helping a friend to set up a media server for his new house. I've installed Debian 7.2.0 and I'm trying to get the network up and running. The physical set-up is like this:                        Other wireless devices                         ^                        |                        Server:     Internet <---> Wireless Router <---------> eth0 (built-in motherboard)                                        UTP     eth1 (extra card) <-----> PC conn. to TV                                                                    UTP      I would like the server to have a static IP address so it can easily be found. Furthermore, the server should share it's internet connection to the PC connected to the TV (running Windows 8). I got it working yesterday using one of the built-in GUI configuration tools. However it stopped working today (possibly due to a restart or plugging in/out the cables) after moving the server to the attic. I've read and tried a lot of tutorials, but get stuck because I do not understand them or because they are meant for different distributions. What steps should I take to:   * Reset or get rid of any settings I made in the GUI/iptables/etc.?   * Give the server a static IP?   * And make it share it's internet connection to the PC on eth1?   * Make it all permanent?


Rename All Files with a Certain Name

I'm trying to find certain files with the name "stringx" and replace the name (but not the extension) with "stringy". So basically for stringx.txt and stingx.cs, I'd want stringy.txt and stringy.cs. I've attempted to test my rename command regex using following, but it returns no results:               rename -n 'stringx./s/\*$stringy./\/' stringx.*      I'm running csh under Centos. I can see that my regex is probably not correct, but I can't see any results to verify this. I can see that there are files that are named stringx. with the following:               find ./ -name 'stringx.*'


bash replace part of string based on location

Sorry I've looked around for a one line solution ( as bash offers ) to replace part of filename. Given that a folder has image sequence like               ve2_sq021_sc001_v000.0101.jpg     ve2_sq021_sc001_v000.0102.jpg     ve2_sq021_sc001_v000.0103.jpg     ve2_sq021_sc001_v000.0104.jpg      Need to replace only v000 with v09 ( say ). How is it possible (throughout directory).


How can I rename a lot of files using a regex?

I want to rename a lot of files on Mac OS X (10.7.2).. I don't have the perl package for the `rename` command. My files have names like "T452-102456-0.png" and I want to delete the "-0" part. I know I can do this action by writing my own php-cli script, but I would like to know of an easier and faster solution.


How to rename file using substring of the same file name

I want to rename my file with its substring.Because unfortunately renamed all the files in my server. _Now I want to remove suffix( .gz) of all the files including files in subdirectories also._ Below is avaliable files with extra `.gz`.               # pwd     /usr/apache-tomcat-6.0.36/webapps/rdnqa/WEB-INF/classes     # ls     META-INF                           jbpm.hibernate.cfg.xml.gz          jbpm.jpdl.cfg.xml.gz               jpdl-4.0.xsd.gz     config                             jbpm.hibernate.cfg.xml.mirror.gz   jbpm.mail.templates.xml.gz         jpdl-4.2.xsd.gz     ecnet                              jbpm.hibernate.cfg.xml.staging.gz  jbpm.repository.hbm.xml.gz         jpdl-4.3.xsd.gz     hibernate.queries.hbm.xml.gz       jbpm.history.hbm.xml.gz            jbpm.task.hbm.xml.gz               jpdl-4.4.xsd.gz     jbpm.businesscalendar.cfg.xml.gz   jbpm.identity.cfg.xml.gz           jbpm.task.lifecycle.xml.gz         labels     jbpm.cfg.xml.gz                    jbpm.identity.hbm.xml.gz           jbpm.tx.hibernate.cfg.xml.gz       log4j.properties.gz     jbpm.console.cfg.xml.gz            jbpm.jboss.idm.cfg.xml.gz          jbpm.tx.jta.cfg.xml.gz             nohup.out.gz     jbpm.default.cfg.xml.gz            jbpm.jbossremote.cfg.xml.gz        jbpm.tx.spring.cfg.xml.gz     jbpm.default.scriptmanager.xml.gz  jbpm.jobexecutor.cfg.xml.gz        jbpm.variable.types.xml.gz     jbpm.execution.hbm.xml.gz          jbpm.jpdl.bindings.xml.gz          jbpm.wire.bindings.xml.gz     # cd ecnet     # ls     core  jms   rd    util     # cd core     # ls     util     # cd util     # pwd     /usr/apache-tomcat-6.0.36/webapps/rdnqa/WEB-INF/classes/ecnet/core/util     # ls     GridService.class.gz               MDPDFXMLParser.class.gz            PDFColumn.class.gz                 PDFXMLParser.class.gz     GridService.java.gz                MDPDFXMLParser.java.gz             PDFColumn.java.gz                  PDFXMLParser.java.gz     MDExcelXmlParser.class.gz          MasterDetailsPrintWriter.class.gz  PDFRow.class.gz                    RGBColor.class.gz     MDExcelXmlParser.java.gz           MasterDetailsPrintWriter.java.gz   PDFRow.java.gz                     RGBColor.java.gz     MDExcleWriter.class.gz             PDFCell.class.gz                   PDFWriter.class.gz                 xml2excel     MDExcleWriter.java.gz              PDFCell.java.gz                    PDFWriter.java.gz     #


Mass mv on files and changing filenames

I want to change these filenames               download (19).download     ...     download (27).download      to               download (19).html     ...     download (27).html      I run unsuccessfully               mv *.download *.html     usage: mv [-f | -i | -n] [-v] source target            mv [-f | -i | -n] [-v] source ... directory      **How can you change the filename?** I think I need a regex here probably.


Rename multiple files in UNix directory

I have files in unix directory in below format using sed or some other commands.               Owner.Env.File_010513_1200_ver1.expdp     Owner.Env.File_010513_1200_ver2.expdp     Owner.Env.File_010513_1200_ver3.expdp     Owner.Env.File_010513_1200_ver4.expdp      I want to rename these files in below format               Owner.Env.File_100613_2300_ver1.expdp     Owner.Env.File_100613_2300_ver2.expdp     Owner.Env.File_100613_2300_ver3.expdp     Owner.Env.File_100613_2300_ver4.expdp


rename multiple files with rename command?

> **Possible Duplicate:**   >  How can I rename a lot of files using a regex?   >  Rename All Files with a Certain Name There are files with               ORDER_EVENTS_SOMETHING_20120117.log     ORDER_EVENTS_SOME2_20120117.log     ORDER_EVENTS_CHARS_20120117.log      and so on.. I need to rename them to               ORDER_EVENTS_SOMETHING_20120113.log     ORDER_EVENTS_SOME2_20120113.log      and so on.. How can I do that?


How to rename multiple files

I have files with names as,               A2002185.h23v04.005.2007177004246.hdf       A2002201.h23v04.005.2008288062542.hdf      I want to rename them by deleting everything in the name after first dot (and have names as _A2002185.hdf_ , _A2002201.hdf_ ), how can I do that?


How do I rename multiple files

> **Possible Duplicate:**   >  How can I rename a lot of files using a regex? I've got some files named               abc-10.5.3.1-1.x86_64.rpm     abc-compiler-10.5.3.1-1.x86_64.rpm     abc-10.5.3.1-6.x86_64.rpm        abc-compiler-10.5.3.1-6.x86_64.rpm      I'd like to remove the minor version numbers (1-1 and 1-6) whenver the files are built. I can't figure out how to achieve this with the rename command on Redhat linux. The resulting filename should for example be:               abc-10.5.3.x86_64.rpm      The command doesn't take regular expressions.


Command to prevent suspend while another command executes?

Is there a command to prevent the suspending of a system while another command executes? For example; lets say I have an upload that I want to complete but it gets interrupted because of my machine suspending. Is there a command that I can use to execute another command that prevents my machine from sleeping until the command finishes?


LXDE: keybinding for single key not working

I am trying to bind `lxterminal` to the `windows` key on my keyboard. The problem is, it only works for key kombination, such as `W-r`. But I would like to use `W` only. I have added the following in to the `<keyboard>` section of my `.config/openbox/lxde-rc.xml`               <keybind key="W">       <action name="Execute">         <startupnotify>           <enabled>true</enabled>           <name>LXterminal</name>         </startupnotify>         <command>lxterminal</command>       </action>     </keybind>      but this does not work. Can somebody please help? UPDATE: I have just realized, that `<keybind key="W">` refers to the `W` key (capital w), and not to the Windows key. This is illogical, because key combination `W-e` refers to `Windows key + e`.


zsh Interpret/ignore commands beginning with '#' as comments

In bash, if I type a command beginning with a `'#'`, bash ignores it as a comment. Ie, the following is ignored at the bash prompt:               > # Hi there!      Whereas in zsh:               > # Hi there !     zsh: bad pattern: #      How can I ask zsh to do the same? This is incredibly useful to "store" commands that you want to run later, or to chat when using a shared tmux/screen session. I am using 'oh my zsh'


How to copy qemu raw images?

I want to backup kvm virtual machines and copy machine's images another path or usb disk? How to copy " qemu raw images"?


Backports on Debian not working

I'm having problems to update to the latest version of particular software on Debian. I'm using Debian 6.0.4 and I currently I have Shutter version 0.85 which is currently the latest stable version. I have this line in `sources.list`:               deb http://backports.debian.org/debian-backports squeeze-backports main      and I run the command               apt-get -t squeeze-backports install shutter      and all I get is that it installs the same 0.85 version. I know there is a unstable version 0.88 and I would really like to get it somehow. Thanks for any help


How to track file change

`nsswitch.conf` file always corrupts somehow. I do restore from my backup every time it corrupt. When this file corrupts, its time stamp is changing. Now I wonder if there is a way to track that file ? I'd like to know which process or maybe user cause that corruption. Is there a way to do that ?


How to copy data from Linux Server to Windows Server

I need to copy from Linux server to Windows. To copy between Linux servers we can use multiple options like scp, or rsync but how to copy data if I have to copy on windows Server from Linux Server. And the size of the data is 2TB so the job should be running in Background. So that I have to close the terminal I can do it without stopping the process.


Running `screen` through a @reboot cron job

I want to have a script running in screen at startup. This doesn't work:               @reboot pi screen -d -m /home/pi/db_update.py      however running this manually as user pi works:               screen -d -m /home/pi/db_update.py      Any idea on what I am missing?


vimrc - how to block comment?

I don't want to comment lines of text in a text file or code. I am looking for inserting block comments in a _.vimrc_ file. To insert a single line comment `"` is used, for example:               " remove spaces and tabs as well  at the end of line automatically while saving     autocmd BufWritePre * :%s/\s\+$//e      Now I've got a relatively large amount of settings/configs/plugins collected over the years after browsing through the internet to add cool features. I'm looking to add some large comment blocks to my .vimrc file. Adding `"` to each line is a option but I am looking for a block comment syntax. Similar to `/**/` in C. `//` is identical to `"`   `/* */` is identical to **___ ____** ? Searching Unix.SE, SO and googling didn't help much.


Can MySQL be malicious without PHP (or other language)?

I'm pretty sure the answer is "no", but who knows. Is a MySQL database able to _initiate_ a communication with the server without any human action ? This server is disconnected from the exterior world and there is no scripting- language file on it.


LXPanel time is wrong?

I just upgraded from Lubuntu 12.10 to 13.10, and it was a nightmare. When I logged in I had nothing but a background, no tray or anything. I finally just got the tray back, but it displays the wrong time, and its static, as in it doesn't progress. I have checked that I have the NTP daemon installed; I checked the time using `date` and `hwclock`, and they are both correct. I have also checked that I am in the correct time zone using the time and date frontend. I am stumped. Edit: Excuse me, the time does change, but only hourly; the minutes don't change at all, so it'll go from, say, 10:02 to 11:02.


Create a Custom User in FreeBSD

I want to create a user in the FreeBSD for `nginx` that has:   * No Login.   * No home directory  how should I do that with `pw useradd` or any other tool.


Is there any issue if I kill sync() process before it finished

On panic situation, I want to set timeout for sync() system call. In the case this timeout value is passed, I want to kill sync process and reboot the system. I wonder if there is any issue with that behivior?


How to see how many context switches a process makes?

I want to see if my process makes a lot of context switches. I also want to see how manpulating task groups affects the number of context switches.


Why does variable expansion without $ work in expressions?

#!/bin/bash          VALUE=10          if [[ VALUE -eq 10 ]]     then         echo "Yes"     fi      To my surprise, this outputs "Yes". I would have expected it to require `[[ $VALUE -eq 10 ]]`. I've scanned the `CONDITIONAL EXPRESSIONS` section of `man bash`, but I did not find anything to explain this behaviour.


How to fork a "cat" command?

This is my bash script.               #!/bin/bash     oo="`cat /etc/httpd/conf/httpd.conf`";     cat > /a.txt << EOF     $oo     EOF      it simply reads /etc/httpd/conf/httpd.conf and writes it to /a.txt, the problem has been when this is executed via web scripts with sudo command.. for some reason not everything is written to the a.txt file but when executed via command line.. everything is written just fine to a.txt so perhaps i should send this to a background process by adding:               > /dev/null 2>&1      to it. but how can this be done? i tried               #!/bin/bash     oo="`cat /etc/httpd/conf/httpd.conf`";     cat > /a.txt << EOF     $oo     EOF > /dev/null 2>&1      this did not work.


Is `-` used only with cd?

`cd -` can switch between current dir and previous dir. It seems that I have seen `-` used as arguments to other commands before, though I don't remember if `-` means the same as with `cd`. I found that `-` doesn't work with `ls`. Is `-` used only with cd?


Emacs commands in xterm

I found that the commands I used to use in `gnome-terminal`, those I learned in Emacs, are only partially working in `xterm`. In some cases, I get strange chars like `ÿ`, `æ`, and `â` instead. Do you know how to enable the shortcuts (or even setting them up one by one, as they are not that many)?


Relation between the filename and inode of a file

For a file, it is said that its "filename" points to its inode. Does it mean that its "file name" is a data structure that has or is a pointer pointing to its inode? It is also said that its "filename" is a string. Is this string stored somewhere (perhaps also in a file)? Are the two sayings inconsistent with each other? A hard link cannot link to a file on a different file system, while a soft link can. Is it because a filename pointer cannot point to an inode on a different file system, while a pointer stored in an inode can point to a file content on a differnt file system?


Can't install vim in fedora 20

When I tried to install VIM in fedora 20, appear this message below ![here](http://i.stack.imgur.com/0t0P2.png) How can I fix this problem?


Elementary OS won't play videos!

I got an issue with my eOS that I recently installed. I can hear recordings and music, even videos but can't watch them. I look in the web a solution and each one answered me to install NVIDIA. I did and then reboot and couldn't log in. After a lot of changes, this is the error that is shown in my black display:               Could not write bytes: Broken pipe     •Stopping restore sound card(s) mixer state(s)     •Starting CPU interrupts balancing daemon     •Starting CPUS printing spoolers/server     •Starting crash report submission daemon     •Stopping save kernel messages     •Starting the winbind daemon winbind     •Starting NTP server ntpd     Saned disabled; edit /etc/default/saned     Starting preload: preload.      I ask at askubuntu.com and someone told me to insert `sudo apt-get install -f`. After that I can no longer see any other display, it just start and freeze in the eOS logo display. So, what should I do? Any answer will be welcome! Thanks!!


Mint 12: synaptic package manager error

Yesterday I had the same issue, I solved it by running               sudo synaptic      But today I don't know what's happening, if I run `gksu synaptic` or `gksudo synaptic` they don't do anything. If I go to root and execute these commands or execute `sudo synaptic`, I see:               sudo synaptic     No protocol specified          (synaptic:32377): Gtk-WARNING **: cannot open display: :0.0      **EDIT: @Nunoxic** I'm working on my local computer. When I do `sudo apt-get update` some stuff will be updated and some some stuff will not be updated `E: Some index files failed to download. They have been ignored, or old ones used instead.` I ran `sudo apt-get update` 2 days ago. when i do `echo $DISPLAY` the output is `:0` **@Gilles** the output of `echo $XAUTHORITY` is nothing at all:) the output of `sudo env | sort` is               COLORTERM=gnome-terminal     DISPLAY=:0.0     HOME=/root     LANG=en_US.UTF-8     LANGUAGE=en_US:en     LC_COLLATE=en_US.UTF-8     LC_CTYPE=en_US.UTF-8     LC_MESSAGES=en_US.UTF-8     LOGNAME=root     MAIL=/var/mail/root     PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/X11R6/bin     SHELL=/bin/bash     SUDO_COMMAND=/usr/bin/env     SUDO_GID=0     SUDO_UID=0     SUDO_USER=root     TERM=xterm     USERNAME=root     USER=root      the output of `sudo xterm` is               No protocol specified     Warning: This program is an suid-root program or is being run by the root user.     The full text of the error or warning message cannot be safely formatted     in this environment. You may get a more descriptive message by running the     program as a non-root user or by removing the suid bit on the executable.     xterm Xt error: Can't open display: %s      **EDIT** the output of `XAUTHORITY=~/.Xauthority; sudo xterm` is               No protocol specified     Warning: This program is an suid-root program or is being run by the root user.     The full text of the error or warning message cannot be safely formatted     in this environment. You may get a more descriptive message by running the     program as a non-root user or by removing the suid bit on the executable.     xterm Xt error: Can't open display: %s      the output of `sudo -s9999 strace xterm` is               sudo: invalid option -- '9'     usage: sudo -h | -K | -k | -L | -V     usage: sudo -v [-AknS] [-g groupname|#gid] [-p prompt] [-u user name|#uid]     usage: sudo -l[l] [-AknS] [-g groupname|#gid] [-p prompt] [-U user name] [-u                 user name|#uid] [-g groupname|#gid] [command]     usage: sudo [-AbEHknPS] [-C fd] [-g groupname|#gid] [-p prompt] [-u user                 name|#uid] [-g groupname|#gid] [VAR=value] [-i|-s] [<command>]     usage: sudo -e [-AknS] [-C fd] [-g groupname|#gid] [-p prompt] [-u user                 name|#uid] file ...


Are kernel threads really kernel processes?

I've read in many places that Linux creates a kernel thread for each user thread in a Java VM. (I see the term "kernel thread" used in two different ways:   1. a thread created to do core OS work and   2. a thread the OS is aware of and schedules to perform user work. I am talking about the latter type.) Is a kernel thread the same as a kernel process, since Linux processes support shared memory spaces between parent and child, or is it truly a different entity?


Linux friendly TV tuner/receiver

My USB TV tuner (an ENUTV-2) just stopped working and now I have to buy a new one. While I was browsing options, I realized my biggest priority was to get one that had Linux drivers (lack of them was my biggest annoyance with the old tuner). Can anyone recommend a TV tuner that has Linux drivers? It could be either PCI-E card or a USB box, my priority is Linux support.


I recently changed my MacBook's UI to show Hebrew, and at around the same time, I began using the Terminal more often. The combination of the two has lead me to wonder - are there Hebrew language commands, or any other non- english language command sets available for the terminal either on Unix, Linux, or Mac OS? (This question leads me to wonder if an entirely separate shell implementation is required for something like that, if it's even possible.) Are there foreign language Terminal command sets?


Emacs: Open a buffer with all lines between lines X to Y from a huge file

In the same spirit as this other question: cat line X to line Y on a huge file: Is there a way to open **from within Emacs** (and show on a buffer) a given set of lines (e.g. all lines between line `X` and `Y`) from a huge text file? E.g. Open and show in a buffer all lines between lines 57890000 and 57890010 from file `huge.txt` **Update:** I am interested in a solution that at least can open the lines in read-only (just for display purposes), although it would be great if I can also edit the lines (and save to the original file).


Disable automatic screen lock in XFCE in Centos

I have a generic install of Centos 5.8 with XFCE 4.4. Pretty much all defaults. As is, after a certain amount of idle time the screen locks (goes black, requires a password to continue). How do I disable the automatic screen lock? I've searched around and read suggestions to use the settings manager to modify the Power Manager or Screen Saver settings but neither of those settings managers/panels/icons are installed on my desktop. UPDATE: It appears `gnome-screensaver` is being started automatically. Of course I could remove that program from the system, but I'd prefer to understand what's going on and use more ordinary configuration methods to prevent it from automatically starting and at the same time keep the option of switching back to it if needed.


Storing commands in files

I'm trying to store commands in a file, so I can just easily call the file usnig the below bit of code;               ./test      I need to run this bit of code;               Set n=0 ; foreach sql ( *_*.sql)     foreach? sed “s/_/-/g” $sql     foreach? @ n ++     foreach? End     echo You changed $n files      I type the following;               set n = 0 > test     foreach sql ( *_*.sql) >> test      When I get to this point, I ave a blank line appear within the terminal so I type the following 3 lines blind;               foreach? sed “s/_/-/g” $sql     foreach? @ n ++     foreach? End      I then finish with:               echo 'echo You changed $n files' >> test      Once I finish the output file only contains this:               foreach? sed "s/_/-/g" $sql     foreach? @ n ++     foreach? end     echo You changed $n file      Totally missing out the set commands and the beginning of the foreach loop. What am I missing here? or is it just not possible? EDITTED               #!/bin/tcsh     set n=0     foreach sql ( *_*.sql )     sed "s/_/-/g" $sql     @ n ++     end     echo You changed $n files     chmod 777 test


Archive (Compress) giant folder in Linux using command line without termination

Well, I'm just trying to compress a whole directory (infact giant!) under Linux using a terminal. The entire folder size is about 7 GB. I've used below command to create the archive.               tar -zcvf myArchieve.tar.gz myFolder      It's working but in middle it stops by displaying `Terminated` message in the terminal. I could see the archive file created but there were missing file(s)/sub folder(s). in the compressed file. I want to create the entire folder (7 GB) Archive without any 'Terminated' message timeout. How can I achieve this?


Linux: How does hard-linking to a directory work?

I'm aware that Linux does not allow hard-linking to a directory. I read somewhere,   1. that this is to prevent unintentional loops (or graphs, instead of the more desirable tree structure) in the file-system.   2. that some *nix systems do allow the root user to hard-link to directories. So, if we are on one such system (that does allow hard-linking to a directory) and if we are the root user, then how is the parent directory entry, `..`, handled following the deletion of the (hard-link's) target and its parent?               a (200)     \-- .  (200)     \-- .. (100)     \-- b  (300)     |   \-- .  (300)     |   \-- .. (200)     |   \-- c  (400)     |       \-- .  (400)     |       \-- .. (300)     |       \-- d  (500)           <snip>          |     \-- H (400)      _(In the above figure, the numbers in the parentheses are the inode addresses.)_ If `a/H` is an (attempted) hard-link to the directory `a/b/c`, then   1. What should be the reference count stored in the inode 400: 2, 3, or 4? In other words, does hard-linking to a directory increases the reference count of the target directory's inode by 1 or by 2?   2. If we delete `a/b/c`, the `.` and `..` entries in inode 400 continue to point to valid inodes 400 and 300, respectively. But what happens to the reference count stored in inode 400 if the directory tree `a/b` is recursively deleted?  Even if the inode 400 could be kept intact via a non-zero reference count (of either 1 or 2 - see the preceding question) in it, the inode address corresponding to `..` inside inode 400 would still become invalid! Thus, after the directory tree `b` stands deleted, if the user changes into the `a/H` directory and then does a `cd ..` from there, what is supposed to happen? **Note:** If the default file-system on Linux (ext4) does not allow hard- linking to directories even by a root user, then I'd still be interested in knowing the answer to the above question for an inode-based file-system that does allow this feature.


Pass argument to script, then redirect script as input to bsub

I am currently working with the bsub job submission system from Platform LSF. I need to submit job scripts, but I am running into a problem with passing arguments to the job script. What I need is as follows: the job script is a bash script that takes one command line argument. I need to pass the argument to that script, then redirect the script to be used as input to bsub. The problem is that the argument isn't being applied to the script. I have tried: `bsub < script.bsub 1` script.bsub is my script and 1 is the numeric argument. This approach doesn't work. The 1 is being treated as an argument to bsub. Another approach: `bsub < "script.bsub 1"` This approach makes bsub treat the entire double-quoted line as a filename. Is there a way to apply a command line argument to a script first, then redirect that script with the argument into another program as input? If anyone has experience with bsub that would be even better. UPDATE AND WORKAROUND: It seems applying a command line argument to a bsub file is a very complicated process. I tried the HEREDOC method stated below, but bsub acted as if the script filename was a command. So the easiest way to get around this problem is just to not use input redirection at all. To pass an argument to a script to be run in bsub, first specify all bsub arguments in the command line rather than in the script file. Then to run the script file, use               "sh script.sh [arg]"      after all of the bsub arguments. Thus the entire line will look something like:               bsub -q [queue] -J "[name]" -W 00:10 [other bsub args] "sh script.sh [script args]"      This doesn't answer my original question, but at least with bsub this is the simplest resolution to my problem.


What distribution for light weight server?

I'm planning on setting up a VM linux box. It needs to be as light weight as possible - no need for GUI. Requirements:   * It will be connected to VPN    * It will be running maintenance scripts on mysql server every night and schedule backups. (we have custom java programs that doing all that maintenance stuff). Preference: - Debian (due to Apt and ease of maintenance) - RH (same as above with RPMs) What I have found so far: LUbuntu and Puppy. (DSL doesn't seem to be maintained anymore?) EDIT: Puppy - not what I'm after. Just tried it, its awesome as a USB stick desktop. Not lightweight server. Questions: Has anyone had any experience with those or perhaps similar requirements? Are there any better linux distros that are made especially to be lightweight servers?


Samba 3.5.9 - join domain specific OU - net join ads

Our Unix team often uses Samba to join machines to the domain. The command they have traditionally used is:               net join ADS -w [domain name] -U [username]      I am one of our AD admins and I am trying to find out how to get them to be able to join to a specific OU so we can have all of the Samba machines organized in AD. From all of my research, it seems that this should work:               net join ads "Servers/Samba" -w [domain] -U [username]       This still allows the machine to join to the domain without issue but it keeps ending up in the 'computers' container and we receive no errors. I have made sure on the AD side that the user they are using have join domain rights and create/delete computer objects on both the "servers" OU tree and the "computers" container. What am I missing? I can't find much documentation on the Samba net commands without having access to a unix box with it. Also, I noticed in most examples people always had 'net ads join...' rather than 'net join ads...' - our Unix admin got errors when trying to use net ads join. I do not know why our syntax seems different then most examples I found but I wanted to point it out. Here are some sites that support my research: https://www.samba.org/samba/docs/man/Samba-HOWTO-Collection/domain-member.html http://www.members.optushome.com.au/~wskwok/poptop_ads_howto_6a.htm


Add arguments to bash -c

Let say that I want to run a command through bash like this:               /bin/bash -c "ls -l"      According to bash man page, I could also run it like this:               #               don't process arguments after this one     #               |   pass all unprocessed arguments to command     #               |   |     #               V   V     /bin/bash -c ls -- -l      except it doesn't seem to work (it seems ignored). Am I doing something wrong, or am I interpreting man page wrong? Relevant quotes from man: > If the -c option is present, then commands are read from string. If there > are arguments after the string, they are assigned to the positional > parameters, starting with $0. and > A -- signals the end of options and disables further option processing. Any > arguments after the -- are treated as filenames and arguments.


Unable to synchronize the clocks on a dual boot system

A have a dual boot system: Ubuntu and Arch. Ubuntu was installed first. A while after installing Arch, I've set up its clock because it was 8 behind my current time zone (my time zone is gmt +8). I don't remember the actual command, something like `date --set "xxxxxx"`. However, I do remember that I specified the time zone during its installation (gmt +8, Hong Kong). And when I checked `sysclock` and it showed the real time in my time zone. In Ubuntu the time zone remained the same - gmt +8. That being said, after setting up the clock in Arch I found out that the clock in Ubunutu was 8 hours behind the actual time. But! The time zone was still the same - gmt +8. So now in both systems the time zone is the same (Hong Kong) but the time is different in 8 hours. What's more that the clock in Ubuntu was changed by itself when I changed the clock in Arch. What do I do about that? `sudo hwclock --show` shows the same time on both systems.


Running Apache as Group only?

I have a folder with files owned by: joe:www-data, joe belongs to the group. Apache only seems to cooperate with www-data:www-data. Is there a way around this so I can keep the user as joe and the group as www-data? Is it recommended to use this module below if I want to accomplish this task? Is this a good idea?               <IfModule unixd_module>     #     # If you wish httpd to run as a different user or group, you must run     # httpd as root initially and it will switch.       #     # User/Group: The name (or #number) of the user/group to run httpd as.     # It is usually good practice to create a dedicated user and group for     # running httpd, as with most system services.     #     User daemon     Group daemon          </IfModule>


agrep with directionally biased penalties

I am using `tre-agrep`, an implementation of `agrep`, to perform approximate pattern matching. This utility searches for matches based on Levenshtein distance, and the user can configure the penalty applied for substitution, insertion, or deletion edits. I would like, however, to apply weighs differentially across the length of the query, namely with a lower weight for deletions at the beginning (left end) of the query than at the right. The `man` page for this utility does not indicate that such a level of control is possible. Are there other command line tools where approximate matching with finer control over the mismatch penalties is possible?


Keep SSH Sessions running after disconnection

I sometimes have long running processes that I want to kick off before going home, so I create a SSH session to the server to start the process, but then I want to close my laptop and go home and later, after dinner, I want to check on the process that I started before leaving work. How can I do that with SSH? My understanding is that if you break your SSH connection you will also break your login session on the server, therefore killing the long running process...


How to run script using SSH from remote computer and avoid its interruption if remote computer goes offline

I have a remote Linux server and I use it to run some very long tasks using SSH. It works great, but, of course, if the connection dies for some reason, the task dies. Specifically, I'm running something like this:               [myName@localStation]$ ssh john_doe@myRemoteServer     Password: *****     [john_doe@remoteServer]$ ./myVeryLongTask.script > myOutputLog.txt      Is there a way to tweak the SSH connection in such a way that, if the network connection fails, the task keeps running?


How can I make a process I start during an SSH session run after the session has ended?

> **Possible Duplicate:**   >  Keep SSH Sessions running after disconnection. I have a process which is basically a web-server, I start it during an SSH session. However, when I leave the session (by closing the PuTTY windows), it stops running and responding to requests. This is true even if I end the command with a `&`. With Apache, I don't have this problem, it comes with a stop, a start, and a restart script. I'd like to create something like that for this program. How can I start a process, so that it will continue running even after I end the SSH session I started it in? Also how can I set it to restart itself if it stops for some reason? Thanks!


Keeping a process running after putty or terminal has been closed

I'm running a `node.js` server off of a raspbian (Debian) machine, and I'd like to start and stop the server remotely. This for me means using `putty` to access the shell, except when I close out of the `putty` terminal or it times out my server goes down with it, because I just execute my server in the foreground. So I'm wondering if there's a way to keep it going but still have a way to kill the process afterwards.


Is there a mechanism to run a "service" by a non-root user?

Is there a way I can have a continuously running, background process that can be controlled by me (a regular, non-root user)? All I need to be able to do is start, stop and restart the process. Monitoring by PID and sending SIGHUP or SIGINT for termination is fine. I'm okay with using a complicated bash script, it doesn't have to be something system-wide. Just for me. I also really need it to not stop when I log off from ssh. Is there a way I can do this in RHEL 6.4?


Keeping a process running on server even SSH is closed

I am running long program on server, which is basically Jar file of java program. I want to keep this program running even if SSH terminal is closed, how I can keep this program running on server?


Red Hat internal specifications

I'm doing a homework assignment for my college, and I'm trying to find the parameters used in kernel compilation on RedHat. My teacher asks: "Analyse and describes in terms of models of each version of linux for Servers: process, scheduling, memory management, file system, security" I can't find anything on RedHat documentation (what I found was too brief). I searched the entire RedHat website and I couldn't find it, can someone give me a pointer?


Can I use a shell or python script to execute commands in a chroot?

I need: to make a shellscript which can chroot into a linux environment and run a command there. I am using: arch-chroot (on the arch linux livecd)


When I try to start MySQL it says "failed!", so I try using `mysqladmin ping` and get the following:               mysqladmin: connect to server at 'localhost' failed       error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)'       Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!"       Why is the `mysqld.sock` file missing from my directory? I've checked everywhere, but I can't find it.


Causing fluxbox to show a different time then the default timezone

I've moved to fluxbox as my default environment on our corporate environment. I obviously can't change the time on the machine. But I'd like the clock to show my local time instead of the machine's local time. Any way that can be achieved?


Dual Boot GRUB2

I just installed EasyBCD for my dual boot laptop (Windows7 and Ubuntu 14.04). Everything works great, however if I choose the Ubuntu option on loading, the next screen it takes me to is GRUB2 with the options of Windows and Ubuntu. How do I bypass that screen so that it bypasses the Linux bootloader and goes right into Ubuntu When I edited the grub file as suggested and run a `sudo update grub` this is what I get:               Found linux image: /boot/vmlinuz-3.13.0-27-generic     Found initrd image: /boot/initrd.img-3.13.0-27-generic     Found linux image: /boot/vmlinuz-3.13.0-24-generic     Found initrd image: /boot/initrd.img-3.13.0-24-generic     Found Windows 7 (loader) on /dev/sda3     done`      When I restart it, the grub still appears as the same.


find with execdir

I run a `find` with `execdir` both I don't get the results I was expecting. SSCCE below:               mkdir -p a/b/c     find . -type d -execdir touch foo \;     $ tree a     a     ├── b     │   ├── c     │   └── foo     └── foo      Directory `c` does not contain a `foo` file. How do I get to visit and do something locally in each directory?


Can I use `type` to check whether an arbitrary name is a valid command name?

The bash built-in `type` can be used for this purpose by checking its exit status:               Exit Status:     Returns success if all of the NAMEs are found; fails if any are not found.      How portable is it? The POSIX spec is a little bit less clear regarding the exit status of `type`:               EXIT STATUS             The following exit values shall be returned:              0 Successful completion.         >0 An error occurred.      Source: http://pubs.opengroup.org/onlinepubs/009695399/utilities/type.html


How to start a virtual machine filled with qemu-nbd?

I migrated a Windows OS (entire disk) to a virtual machine on another host (Debian with `qemu` and `kvm`). I used **Selfimage** to export the disk. On the host, first of all, I created an empty virtual machine:               qemu-img create -f qcow2 myVM.qcow2 180G      And I imported the image by:               qemu-nbd -t myVM.qcow2 -p 1024      After 10 hours the image was exported. I stopped `qemu-nbd` by `Ctrl`+`C`. Now I don't know how to start the VM or how to add it with `virt-manager`!


Yum regular expression or wildchard search?

Fedora documentation says: > 5.2. Advanced Searches > > If you do not know the name of the package, use the search or provides > options. Alternatively, use wild cards or regular expressions with any yum > search option to broaden the search critieria. Well, at first I thought that this is simply wrong or outdated, since no known syntax of regular expressions would work with `yum search`, but then I found this: `yum search [cl-*]` for example. But it does something otherworldly. It finds things which have neither "c" nor "l" letters in the name or description. (What I wanted is to find all packages, whose names would be matched by `cl-.*` regexp. I also found few people suggesting to pipe yum results to `grep`, which, of course, solves the problem. But, just on principle, I want to find out what did the thing in the square brackets do. What if `yum` actually can search by regexp?


What is the difference between $* and $@?

Consider the following code:               foo () {         echo $*     }          bar () {         echo $@     }          foo 1 2 3 4     bar 1 2 3 4      It outputs: > 1 2 3 4 > > 1 2 3 4 I am using Ksh88, but I am interested in other common shells as well. If you happen to know any particularity for specific shells, please do mention them. I found the follwing in the Ksh man page on Solaris: > The meaning of $* and $@ is identical when not quoted or when used as a > parameter assignment value or as a file name. However, when used as a > command argument, $* is equivalent to ``$1d$2d...'', where d is the first > character of the IFS variable, whereas $@ is equivalent to $1 $2 .... I tried modifying the `IFS` variable, but it doesn't modify the output. Maybe I'm doing something wrong?


Should I use $* or $@?

Which one of `$*` or `$@` is better to use (in array syntax,command line parameters, etc.) to avoid any bugs/problems in code? Or it does not make any difference?


What is the meaning of $* in a shell script?

In a shell script file i saw "$*", what does it mean and when we have to use it?


In bash, what is the safest way to pass variables to another program -- $* or $@?

Can someone explain to me in a concise way what the difference between these two vars is? What is the safest way to pass variables to another program? E.g.               #! /bin/bash          # do stuff          # pass variables onto another program     java $@


what does $* mean in shell

What does `$*` mean in shell? I have code two function, `run_command` and `run_test`, they are called like this:               if [ -n "`echo ${GOAT_COMMANDS} | grep $1`" ]; then       run_command $*     else       run_test $*     fi      I want to understand what `$*` means, but Google search is very bad for searching these kinds of things.


Where to download Fedora 16

I am having a really hard time finding a place to download Fedora 16 64 bit distribution are there still places that have links up for 16th version instead of 17? A Virtual image for VirtualBox would be good as well.


Playing an ogg format video using gstreamer in an embedded system

I created a pipeline to play an ogg formatted video on an embedded system. I used the gst plugins like `libgstvorbis.so`, `libgsttheora.so`, and `libogg.so`, and copied them to the `/lib` folder on my embedded system. But when trying to play the video, 'm receiving warnings like > (:25214): GStreamer-WARNING **: Failed to load plugin > '/lib/gstreamer-0.10/libgstogg.so': /lib/gstreamer-0.10/libgstogg.so: > undefined symbol: gst_collect_pads2_start > > (:25214): GStreamer-WARNING **: Failed to load plugin > '/lib/gstreamer-0.10/libgstvorbis.so': /lib/libm.so.6: version `GLIBC_2.15' > not found (required by /lib/gstreamer-0.10/libvorbis.so.0) > > (:25214): GStreamer-WARNING **: Failed to load plugin > '/lib/gstreamer-0.10/libgsttheora.so': /lib/gstreamer-0.10/libgsttheora.so: > undefined symbol: gst_element_class_add_static_pad_template How can I fix this?


Given a mime-type get the corresponding file extension

I want to download I file using `curl` to a temporary directory with the appropriate extension. Currently I do something like this:               tmp="$(mktemp -t 'curl')"     curl -o "$tmp" http://example.com/generate_image.php?id=44     file -b --mime-type "$tmp"      This will print the mime-type of the downloaded file, but how do I map these to extensions? As you can see I can't just extract the "extension" of the url as that would give `.php` instead of `.png`. I know there isn't a one-to-one map between mime-types and file extensions but it should handle normal file extensions.


Can't find nmap executable in Metasploit

I'm running Metasploit in archlinux and when I execute               msf> db_nmap -h      It'll return an error:               The nmap executable could not be found      Now, I know I am probably missing a binary or something, but how did I end up missing it? I installed `ruby1.9` and `metasploit-git` from the AUR.


Hide "Mail" in emacs mode line

This is small stuff but I haven't been able to figure it out: How do I hide "Mail" from the mode line in emacs?


Search for mail content with mutt

Is it possible to use to search for specific mail content using built-in functionality of Mutt? Or, as last resort, how can I configure `grep` to be used in Mutt ? The documentation only mentions the `search` and `limit` functions, which only search headers.


PCLinuxOS install without usb keyboard at bootloader

I have a PCLinuxOS Live CD in a very old computer (emachines etower 500i), and have managed to boot into the Live CD. The USB keyboard does not work in the bootloader, so it is impossible to select the "Install" option. I see from `isolinux.cfg` that the install is activated as an option to the kernel (`install` on the kernel command line). How can I get PCLinuxOS installed from the live cd (by activating the installer, or by manually copying over the files, with `cp` or `dd`)?


Tshark not running via gdb

I have successfully installed wireshark on centos 6.4 I can run the command tshark it works perfectly fine. I want to run gdb so that I want to learn how it decodes tcp and udp packet as I am writing an application where I need to dissect these two types of packets. When I run libtool --mode=execute gdb tshark it run and stop at here (gdb) it not capturing anything.


No bluez device after pactl list sources short

I am using pulseaudio on a Raspberry Debian (Wheezy) but my bt-headset(Iqua BHS-611) does not show up in sources or sinks. **What I did:** I followed the _Raspbian Wheezy Installation Guide_ at: http://kmonkey711.blogspot.de/2012/12/a2dp-audio-on-raspberry-pi.html Having entered:               pactl list sources short      I only get the following but no bluez device.               0       alsa_output.platform-bcm2835_AUD0.0.analog-stereo.monitor       module-alsa-card.c      s16le 2ch 44100Hz       SUSPENDED      Instead of the command `bluez-simple-agent` I used `hcitool scan` which showed my device:               bluez-test-device trusted <MAC> yes      This appeared to work as well but still no bt-devices.


Issue installing OpenVPN via apt

Pastebin I wanted to install OpenVPN on my Debian Wheezy server at home, so I could create a tunnel with my phone or tablet from outside my home. We use OpenVPN at work, so I figured it would be easy enough to setup, given my experience. When I execute (as root) `apt-get install openvpn`, it looks like it installs, then fails. OK, I'll check what `dpkg --audit` has to say about it. It claims that it's not configured properly. Alright, I run `dpkg --configure openvpn`, but I just get an error about the boot order. It claims to conflict with minidlna and denyhosts, two services I run at home. I have minidlna so I can watch my media on my other devices (i.e. my XBox), and denyhosts to block a lot of script kiddies who try to get into my website. I would prefer to not have to remove those packages, but is there some way I can get OpenVPN to install on this box?


Arch Linux not picking up static DHCP lease from DD-WRT

I have a Arch Linux system on my home network and its MAC address is setup in my Linksys running DD-WRT to receive a static lease. However, this system is not getting the static lease from the DD-WRT, but rather a random ip from the dynamic pool. I tried various things, like forcing a lease renewal, but to no avail. How should I go about troubleshooting this problem? Running Arch Linux 201404 with a wired connection. I am new to Arch, but been a long time Debian user, so the Arch `ip` toolset is not too familiar to me.


Extract lines based on words on position, not column

I have a file like this:                                    v     ATOM     57  O   LYS A   7       2.254  25.484  18.942  1.00 14.46     ATOM     77  NH1AARG A   8       5.557  19.204  13.388  0.55 24.50     TER    1648      ILE C 206     HETATM 1668  O   HOH A1023      25.873  38.343   2.138  1.00 21.99                          ^      Only lines which has A at the marked position are what I need. You see, the A in the second row is on the fourth column, not fifth as others, and the fifth column of the last row is A1023, not A anymore. I have tried this, but it needs some temp files, which I don't want to. I think there are tools for this. I want to extract a **whole** line, not only the word. I need my input to be:               ATOM     57  O   LYS A   7       2.254  25.484  18.942  1.00 14.46     ATOM     77  NH1AARG A   8       5.557  19.204  13.388  0.55 24.50     HETATM 1668  O   HOH A1023      25.873  38.343   2.138  1.00 21.99      But sometimes I also want to extract only A, not Aabcdef, like this:               ATOM     57  O   LYS A   7       2.254  25.484  18.942  1.00 14.46     ATOM     77  NH1AARG A   8       5.557  19.204  13.388  0.55 24.50


htop: show processes of all users except root

I am aware of the `-u` option in htop, where I can show only processes of a given user, such as:               htop -u root      I am wondering whether there is a way to show processes of all user except root.


GNU screen, tmux, dvtm - none work as ordinary user

I bought cheapest vps for teamspeak hosting and I have strange issues with demonizing it's process. None of screen tmux and dvtm work for ordinary user, but they work witout a charm for root. As far as i know running server apps from root is not very wise. No errors are generated, I could not find any logs. screen -> instant [screen is terminating]   dvtm -> instant hang, I need to reconnect ssh   tmux -> this imageshack.us/photo/my-images/39/i59a.png/   @edit ok, here's the sollution `chmod 666 /dev/ptmx`


Stop atieventsd flooding my journalctl

When running `journalctl -f`, this line shows up every seconds..               Month DD HH:MM:SS computername atieventsd[number]: xauth:  file list does not exist      for example               May 15 08:32:11 gravity atieventsd[355]: xauth:  file list does not exist     May 15 08:32:12 gravity atieventsd[355]: xauth:  file list does not exist     May 15 08:32:13 gravity atieventsd[355]: xauth:  file list does not exist      What is this and how should I stop this? (I haven't found any hint on google)


Can grep be used for searching files with some string in their names?

I understand that `grep` can only be used for searching for files which contain a string in their content. Can it be used for searching for files with a string in their names? I read the manpage, and don't think so. Also Is `grep` pronounced as [gri:p] or [grep] (in IPA notation)? I read it as the former.


How can I capture a consistent snapshot of a directory and all its children?

We have an application that periodically backs itself up to a directory on the local file system. Inside this directory are several more files and directories. I want to produce a "snapshot" of all these files that can be copied to backup storage. Most importantly, how can I produce this "snapshot" in an atomic manner? Keep in mind that all the while, any of these files may be modified by the backup daemon rendering our "snapshot" inconsistent. Edit: Perhaps I should mention that the system has an `ext4` file system.


/sys/class filesystem on Linux

On Linux (Ubuntu 11.10 on a ARM processor in my case) I was looking for a way to measure CPU temperature. I found out that a               cat /sys/class/thermal/thermal_zone0/temp      did the trick. Now I wonder: what is the /sys/class filesystem meant for?


VNC Server without X Window System

Will a VNC server work without X Server installed? I know vnc works with X Server, but what about without it?


How to find site on shared server that is generating httpd requests

I have a shared server that had a Wordpress site that was compromised. I cleaned out all the wordpress sites on the server and everything seemed to be fine. When I checked today I noticed a large volume of httpd request in htop. **Question:** Is there an easy way to locate what site on the server is generating those requests? Centos 6.5


Print arguments to printf in no particular order

How can I refer back to arguments to `coreutil`'s `printf` in no particular order? This is what I want to avoid:               $ printf '%s %s %s %s %s %s %s' a c a c b c a     a c a c b c a      This is what I would like to do:               $ printf '%s %s³ %s¹ %s³ %s² %s³ %¹' a b c     a c a c b c a      This is how to do it with Perl.               perl -e 'printf ("%s %3\$s %1\$s %3\$s %2\$s %3\$s %1\$s\n", 'a', 'b', 'c');'     a c a c b c a      Notice only four arguments are passed to `printf`.


How can I automatically create a document that allows me to compare a list of 4 .png files side-by-side?

So I have a list of 4 .png files, and I'd like to auto-pipe this to some document that puts them all side-by-side for easy comparison. I'm thinking of automatically putting them in a HTML file. So I'd like to use terminal commands to automatically put for each of the 4 .png files. How would I best do this via the command line?


Faulty support for the installation of Debian Jessie/testing

From here I downloaded a `debian-testing-amd64-netinst.iso` and `boot.img.gz`, then I followed these instructions but the result is an USB dongle that is capable of booting the Debian installer, reading the `iso` in it, but I got no kernel module, no Ethernet and basically I can't install anything with it because I can't go forward with the installation process or download anything from the internet. I tried to burn the `iso` directly to a CD, same result. I don't get how I'm supposed to do this, what is the logic behind this cumbersome solution solution with this `iso` + boot.img system without kernel modules. I don't even get If I'm doing something wrong or what else is the problem. In the end I'm interested in installing the current Debian testing, codename "Jessie", possibly via Wi-Fi ( I have a WPA2 PSK network ) but I have Ethernet too, using an USB dongle.


How to set default auto mount options for removable media?

I have quite a bit of removable media (flash drives, external hard drives, etc) that I want to adjust auto mount options for. How does one do this? Is there something similar to `/etc/fstab`?


Using alias in another script (ksh)

I'm writing a `ksh` script, and I'd like to use a command define by an alias in my `.profile` file, in my script. I tried this command in the folder containing my script, and it works. However, in my script, I've: `[command] not found`. How can I solve this? My command just make a `ls` of a repository, then I'm doing in my script:               [command]| grep ... | { IFS== read -r var1 x && IFS== read -r var2 x; }


Ksh script warnings

While running my script, I got the following message (it's not an error strictly speaking, because the execution go ahead after) :               myScript -s test -u test2     pk_copylogs[2]: hist: :: not found      However, do you know why does this message appear ?


Running thousands of curl background processes in parallel in bash script

I am running thounsand of **curl** background processes in parallel in the following bash script               START=$(date +%s)     for i in {1..100000}     do                curl -s "http://some_url_here/"$i  > $i.txt&         END=$(date +%s)         DIFF=$(( $END - $START ))         echo "It took $DIFF seconds"     done      I have 49Gb Corei7-920 dedicated server (not virtual). I track memory consumption and CPU through `top` command and they are far away from bounds. I am using `ps aux | grep curl | wc -l` to count the number of current **curl** processes. This number increases rapidly up to 2-4 thousands and then starts to continuously decrease. If I add simple parsing through piping curl to awk (`curl | awk > output`) than curl processes number raise up just to 1-2 thousands and then decreases to 20-30... Why number of processes decrease so dramatically? Where are the bounds of this architecture?


named starts but doesn't answer until reboot

I have a current arch linux arm running on raspberry-pi and bind 9.9.4.P2-1 from the community repository. I'm using this bind as a slave-nameserver for our internal network. I have enabled named using `systemctl enable named`.   When I reboot the raspberry pi the named doesn't answer for `dig stackexchange.com @xx.xx.xx.xx` and runs into a timeout. `systemctl status named` says named is active and all zones have been successfully loaded.   If I simply login and issue `systemctl restart named` it provides the correct answer for `dig stackexchange.com @xx.xx.xx.xx`.


How do I change the screen font size when using a virtual terminal

Using LDXE and Ubuntu, I can log into a virtual terminal via CTRL+ALT+F1. The text is far too small. How do I change the screen resolution to get a larger font?


Why do some Debian packages have a "+deb7u2" suffix?

I figured the "7u2" part stood for "Debian 7.2" (aka "wheezy"). But I'm wondering if anybody knows the official answer as to why some packages have it and others do not. Example: http://metadata.ftp- master.debian.org/changelogs//main/g/grub2/grub2_1.99-27+deb7u2_changelog The only time "+deb7u2" is appended to the version is when the package gets put in the "stable" release. Does this mean that's a "tag" to indicate a checkin to stable from another repo?


How to run scripts on headless startup?

How can I run a shell script when my Raspberry Pi starts up headless? I don't want it to be dependent on booting into a console, or logging in, etc. It will literally be plugged into Ethernet and power, nothing else. I saw this post on RPi SE. The answer was really thorough, but depended on things like logging in, booting to desktop, or booting to console. How can I run a script on powerup, even if none of these things happen? Thanks! evamvid


understanding LAMP: linux apache mysql and php

I have multiple questions and I am confused. Few months back, I was installing a software locally `~/bin`. Tools got installed successfully and running fine till date. In installation it automatically created `var/www/` and added its folders in `~/bin`. Now, I am trying to learn some php development. I have installed apache from source, locally on `~/someFolder`, installation is complete. I did `sudo ~/someFoler/bin ./apachetl start`; `localhost` on browser, and `It works` message received on browser. I do not want to use `sudo`, and do all my learning experiments in `/usr/local` or `/usr/var/www`. Sorry, I do not understand well these directories. From what all I have read and gone through, most users work in `/usr/var` or `usr/local`. However, while copying, removing or doing anything it requires `sudo`. What is the work around for this? How do I get Apache and PHP working locally without using too many `sudo` commands? I read port 80 is required to start the server. Hence, `sudo` is necessary while starting the server. Any help in these would be highly appreciated. machine specification: Linux 3.11.0-15-generic x86_64 Ubuntu 13.10 **Edited** If I install apache and php by sudo, would I have to move my web pages to `/var/www` location?


Something's special about /dev/fd/3

I've been trying to learn about file descriptors. When I type "ls -l /dev/fd/" I get               lrwx------ 1 me users 64 May  2 16:02 0 -> /dev/pts/5     l-wx------ 1 me users 64 May  2 16:02 1 -> /home/me/file     lrwx------ 1 me users 64 May  2 16:02 2 -> /dev/pts/5     lr-x------ 1 me users 64 May  2 16:02 3 -> /proc/31518/fd      /dev/fd/3 seems to be pointing to the current process. However, explanations of file descriptors I've seen, e.g. http://www.tldp.org/LDP/abs/html/io- redirection.html, don't say there's anything special about /dev/fd/3 (and imply it's just like any /dev/fd/N for N > 3). What's going on here? I've observed this on arch linux and ubuntu, but not on the solaris server I have an ssh account on.


Drawbacks of increasing number of inodes in EXT4

I am currently using `backintime` to take "snapshots" of my file system. It is similar to `rsnapshot` in that it, makes hard links to unchanged files. I have recently run out of inodes on my `EXT4` filesystem. `df -hi` reveals I have used 9.4 million inodes. A rough count of the number of current directories times the number of snapshots plus the number of current files suggests that I may in fact be using 9.4 million inodes. From what I understand the `EXT4` filesystem can support around 2^32 inodes. I am considering reformatting the partition to use all 4 billion or so inodes, but I am concerned that this is a bad idea. What are the drawbacks of having so many inodes in an `EXT4` filesystem? Is there a better choice of filesystem for an application like this?


start_daemon fails with exit code 7

I have a daemon called `mydaemon.bin` and a shell script called `start-my- daemon.sh` that sets some environment variables and then starts `mydaemon.bin`, which in turn calls the unix function `daemon` to daemonize itself and then creates a pidfile in `$PIDFILE`. To start the daemon under Suse 10.0 I've written an init script that uses `start_daemon -p $PIDFILE mydaemon.bin`, however in 9 of 10 cases `start_daemon` returns with exit code 7 although the daemon started successfully. Even `pidof proc` does return the right pid. In case #10 it returns 0 as it should. Any hints?


Archlinux ARM Apache server fails to start

I am currently setting up an Apache web server on my Pi running on Archlinux ARM. After installing and making the first small configurations I have tested it and it works. Then I stop the server and wanted to add SSL certificates, I have followed this guide. But after doing this the server does not start again. The error message I get from _systemctl status httpd.service_ is:               httpd.service - Apache Web Server     Loaded: loaded (/usr/lib/systemd/system/httpd.service:disabled)     Active: failed (Result: resources) since Di [...]; 13 min ago     Process: 1071 ExecStart=/usr/bin/apachectl start (code=exited, status=0/SUCCESS)          [...] apachectl[1071]: (98)Address already in use: AH00072: make_sock:could not bind to address [::]443     [...] PID file /run/httpd/htppd.pit not readable (yet?) after start     [...] httpd.service never wrote its PID file. Failing.     [...] Failed to start Apache Web Server     [...] Unit httpd.service entered failed state      The [...] brackets indicates where the date and time would be showned, I left them out as I had to retype everything. I have already change the content of the file _/usr/lib/tmpfiles.d/apache.conf_ to:               d /run/httpd 0755 http http -      I have also checked if there is another service running with the following command:               /usr/sbin/lsof -i | grep http      But there is no and chaning the listening port to e.g. 8080 produces the same error just with port 8080 instead of 443. I am looking forward to hear from you.


How do I set a user environment variable? (permanently, not session)

This is irritating me. I seen several suggestions (all using different files and syntax) and none of them worked. How do I set an environment variable for a specific user? I am on debian squeeze. What is the exact syntax I should put in the file to make ABC = "123"?


Removing path in env variable PATH permanently

I have recently installed Code Sourcery's ARM EABI Tool Chain. All the executable binaries were installed in a separate folder. I thought that the bin path will be added to env variable $PATH. However, after installation I was unable to run, as the bin path was not added to the env variable. So, I removed the directory, downloaded just the binaries (not installation package). Moved to /opt/ folder and I added the new path to the PATH variable by adding the line               export PATH=$PATH:/opt/arm/usr/local/bin      in `/etc/profile`. Later I restarted my computer and I see that the path to code sourcery's bin(installation path) is present in $PATH along with my manual entry. I checked               /etc/profile/     .bashrc      I didn't find the path to CodeSourcery's installation How do I remove it now? Though its of no use as the directory is absent. I want to remove that path.


Chromium OS Compiling Path

![enter image description here](http://i.stack.imgur.com/u4PzP.png) After following the steps at the Chromium OS Developer site, I would like to know how I could add the path to my .bashrc file so I could make it permanent? I am using Ubuntu 13.10


Being not sudo on debian how to make a .sh execute each time I log in?

> **Possible Duplicate:**   >  How do I set a user environment variable? (permanently, not session) So each time I log on I want to execute a command like `export PATH=~/gcc-4.5.0-g/bin:$PATH`. I have no sudo rights. So how to make a .sh execute each time I log in?


changing an environment variable like PATH forever

> **Possible Duplicate:**   >  How do I set a user environment variable? (permanently, not session) to change the amount of PATH variable , I use : `export PATH=...`   but when I close the terminal, the amount of PATH becomes what it was at the first. I want to save the changes , so that the amount will be what I want after closing the terminal or logging out. how can I do this work?   I use Fedora 17, kernel : 3.4.3   (sorry for my weak english)


Update Linux Path permanently

> **Possible Duplicate:**   >  How do I set a user environment variable? (permanently, not session) How can I permanently modify the PATH variable in Ubuntu? Is it possible to do it without modifying any files? I currently use `export PATH=${PATH}:/usr/local/cuda/bin` but each time I open a new terminal I have to type it again.


How to set environment variables permanently for one user

> **Possible Duplicate:**   >  How do I set a user environment variable? (permanently, not session) I have a user XX and I want to set the env variables for it. I looked for .bash_profile in the home dir but there was none. SO, I tried with .bashrc, but when I try to see the env variables (printenv), my variables are not there. This is killing me. I tried for root, and it works. But it does not work for user XX.


How to get environment variables to persist across login?

> **Possible Duplicate:**   >  How do I set a user environment variable? (permanently, not session) For a project I'm working on, I have a service that runs at startup which calls a script to set environment variables. This works just fine to set the variables before the login has occurred, however once the user logs in those environment variables are not being persisted and seem to dissappear. I currently have to call my script a second time from /etc/profile for the variables to be set after login. Is there a way to persist the environment variables across a login?


Network Printing in Fedora

I´m having problems setting up network printing in Fedora 16. In the printer setup box it says FirewallD is not running and gives a list of protocols that need to be enabled. I cannot find a FirewallD but have gone into Firewall and enabled the protocols. There is obviously something I´m missing. The printer is a Canon MP970 and is connected to a Windows machine. **Update: 4Nov12** Bought a new printer - same problem. This time I set it up properly as a network printer. Windows 7 and Ubuntu both find the printer and print fine. Fedora still complains FirewallD is not running. The new printer is a Canon MG6250. I have installed the drivers from RPM packages.


How do I get my Logitech Quickcam 4000 up and running?

I've just installed Debian “Squeeze” and would love it if I could get my webcam up and running. I've Googled for a solution, and there's a package named `pwc` that I need to install to get it up and running (it's a Philips driver, but runs on my Logitech too if I am correct). So, I did a `apt-cache search pwc` but the only result is               setpwc - program to set and query settings of (mainly) Philips WebCams.      So, how do I install the correct driver for my webcam?


Is openwrt difficult to use for a novice?

**Background** I am very interested in openwrt, I like that it's open source and gives you complete, granular control over your router. I'm going to use my router for a home network (with a nas, htpc and desktop), so the functionality I'm looking for is pretty basic. I'm leaning towards openwrt (instead of ddwrt) because I've read that the code of ddwrt is rather messy compared to openwrt. **Problem** However, seeing the information online leads me to believe that it is not very easy to get started with, and that part of its use takes place on the command line. I am not a linux user (am going to be soon though), so I don't have a lot of experience with the command line. I love to learn new things, and am willing to expend some effort to get everything working, but am I biting off more than I can chew with openwrt as a novice? **Question** So my question is; is openwrt difficult to learn as a novice? Will it take a lot of time? Can anyone with experience in this area give me some feedback?


copy files from Google drive

I've installed a terminal on my nexus tablet and would like to batch copy files from a sub-directory in Google drive to my tablet's dcim directory. how do I do this?


Why does my regular expression work in X but not in Y?

I wrote a regular expression which works well in a certain program (grep, sed, awk, perl, python, ruby, ksh, bash, zsh, find, emacs, vi, vim, gedit, …). But when I use it in a different program (or on a different unix variant), it stops matching. Why?


Making voice calls using Huawei E1550

3G dongle Huawei E1550 is able to make voice calls using huawei app in windows. With search I found the same app for linux (called Mobile Partner), seems it's working and makes calls but without sound (tested on several machines). Is there any other software for making voice calls with this modem?


Configure touchscreen on Debian?

I have got Samsung Q1 Ultra with **Debian Squeeze** on it. Everything works okay, except **touchscreen**. The arrow almost does not respond to touching -- it only moves once in a while to a random place after the screen being touched. I have tried to calibrate the screen using `xinput-calibrate`, but it did not do anything, as the arrow did not respond to touching. X11 generates configuration on start up, so I dont have Xorg.conf to append, but I have **/user/share/X11/xorg.conf.d/10-evdev.conf**. Should I try a different driver (if there are others)? Or is there some configuration that needs to be done? Or what might be wrong? Thanks.


probably gfs2 problem

We have a Mail Server (CentOS 6.5) with these component:   * Postfix    * Dovecot   * Mysql   * MailScanner (spamassassin,clamav)   * GFS2 Partition  Last night the server crashed and this is the kernel logs before that:               May 11 01:07:01 mail1 kernel: original: gfs2_fallocate+0xdc/0x540 [gfs2]     May 11 01:07:01 mail1 kernel: pid: 24608     May 11 01:07:01 mail1 kernel: lock type: 2 req lock state : 1     May 11 01:07:01 mail1 kernel: new: gfs2_fallocate+0xdc/0x540 [gfs2]     May 11 01:07:01 mail1 kernel: pid: 24608     May 11 01:07:01 mail1 kernel: lock type: 2 req lock state : 1     May 11 01:07:01 mail1 kernel: G:  s:EX n:2/28b165f5 f:yfIqob t:EX d:EX/0 a:1 v:0 r:4 m:200     May 11 01:07:01 mail1 kernel:  H: s:EX f:W e:0 p:24608 [imap] gfs2_fallocate+0xdc/0x540 [gfs2]     May 11 01:07:01 mail1 kernel:  H: s:EX f:W e:0 p:24608 [imap] gfs2_fallocate+0xdc/0x540 [gfs2]     May 11 01:07:01 mail1 kernel:  H: s:EX f:W e:0 p:24608 [imap] gfs2_fallocate+0xdc/0x540 [gfs2]     May 11 01:07:01 mail1 kernel:  H: s:EX f:W e:0 p:24608 [imap] gfs2_fallocate+0xdc/0x540 [gfs2]     May 11 01:07:01 mail1 kernel:  H: s:EX f:W e:0 p:24608 [imap] gfs2_fallocate+0xdc/0x540 [gfs2]     May 11 01:07:01 mail1 kernel:  H: s:EX f:W e:0 p:24608 [imap] gfs2_fallocate+0xdc/0x540 [gfs2]     May 11 01:07:01 mail1 kernel:  H: s:EX f:W e:0 p:24608 [imap] gfs2_fallocate+0xdc/0x540 [gfs2]      I found these solutions in this post titled: /var/log/messages shows lines like "H: s:EX f:W e:0 p:19456 [imap] gfs2_fallocate+0xdc/0x540 [gfs2]" repeated many times and GFS2 file system becomes inaccessible in RHEL 6 but we're not a Red Hat subscriber. In the Dovecot logs I found the message: > MySQL server has gone away **NOTE:** Presently the MySQL data is stored on that GFS2 partition. Does anyone have any ideas on how to resolve this problem?


Prevent non-root user from formatting a partition

Few days back I mistakenly formatted a partition on my external hard drive by clicking Format from the Context menu in Computer. I want to know that how can I prevent non-root user from being able to do so. At the same time I need the non-root user to be able to read and write on the partition. I use Fedora 14. Thanks.


Is there an easy way to replace duplicate files with hardlinks?

I'm looking for an easy way (a command or series of commands, probably involving `find`) to find duplicate files in two directories, and replace the files in one directory with hardlinks of the files in the other directory. Here's the situation: This is a file server which multiple people store audio files on, each user having their own folder. Sometimes multiple people have copies of the exact same audio files. Right now, these are duplicates. I'd like to make it so they're hardlinks, to save hard drive space.


How to de-unzip, de-tar -xvf -- de-unarchive in a messy folder?

Usually, I unarchive things by `$ mkdir newFolder; $ mv *.zip newFolder; $ cd newFolder; $unzip *.zip` but sometimes I get lazy and just do in an arbitrary folder `$ unzip *.zip` so time-to-time messing up with other content. Before you say that my brains are missing, I will list here some methods -- some archive version surely have crappy-flags while others more spartan, I am more interested about the latter but feel free to share any way. **Some ways to de-unarchive, are there others?**   1. `$ find . -anewer fileThatExistedBeforeUnarchieving -ok rm '{}' \;` Weaknesses are that it lists the `*.zip` dirs, so you need to use slow `-ok`, slow with many `*.zip` matches and, for some reason, it does not seem to match everything extracted.    2. If small amount of extracted files, one-by-one, slow, cumbersome and error-prone.   3. When I want to make sure whether the content of the archieve is actually a folder, I sometimes check it with `$ unzip -l *.bsd`, works at least in obsd`s unzip-version. If you are referring to certain archiving tools, please, state them when appropriate. Keep it simple though -- I am more interested about the WAYS how you do it, rather than a single tool.


Remove accidentally extracted files

> **Possible Duplicate:**   >  How to de-unzip, de-tar -xvf -- de-unarchive in a messy folder? This is a pretty annoying occurrence. Sometimes, I download an archive (`tar.gz, tar.bz2, zip, rar, etc`) and run `tar xf [file]` (or similar) in the file's directory. In rare occasions, all the files extract in the current working directory instead of a sub-directory. This can lead to hundreds of files and hundreds of patterns that can't simply be removed using a pattern matching solution. Is there a way to get the file contents of an archive and then delete all files on that list in the current working directory?


How to undo an unrar?

> **Possible Duplicate:**   >  How to de-unzip, de-tar -xvf -- de-unarchive in a messy folder? I just extracted a RAR archive that contained a lot of files in the base directory. Assuming that there were no filename collisions, what's the easiest way to remove the files just created? Parsing `unrar -l` seems troublesome due to filename variety.


Questions on Linux kernel internals

I was reading "Linux device drivers, 3rd edition" and faced a few kernel items I don't quite understand. Hope gurus on this forum will help me out.   1. Does the Linux kernel internally operate with virtual or physical addresses? What especially confuses me is that there are several types of addresses (logical, virtual, bus and physical) and they are all valid and operable by the kernel.   2. Is that correct that CPU instructions can't directly address data stored in peripheral devices and therefore addressable memory is used, i.e. buffers, for these purposes?   3. Can a process sleep when requesting a semaphore (which has a value 0) and has to wait for it?   4. Atomic operations -- are these guaranteed by specific CPU instructions?


Piping commands, modify stdin write to stdout

echo Hello World | nano - | less      I want to modify Hello -> Goodbye while in the the text editor. It does not have to be with nano. I am stuck with nano reading stdin but requiring me to write to a file (writing to - creates a file named -)


Can't find ubuntu-desktop package on ubuntu desktop iso

Trying to add a desktop environment to Ubuntu Server 13.10. The machine is offline and needs to stay that way for a while. I burned the Ubuntu Destop ISO (ubuntu-13.10-desktop-amd64.iso, nabbed here) to a DVD and tried to use apt to install ubuntu-desktop like so:               # add cdrom to apt repos     apt-cdrom add      # "apt-cdrom ident" and a look in sources.list confirmed that this worked          # refresh sources     apt-get update          # install ubuntu-desktop from DVD     apt-get install ubuntu-desktop      # fails, package not found      However, ubuntu-desktop doesn't appear to be present. (ubuntu-minimal and ubuntu-standard both are, FYI.) Have I downloaded the wrong image? Is there a better source? Thanks so much for your help!


I'm trying to install steam on debian jessie/sid but I'm getting unresolved dependencies

I'm following the debian wiki on installing steam but I keep getting dependency issues. Debian tells me to edit my sources.list to:               deb http://http.debian.net/debian/ jessie main contrib non-free      My sources.list looks like this: Debian GNU/Linux jessie/sid \n \l               #     deb http://ftp.uk.debian.org/debian/ jessie main contrib non-free     deb-src http://ftp.uk.debian.org/debian/ jessie main contrib non-free          #deb http://ftp.uk.debian.org/debian wheezy main          #deb http://security.debian.org/ wheezy/updates main non-free     #deb-src http://security.debian.org/ wheezy/updates main contrib non-free          # wheezy-updates, previously known as 'volatile'     #deb http://ftp.uk.debian.org/debian/ wheezy-updates main contrib non-free     #deb-src http://ftp.uk.debian.org/debian/ wheezy-updates main contrib non-free      My unresolved dependencies look like:                Keep the following packages at their current version:               1)      gcc-4.8-base:i386 [Not Installed]                                 2)      libc6:i386 [Not Installed]                                        3)      libc6-i686:i386 [Not Installed]                                   4)      libdrm-intel1:i386 [Not Installed]                                5)      libdrm-nouveau2:i386 [Not Installed]                              6)      libdrm-radeon1:i386 [Not Installed]                               7)      libdrm2:i386 [Not Installed]                                      8)      libelf1:i386 [Not Installed]                                      9)      libexpat1:i386 [Not Installed]                                    10)     libffi6:i386 [Not Installed]                                      11)     libgcc1:i386 [Not Installed]                                      12)     libgl1-mesa-dri:i386 [Not Installed]                              13)     libgl1-mesa-glx:i386 [Not Installed]                              14)     libglapi-mesa:i386 [Not Installed]                                15)     libllvm3.3:i386 [Not Installed]                                   16)     libpciaccess0:i386 [Not Installed]                                17)     libstdc++6:i386 [Not Installed]                                   18)     libtxc-dxtn-s2tc0:i386 [Not Installed]                            19)     libx11-6:i386 [Not Installed]                                     20)     libx11-xcb1:i386 [Not Installed]                                  21)     libxau6:i386 [Not Installed]                                      22)     libxcb-dri2-0:i386 [Not Installed]                                23)     libxcb-glx0:i386 [Not Installed]                                  24)     libxcb1:i386 [Not Installed]                                      25)     libxdamage1:i386 [Not Installed]                                  26)     libxdmcp6:i386 [Not Installed]                                    27)     libxext6:i386 [Not Installed]                                     28)     libxfixes3:i386 [Not Installed]                                   29)     libxxf86vm1:i386 [Not Installed]                                  30)     steam:i386 [Not Installed]                                        31)     zlib1g:i386 [Not Installed]                                                  Leave the following dependencies unresolved:                        32)     libgl1-mesa-glx:i386 recommends libgl1-mesa-dri:i386 (>= 7.2)      I think this could be something to do with `# dpkg --add-architecture i386` but nothing seems to happen when I run the command. Help appreciated. **Edit:**               root@Wheezy:/# apt-get install steam     Reading package lists... Done     Building dependency tree            Reading state information... Done     Some packages could not be installed. This may mean that you have     requested an impossible situation or if you are using the unstable     distribution that some required packages have not yet been created     or been moved out of Incoming.     The following information may help to resolve the situation:          The following packages have unmet dependencies:      steam:i386 : Depends: libc6:i386 (>= 2.12) but it is not going to be installed                   Depends: libstdc++6:i386 (>= 4.3) but it is not going to be installed                   Depends: libx11-6:i386 but it is not going to be installed                   Depends: libgl1-mesa-dri:i386 but it is not going to be installed                   Depends: libgl1-mesa-glx:i386 but it is not going to be installed                   Depends: libtxc-dxtn-s2tc0:i386 but it is not going to be installed     E: Unable to correct problems, you have held broken packages.      **Edit:**               root@Wheezy:/# dpkg --print-architecture     amd64     root@Wheezy:/# dpkg --print-foreign-architectures     i386      **Edit:**                    root@Wheezy:/# apt-cache policy libc6:i386 libstdc++6:i386  libx11-6:i386 libgl1-mesa-dri:i386 libgl1-mesa-glx:i386  libtxc-dxtn-s2tc0:i386 steam:i386     libc6:i386:       Installed: (none)       Candidate: 2.18-4       Version table:          2.18-4 0             500 http://ftp.uk.debian.org/debian/ jessie/main i386 Packages     libstdc++6:i386:       Installed: (none)       Candidate: 4.8.2-16       Version table:          4.8.2-16 0             500 http://ftp.uk.debian.org/debian/ jessie/main i386 Packages     libx11-6:i386:       Installed: (none)       Candidate: 2:1.6.2-1       Version table:          2:1.6.2-1 0             500 http://ftp.uk.debian.org/debian/ jessie/main i386 Packages     libgl1-mesa-dri:i386:       Installed: (none)       Candidate: 9.2.2-1       Version table:          9.2.2-1 0             500 http://ftp.uk.debian.org/debian/ jessie/main i386 Packages     libgl1-mesa-glx:i386:       Installed: (none)       Candidate: 9.2.2-1       Version table:          9.2.2-1 0             500 http://ftp.uk.debian.org/debian/ jessie/main i386 Packages     libtxc-dxtn-s2tc0:i386:       Installed: (none)       Candidate: 0~git20131104-1.1       Version table:          0~git20131104-1.1 0             500 http://ftp.uk.debian.org/debian/ jessie/main i386 Packages     steam:i386:       Installed: (none)       Candidate: 1.0.0.45-1       Version table:          1.0.0.45-1 0             500 http://ftp.uk.debian.org/debian/ jessie/non-free i386 Packages     root@Wheezy:/#       **Edit:**               root@Wheezy:/# apt-cache policy     Package files:      100 /var/lib/dpkg/status          release a=now      500 http://ftp.uk.debian.org/debian/ jessie/non-free Translation-en      500 http://ftp.uk.debian.org/debian/ jessie/main Translation-en      500 http://ftp.uk.debian.org/debian/ jessie/contrib Translation-en      500 http://ftp.uk.debian.org/debian/ jessie/non-free i386 Packages          release o=Debian,a=testing,n=jessie,l=Debian,c=non-free          origin ftp.uk.debian.org      500 http://ftp.uk.debian.org/debian/ jessie/contrib i386 Packages          release o=Debian,a=testing,n=jessie,l=Debian,c=contrib          origin ftp.uk.debian.org      500 http://ftp.uk.debian.org/debian/ jessie/main i386 Packages          release o=Debian,a=testing,n=jessie,l=Debian,c=main          origin ftp.uk.debian.org      500 http://ftp.uk.debian.org/debian/ jessie/non-free amd64 Packages          release o=Debian,a=testing,n=jessie,l=Debian,c=non-free          origin ftp.uk.debian.org      500 http://ftp.uk.debian.org/debian/ jessie/contrib amd64 Packages          release o=Debian,a=testing,n=jessie,l=Debian,c=contrib          origin ftp.uk.debian.org      500 http://ftp.uk.debian.org/debian/ jessie/main amd64 Packages          release o=Debian,a=testing,n=jessie,l=Debian,c=main          origin ftp.uk.debian.org     Pinned packages:


Compose key works on console/TTY, but not in X session

My compose key does not work in my X session anymore if I change a certain line in my `/etc/default/keyboard` that (if I am not mistaken) should only affect the keymap of the TTY. I'll try to elaborate on this since the situation probably is kind of convoluted. I normally use German keyboard layout with no dead keys. A while ago, however, I was trying out Neo (an alternate keyboard layout), and since I also wanted to be able to use Neo on the TTY, I edited `/etc/default/keyboard` to look like this (`/etc/console-setup/` contains the file `neo.map.gz`, among others):               # If you change any of the following variables and HAL and X are     # configured to use this file, then the changes will become visible to     # X only if HAL is restarted.  In Debian you need to run     # /etc/init.d/hal restart          # The following variables describe your keyboard and can have the same     # values as the XkbModel, XkbLayout, XkbVariant and XkbOptions options     # in /etc/X11/xorg.conf.          XKBMODEL="pc105"     XKBLAYOUT="de"     XKBVARIANT="nodeadkeys"     XKBOPTIONS="compose:rwin" # right Win is the Compose key          # If you don't want to use the XKB layout on the console, you can     # specify an alternative keymap.  Make sure it will be accessible     # before /usr is mounted.     # KMAP=/etc/console-setup/defkeymap.kmap.gz          # Set up Neo 2 for TTY     KMAP=/etc/console-setup/neo.map.gz # <-- this is the line I'm talking about     BACKSPACE="guess"      After some time, I decided I did not want to use Neo anymore, so I went back to German layout with nodeadkeys for my X session. Because I was lazy, I did not change the layout on the TTY right away, therefore the TTY still uses Neo. Yesterday I finally wanted to change the TTY keyboard layout back to de- nodeadkeys. Therefore I commented the line `KMAP=/etc/console- setup/neo.map.gz`, and when I booted my computer today, I found that all is well and the console uses German layout again. Except that, suddenly, my compose key does not work in my X session anymore, which previously worked just fine. It does however work on the TTY with de-nodeadkeys. I uncommented `KMAP=/etc/console-setup/neo.map.gz` again, rebooted and now I once again have a working compose key in my X session, but also Neo on the TTY. **I would rather have de-nodeadkeys layout on the TTY while still having a working compose key on X. How can I achieve this?** Instead of editing `/etc/default/keyboard` manually, I also tried               # dpkg-reconfigure keyboard-configuration      (as suggested here on unix.SE), just to make sure I did not insert any errors by editing the file myself. For testing purposes, I selected the left Win key instead of the right one, but this did not help either. I don't know if this is important, but I use `xim` for input on X, my `.bashrc` contains the line `export GTK_IM_MODULE=xim` and my `.Xcompose` file comes from Kragen's xcompose.


Escaping multiple backticks in a sed call

I need to perform search and replacement iteratively in several SQL statements: From:               CREATE TABLE `Old_Name` (      To:               ALTER TABLE `Old_Name` RENAME TO `New_Name`      The above query contains backticks ```. I tried doing the following               sed -i -r "s/CREATE TABLE \`$search\` \(/ALTER TABLE \`$search\` RENAME TO \`$replacement\`/g" /query.txt;      It creates an enter on the command line instead. But if I add a space behind `$replacement`, it runs normally. But I do not want the space after `New_Name`. Note, I do not know whether this is actually caused by the backticks or it could be a variable name interpolation problem. Regardless the case, how can I solve this issue?


Run an executable with a Shell Script

I have `mplayer` installed and I want to create a simple shell script that runs in `bash` and executes `mplayer *` in the current directory. So, how to call upon `mplayer` in the shell script? I am a newbie to linux and would like detailed instructions.


Can not create new partition

I have Centos that have 508G free space i want to create new partition from it. it locates in extended partition ![enter image description here](http://i.stack.imgur.com/zoZmN.png) I create new partition and format it as anything (ext4, fat32), after apply it can't finish the process and gives me this error:               An error occured while applying the operations     See the details for more information.          IMPORTANT     If you want support, you need to provide the saved details!     See http://gparted.sourceforge.net/larry/tips/save_details.htm for more information.      and when i save the `save_details.htm` it contains this information:               GParted 0.6.0          Libparted 2.1          Create Logical Partition #1 (fat32, 508.23 GiB) on /dev/sda  00:00:01    ( ERROR )          calibrate New Partition #1  00:00:00    ( SUCCESS )          path: /dev/sda-1     start: 184424448     end: 1250263039     size: 1065838592 (508.23 GiB)     create empty partition  00:00:01    ( ERROR )     libparted messages    ( INFO )          WARNING: the kernel failed to re-read the partition table on /dev/sda (Device or resource busy). As a result, it may not reflect all of your changes until after reboot.     WARNING: the kernel failed to re-read the partition table on /dev/sda (Device or resource busy). As a result, it may not reflect all of your changes until after reboot.     ========================================      I used fdisk and create `/dev/sda6` and I see partitions like this:               $ sudo fdisk -l           Disk /dev/sda: 640.1 GB, 640135028736 bytes     255 heads, 63 sectors/track, 77825 cylinders     Units = cylinders of 16065 * 512 = 8225280 bytes     Sector size (logical/physical): 512 bytes / 4096 bytes     I/O size (minimum/optimal): 4096 bytes / 4096 bytes     Disk identifier: 0xa62a8bc3             Device Boot      Start         End      Blocks   Id  System     /dev/sda1   *           1         262     2097152   83  Linux     Partition 1 does not end on cylinder boundary.     /dev/sda2             262        5361    40960000   83  Linux     /dev/sda3            5361       10460    40960000   83  Linux     /dev/sda4           10460       77826   541113344    5  Extended     /dev/sda5           10461       11480     8192000   82  Linux swap / Solaris     /dev/sda6           11480       77825   532917056+  83  Linux     Partition 6 does not start on physical sector boundary.      but when I use `mkfs` to format it I see this error:               $ sudo mkfs -t ext4 /dev/sda6     mke2fs 1.41.12 (17-May-2010)     Could not stat /dev/sda6 --- No such file or directory          The device apparently does not exist; did you specify it correctly?      what is the problem?