title: Does * match hidden files in tar even with dotglob unset?

text: I was under the impression that the `*` glob does not match dot-prefixed files unless you manually enable such functionality (through dotglob, or your shell's equivalent). Yet if I have a directory `a` containing files `file1` and `.hidden1`, then if I do               tar -cvpjf backup.tar.bz2 --exclude 'a/*' a      the resulting tar file contains only the empty directory `a` and no trace of either the hidden or non-hidden file. My expectation would have been only the non-hidden `file1` would have been excluded. What is going on here?


title: Bash's declare -p HISTIGNORE brings bash to a halt! Why?

text: Executing the following code in GNU bash, Version 4.2.45(1)-release (x86_64-redhat-linux-gnu), Fedora 19 ...               shopt -s extglob     export HISTIGNORE="!(+(!([[\:space\:]]))+([[\:space\:]])+(!([[\:space\:]])))"     declare -p HISTIGNORE      ... brings bash to a full stop. It does not print a command prompt hereafter. Why is that. Background: All I want to tell bash is to ignore any simple, i.e. one word command. Bash should not remember command lines like `cd`, `pwd`, `history`, etc. My original definition of the `HISTIGNORE` variable looked like this:               export HISTIGNORE="!(+(!([[:space:]]))+([[:space:]])+(!([[:space:]])))"      I added a `\` backslash character before each `:` colon character because according to the `bash` info pages the latter separates each (extended) shell glob, i.e. pattern from another. Without escaping the single pattern does not have any effect and a simple command still makes it into history.


title: How do I mount my encrypted private home directory if I forgot the password?

text: On Ubuntu 12.04, how can I access encrypted private home directory? I forgot my root password at some point and my root home folder is locked. I am now using another account in root group so can I get access to encrypted home directory from this account?


title: rename character "â" of directory name?

text: I'm trying to rename rename character `â` of directory name to be blank. For example, directory with name `how-â8093-to`. This is the command I use, including some other modification               find . -type d | xargs rename 's/â//'      but still not works.


title: Using source downloaded on windows on Linux platform

text: I downloaded the Linux source code from the git repository on Windows and then copied the files to Fedora. I am unable to the build the kernel. Is this, because I downloaded the source on Windows environment and then copied it to Linux? The command               make defconfig       gives error message               lib/Kconfig.debug:1543: unknown option *the*     lib/Kconfig.debug:1546: syntax error     lib/Kconfig.debug:1545: unknown option *This*     lib/Kconfig.debug:1546: unknown option *in*     lib/Kconfig.debug:1549: syntax error     lib/Kconfig.debug:1548: unknown option *See*     lib/Kconfig.debug:1560: syntax error     lib/Kconfig.debug:1559: unknown option *If*     lib/Kconfig.debug:1569: syntax error     lib/Kconfig.debug:1568: unknown option *Say*     samples/Kconfig:23: syntax error     samples/Kconfig:22: unknown option *If*     samples/Kconfig:50: syntax error     samples/Kconfig:49: unknown option *If*     make[1]: *** [defconfig] Error 1     make: *** [defconfig] Error 2     [adminuser@localhost linux]$ _      The complete error message was too long basically says about syntax error in Kconfig.debug file ( unknown option ). I may have to download the entire source code again if it is so.


title: Offsetting maximized window? (KDE + Compiz + Emerald)

text: Is there a way anyone knows of to offset a maximized window's position in KDE+Compiz+Emerald setup? I seem to have a 5px distance between the top of the screen and where the window actually starts. It's the little things that unrelentlessly nag.


title: Extracting a regex matched with 'sed' without printing the surrounding characters

text: To all the 'sed' doctors out there: I have a seemingly trivial 'sed' question to which I have not been able to find a solution. How can you get 'sed' to exctract a regular expression it has matched in a line? In other words words, I want just the string corresponding to the regular expression with all the non-matching characters from the containing line stripped away. I tried using the back-reference feature like below               regular expression to be isolated               gets `inserted`                    here                         |                    v        sed -n 's/.*\( \).*/\1/p       this works for some expressions like                sed -n 's/.*\(CONFIG_[a-zA-Z0-9_]*\).*/\1/p       which neatly extracts all macro names starting with 'CONFIG_ ....' ( found in some '*.h' file ) and prints them all out line by line                         CONFIG_AT91_GPIO               CONFIG_DRIVER_AT91EMAC                        .                        .                  CONFIG_USB_ATMEL               CONFIG_USB_OHCI_NEW                        .                      e.t.c.       BUT the above breaks down for something like                 sed -n 's/.*\([0-9][0-9]*\).*/\1/p       this always returns single digits like                                7                      9                      .                      .                        6      rather than extracting a contigious number field such as.                             8908078                   89670890                        .                      .                        .                    23019                         .                    e.t.c.        P.S.: I would be grateful to feedback on how this is achieved in 'sed'. I know how to do this with 'grep' and 'awk' I would like to find out if my - albeit limited - understanding of 'sed' has holes in it and if there is way to do this in 'sed' which I   have simply overlooked.


title: Only return the matched string in sed

text: > **Possible Duplicate:**   >  Extracting a regex matched with 'sed' without printing the surrounding > characters How do I make this only print `test`:               echo "atestb" | sed -n 's/\(test\)/\1/p'


title: boot messages for wireless nic in Fedora 14

text: After a recent install of Fedora 14, I had to build the firmware for my Broadcom 4311 wireless nic. I got the wireless working, but only after adding `modprobe b43` to the `rc.local` file. On every boot, however, I am now get a message stating:               Bringing up interface Auto_Tigris_Connecticus:  Device  does not seem to be present, delaying initialization.     [FAILED]      My understanding is that the `rc.local` file is loaded after the other _"normal"_ boot steps, so I am thinking that the `modprobe b43` statement should be added elsewhere. Can someone point me in the right direction as to where to add module `b43` in the boot process to make sure that I dont receive these (admittedly harmless) boot messages?


title: GDM not showing when I boot my FreeBSD system

text: 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?**


title: How-to diff distributions?

text: 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.


title: Wireless Connectivity and Fedora 15 Boot Up

text: 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?


title: "make test" failed while compiling Python

text: 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


title: Omit the target dir from find results

text: 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


title: How to set up server networking on Debian?

text: 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?


title: Rename All Files with a Certain Name

text: 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.*'


title: bash replace part of string based on location

text: 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).


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

text: 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.


title: How to rename file using substring of the same file name

text: 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     #


title: Mass mv on files and changing filenames

text: 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.


title: Rename multiple files in UNix directory

text: 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


title: rename multiple files with rename command?

text: > **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?


title: How to rename multiple files

text: 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?


title: How do I rename multiple files

text: > **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.


title: Command to prevent suspend while another command executes?

text: 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?


title: LXDE: keybinding for single key not working

text: 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`.


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

text: 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'


title: How to copy qemu raw images?

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


title: Backports on Debian not working

text: 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


title: How to track file change

text: `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 ?


title: How to copy data from Linux Server to Windows Server

text: 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.


title: Running `screen` through a @reboot cron job

text: 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?


title: vimrc - how to block comment?

text: 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.


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

text: 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.


title: LXPanel time is wrong?

text: 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.


title: Create a Custom User in FreeBSD

text: 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.


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

text: 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?


title: How to see how many context switches a process makes?

text: 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.


title: Why does variable expansion without $ work in expressions?

text: #!/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.


title: How to fork a "cat" command?

text: 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.


title: Is `-` used only with cd?

text: `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?


title: Emacs commands in xterm

text: 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)?


title: Relation between the filename and inode of a file

text: 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?


title: Can't install vim in fedora 20

text: 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?


title: Elementary OS won't play videos!

text: 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!!


title: Mint 12: synaptic package manager error

text: 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 ...


title: Are kernel threads really kernel processes?

text: 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?


title: Linux friendly TV tuner/receiver

text: 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?


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

text: 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).


title: Disable automatic screen lock in XFCE in Centos

text: 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.


title: Storing commands in files

text: 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


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

text: 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?


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

text: 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.


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

text: 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.


title: What distribution for light weight server?

text: 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?


title: Samba 3.5.9 - join domain specific OU - net join ads

text: 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


title: Add arguments to bash -c

text: 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.


title: Unable to synchronize the clocks on a dual boot system

text: 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.


title: Running Apache as Group only?

text: 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>


title: agrep with directionally biased penalties

text: 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?


title: Keep SSH Sessions running after disconnection

text: 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...


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

text: 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?


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

text: > **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!


title: Keeping a process running after putty or terminal has been closed

text: 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.


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

text: 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?


title: Keeping a process running on server even SSH is closed

text: 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?


title: Red Hat internal specifications

text: 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?


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

text: 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.


title: Causing fluxbox to show a different time then the default timezone

text: 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?


title: Dual Boot GRUB2

text: 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.


title: find with execdir

text: 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?


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

text: 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


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

text: 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`!


title: Yum regular expression or wildchard search?

text: 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?


title: What is the difference between $* and $@?

text: 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?


title: Should I use $* or $@?

text: 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?


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

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


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

text: 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 $@


title: what does $* mean in shell

text: 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.


title: Where to download Fedora 16

text: 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.


title: Playing an ogg format video using gstreamer in an embedded system

text: 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?


title: Given a mime-type get the corresponding file extension

text: 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.


title: Can't find nmap executable in Metasploit

text: 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.


title: Hide "Mail" in emacs mode line

text: 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?


title: Search for mail content with mutt

text: 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.


title: PCLinuxOS install without usb keyboard at bootloader

text: 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`)?


title: Tshark not running via gdb

text: 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.


title: No bluez device after pactl list sources short

text: 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.


title: Issue installing OpenVPN via apt

text: 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?


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

text: 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.


title: Extract lines based on words on position, not column

text: 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


title: htop: show processes of all users except root

text: 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.


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

text: 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`


title: Stop atieventsd flooding my journalctl

text: 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)


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

text: 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.


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

text: 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.


title: /sys/class filesystem on Linux

text: 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?


title: VNC Server without X Window System

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


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

text: 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


title: Print arguments to printf in no particular order

text: 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`.


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

text: 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?


title: Faulty support for the installation of Debian Jessie/testing

text: 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.


title: How to set default auto mount options for removable media?

text: 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`?


title: Using alias in another script (ksh)

text: 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; }


title: Ksh script warnings

text: 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 ?


title: Running thousands of curl background processes in parallel in bash script

text: 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?


title: named starts but doesn't answer until reboot

text: 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`.


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

text: 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?


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

text: 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?


title: How to run scripts on headless startup?

text: 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


title: understanding LAMP: linux apache mysql and php

text: 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?


title: Something's special about /dev/fd/3

text: 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.


title: Drawbacks of increasing number of inodes in EXT4

text: 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?


title: start_daemon fails with exit code 7

text: 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?


title: Archlinux ARM Apache server fails to start

text: 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.


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

text: 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"?


title: Removing path in env variable PATH permanently

text: 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.


title: Chromium OS Compiling Path

text: ![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


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

text: > **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?


title: changing an environment variable like PATH forever

text: > **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)


title: Update Linux Path permanently

text: > **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.


title: How to set environment variables permanently for one user

text: > **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.


title: How to get environment variables to persist across login?

text: > **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?


title: Network Printing in Fedora

text: 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.


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

text: 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?


title: Is openwrt difficult to use for a novice?

text: **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?


title: copy files from Google drive

text: 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?


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

text: 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?


title: Making voice calls using Huawei E1550

text: 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?


title: Configure touchscreen on Debian?

text: 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.


title: probably gfs2 problem

text: 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?


title: Prevent non-root user from formatting a partition

text: 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.


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

text: 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.


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

text: 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.


title: Remove accidentally extracted files

text: > **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?


title: How to undo an unrar?

text: > **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.


title: Questions on Linux kernel internals

text: 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?


title: Piping commands, modify stdin write to stdout

text: 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 -)


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

text: 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!