Partially remove formatting from text in clipboard

I need to delete the formatting in the text contained in the clipboard, but keeping some elements. The most important are the "new line" characters. In a simple script, the effect of               variable=$(xsel --clipboard)      is that the text appears to be all in the same line, so it has lost all the "new line" characters. 1) Is there a way to avoid this? Sometimes I copy text from Windows format (so the newline is "\r\n") and sometimes from *nix (and so the newline is just "\n"). 2) The previous question was the most important, but: there is also a way to preserve the "bold", "italic" and "underlined" formatting elements? Because they are all lost too with that shell command. Thank you anyway!


location of the "disk identifier"

According to Wikipedia, "disk signature" is a 32 bit value stored in MBR on bytes 440 - 443. According to `fdisk`, my "disk identifier" is _00043afc_ in hex:               # fdisk -lu /dev/sda | grep identi     Disk identifier: 0x00043afc     #       However, I can not confirm this with `dd`:               # dd if=/dev/sda skip=439 bs=1 count=4 2>/dev/null | xxd -ps     c3fc3a04     #       Even if I check the entire MBR, I do not see the "disk identifier":               # dd if=/dev/sda bs=512 count=1 2>/dev/null | xxd -ps | grep 43a     #       Where is the "disk identifier" stored?


rsyslogd crashes while running from board.(rsyslogd -M /lib/rsyslog option is running well)

when i tried rsyslogd without any option from my board it will give following error.               rsyslog runtime error(-2066): could not load module '/home/vipul_test/lib/rsyslog/lmnet.so', dlopen: /home/vipul_test/lib/rsyslog/lmnet.so: cannot open shared object file: No such file or directory      [try http://www.rsyslog.com/e/2066 ]     Error during class init for object 'conf' - failing...     rsyslogd initializiation failed - global classes could not be initialized.     Did you do a "make install"?      Suggested action: `run rsyslogd with -d -n` options to see what exactly fails.               rsyslogd: run failed with error -2066 (see rsyslog.h or try http://www.rsyslog.com/e/2066 to learn what that number means)      while `rsyslogd -d -n` option is not running and giving segmantation fault as below.               Segmentation fault (core dumped)     ash Get The <Segmentation fault>, Retry!     Segmentation fault (core dumped)     ash Get The <Segmentation fault>, Retry Fail!      only `rsyslogd -M /lib/rsyslogd` option is running. so how to run rsyslogd without any interpretation?


Copying Linux NFS files to a standard consumer external hard drive

I am a graduate student and a relative Linux novice. My institution has an in- house Linux cluster on which I run many scientific simulations. I have a Windows desktop computer from which I access the Linux cluster via SSH. I have a large amount (~1 TB) of simulation results data on the Linux cluster's file server. When the project is finished, the research group probably will not have the space to save the simulation results. However, I would like to save the files (with the group's permission, of course) on an external drive that I myself will purchase. My question is, if I purchase a standard Windows external hard drive with a USB connection, will I be able to copy the files from the Linux cluster's files server to the external drive? (I am assuming that the Linux cluster has a USB port, but this is something that I will need to verify.) It looks like many standard Windows external hard drives are formatted in either NTFS or FAT32, whereas our Ubuntu Linux file server uses NFS. Here are some examples from Amazon:   * Seagate Backup Plus 4 TB USB 3.0 Desktop External Hard Drive STCA4000100 (NTFS)   * WD My Book 4TB External Hard Drive Storage USB 3.0 File Backup and Storage (NTFS)   * BUFFALO MiniStation Plus 1 TB USB 3.0 Portable Hard Drive - HD-PNT1.0U3BS Silver (FAT32) Do you think any or all of the above hard drives will be able to be **_easily_** reformatted in NFS for use with the Linux cluster? On the other hand, Amazon _does_ have a section for "Linux platform support" external hard drives, such as:   * LaCie 3 TB Minimus Hard Disk USB 3.0 (302004) (file system not specified, as far as I can tell; perhaps it is unformatted?) But, even if standard Windows external hard drives are easily reformatted, the problem is that I may subsequently want to copy the files from the external hard drive to a Windows computer, which is NTFS. This part of the question may require a separate question or a question on SuperUser, but is it possible to copy NFS files from an external hard drive to a Windows NTFS computer? Thanks for your time.


Retrieve system commands without reading sources

Sometimes I wonder how Linux programs achieve certain results knowing that they internally use system calls (`system()` or `exec()` in C programs). Given a working binary I wonder if it is possible to know easily which commands where executed. In a concrete example I use the genealogy tool `gramps` to build a family tree. I assume that it generates certain graphs using `graphviz` (using command line tools rather than libraries). Now I want to reproduce the same manually on the command line. This task would be simplified a lot if I knew the commands used by `gramps`. I could download and look at the sources to find out, but I wonder if I can obtain this information more easily using debugging tools such as `strace`, something like `strace gramps 2>/dev/stdout | grep system`. Note that I would not like to search the binary using a hex editor unless this can be automated. Looking at the sources directly should be easier in this case.


Facelifting XClock while using Xrender: A long and winding road

Basically, `xclock` is a great tool, and every basic X setup would have it "onboard". However, _configuring_ `xclock` (analog) _while_ keeping `XRender` active is definitely not for the faint of heart. In particular, beginners will not have any chance to configure the _analog_ clock without delving deeply into the `.Xresource` realm, since everything you set at the command line will be _for the non-rendered mode only_ (requires option `-norender`) and ignored by default (which means, that `XRender` is being used). Plus, the documentation about it is abysmal, and examples which actually _deal_ with `XRender` are rare as hen's teeth. Hence, I decided to start my own approach.   I wish there was an easier way to do all this, but there apparently isn't. For one, this question will probably help new users as a guide how to set things up for "their" `xclock`; on the other hand, I'd also like to ask you guys if there is any way to improve my "configuration file" (mind the quotes). Oddly enough, `.Xresources` is widely deemed "obsolete" and "last century", but what if the application you use _does_ rely on the old-fashioned way, using `xrdb`, `.Xresources` and the whole caboodle? I personally fancied a _" **night design** "_ because it fit perfectly to my desktop style. So this is what I did:               $ touch ~/.Xresources     $ vi ~/.Xresources          XClock*foreground: #fbfbfb     XClock*background: #000018     XClock*update: 1     XClock*geometry:          210x210+1020+12     XClock.Clock.majorColor:  rgba:f0/f0/19/7b     XClock.Clock.minorColor:  rgba:a0/c0/f0/c0     XClock.Clock.hourColor:   rgba:c9/66/11/72     XClock.Clock.minuteColor: rgba:00/82/9f/72     XClock.Clock.secondColor: rgba:50/93/30/6f      `rgba` stands for "red, green, blue, alpha" - where the fourth parameter, _alpha_ , will indicate the opacity level in hexadecimal notation: a `00` will make the clock hand or tick mark invisible; a `ff` will turn any opacity off.   So far, so good. Since we do not want to restart the `X` server for these things to come into effect, we will simply merge our settings into those that may (or, as usual, may not) be already there:               $ xrdb -merge ~/.Xresources && xclock &      Although I hate to brag, I honestly think it looks _way_ better than the boring design which is default on my desktop. But during my efforts in getting this to work the way I wanted to, there has also a question come up from my side: I actually "stole" the syntax `XClock.Clock.<parameter>` from `/etc/X11/app-defaults/XClock-color`.   Interestingly enough, ALL parameters that end in `...Color` require the same `XClock.` **Clock**`.<parameter>` syntax as in `app-defaults`; e. g. `XClock*hourColor: rgba:ff/ff/ff/80` will NOT get the hour hand white, nor set the opacity to `0x80`. Why is that so?   Up to now, I thought the `*` was simply a wildcard meaning `XClock<whatever><parameter>`.


What is a command to find priority of process in Linux?

How can i view the priority of a specific process ?


How to view and edit the code of a pdf file

I was wondering how to view and edit the code of a pdf file?   1. By viewing, I don't want to see the binary format, so I think hexdump may not be what I want. I tried gedit, but no encoding method can be used to decode the pdf content.   2. By editing, I would like to search for `/Fit` and change them to `/XYZ` by for example sed. But my command `sed s/\/Fit/\/XYZ/ < 1.pdf > 2.pdf` seem not change the appearance of my pdf as I expected, although it doesn't report any error. I was wondering if sed can actually work on pdf files as if they were plain text? The context of my questions can be found from this question. My OS is Ubuntu 10.10.


Did I delete the whole debian root server?

I installed a new debian 6 system a few days ago - today I wanted to create a CSR request for a SSL certificate and wanted to delete the CSR file afterwards. In the root of my server I was typing               rm * /etc/apache2/sslstuff      then I noticed that I cannot use `ls` or `top` anymore, did I delete everything? I thought I needed to do `rm -R` to delete folders as well. Now I can't even login using SSL because putty will always close after I type in the password of my login user. What can I do here? Do I have to re-install the system or is there a more time-saving way? (root login is not allowed, I login with a different user and then use `su`) * * * Okay, I used another user to login because I set permitrootlogin to NO for security reasons. When I open Putty to login via SSH then I put in the user name and after I enter the PW putty will close.. So what can I do to at least connect to that server? FTP still works, website is still up and running, so I guess I only deleted some symbolic links and stuff. What to do now?


How can I split a text file into multiple text files using Perl?

I have a file ABC_TabDelim.txt that contains the following:               00:00:00:00 00:00:05:00 01SC_001.jpg     00:00:14:29 00:00:19:29 01SC_002.jpg     00:01:07:20 00:01:12:20 01SC_003.jpg     00:00:00:00 00:00:03:25 02MI_001.jpg     00:00:03:25 00:00:08:25 02MI_002.jpg     00:00:35:27 00:00:40:27 02MI_003.jpg     00:00:00:00 00:00:05:00 03Bi_001.jpg     00:00:05:19 00:00:10:19 03Bi_002.jpg     00:01:11:17 00:01:16:17 03Bi_003.jpg     00:00:00:00 00:00:05:00 04CG_001.jpg     00:00:11:03 00:00:16:03 04CG_002.jpg     00:01:12:25 00:01:17:25 04CG_003.jpg      I would like to split this into multiple files for each instance of 00:00:00:00, outputting it as ABC01_TabDelim.txt, ABC02_TabDelim.txt, ABC03_TabDelim.txt, etc. So 00:00:00:00 would indicate a new file should begin. Is there any way I can accomplish this with a Perl script?


Kali Linux internet connection

I'm pretty new to site and networking overall. I got interested in this topic and I've installed KaliLinux on my VirtualBox. Then I faced a problem: I couldn't connect to the internet. I was going through many tutorials, that's what I did: `-Went to Settings->Network`, enabled network adapter, changed it to `"Bridged Adapter"` and made it `"AllowAll"`. Didn't help. `Airmon-ng` shows empty result set. Next thing is that `"ifconfig"/"iwconfig"` shows `Eth0` for me, while ppl showing tutorials had Wlan0 there. On my notebook I'm using wifi, no cables or anything. Furthermore, on `Devices->UsbDevices`, I have my mouse device detected + "Unknown Device" clicking on which causes an error. Does anyone have any tips for a beginner? Cheers! # edit I'd forget: I also change the boolean in NetworkManager.conf file to true.


Excluding files in etckeeper with .gitignore doesn't work

I use etckeeper for changes in my configfiles (on debian squeeze) Since I also have an ircdeamon running, there are some files, that change every minute in the folder               /etc/hybserv/      I don't want to version control them anymore, so i added               hybserv/*      to the end of               /etc/.gitignore      but they are not ignored! They keep showing up every hour in the hourly commit. what am I doing wrong?


Compile Linux Application for Windows

I want to use a Linux Application under Windows. It is my understanding that the application is Linux only and to use it in Windows I have to compile the application from the source using Cygwin or MinGW. My question is which to use: Cygwin or MinGW? Should i setup Cygwin or MinGW in Windows and then compile the Linux Application there? Should i setup Cygwin or MinGW in Linux and then compile the Linux Application there? Any guide/tutorial?


Disadvantages of linux kernel module?

I am trying to understand the disadvantages of using Linux kernel modules. I understand the benefits of using them: the ability to dynamically insert code into a running system without having to recompile and reboot the base system. Given this strong advantage, I was guessing most of kernel code should then be in kernel modules instead as part of base kernel, but that does not seem to be the case -- a good number of core subsystems (like memory management) still go into the base kernel. One reason I can think of is that kernel modules are loaded very late in the boot process and hence core functionality has to go in the base kernel. Another reason I read was about fragmentation. I didn't really understand why kernel modules cause memory fragmentation, can someone please explain? Are there any other downsides of using kernel modules?


lspci machine-readable format (-vmm) does not show a kernel Module/Driver line

I briefly read the manual of lspci, where I found out that there is a machine- readable format lspci output using "-m" or "-mm" or "-vmm". I need to print out the device name, the device id and the kernel module driver in use using the machine-readable format. I tried this command:               $ lspci -vmm -v -nn -d 10de:0393     Slot:   01:00.0     Class:  VGA compatible controller [0300]     Vendor: NVIDIA Corporation [10de]     Device: G73 [GeForce 7300 GT] [0393]     SVendor:    Micro-Star International Co., Ltd. [1462]     SDevice:    NX7300GT-TD256EH [0412]     Rev:    a1      Compared to this output:               $ lspci -nn -v -d 10de:0393     01:00.0 VGA compatible controller [0300]: NVIDIA Corporation G73 [GeForce 7300 GT] [10de:0393] (rev a1) (prog-if 00 [VGA controller])         Subsystem: Micro-Star International Co., Ltd. NX7300GT-TD256EH [1462:0412]         Flags: bus master, fast devsel, latency 0, IRQ 16         Memory at fd000000 (32-bit, non-prefetchable) [size=16M]         Memory at d0000000 (64-bit, prefetchable) [size=256M]         Memory at fc000000 (64-bit, non-prefetchable) [size=16M]         I/O ports at cc00 [size=128]         [virtual] Expansion ROM at fe9e0000 [disabled] [size=128K]         Capabilities: <access denied>         Kernel driver in use: nvidia         Kernel modules: nvidia_current, nouveau, nvidiafb      You can see that the normal (non-machine-readable) format shows the kernel driver/module in use. How do I get it to show the Driver/Module lines in machine-readable format? In the manual it says that "Module" and "Driver" lines are optional. Does that mean that I have to compile it from source with some special attributes? P.S. I know about awk and sed and other workarounds, I'm just curious why it doesn't work. I use ubuntu 12.10, pciutils version 3.1.9-5ubuntu4


Upgrade matplotlib to 1.2 or 1.3

I am trying to upgrade my python matplotlib but for some reason I can't get it to upgrade. I originally installed matplotlib with: `apt-get install python-matplotlib` which was fine. However it defaulted to version 1.1 I then downloaded the 1.2 source from the website and then extracted the tar.gz and ran :               sudo python setup.py build     sudo python setup.py install      After all this I went into python2.7 idle and typed:               import matplotlib     print matplotlib.__version__     >>>1.1.1      So it seems its not updating. How can I update matplotlib to 1.2 or greater?


What's the motivation behind kfreebsd

I use both FreeBSD and Debian-based Linuxes on a daily basis. (I am mostly a user/developer/sysadmin not an OS-developer). I want to know what is the motivation behind kFreeBSD? Why people may want to use FreeBSD kernel but avoid the user land?


Iterate over multiple parameters with spaces in bash script

I have a bash script for my RaspberryPi (running Raspbian) that is supposed to take multiple file names as parameter(s) and play one after the other (using `omxplayer`). The basic structure is this:               #!/bin/bash     for f in ${*}     do       echo "${f}";     done;      Now I have problems when the input filenames contain spaces; in particular, the behaviour seems to be inconsistent. Assume we have two files `test a b` and `test d e` in the same directory. Running above script with different parameters yields this:               $ ./test test\ a\ b     test     a     b     $ ./test "test a b"     test     a     b     $ ./test test\ a*     test     a     b     $ ./test "test a*"     test     a*      But, curiously:               ./test "test*"     test a b     test d e      Obviously, only this last variant provides the intended output. It is cumbersome to use, however, especially if you want to watch a single file (tab-completion will fill in the whole name) or if one of the folder names in the file's path contains spaces. What can I do differently in the shellscript so that it will always behave as intended? In particular, both of               $./test test*     $./test test\ a\ b test\ d\ e      should produce the same output               test a b     test d e          so the script can be used easily using normal tab-completion.


how to release wlan0 and wlan1 interfaces which are reserved by default

I have just installed debian 7.1 for an arm device,               Linux arm 3.12.0-armv7-x7 #1 SMP Fri Nov 8 11:48:19 CET 2013 armv7l GNU/Linux      iwconfig shows 4 wifi interfaces where I have only two.               root@arm:~# iwconfig     wlan3     IEEE 802.11bgn  ESSID:off/any                 Mode:Managed  Access Point: Not-Associated   Tx-Power=0 dBm                  Retry  long limit:7   RTS thr:off   Fragment thr:off               Encryption key:off               Power Management:off          wlan0     IEEE 802.11abgn  ESSID:off/any                 Mode:Managed  Access Point: Not-Associated   Tx-Power=0 dBm                  Retry  long limit:7   RTS thr:off   Fragment thr:off               Encryption key:off               Power Management:off          wlan2     IEEE 802.11bgn  ESSID:off/any                 Mode:Managed  Access Point: Not-Associated   Tx-Power=0 dBm                  Retry  long limit:7   RTS thr:off   Fragment thr:off               Encryption key:off               Power Management:off          lo        no wireless extensions.          eth0      no wireless extensions.          wlan1     IEEE 802.11abgn  ESSID:off/any                 Mode:Managed  Access Point: Not-Associated   Tx-Power=0 dBm                  Retry  long limit:7   RTS thr:off   Fragment thr:off               Encryption key:off               Power Management:off          hwsim0    no wireless extensions.      `/etc/udev/rules.d/70-persistent-net.rules` shows my devices are `wlan2` and `wlan3`, somehow wlan0 and wlan1 are reserved. `/etc/network/interfaces` does not have any config. what could be the problem?


SFTP and sudo using Windows client?

I want to download files from a linux system using a windows client. While there are many SFTP clients I am having the problem, that I need to access files where I need to be root. On the linux system I have the root account disabled, I am using sudo to get root privileges. How to execute "sudo" using an SFTP client? I don't want to change my linux system! Thanks for any hint!


Trying to use multiple Debian repositories

**General situation:** I need to port a Qt project from MS Visual Studio 2010 to Linux (Debian). In VS 2010 I have Qt **v.4.8.1** , but in Debian it is Qt **v.4.6.1**. This difference prevents me from porting, as some features are not present in 4.6.1. In Debian I am using the stable Squeeze repository. My experience with this OS, and Linux in general, is zero. **The Issue:** Because the highest available version of Qt in the Squeeze repo is 4.6.1, I decided to enable multiple repositories, and get the more recent package from Wheezy instead. To add Wheezy I performed the following actions:   1. Edited `/etc/apt/sources.list`, where I included:     * deb http:// ftp.debian.org/debian/ wheezy main deb-src http://      * ftp.debian.org/debian/ wheezy main   2. Edited `/etc/apt/apt.conf.d*`:     * APT::Default-Release "stable"      * APT::Cache-Limit "50000000" However, it hasn't worked. I can't select the needed package from Wheezy because when I open Synaptic I get this error: > Wow, you exceeded the number of descriptions this APT is capable of I don`t know how to solve with this problem. All I need is to upgrade Qt in Debian. Am I doing this the hard way? Is there a much simpler solution?


Execute bash scripts on entering a directory

What is the best way to execute a script when entering into a directory?   When I move into a new directory I would like bash to execute the projectSettings.bash script much like RVM does.


Write a zsh method the responds to a `cd` command

I'm trying to write a script that will be called when navigating into certain directories. What I'd want is to have a message appear when I enter certain (not every) directories based on what it finds in there. Is there any way to write a function in my .zshrc that will respond to cd commands into certain directories, or do I simply have to alias cd?


sources for doing profiling of kernel portions?

Related to my previous post. I did not find any specific driver for which I can do profiling and benchmarking. However there is a one driver jffs2 filesystem for flash devices but I didn't know about any specific profiling tool and is it possible to do profiling without having flash device(that means for virtual hardware). And please tell me if we can do profiling (by changing various parameters) test for other kernel portions like memory management and process scheduling and what are the sources to study about it and profiling tools to do it efficiently and accurately.


how will I make interactive login

I'm having trouble in making script with interactive login. I have made one but it doesn't ask the login, it automatically log in when i run the script. i just need the output like this:               please enter ftp server :     username :     password :


How to find path where jdk installed?

I'm a newbie to `Linux` so please forgive me for asking such stupid question! I'd installed `jdk1.7.0.rpm` package in `RHEL6`.   Where I do find the `path` and to `execute` my first `java` program?


Automating typing strings in xmacro

Could you show me how to write macro in `xmacro` (that will work in whole desktop environment) that is able to expand strings? E.g. I will type "thx" and it will expand to "thank you".


Why can't I run programs on another partition in Linux?

So for convenience, I store all my data on my Windows partition so that I can access my data easily from both Linux and Windows. However, I tried compiling a C++ program with g++, and found out that I cannot run the program with `./program_filename`, as it tells me               bash: program_filename: Permission denied      Doing               cp program_filename ~/program_filename      and running it from my home directory works just fine, however. So I tried `chmod +rwx program_filename`, but `ls -l` shows that the permissions are still set as `-rw-------.` for all files in the directory. Nothing changes when I do this as root, either. Is there a simple fix for this? (In case it's useful, I am running Fedora 16 x64)


Problems with permissions for /tmp

I executed command:               chmod 1777 /tmp      Now I get these results of executing the `ls` command from root:               ls -ld /tmp     drwxrwxrwt 4 root root 4096 Aug 9 05:42 /tmp      and from not-root user:               ls -ld /tmp     d-w--w--wT 4 root root 4096 Aug 9 05:42 /tmp      Why cannot I get full access to /tmp from not-root user? OS: Red Hat Linux 6.2 Not-root user `admin73` is created with `useradd` command. Then a password was set to it using `passwd`. Output of `ls -id` command (the same for both users):               ls -id /tmp     212577 /tmp      Output of `df /tmp` command (the same for both users):               File system  1K-blocks  Used      Available Used%  mounted     /dev/hda3    13369468   12131244  559080    96%    /      Output of `grep -E '/*tmp*' /proc/self/mounts` command:               none /dev/shm tmpfs rw 0 0


Usb-ethernet device

I have CP210x Composite Device. This device is USB-to-RS232 converter. When I plug it into Ubuntu-11.10, module named `cp210x` get inserted but I don't know why it did not create "usb0" network device ( which is the desired result ). Does anyone knows, what is the process to make it work ? > lsusb > > Bus 004 Device 005: ID 10c4:ea60 Cygnal Integrated Products, Inc. CP210x > Composite Device


Rygel slowing down my Debian system

Recently I noticed that a process called `rygel` is taking a lot of IO resources every time I am starting something on my home system. What is this process doing and how can I disable it?


issue with how newly made gnome launchers work vs launchers rebuilt after a system boot. (title change for clarity)

This isnt so much a request for help as a curiosity of mine. I wrote this script to quickly pop up four terminal sessions and fill my screen, since so many of my current systems have things that come in fours, and I'm a bit OC about terminal positioning if I'll be using them all heavily.               #!/bin/bash     #launch 4 terminals setup to fill my screen     gnome-terminal --geometry 116x27+0+600 &         gnome-terminal --geometry 116x27+0+0 &     gnome-terminal --geometry 116x27+1000+0 &     gnome-terminal --geometry 116x27+1000+600 &     exit      Now, this script works just fine for me. Nothing to write home about etc. The wierd thing is that pre-rebooting my system (solaris 11 x86) I was not putting the commands to the background (no & at the end). It worked perfectly pre reboot. In fact, it worked slightly faster before the reboot, when it was not sending the commands to bg. post reboot, without back grounding the commands, I get one terminal, and when I exit from that one, I get the next one and so one. That seems reasonable to me, but I am now very curious if anyone knows what might have been different about how the script was launched that made it work without having to & all the commands. Its as if before it was being launched as a normal shell script, and now the same launcher, executing the same script, is launching it as though I were typing in each command at a prompt. I've looked around the docs, and tried options to see if anything affects this, unfortunately, my main use for desktops is usually just to have multiple terminal sessions up, so I'm kind of clueless about gui desktops. One last bit of weirdness. I copied the original script (with no &) to another script name. Then made a brand new launcher, and it worked again. So then I rebooted again. But post reboot.. it no longer worked (opening them one at a time and only after the previous one has exited). Summary, before rebooting, this script didn't need the & to work, and now it does. Fresh made, this script works, but after a reboot it stops working. Why might this be? No changes were made to the system. If someone has intimate knowledge of how launchers get their information at boot time vs how they work when assembled on the fly, that would be very nice to know.


Can I install Mint but defer setting language, timezone, username/password, etc.?

Going the follow-your-nose route, I can take a Mint install medium, set up the language, timezone, username, password, etc. during the install process, and at the end when I'm done setting all these factors, and not before, I can remove the installation medium. Is there a straightforward way I can alter this workflow so that I completely install the system and then later have the end user specify all these details without needing the install medium?


Synaptics Touchpad Tap Lag (FastTaps Option Gone)

I own an Asus Zenbook Prime UX31A with a clickpad. Under the Synaptics driver, I'm trying to use tap-to-click. With the default settings, there is a very noticeable lag between when I tap and the tap is registered. Usually, I just set FastTaps to true in:               /etc/X11/xorg.conf.d/50-synaptics.conf      However, in the latest version of xf86-input-synaptics, FastTaps is no longer an option. I can set "SingleTapTimeout" to 0, which does make tapping instant, but then double tapping is impossible. Is there some way to make tapping instant while allowing for double tapping (and other related functions like tap-and-drag) in the latest Synaptics driver?


Best way to call command within a shell function having the same name

I like to encapsulate commands within shell-functions using the same name. But to avoid the shell-function calling itself recursively, I specify the complete path of the command as the following example:               less()     {         test 0 -lt $# && echo -ne "\e]2;$@\a\e]1;$@\a"     # Window title         /usr/bin/less -i -rS --LONG-PROMPT --shift 5 "$@"     }      But for some commands, I do not want to specify the path because it may change. I would prefer to use `$PATH`. For instance, my following attempt failed to call `mvn` command using backslash: `\mvn`               mvn()  # colorizes maven output     {             \mvn "$@" 2>&1 | #here: the shell-function recursively calls itself indefinitely             sed -u '                                                      s/^\[ALL\].*/\o033[1;37m&\o033[0m/       s/^\[FATAL\].*/\o033[1;31m&\o033[0m/       s/^\[ERROR\].*/\o033[1;31m&\o033[0m/     s/^\[WARNING\].*/\o033[1;33m&\o033[0m/        s/^\[INFO\].*/\o033[1;37m&\o033[0m/       s/^\[DEBUG\].*/\o033[1;36m&\o033[0m/       s/^\[TRACE\].*/\o033[1;32m&\o033[0m/'     }      **What is the best way to bypass this issue?**   Please do not suggest to use a different shell-function name. (I usually use `bash` but I am interested about other shell solutions.)


File- and directory-based workflow

I work at a company where third party contributors transfer files, typically by FTP, to our site. Depending on which account the file is uploaded to, some scripts are triggered and the file is processed. Usually the file is transferred via FTP to another machine, that does a specific job on the file, and then we monitor a "finished" folder on the remote machine and transfer it back. The final stage of the job is to transfer the file to its long-term storage server. Today we have solved this with Windows and a software called RoboTask. It has done the work okay for now, but it is not very user friendly and hides a lot of the logic. I am looking for something that is:   * Maintainable for many workflows   * Modular, so that common jobs can be reused   * Visual, so that our less tech savvy employees can understand what is going on Any suggestions to this problem? I tried asking this question to Superuser, but was told it was off topic since I am asking for a software recommendation. If this is also the case in Unix & Linux, I am sorry, but could you tell me where it is appropriate to ask the question?


sudo: unable to execute ./script.sh: no such file or directory

I'm stumped. I have a script in my `/home` directory which is executable:               [user@server ~]$ ll     total 4     -rwx------ 1 user user 2608 Jul 15 18:23 qa.sh      However, when I attempt to run it with `sudo` it says it can't find it:               [user@server ~]$ sudo ./qa.sh      [sudo] password for user:      sudo: unable to execute ./qa.sh: No such file or directory      This is on a fresh build. No changes have been made which would cause problems. In fact, the point of the script is to ensure that it is actually built according to our policies. Perhaps maybe it isn't and `sudo` is actually being broken during the build? I should also note that I can run `sudo` with other commands in other directories. EDIT: The script ( I didn't write it so don't `/bin/bash` me over it, please ;) )               #! /bin/bash          . /root/.bash_profile          customer=$1          if [ -z "$customer" ]; then                  echo "Customer not provided. Exiting..."             exit 1          fi          space ()     {     echo     echo '###########################################################################'     echo '###########################################################################'     echo '###########################################################################'     echo     }          g=/bin/egrep          $g ^Listen /etc/ssh/sshd_config     $g ^PermitR /etc/ssh/sshd_config     $g ^LogL /etc/ssh/sshd_config     $g ^PubkeyA /etc/ssh/sshd_config     $g ^HostbasedA /etc/ssh/sshd_config     $g ^IgnoreR /etc/ssh/sshd_config     $g ^PermitE /etc/ssh/sshd_config     $g ^ClientA /etc/ssh/sshd_config          space          $g 'snyder|rsch|bream|shud|mweb|dam|kng|cdu|dpr|aro|pvya' /etc/passwd ; echo ; echo ; $g 'snyder|rsch|bream|shud|mweb|dam|kng|cdu|dpr|aro|pvya' /etc/shadow          space          $g 'dsu|scan' /etc/passwd ; echo ; echo ; $g 'dsu|scan' /etc/shadow          space          $g ${customer}admin /etc/passwd          space          chage -l ${customer}admin          space          $g 'urs|cust|dsu' /etc/sudoers          space          $g dsu /etc/security/access.conf          space          $g account /etc/pam.d/login          space          /sbin/ifconfig -a | $g addr | $g -v inet6          space          echo "10.153.156.0|10.153.174.160|10.120.80.0|10.152.80.0|10.153.193.0|172.18.1.0|10.153.173.0"     echo     $g '10.153.156.0|10.153.174.160|10.120.80.0|10.152.80.0|10.153.193.0|172.18.1.0|10.153.173.0' /etc/sysconfig/network-scripts/route-eth1          space          cat /etc/sysconfig/network-scripts/route-eth2          space          netstat -rn | tail -1          space          cat /etc/sysconfig/iptables          space          cat /etc/hosts          space          ##file /usr/local/groundwork ; echo ; echo ; /sbin/service gdma status          ##space          cat /etc/resolv.conf          space          HOSTNAME=`echo $HOSTNAME | awk -F. '{ print $1 }'`          nslookup ${HOSTNAME}          echo     echo          nslookup ${HOSTNAME}-mgt          echo     echo          nslookup ${HOSTNAME}-bkp          space          /sbin/service rhnsd status ; echo ; echo ; /sbin/chkconfig --list rhnsd ; echo ; echo ; yum update --security          space          /sbin/service osad status ; echo ; echo ; /sbin/chkconfig --list osad          space          /sbin/service sshd status ; echo ; echo ; /sbin/chkconfig --list sshd          space          /sbin/service snmpd status ; echo ; echo ; /sbin/chkconfig --list snmpd ; echo ; echo ; echo ; cat /etc/snmp/snmpd.conf          space          df -h          space          cat /proc/cpuinfo | $g ^processor          space          free -g          space          if [ -f /etc/rsyslog.conf ]; then                  tail -3 /etc/rsyslog.conf          else                  echo "This system is not running rsyslog."          fi          rm -f $0


I have several Amazon EC2 servers and I'm using Chef to manage the configuration. I'd like to set the hostname so that the default bash prompt is more helpful. Right now after launching a new server it's just set as:               root@ip-10-123-123-123      Since I'm using Ubuntu 12 on these boxes I consulted the corresponding man page for hostname. It has a lot of good information on how to set it, and talks a little about the hostname and the fqdn, but it doesn't really tell me what I want to know: > What are the ramifications of setting the hostname? I'd like to assume that setting the hostname is mostly a convenience item for users and sysadmins, giving the box a face / nice-name so it can be more easily recognized internally (via the command prompt, e-mails that are sent, etc), but I'm not positive. I don't see the hostname listed in the `/etc/hosts` file, which appears to be a good sign that it won't affect anything negatively if changed:               127.0.0.1 localhost     # The following lines are desirable for IPv6 capable hosts     ::1 ip6-localhost ip6-loopback     fe00::0 ip6-localnet     ff00::0 ip6-mcastprefix     ff02::1 ip6-allnodes     ff02::2 ip6-allrouters     ff02::3 ip6-allhosts      Am I on the right track? What are the ramifications of setting the hostname? **Update** I tried changing the hostname on my ec2 instance from `ip-10-123-123-123` to `webserver` and `hostname --fqdn` no longer works. If I put it back then it works fine. Apache also gives me an error when starting that it can't reliably determine the fqdn. I suppose there must be some way to set the hostname without messing up the fqdn.


Switching output sink/moving audio streams - but some apps still use the old sink!

I'd like to easily switch between a usb-connected amplifier/dac and my onboard audio. I'm using a fully updated Arch Linux x64 with PulseAudio 4.0-2. Another thread on this board is about switching the output sink and moving active audio streams, see here. Using the accepted answer's script, albeit a little modified, I am able to switch back and forth between the amp/dac and my onboard audio, just as I would like. Equally as well, my audio streams are moved from the old sink to the new one. The problem is that not every application uses the new sink. For example: If I have a YouTube clip paused in my web browser and I switch the output sink and move all the audio streams, if I then unpause the clip, the audio will still be played via the old sink! It seems that moving audio streams is only about moving active - currently playing - audio streams. I thought that maybe audio streams that weren't playing was in some kind of suspended mode but still tracked by PulseAudio, and therefore movable, but it doesn't look that way. Probably for a reason, I don't really know since I'm not particulary familiar with how the sound system(s) work. But if I instead of using _pactl_ use the sound settings of _gnome-control- center_ to switch sink, every single application honors the newly-switched-to sink - even my web browser with a paused YouTube clip. **The question can probably be distilled to:** How can I, by using terminal programs like e.g. _pactl_ , make every application use my new sink for playing sound, just like _gnome-control-center_ does it? This includes programs that aren't currently playing some kind of sound, and therefore doesn't seem to have movable audio streams.


MSSQL database server on UNIX

I have heard rumors, but did not manage to find anything more, about some sort of MSSQL serving on UNIX machine, or MSSQL/MySQL server, that can handle MSSQL storage. I would like to know, if it is possible, and what are possible methods to achieve this.


Why does visudo discourage other editors?

`man visudo` explains that visudo will not (by default) use `EDITOR` or `VISUAL` environment variables. It states that > "There is no easy way to prevent a user from gaining a root shell if the > editor used by visudo allows shell escapes." Now I am confused where the security risk lies. I believe that   * only root can use visudo to edit `/etc/sudoers`   * only root can change root's environment variables   * root already has a root shell There is probably a use case where this does not hold, but I can't think of it.


How do you construct a grep & command to match a number of patterns depending on how many are provided at runtime?

I have exported some _MS Word_ documents to plain text and use this function to parse the contents of the `.txt` files in the current directory:               mo1 () {     for i in *.txt; do         echo "File: $i"         grep -n -HC 1 "$@" "$i"     done     }      If I had more than one pattern to look for, I could do `mo1 | grep pattern2`. But what if I want to do something the result of which would be like `grep -E 'pattern1.*pattern2[.*...]...'` depending on how many patterns are supplied to the function at runtime i.e. `mo1 pattern1 pattern2 [...]` etc.? I can see the `@` array could provide the number of items and I could construct over a loop a variable (finalpattern='$1.*$2.*$3') that would end up being the expression used for `grep`. But I can't think of how to abstract that bit where you craft the expression in the function? Or is there a better/simpler way to do something like this?


Gdm3 doesn't start after upgrading system

I installed Debian a few days ago. The first thing I did was install the ATI graphics driver (I needed some additional software to install it) and some apps for everyday use. Today I upgraded the system and now `gdm3` doesn't start. In recovery mode the system works, but when I try to run X (`startx`), everything is like in normal mode. How can I get my system working again?


Updated Fedora 18 - no sound devices, just dummy output

So, yesterday I updated the recently released Fedora 18, this has been done:               Packages Altered:     Updated grubby-8.20-1.fc18.x86_64                        @?fedora     Update         8.22-1.fc18.x86_64                        @updates     Updated java-1.7.0-openjdk-1:1.7.0.9-2.3.3.2.fc18.x86_64 ?     Update                     1:1.7.0.9-2.3.4.fc18.x86_64   @updates     Updated nss-3.14.1-3.fc17.x86_64                         @updates/17     Update      3.14.1-3.fc18.x86_64                         @updates     Updated nss-sysinit-3.14.1-3.fc17.x86_64                 @updates/17     Update              3.14.1-3.fc18.x86_64                 @updates     Updated nss-tools-3.14.1-3.fc17.x86_64                   @updates/17     Update            3.14.1-3.fc18.x86_64                   @updates     Updated xorg-x11-drv-intel-2.20.16-1.fc18.x86_64         ?     Update                     2.20.17-1.fc18.x86_64         @updates      After rebooting today - the sound's gone and Dummy Output is the only device left. So my wild guess would go towards the xorg-x11-drivers .. I tried adding myself to the 'audio' group - but to no avail. It's the usual Intel chipset. I have no clue where I should begin debugging this, any hints ? Edit: The older kernel `3.6.11-1.fc17.x86_64` works just fine. It's `3.7.2-201.fc18.x86_64` which is causing the problem. Edit 2: Today, after booting 3.7.2 up, problem seems to be gone. No clue why.


Changing order of font style

Is it possible to change the order of font style? ![enter image description here](http://i.stack.imgur.com/niAle.png) In qtconfig-qt4, the default style was no longer Regular. Is it possible to re-order it? Maybe with something in /etc/fonts/conf.d? Anyone know it?


Xrandr does not recognize newmode option

I was trying to modify the screen resolution using xrandr. I used the following command.               xrandr -s 1680x1050      It returned an error.               size 1680x1050 not found in available modes      I figured I have to define and add the mode.               cvt 1680 1050      worked. After that I tried to add new mode               xrandr --newmode <model-line>      Here the newmode option is not recognized. The command does not go through.               usage: xrandr [options]      where options are      -display     -help. etc.      And the --newmode option is not even listed there.


How to manipulate all parameters of a shell script at once?

While for a finite amount of parameters one can explicitly do something like               wrapped_function "${1#prefix}" "${2#prefix}" "${3#prefix}"  # etc.,      isn't there a simpler way to manipulate _all_ parameters at once?


need to display Hard error,transport error &soft error above 2 for the output of iostat -En | grep Hard like this

I am new to this field scripting. iam a solaris engineer.shall i get the answer of this script in KSH scripting" iostat -En | nawk '/Hard Errors/ {line=$0;gsub(/.*Hard Errors:/,"");if($1>2) printf("%s\n",line); }' "which are for hard error above 2,as "warning about iostat hard error , transport error & soft errors > 2 on system1 is "error". And here need to display any of the errors such as hard error , transport error & soft errors are above 2. Anybody can help for this.


Chromium does not Render webpage (arm)

I am trying to run Chromium (the browser) on a Ubuntu install within Android (ARM) and am facing a weird issue: Webpages are not rendering at all. Links etc within the page are still clickable, however the webpage area is completely blank. ![enter image description here](http://i.stack.imgur.com/bpeSG.png) Terminal output:               chromium-browser --user-data-dir='/home/zac'     [2495:2495:0710/143156:ERROR:browser_main_loop.cc(192)] GTK theme error: Unable to locate theme engine in module_path: "pixmap",     [2495:2495:0710/143156:ERROR:browser_main_loop.cc(192)] GTK theme error: Unable to locate theme engine in module_path: "pixmap",     [2495:2495:0710/143156:ERROR:browser_main_loop.cc(192)] GTK theme error: Unable to locate theme engine in module_path: "pixmap",     [2495:2495:0710/143156:ERROR:browser_main_loop.cc(212)] Gdk: shmget failed: error 38 (Function not implemented)     Failed to open /proc/cpuinfo     Failed to open /proc/cpuinfo     Failed to open /proc/cpuinfo     Failed to open /proc/cpuinfo     Failed to open /proc/cpuinfo     Failed to open /proc/cpuinfo     Failed to open /proc/cpuinfo     Failed to open /proc/cpuinfo     Failed to open /proc/cpuinfo     Failed to open /proc/cpuinfo     Failed to open /proc/cpuinfo     Failed to open /proc/cpuinfo     Failed to open /proc/cpuinfo     Failed to open /proc/cpuinfo     Failed to open /proc/cpuinfo     Gkr-Message: secret service operation failed: The name org.freedesktop.secrets was not provided by any .service files     Failed to open /proc/cpuinfo     Failed to open /proc/cpuinfo     Failed to open /proc/cpuinfo     Failed to open /proc/cpuinfo     Failed to open /proc/cpuinfo     Failed to open /proc/cpuinfo     Failed to open /proc/cpuinfo     Failed to open /proc/cpuinfo     Failed to open /proc/cpuinfo     Failed to open /proc/cpuinfo     Failed to open /proc/cpuinfo     Failed to open /proc/cpuinfo     Failed to open /proc/cpuinfo     Failed to open /proc/cpuinfo     Failed to open /proc/cpuinfo      If you need any more info, let me know!


tmux set-titles doesn't work?

To start `tmux` on every shell login, the following was added to the `~/.bashrc` (on the server):               if [ $TERM != "screen-256color" ] && [  $TERM != "screen" ]; then         tmux attach || tmux new; exit     fi      I also want to change the window title to something like `user@server` (instead of `user@localhost`) when ssh into a host. Here's my `~/.tmux.conf`:               set -g prefix C-a     unbind C-b     bind C-a send-prefix          set -g set-titles on     set -g set-titles-string "#T"          bind-key o split-window -v     bind-key e split-window -h          bind-key w kill-pane          set -g terminal-overrides 'xterm*:smcup@:rmcup@'      As you can see, `set-titles` was set to `on`, but it doesn't work as expected. More informations: Outside of tmux:               $ echo $TERM     xterm      Inside of tmux:               $ echo $TERM     screen      `show -g`: https://clbin.com/h7oDh `tmux info`: http://sprunge.us/XHCB And here're the logs when running `tmux -vvvvv` for a bit:   * tmux-client-8441.log: https://clbin.com/eFwFF   * tmux-out-8443.log: https://clbin.com/MSKZv   * tmux-server-8443.log: https://clbin.com/JXwRN If I comment out the lines in `~/.bashrc`, from my laptop, ssh to the server, the title bar shows correctly (`quanta@server`), then start `tmux` from there also works as expected. But if I want to start `tmux` immediately after login, the title bar remains to be `quanta@Ubuntu` after ssh. * * * **UPDATE Fri May 10 07:51:23 ICT 2013** I have deleted the `exit` command in order not to close the shell session when the last `tmux` window is closed:               if [ $TERM != "screen-256color" ] && [  $TERM != "screen" ]; then         tmux attach || tmux new     fi      The strange thing is:   * ssh to server -> the title bar: `quanta@Ubuntu`   * detach from `tmux` -> the title bar switch to `quanta@server`   * attach to `tmux` again -> the title bar still shows correctly `quanta@server` * * * I'm not sure if it's related to the `PROMPT_COMMAND` environment variable or not: Outside of `tmux`:               $ echo $PROMPT_COMMAND      echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/~}"; echo -ne "\007"      Inside of `tmux`:               $ echo $PROMPT_COMMAND     echo -ne "\033_${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/~}"; echo -ne "\033\\"


How do you migrate from dmraid to mdadm on a working 14.04?

I installed 14.04 LTS the other day on two Samsung 840 Pro's in RAID0 on my Intel FakeRAID BIOS setup (NO efi). It is running great, however during the initial boot the system seemed to have a broken Grub, so I used Boot-Repair from a live usb to fix it and apparently that converts mdadm back to dmraid. So, now here I am running in a really nice fast raid setup but with a deprecated mdraid. I wanted mdadm since it appears to be actively updated. How do you go back to mdadm on a working system without damaging your system? Is this even possible? Thank You! Regards, Rod


Given keys in ~/.ssh/authorized_keys format, can you determine key strength easily?

~/.ssh/authorized_keys[2] contains the list of public keys. Unfortunately, each public key does not specify the key strength ( number of bits ). Is there a utility that can process this file line by line and output the key strength? I checked man pages for `ssh-keygen`, but it looks like it would only work with private keys. Also, is there a tool that would output sha1 hash the same way as it is displayed in `pageant` Putty tool? The format I am looking for:               Key Algorithm  Strength  Hash                                             Comment     ssh-rsa        2048      00:11:22:33:44:55:66:77:88:99:aa:bb:cc:dd:ee:ff  user1@host1     ssh-rsa        2048      11:22:33:44:55:66:77:88:99:aa:bb:cc:dd:ee:ff:11  user2@host2


ZSH to auto-complete directories in command-line arguments?

_Transferred from regular StackOverflow..._ I'm a new ZSH convert on OSX (git status in the prompt was my main driver to make the leap). Everything seems to be working swimmingly but I'm missing something from BASH.. In BASH I would start to run a CLI PHP script that's built around Symfony's CLI tools. Typically I would run the command like this:               $> php doctrine --configuration=../conf/doctrine.xml migrations:migrate      In BASH I would be able to use the `TAB` key while typing out the `../conf/doctrine.xml` portion to complete the directories. In ZSH hitting the `TAB` key while typing out the directory results in... nothing. Is there a setting in ZSH or a configuration I can set to enable this behavior of attempting to complete almost anything that looks like a directory?


Listing all devices as non-superuser

I'm trying to mount external hard drive. As I know, to mount manually, I should use `fdisk -l` to determine which device refers to the drive. When I'm doing so without `sudo` I have next output:               user@desktop:~/tmp$ /sbin/fdisk -l          Disk /dev/sda: 320.1 GB, 320072933376 bytes     255 heads, 63 sectors/track, 38913 cylinders, total 625142448 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 4096 bytes     I/O size (minimum/optimal): 4096 bytes / 4096 bytes     Disk identifier: 0x000844b8             Device Boot      Start         End      Blocks   Id  System     /dev/sda1   *        2048      499711      248832   83  Linux     /dev/sda2          501758   625141759   312320001    5  Extended     Partition 2 does not start on physical sector boundary.     /dev/sda5          501760   625141759   312320000   8e  Linux LVM          Disk /dev/mapper/vg0-root: 348 MB, 348127232 bytes     255 heads, 63 sectors/track, 42 cylinders, total 679936 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 4096 bytes     I/O size (minimum/optimal): 4096 bytes / 4096 bytes     Disk identifier: 0x00000000          Disk /dev/mapper/vg0-root doesn't contain a valid partition table          Disk /dev/mapper/vg0-swap_1: 8162 MB, 8162115584 bytes     255 heads, 63 sectors/track, 992 cylinders, total 15941632 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 4096 bytes     I/O size (minimum/optimal): 4096 bytes / 4096 bytes     Disk identifier: 0x00000000          Disk /dev/mapper/vg0-swap_1 doesn't contain a valid partition table          Disk /dev/mapper/vg0-usr: 8996 MB, 8996782080 bytes     255 heads, 63 sectors/track, 1093 cylinders, total 17571840 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 4096 bytes     I/O size (minimum/optimal): 4096 bytes / 4096 bytes     Disk identifier: 0x00000000          Disk /dev/mapper/vg0-usr doesn't contain a valid partition table          Disk /dev/mapper/vg0-var: 2998 MB, 2998927360 bytes     255 heads, 63 sectors/track, 364 cylinders, total 5857280 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 4096 bytes     I/O size (minimum/optimal): 4096 bytes / 4096 bytes     Disk identifier: 0x00000000          Disk /dev/mapper/vg0-var doesn't contain a valid partition table          Disk /dev/mapper/vg0-tmp: 398 MB, 398458880 bytes     255 heads, 63 sectors/track, 48 cylinders, total 778240 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 4096 bytes     I/O size (minimum/optimal): 4096 bytes / 4096 bytes     Disk identifier: 0x00000000          Disk /dev/mapper/vg0-tmp doesn't contain a valid partition table          Disk /dev/mapper/vg0-home: 298.9 GB, 298907074560 bytes     255 heads, 63 sectors/track, 36340 cylinders, total 583802880 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 4096 bytes     I/O size (minimum/optimal): 4096 bytes / 4096 bytes     Disk identifier: 0x00000000          Disk /dev/mapper/vg0-home doesn't contain a valid partition table      With `sudo`:               user@desktop:~/tmp$ sudo fdisk -l     [sudo] password for user:           Disk /dev/sda: 320.1 GB, 320072933376 bytes     255 heads, 63 sectors/track, 38913 cylinders, total 625142448 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 4096 bytes     I/O size (minimum/optimal): 4096 bytes / 4096 bytes     Disk identifier: 0x000844b8             Device Boot      Start         End      Blocks   Id  System     /dev/sda1   *        2048      499711      248832   83  Linux     /dev/sda2          501758   625141759   312320001    5  Extended     Partition 2 does not start on physical sector boundary.     /dev/sda5          501760   625141759   312320000   8e  Linux LVM          Disk /dev/mapper/vg0-root: 348 MB, 348127232 bytes     255 heads, 63 sectors/track, 42 cylinders, total 679936 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 4096 bytes     I/O size (minimum/optimal): 4096 bytes / 4096 bytes     Disk identifier: 0x00000000          Disk /dev/mapper/vg0-root doesn't contain a valid partition table          Disk /dev/mapper/vg0-swap_1: 8162 MB, 8162115584 bytes     255 heads, 63 sectors/track, 992 cylinders, total 15941632 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 4096 bytes     I/O size (minimum/optimal): 4096 bytes / 4096 bytes     Disk identifier: 0x00000000          Disk /dev/mapper/vg0-swap_1 doesn't contain a valid partition table          Disk /dev/mapper/vg0-usr: 8996 MB, 8996782080 bytes     255 heads, 63 sectors/track, 1093 cylinders, total 17571840 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 4096 bytes     I/O size (minimum/optimal): 4096 bytes / 4096 bytes     Disk identifier: 0x00000000          Disk /dev/mapper/vg0-usr doesn't contain a valid partition table          Disk /dev/mapper/vg0-var: 2998 MB, 2998927360 bytes     255 heads, 63 sectors/track, 364 cylinders, total 5857280 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 4096 bytes     I/O size (minimum/optimal): 4096 bytes / 4096 bytes     Disk identifier: 0x00000000          Disk /dev/mapper/vg0-var doesn't contain a valid partition table          Disk /dev/mapper/vg0-tmp: 398 MB, 398458880 bytes     255 heads, 63 sectors/track, 48 cylinders, total 778240 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 4096 bytes     I/O size (minimum/optimal): 4096 bytes / 4096 bytes     Disk identifier: 0x00000000          Disk /dev/mapper/vg0-tmp doesn't contain a valid partition table          Disk /dev/mapper/vg0-home: 298.9 GB, 298907074560 bytes     255 heads, 63 sectors/track, 36340 cylinders, total 583802880 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 4096 bytes     I/O size (minimum/optimal): 4096 bytes / 4096 bytes     Disk identifier: 0x00000000          Disk /dev/mapper/vg0-home doesn't contain a valid partition table          Disk /dev/sdb: 500.1 GB, 500105740288 bytes     255 heads, 63 sectors/track, 60801 cylinders, total 976769024 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x0002e78d             Device Boot      Start         End      Blocks   Id  System     /dev/sdb1            2048   976769023   488383488    7  HPFS/NTFS/exFAT      Why I can see plugged device only while launching the command with root rights?


In Vim, how can I delete all text from the current cursor position until the next space?

In Vim, I know 'd$', that deletes everything to the end of line. But how can I delete all text from the current cursor position until the next space? `dw` doesn't work, since it treats symbols like colon as separator as well.


Python set up on mac

My /usr/bin contains the following installs of python               lrwxr-xr-x  1 root  wheel     76 Nov 18 06:17 pythonw2.7 -> ../../System/Library/Frameworks/Python.framework/Versions/2.7/bin/pythonw2.7     lrwxr-xr-x  1 root  wheel     76 Nov 18 06:17 pythonw2.6 -> ../../System/Library/Frameworks/Python.framework/Versions/2.6/bin/pythonw2.6     lrwxr-xr-x  1 root  wheel     76 Nov 18 06:17 pythonw2.5 -> ../../System/Library/Frameworks/Python.framework/Versions/2.5/bin/pythonw2.5     -rwxr-xr-x  2 root  wheel  62752 Nov 18 06:17 pythonw     lrwxr-xr-x  1 root  wheel     82 Nov 18 06:17 python2.7-config -> ../../System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7-config     lrwxr-xr-x  1 root  wheel     75 Nov 18 06:17 python2.7 -> ../../System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7     lrwxr-xr-x  1 root  wheel     82 Nov 18 06:17 python2.6-config -> ../../System/Library/Frameworks/Python.framework/Versions/2.6/bin/python2.6-config     lrwxr-xr-x  1 root  wheel     75 Nov 18 06:17 python2.6 -> ../../System/Library/Frameworks/Python.framework/Versions/2.6/bin/python2.6     lrwxr-xr-x  1 root  wheel     82 Nov 18 06:17 python2.5-config -> ../../System/Library/Frameworks/Python.framework/Versions/2.5/bin/python2.5-config     lrwxr-xr-x  1 root  wheel     75 Nov 18 06:17 python2.5 -> ../../System/Library/Frameworks/Python.framework/Versions/2.5/bin/python2.5     -rwxr-xr-x  6 root  wheel    925 Nov 18 06:17 python-config     -rwxr-xr-x  2 root  wheel  62752 Nov 18 06:17 python     lrwxr-xr-x  1 root  wheel     63 Mar  6 13:23 python3.2 -> /Library/Frameworks/Python.framework/Versions/3.2/bin/python3.2      I would have thought that python would be a link to any of the versions installed, but it is not. It appears to be a python executable               15:00:33 /usr/bin $ python -V     Python 2.7.1      Another install shows the same version               15:01:36 /usr/bin $ pythonw2.7 -V     Python 2.7.1      Checksums are, however not the same               15:02:15 /usr/bin $ sum python2.7     60959 35 python2.7          15:03:18 /usr/bin $ sum python     10360 62 python      **I wonder .. is it ok to actually**               rm python     ln -s python3.2 python      System: MAC


SSH to a host and enter password with shell script

I want to create a file like this : sshTOhost :               #!bin/bash     ssh -D 1500 user@host     #enter password (I don't know how)      can any one help me?


How to query pdf page size from the command line?

For scripting I need to get the page dimensions of a PDF file (in mm). `pdfinfo` just prints it in 'pts', e.g.:               Page size:      624 x 312 pts      What should I use? Or what unit is 'pts' anyway - in case I want to convert them ...


Scope of variables when calling function from find

In a bash script I define a function that is called from `find`. The problem is that the scope of variables does not extend to the function. How do I access variables from the function? Here is an example:               variable="Filename:"          myfunction() {         echo $variable $1     }          export -f myfunction          find . -type f -exec bash -c 'myfunction "{}"' \;      This will output filenames but without the string "Filename:". Is there perhaps a better way to invoke a function from `find` such that it is called for every file that `find` finds, and variables are still defined?


How to assign value of variable with regex (bash)?

I want to use regex in bash at line of variable assignment e.g.               oldip="14\.130\.31\.172"     oldip_a="14.130.31.172" << How to use regex to del all '\'? and assign to oldip_a      Do you have any idea?


Linux Mint Stops Network File Transfers to Load Data into RAM

I've never seen or heard anything like this before, and I can't find anything else online that is at all similar. I've upgraded my network to gigabit and have been transferring large files lately (this one in question is a bunch of DVD images totaling over 200GB). Whenever I try to copy a set of files a few gigs and larger, I've noticed this odd behavior where Mint will load a chunk of the data into RAM-- usually about 1.2 GB or smaller-- sometimes only a few hundred megs-- and then start transferring. When it gets done transferring that, it will literally halt the transfer, spit out the old hunk of data, and wait to continue transferring until the next chunk of data is loaded into the RAM. Then it will resume transferring across the network. Then it repeats. And repeats. And repeats. Until the data is all done. Here is a screenshot of the System Monitor during one of these weird moments. ![Screenshot Here](http://i.stack.imgur.com/IzDuv.png). You can see the death of the transfer at the precise moment the RAM dumps the data, and then you see the RAM level out at the same moment that the transfer resumes again. What's also funny is that I actually have six gigs of RAM, not 3.2 as Sys. Monitor would have you believe-- this is the second time Mint hasn't reported it all of the sudden. But that's a question for another day. It's not the worst thing in the world, but it is a little annoying when every other OS I've used simultaneously loads data in and out of the RAM while it's transferring across the network. It doesn't have to pause to think about it. It would save me time while I'm moving these large sets of data if I could remedy this. Are there any suggestions, remedies, diagnoses, or theories?


jpg to pdf without data loss

Trying to make such things: 1st step:               convert img.jpg img.pdf      2nd step:               pdfimages -j img.pdf img1      Comparing source and extracted images in HEX shows difference. How to make such conversion without data loss?


Which software to use?

I am familiar with Unix and am trying to move my home away from Microsoft completely. I wannna build a NAS/website(local and webwide) server. My primary OS is OS X Mavericks and secondly Ubuntu. The solution should be able to independently host on the NAS/Server and be managed from OS X Mavericks Server. What would it take to host a couple OS's too?


local package cache for arch linux

I am running an arch linux system and want to host a few arch linux VMs. For installing and updating the VMs they need access to the arch package repository which is usually achieved by a direct network connection to the official arch servers. In my situation this would result in downloading the same packages again and again for my host and all the VMs. Is there a good way to cache those packages locally to avoid downloading them again?


Is it possible to copy whole userland into other machine in FreeBSD?

AFAIK, FreeBSD has strict separation between base system and userland. IMO, theoretically, it seems possible to transfer whole userland to other machine by simple copying. If the base systems are equal (version) Can I actually copy the userland by simple copying? If it's possible what directories should I copy? If it is not, what's the major reason which prevent copying userland configurations? **Update** The term _userland_ seems to be wrong in the text. My intention was **stuffs of full OS except base system** , and I don't know correct wording for this.


Why does `at` warn me that commands will be executed using /bin/sh? What if I want a different shell?

I tried to use `at` from within a script of mine and it prints: > warning: commands will be executed using /bin/sh How would I use different shell if I wanted?


No font in emacs on CentOS

When I open emacs over an SSH connection I get this error               Warning: Cannot convert string "-*-courier-medium-r-*-*-*-120-*-*-*-*-iso8859-*" to type FontStruct     Warning: Cannot convert string "-*-helvetica-medium-r-*--*-120-*-*-*-*-iso8859-1" to type FontStruct      and the font is replaced with empty squares. Does anyone know what could be wrong? ![enter image description here](http://i.stack.imgur.com/wlK8u.png)


Extracting text string from file, assigning them to variables then writing them to another file?

Basically, its a game server (minecraft) and I have a situation where I am attempting to automate new world generation. Basically, I have a file that gets generated happily which has this snippet in it. file1.txt               keepSpawnInMemory: 'true'     spawnLocation:       ==: MVSpawnLocation       yaw: 0.0       pitch: 0.0       z: 256.5       y: 62.0       x: -223.5     autoLoad: 'true'     bedRespawn: 'true'      This works fine, but I need to extract the z: 256.5, y:62.0 and x: -223.5 respectively and then write a file called file2.txt with the following lines.                world: mine      x: -223.5      y: 62.0      z: 256.5      yaw: 0.0      pitch: 0.0      name: mine      I assume I'll be using something like awk to extract the initial numbers, assigning them to variables then writing the file? I have never used awk before, and I am insanely confused. Appreciate any help in this guys. Im using Ubuntu linux, bash scripts. Can I extract text like that and make them into variables using awk and bash? EDIT: I did forget to mention that the file 1 has multiple instances of x,y and z. It can be accessed here: http://pastebin.com/TqaLcWzV Is there a way to start at a certain line? For example, z, y and x will always be on lines 183, 184 and 185 respectively.


apostrophe appearing whenever type letters with soft signs

I use a Latvian keyboard layout (apostrophe variant) and whenever I type letters with a soft sign it prints an actual apostrophe before each letter. For example, instead of `āēģņļ`, I get `'ā'ē'ģ'ņ'ļ`. How can I fix this?


ls with find :: report total size

I am trying to get the total size of files satisfying a `find`, e.g.:               ls  $(find -maxdepth 2 -type f)      However, this kind of invocation of `ls` does not produce the total size as well.


show part of wraped lines in vim instead of hiding it with the @ character

I use `vim` not only for coding but also for text writing. In this context I use the wrap and linebreak options to wrap my text. Since lines - forming paragraphs in text writing - can be very long a wraped line easily does not fit in the lower part of the screen so `vim` hides all the wrapped line replacing the visible part of it with the @ symbol. Is there any chance to avoid this so that `vim` just shows the part of the wraped line that still fits at the bottom of the screen?


stat meanings of computing nodes

I submitted a job to a Linux cluster which uses SGE job scheduler. The job stat is qw for a long time, so I inspected the stats of computing nodes using "qstat -f". I found that many nodes were labelled with stats "d", "adu" and "E". I wonder what these stats mean. The Grid Engine Man pages listed these stats for filtering queue instances ( `-qs {a|c|d|o|s|u|A|C|D|E|S}` ), but no further explanation on the meaning of these stats. What do the states mean?


Xenomai and Ubuntu

I have installed xenomai 2.4.8 in Ubuntu 11.04 with this command:               apt-get install libxenomai-dev      Now I want test a simple vxWorks program, but when I compile my program, I receive this message: > Xenomai: vxworksskin or CONFIG_XENO_OPT_PERVASIVE disabled   >  (modprobe xeno_vxworks?) ...and the output of `modprobe xeno_vxworks` is: > FATAL: Module xeno_vxworks not found My question is, how can I eanble the xeno_vxworks module? I am new to Xenomai so please forgive me if my question is silly.


Unable to boot to windows

Context: Recently I've bought an SSD. Before that I had 2 HDDs; one being a 500GB drive with a W7 installation, and another 320GB Drive containing two partitions, one of which for storage (NTFS) and another to hold a linux mint installation (Which I'm currently on). When the SSD arrived I set up another W7 installation. Once this was fully set-up, I wanted to format the 500GB drive to use it for storage. I've done this today, and as a result wiped the windows loader from my system. Ideally, what I would like is for the windows boot manager to be on the SSD, and a grub installation on the 320GB drive. Then I'd like the system to boot to the 320GB drive, and give options to load the Windows boot manager, or boot to linux. Since the windows drive cannot be booted to, when running a W7 disc and using CLI I get the error "element not found" when attempting to use "recboot /fixboot". using /scanos does find my W7 installation however. I've also set the W7 partition as active and rebooted, but had the same results. I've also attempted using boot-repair, however my system still cannot boot to windows. My current boot summary is here. My current grub boot menu just lists the mint installations. How can I fix this to include a windows boot loader? @terdon:               Generating grub.cfg ...     Found linux image: /boot/vmlinuz-3.11.0-15-generic     Found initrd image: /boot/initrd.img-3.11.0-15-generic     Found linux image: /boot/vmlinuz-3.11.0-12-generic     Found initrd image: /boot/initrd.img-3.11.0-12-generic       No volume groups found     done


How to automatically install packages?

I want to install packages automatically by running a script I can write `yum install php`, but I want it to install another package once installation of the php package is completed. Is there any solution to make it automatic? I have around 20 packages which are to be downloaded from remi repository.


fix ctrl-O in xterm?

I'm trying to investigate the vt100 alternate graphics character-set with xterm. And somehow my setup doesn't allow the examples to work correctly. The sequence "`Esc`(B" sets the G0 character set to US ASCII. "`Esc`)0" sets the G1 character set to the alternate graphics character set. "`Ctrl`+`N`" (ascii Shift-Out) switches to the G1 set. But "`Ctrl`+`O`" (ascii Shift-In) to shift back to G0 is not taking effect (investigating with `cat`). It seems to be hijacked by the pty or something. `stty -a` shows               $ stty -a     speed 38400 baud; rows 60; columns 97; line = 0;     intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>; eol2 = <undef>; swtch = ^Z;     start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; flush = ^O;     min = 1; time = 0;     -parenb -parodd cs8 -hupcl -cstopb cread -clocal -crtscts     -ignbrk brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff -iuclc -ixany     imaxbel     opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0     isig icanon iexten echo echoe echok -echonl -noflsh -tostop echoctl echoke      Now, I can call "stty flush `ctrl-V``ctrl-E`" (just to pick something seemingly innocuous), and the read-out from `stty -a` changes. But still `ctrl-O` doesn't shift me back to the G0 set. What else can I do to fix this? I'm using Cygwin32 xterm on Windows 8.


Can not connect wirelessly to internet in CrunchBang 10

I am trying to install Crunch Bang 10 on a clients computers. The problem is, wireless internet is not working. Internet on the computer has worked before when it had Lubuntu on it. I have wired works. The computer could temporaily be connected with a wire to do the fix, but it can not be permanent. Also, if it helps, the output from `lspci` (I saw at http://www.cyberciti.biz/faq/linux-find-wireless-driver-chipset/ it told you some wireless info.)               00:00.0 Host bridge: Intel Corporation 82845 845 [Brookdale] Chipset Host Bridge (rev 04)     00:01.0 PCI bridge: Intel Corporation 82845 845 [Brookdale] Chipset AGP Bridge (rev 04)     00:1d.0 USB Controller: Intel Corporation 82801CA/CAM USB Controller #1 (rev 02)     00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev 42)     00:1f.0 ISA bridge: Intel Corporation 82801CAM ISA Bridge (LPC) (rev 02)     00:1f.1 IDE interface: Intel Corporation 82801CAM IDE U100 Controller (rev 02)     00:1f.5 Multimedia audio controller: Intel Corporation 82801CA/CAM AC'97 Audio Controller (rev 02)     00:1f.6 Modem: Intel Corporation 82801CA/CAM AC'97 Modem Controller (rev 02)     01:00.0 VGA compatible controller: ATI Technologies Inc Radeon Mobility M7 LW [Radeon Mobility 7500]     02:00.0 Ethernet controller: 3Com Corporation 3c905C-TX/TX-M [Tornado] (rev 78)     02:01.0 CardBus bridge: Texas Instruments PCI1420 PC card Cardbus Controller     02:01.1 CardBus bridge: Texas Instruments PCI1420 PC card Cardbus Controller     02:03.0 CardBus bridge: Texas Instruments PCI1410 PC card Cardbus Controller (rev 01)


No elevated permissions when using GUI applications on i3 wm

I'm running Lubuntu 13.10 with the i3 window manager. Tasks that need elevated permissions, like installing applications from the lubuntu software center or using the gnome-disks, complain about not having sufficient permissions and never prompt for a password. Sudo through the command line works so it seems to be just an issue with GUI applications. Everything works as normal when running vanilla lubuntu.


Is it possible to put arithmetic expressions in a crontab?

I know I can do simple arithmetic in shell scripts, like so:               #!/bin/bash     ((sum = 1 + 2))     echo sum      This will output 3 on execution. My question now is, can this kind of expressions be used in crontab? For example, see this line:               03,13,23,33,43,53 * * * * ~/DoSomeStuff.sh      The minutes could be specified as `x+3` with `x` the expression `*/10`, which can be used in crontabs. However, simply writing `*/10+3` or `((*/10+3))` wont work. Is there any way to do this? And what is the correct syntax? The alternative, that certainly works, is putting a `sleep 3m`. I'm just wondering if the arithmetic way of doing it is somehow possible.


Can't yum WINE from repo - No package wine available

I'm trying to install WINE on Centos 5.10 as per some instructions I wrote last year using this instruction:               # yum install wine      However when run, it can't find any package under that name:               # yum install wine      Loaded plugins: fastestmirror, security      Loading mirror speeds from cached hostfile      * base: mirror.mhd.uk.as44574.net      * extras: mirror.sov.uk.goscomb.net      * updates: mirror.sov.uk.goscomb.net     Setting up Install Process     No package wine available.     Nothing to do      I tried saving the RPMs from the Centos 5.10 livecd locally and using them as a repo but it's not found there either. How can I install WINE via yum without having to resort to RPMs?


Increase brightness in a part of the display

I have a laptop with a damaged screen: while it displays an image, one half of it is darker than the other half. Is there any tool to increase the brightness of only a single part of the display? I managed to make things slightly better by playing with `xgamma`, but it's not quite what I want.


Public key problem when installing ovirt on aws

I started an instance on AWS with centos 6.4. I ran the following two commands:               $ yum localinstall http://resources.ovirt.org/releases/ovirt-release.noarch.rpm     $ yum -y install ovirt-engine      I got the following messages: > warning: rpmts_HdrFromFdno: Header V3 RSA/SHA256 Signature, key ID 0608b895: > NOKEY > > Public key for python-websockify-0.5.1-1.el6.noarch.rpm is not installed How can I solve this public key problem?


apt-get doesn't upgrade openssl on debian 7

I'm facing the following problem. If I run the command `sudo apt-get upgrade`, I get:               Reading package lists... Done     Building dependency tree            Reading state information... Done     The following packages have been kept back:       libssl1.0.0:i386     0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.      and if I run `sudo apt-get install libssl1.0.0:i386`               Reading package lists... Done     Building dependency tree            Reading state information... Done     Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming.     The following information may help to resolve the situation:          The following packages have unmet dependencies:      apache2-mpm-prefork : Depends: apache2.2-bin (= 2.2.22-13+deb7u1) but it is not going to be installed      apache2.2-common : Depends: apache2.2-bin (= 2.2.22-13+deb7u1) but it is not going to be installed                     Depends: apache2-utils but it is not going to be installed                     Recommends: ssl-cert but it is not going to be installed      libssl1.0.0 : Breaks: libssl1.0.0:i386 (!= 1.0.1e-2+deb7u6) but 1.0.1e 2+deb7u7 is to be installed      libssl1.0.0:i386 : Breaks: libssl1.0.0 (!= 1.0.1e-2+deb7u7) but 1.0.1e-2+deb7u6 is to be installed     E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.      I'm using Debian 7 64. Could you please explain what's really going on? Is there somethign wrong in my server? Thank you.


How do I output a suggestion for a user to accept and use as input?

What can I do to leave the cursor on the same line of the suggestion in a Bash script? Bash version = 3.2.51 It's purpose is to suggest a string so that the user should only press Enter.               #!/bin/sh     echo "@@@@@@@@@@     @ Enter the new plarform name [for example: our-platform-7.26-2.17-res4]:     @@@@@@@@@@"     echo "our-platform-7.26-2.17-res4"     read SuggestDefaultPlatform          echo "Stored name: " ${SuggestDefaultPlatform}      which prompts:               @@@@@@@@@@     @ Enter the new plarform name [for example: our-platform-7.26-2.17-res4]:     @@@@@@@@@@      our-platform-7.26-2.17-res4     _      where the underscore "`_`" stands for the cursor. I don't want to use a "Y/n" logic workaround, assigning a default value to the "`SuggestDefaultPlatform`" variable               SuggestDefaultPlatform='our-platform-7.26-2.17-res4';      and then prompt a question like:               Are you okay with `'our-platform-7.26-2.17-res4'` as your platform name? [Y/n]...      Instead the user might want to change just a few digits of a prompted suggestion and press Enter. See below the cursor "`_`" at the end of the "`SuggestDefaultPlatform`" variable:               @@@@@@@@@@     @ Enter the new plarform name [for example: our-platform-7.26-2.17-res4]:     @@@@@@@@@@      our-platform-7.26-2.17-res4_      so that the user can move the cursor, modify the suggestion and/or press Enter.               our-platform-7.26-2.17-res_     our-platform-7.26-2.17-re_     our-platform-7.26-2.17-r_     our-platform-7.26-2.17-_     our-platform-7.26-2.17_     our-platform-7.26-2.1_     our-platform-7.26-2.18-alpha1_      Press Enter. which prompts:               Stored name: our-platform-7.26-2.18-alpha1


Is there way to close Guake tab by center click?

I want to close Guake's tab by mouse wheel click. As far as I see there is no configuration for it. Is there a way to do it? For example by configuring with a `~/.guakerc` file or so.


How to delete files only, but keep the directory structure?

I would like to delete every file, but keep the folder structure. Is there a way? NOTE: (I'm using GNU bash 4.1.5).


Replace value within single quotes in a line that contains certain word using sed command

I have a line as below in a html file,               shahar.push(['remoteUrl', 'staging.zazzercode.com']);      Depending upon environment, I want to replace the `remoteUrl` value with `sed` command. **eg,**               shahar.push(['remoteUrl', 'staging.zazzercode.com']);     shahar.push(['remoteUrl', 'production.zazzercode.com']);      I used               sed -i '/remoteUrl/c\shahar.push(['remoteUrl','staging.zazzercode.com']);' predict.html      It works but removing single quotes over `'remoteUrl'` and `'staging.zazzercode.com'` causing html error.               shahar.push([remoteUrl, staging.zazzercode.com]);      **So to be safe,** I want to change `sed` command just to change the value between two single quotes after `,` in a line with `remoteUrl`. Or I want other `sed` options than What I knew to replace whole line but with single quotes.


Converting multiple image files from JPEG to PDF format

I want to convert some files from jpeg to pdf. I am using following command.               $ convert image1.jpg image1.pdf       But I have 100 images. How should I convert all of them to corresponding pdfs? I tried               $ convert image*.jpg image*.pdf       It doesn't work.


Need help setting up networking for KVM on Gentoo with exit to wifi adaṕter

I am running Gentoo Linux on an AMD64 laptop, and I am having an extremely hard time setting up host networking on KVM. I alreay have KVM, libvirtd, virt-manager, the kernel modules required to get virtualization working, and I already rebuilt my kernel with new configuration options according to this guide here, and I still cannot seem to be able to get host networking running. I am able to create a VM using virt-manager, but I am unable to choose a network interface to connect my VM to, on virt-manager's final dialog under Advanced options, all the options on the drop-down box are disabled except "No networking" and "Specify shared device name". I cannot use bridge networking because my internet exit is through a wi-fi NIC. I just spent a good few hours bashing my head with this and I still can't get networking on KVM running. I do not want to use Oracle VM VirtualBox because I had a lot of problems with it in the past. Did I miss something? Is my computer acting up?


What is the best way to add a user to the sudoer group?

So far I have found four different ways to add a user to the sudoers group and not all methods work in all systems. Why so many different implementations? What is the best? What is the standard (i.e. work in most systems)? Different implementations:   1. Adding the user to the 'wheel' group.    2. Adding the user to the 'sudo' group.    3. Editing the file /etc/sudoers   4. Editing the file /etc/sudoers using visudo


USB Ubuntu with whole-disk encryption

Is it possible to create a single-user USB installation (with persistence) of Ubuntu Linux such that the entire USB stick is encrypted and requires a passphrase at boot time? Is there an online tutorial for this?


sed: what does "/ " mean?

x=`src/lstat64 $TEST_DIR/$tmp.1 | sed -n -e '/ Links: /s/.*Links: *//p'`      In this script. I understand this part `"/s/.*Links: *//p'"` the only thing I don't understand is `'/ Links: '` what does `"/ "` mean? thank you!


How to tell which file is original if hard link is created

For example, I have a file `myold_file`. Then I use `ln` to create a hard link as `mylink`:               ln myold_file mylink      Then, even by using `ls -a`, I cannot tell which is the old one. Is there anyway to tell?


How to process/pipe TCPDUMPs output in realtime

If I want to tcpdump DNS requests by clients (on an OpenWrt 10.04 router), then I               root@ROUTER:/etc# tcpdump -n -i br-lan dst port 53 2>&1            tcpdump: verbose output suppressed, use -v or -vv for full protocol decode     listening on br-lan, link-type EN10MB (Ethernet), capture size 96 bytes     22:29:38.989412 IP 192.168.1.200.55919 > 192.168.1.1.53: 5697+ A? foo.org. (25)     22:29:39.538981 IP 192.168.1.200.60071 > 192.168.1.1.53: 17481+ PTR? 150.33.87.208.in-addr.arpa. (44)     ^C     2 packets captured     3 packets received by filter     0 packets dropped by kernel      That's fully ok. But. Why can't I pipe the tcpdumps output in realtime?               root@ROUTER:/etc# tcpdump -n -i br-lan dst port 53 2>&1 | awk '/\?/ {print $3}'     ^C     root@ROUTER:/etc#       If I awk, etc. anything after tcpdump, I don't get ANY output. Why is that? Why can't I process the output of tcpdump with pipelining in realtime? (so that e.g.: in the example in only outputs the 3rd column) Are there any solutions for this?


Finding MFLOPS using Linux

How can I find out the Mflops on my linux computer? I can see the bogomips on my /proc/cpuinfo but I don't see any Mflops on that file:               $ cat /proc/cpuinfo | grep -ie mips -ie flops          bogomips    : 3591.29     bogomips    : 3590.96     bogomips    : 3590.96     bogomips    : 3590.96


Does (should) LC_COLLATE affect character ranges?

Collation order through `LC_COLLATE` defines not only the sort order of individual characters, but also the meaning of character ranges. Or does it? Consider the following snippet:               unset LANGUAGE LC_ALL     echo B | LC_COLLATE=en_US grep '[a-z]'      Intuitively, `B` isn't in `[a-z]`, so this shouldn't output anything. That's what happens on Ubuntu 8.04 or 10.04. But on some machines running Debian lenny or squeeze, `B` is found, because the range `a-z` includes everything that's between `a` and `z` in the collation order, including the capital letters `B` through `Z`. All systems tested do have the `en_US` locale generated. I also tried varying the locale: on the machines where `B` is matched above, the same happens in every available locale (mostly latin-based: `{en_{AU,CA,GB,IE,US},fr_FR,it_IT,es_ES,de_DE}{iso8859-1,iso8859-15,utf-8}`, also Chinese locales) except Japanese (in any available encoding) and `C`/`POSIX`. **What do character ranges mean in regular expressions** , when you go beyond ASCII? Why is there a difference between some Debian installations on the one hand, and other Debian installations and Ubuntu on the other? How do other systems behave? Who's right, and who should have a bug reported against? (Note that I'm specifically asking about the behavior of character ranges such as `[a-z]` in `en_US` locales, primarily on GNU libc-based systems. I'm not asking how to match lowercase letters or ASCII lowercase letters.) * * * On two Debian machines, one where `B` is in `[a-z]` and one where it isn't, the output of `LC_COLLATE=en_US locale -k LC_COLLATE` is               collate-nrules=4     collate-rulesets=""     collate-symb-hash-sizemb=1     collate-codeset="ISO-8859-1"      and the output of `LC_COLLATE=en_US.utf8 locale -k LC_COLLATE` is               collate-nrules=4     collate-rulesets=""     collate-symb-hash-sizemb=2039     collate-codeset="UTF-8"


Disable stack protection on Ubuntu for buffer overflow without C compiler flags

I'd like to try some shell codes and I want to disable linux protections. I know I could compile using flags but I know another way exists to disable these protections in general I just can't remember. Can you help me?


Can I set defaults for rsync in non daemon mode? I know the daemon mode has this configuration file: `/etc/rsyncd.conf` But I typically use the non daemon version in this sort of manner:               rsync -avzcO --exclude-from=/path/to/rsync/exclude/list {from...} {to...}      Is there a way that I can set those flags to be defaults? I'm using `rsync version 2.6.9 protocol version 29` but I am happy to install a newer version if it has support for a default configuration file. I suppose I could setup an `alias` but it just seems strange if there really is not a config file.


What is the best way to find directories that exactly match a string irrespective of the path?

Suppose I have the directories:               /foo/     /A/B/C/foo/D/E/     /F/foo/G/H/foo/I/      How can get a result that lists all the directories whose basename exactly matches a given string (for example `foo` in here)?               /foo/     /A/B/C/foo/     /F/foo/     /F/foo/G/H/foo/


Laptop running ~30° hotter than normal; CPU/Load is reportedly normal. What could cause this and how can I diagnose it?

I'm running the latest Arch Linux on my ThinkPad t420 laptop, and am having an intermittent heat problem where my temp will rise from the typical ~45°C to ~75-90°C, and stay there until I reboot. I've run several diagnostic tools, including the obvious `htop` and others that googling has suggested, including `powertop`, `iostats`, and surely others I don't recall. So far I've come up with no obvious issues, and ostensibly no differences in readouts whether my machine is running normally or in this hot state. I've also killed most suspicious processes one by one (databases and other daemons), hoping to find the hidden culprit, to no avail. Beyond these attempts, **I don't know where to begin troubleshooting**. I'm hoping someone could point me in the right direction to begin looking for the deeper issue. ### To be precise, my question is not how to cool my machine, but rather what could cause a consistent 30+ degree heat change in a system where (reportedly) CPU and load is normal? And what tools/practices could I use to diagnose it? Some notes that might be helpful:   * I **can** cool the system (e.g. by disengaging the fan control completely), but it immediately heats up again if left alone. This seems to suggest that heat retention is not an issue, but rather _something_ is continually generating heat.   * CPU usage and load are reported by `htop` as normal after entering this hot state. This includes kernel threads. According to `htop`, the system is essentially idle (1-2% sytem wide CPU usage, a load of 0.10).   * My machine uses Intel HD integrated graphics, and _has no other graphics card_. An nVidia card was an option for this model, as noted by @braiam; I did not opt for it.   * @terdon brought up the CPU governor settings. My CPUs are set to `powersave`   * My specific processor is a 2.7GHz Core i7-2620M. **Edit** : At the time of writing this question, my fancontrol was not functioning properly and ran continually at a middle RPM range (3900 RPMs), even at high temps. At the suggestion of @Alex and @JustDanyul, this has been fixed. The underlying problem, however, still remains.


Delete extraneous files from dest dir via rsync?

Say I have               SRC        001.jpg       002.jpg       001.txt       a.zip          DEST       hello.jpg      `rsync -d --delete SRC:{*.jpg,*.txt} DEST` It doesn't remove hello.jpg from DEST, any idea how to archive this?


Why can't I upgrade Linux Mint 15 from Cinnamon 1.8.8 to Cinnamon 2.0, and how do I fix it?

So Cinnamon 2.0 is out, and I've followed the steps people have given for upgrading.               sudo add-apt-repository ppa:gwendal-lebihan-dev/cinnamon-stable      sudo apt-get update     sudo apt-get dist-upgrade      This however doesn't work. It says I'm already on the newest version. I've tried doing this from a different DE, but that also didn't work. I don't appear to have any held packages in apt, so that's not the problem. Do I need to uninstall Cinnamon and reinstall it? Is there something I'm missing? Thanks.


How can I set up byobu to use a second screen session on login?

**tl;dr:** I have an irssi proxy screen session running in the background. I'm running `byobu -R -S byobu;exit` in `~/.bash_profile` to start a second session instead of reconnecting to the irssi session, but it starts a third session when I log in twice (e.g. once through the local terminal and once through SSH). How can I make the secon login reconnect to the first? I had previously enabled byobu on login for my server. This worked fine, and I would get the same underlying screen session no matter where I logged in from. However, then I added a second screen session to the server's boot:               [alex@alex-ubuntu-server ~]$ cat /etc/rc.local     #!/bin/sh -e     # [clipped out default ubuntu rc.local header]          # run an irssi proxy under screen as user alex     sudo -H -u alex screen -d -m -S irssi-proxy irssi          exit 0     [alex@alex-ubuntu-server ~]$       From then on, this command (which was put in my `~/.bash_profile` by byobu configuration):               _byobu_sourced=1 . /usr/bin/byobu-launch -S byobu      would connect to the already existing irssi screen session, instead of creating a new session. This was obviously not ideal, so eventually I settled on the following command:               byobu -R -S byobu;exit      Then intention was to name the screen session, thus allowing a reconnect to the same name when I logged in again through e.g. SSH. However, when I login again, I get a fresh screen session instead of the existing one (as you can see in the example below, this has already happened once).               [alex@alex-ubuntu-server ~]$ screen -ls     There are screens on:             18036.byobu     (07/07/2013 04:26:44 PM)        (Attached)             3869.byobu      (07/05/2013 07:45:37 PM)        (Attached)             1319.irssi-proxy        (07/04/2013 05:01:54 PM)        (Detached)     3 Sockets in /var/run/screen/S-alex.          [alex@alex-ubuntu-server ~]$ ssh localhost     Ubuntu 13.04     alex@localhost's password:     # at this point the screen redrew because of the new byobu session,     # so these weren't really one after another, as shown here     alex@alex-ubuntu-server:~$ screen -ls     There are screens on:             6216.byobu      (07/07/2013 05:17:38 PM)        (Attached)             18036.byobu     (07/07/2013 04:26:44 PM)        (Attached)             3869.byobu      (07/05/2013 07:45:37 PM)        (Attached)             1319.irssi-proxy        (07/04/2013 05:01:54 PM)        (Detached)     4 Sockets in /var/run/screen/S-alex.          alex@alex-ubuntu-server:~$       I'd prefer not to switch to `tmux`. How can I construct a byobu/screen command that reconnects to the existing second screen session if possible, but otherwise starts a new (second) session?


Looking for simple photo organizing software for Linux

I am looking for a simple Linux software to organize photos. What exactly I want to do with this application is the following: I want to view all images in a given folder and just tag/star/mark some of them with by simple key pressing or a simple mouse click. No menu, not complicated 10-mouse click journey, just ONE key pressing/mouse click and on to the next image. After I have selected a couple of images that way, I want them moved to another directory. Is there such a simple application? I just want to simply organize my photos in different folders, as simple as that. No tagging which is software-dependent, as I want to view those images on differrent OS, like Linux, Windows, on TV, ... Therefore, no special tagging format, just simple reorganizing photos on the touch of a simple keystroke...


What is hvc0? (appearing in "who" list)

I have an Ubuntu Server, and when I type `who`, to see who's connected, I can see that there's a user connected, and instead of being logged to a `pts/x`, he's connected to `hvc0`. Is there something to worry about?


Can I create a local only guest account?

Is it possible to create a "guest" account in Linux? by "guest" account I mean an account that does not require a password to log in graphically. I want this account for when people come over and are like "can I use your computer to check my email". Then I don't have to worry about them snooping my stuff. I realize that some of this may require doing stuff specific to the login manager, since I wouldn't be surprised that this is a common problem, it'd be best to include instructions for `xdm`, `kdm`, and `gdm` and any other login managers that I haven't listed.


Wait until no incoming network connection for N minutes, then execute a command

I want to put my Debian Wheezy home server to sleep, if it wasn't accessed through the network for a certain amount of time. I thought of a bash script that uses netstat to count the number of active connections, sleeps for some seconds, runs netstat again, and so on. Is there any better way to achieve this without using sleeping every second? Is there any way to react to the event 'incoming network connection' and reset some kind of countdown timer?