How to create a new partition in Ubuntu

I want to build my own Linux as "Linux From Scratch". I need to get a new partition from my hard disk. I checked and saw I have sda1. (I have about 20G empty) When I use the `fdisk` command `n`, I can only get about 500M space (according to the first and last cylinder `fdisk` provided me). Why? Could anyone help me? How can I do this correctly? Screen shots of my operation: ![fdisk output](http://i.stack.imgur.com/PnYX3.png) ![df output](http://i.stack.imgur.com/OuzwE.png)


Is it possible to have two different volume level?

I am playing background music on audacious player. At the same time I am watching youtube videos. The problem is that the volume on Audacious is the Master volume, so it is impossible to have volume down on audacious and high volume whilst I am watching youtube videos. Is there a way to have a different volume for Audacious?


How to recover a SD card?

I accidentally deleted my SD card photos. I purchased a software call wondershare photo recovery and card recovery. I am able to recover back 50% of my photos. But I got some strange issues here. Actually I am able to recovered all photos. But only old photo (mean 1 or 2 years back) are recovered in full size (3-5MB), the latest photos (all 2013) were recovered in 30-100KB only. From thumbnail and the mega tag, I am able to see the image and information. But when I open the image file. Its look like fragments. Since the day I accidentally deleted the photos, I had never use this SD card anymore to avoid data overlap. But I really dont understand why I can recovered those old photos, the latest photos all is fragments?


Text-based mail client with usability

I have fond memories to using `pine` and `emacs/rmail` for reading mail in the 90's. At some point I switched over to Gmail plain HTML, but I recently realized I really miss navigating mail with cursor keys, replying with R, etc. And that QUICK, QUICK response to every action that did not involve an HTTP request to some far-off server. With this in mind, I tried `alpine` and `mutt` a year ago, and they were extremely complex things. A million settings, and they insisted on downloading my 100.000 emails from Gmail, which of course took forever, and searching was dead slow, and there were so many ways to get lost. What I suspect, is that UNIX mailers are super-complex, historical beasts trying to cater for every UNIX guru's possible need, with configuration files that require a Ph. D. in astrophysics. What I'm wondering is, has someone who has taken the following approach: Make a lightweight, text-based email client for UNIX terminals, but with great simplicity and usability for everyday tasks such as replying/deleting/forwarding mail, threading, super-fast searches even for huge mailboxes, and simply for getting quickly through your inbox. And yeah, some brilliant, seamless way of viewing attachments (this being a text-based environment). Sort of a "take the best from the minimalism from UNIX and combine it with the usability of the modern Web" kind of approach. I think I would start crying if someone had actually made this.


How to use expandos in backtick shell command

In my `.muttrc` I have `attribution` set to emulate Outlook-style message quoting like this:               set attribution="\n\n-----Original Message-----\nFrom: %f\nSent: %d\n%t\nSubject: %s\n"      However, the `%t` expando evaluates to "To Persons_Name" with no colon after the "To" so I'd like to run it through a shell command to add the colon. I can use backticks to run a shell command but I can't figure out how to get the value of the `%t` expando in the shell command. I've tried this but it doesn't work:               set attribution="\n\n-----Original Message-----\nFrom: %f\nSent: %d\n`echo %t | sed s/^To/To:/`\nSubject: %s\n"


Tool to compare 2 excel sheets in linux

I want to be able to compare 2 excel sheets in linux. I am not interested in converting them to `csv` format as they have a complicated formating that is not supported in `csv`. I would like to be able to have a graphical comparison (some sort of `kompare` way). The tool should be available in linux platform. Any ideas ?


log freeradius ip address with username

i configured a mikrotik with linux(freeradius+rsyslog+mysql) to authenticate and log users activity. now i want to log users visited urls, but only ip addresses of users and visited urls are logged. what should i do if i want to log usernames + visited urls in my database? users ----------> mikrotik -----> Linux_Box (freeradius + rsyslog + mysql) **is there another way rather than assigning ip addresses to usernames?**


how to subtract a constant value from a data file?

I want to subtract a constant number from my data to get new data file. For example, I want to subtract 10 from my data. data.txt               Id  a   b   c   d   e     1   1   2   3   4   5     2   2   3   4   5   6     3   3   4   5   6   7     4   4   5   6   7   8     5   5   6   7   8   9     6   6   7   8   9   10     7   7   8   9   10  11     8   8   9   10  11  12     9   9   10  11  12  13     10  10  11  12  13  14     11  11  12  13  14  15     12  12  13  14  15  16     13  13  14  15  16  17     14  14  15  16  17  18      Required output: out.txt               Id  a   b   c   d   e     1   -9  -8  -7  -6  -5     2   -8  -7  -6  -5  -4     3   -7  -6  -5  -4  -3     4   -6  -5  -4  -3  -2     5   -5  -4  -3  -2  -1     6   -4  -3  -2  -1  0     7   -3  -2  -1  0   1     8   -2  -1  0   1   2     9   -1  0   1   2   3     10  0   1   2   3   4     11  1   2   3   4   5     12  2   3   4   5   6     13  3   4   5   6   7     14  4   5   6   7   8


PPTP VPN client connectivity not working

I am trying to connect to my VPN from my `tonidoplug`. I followed the steps found in PPTP Client. But I am getting the below error now:               $ sudo pon codeme debug dump logfd 2 nodetach     Couldn't open the /dev/ppp device: No such device or address /usr/sbin/pppd: Please load the ppp_generic kernel module.      From what I found somewhere in the Internet I tried adding the line `alias char-major-108 ppp_generic` to my `/etc/modprobe.d/modules.conf` file and rebooted the device. Still am not able to connect to VPN.


pam.d password hardening: nullok

In most all pam.d documentation or linux distributions that I saw, the recommend "secure" configuration for password is the following:               password    required    pam_unix.so sha512 shadow nullok rounds=65536      looking up the documentation for "nullok", i found the following:               The default action of this module is to not permit the user access to a service if their official password is blank. The nullok argument overrides this default.      So IMO, it should be disabled, **null passwords aren't ok**. So the question are:   * will it break something?    * maybe system accounts (however, they are normally disabled) won't work anymore?    * Any known issue?


Difference between the terminal file and the terminal screen

I recently posted a question about terminals and this seemed like it deserved its own question. If the **tty** which would be **synonymous with terminal** , is just the device driver/device file itself, _what provides the actual interface to the terminal, and what is it called?_ I don't mean the gui in any way, I mean the actual area (either in a virtual terminal or a possibly a psuedo-terminal) where text is being printed and read. _Is this considered a part of the terminal? Are these in some way controlled by the kernel? Basically if someone wanted to write a console program, like gnome-terminal (or even with virtual terminals), is there some sort of kernel based widget/interface that takes input and output? **Basically is the tty (itself i.e. /dev/tty) just a file or does it include the code needed to display output (in various colors and weights), and read from the keyboard._** Is this correct: I found here What is the exact difference between a 'terminal', a 'shell', a 'tty' and a 'console'? that is says tty is synonymous with terminal. This is what is confusing me. I would think that to emulate a terminal or to provide a terminal, would require the terminal driver (tty) and the terminal display and interactive part (something like xterm). So by itself the tty is simply a driver for input and output, and what displays and reads the text from and to the tty is something like xterm? Would be calling the "/dev/tty a terminal driver" also be correct? Also when I say xterm I mean the value of the $TERM var. Another thought (let me know about this one): The tty file is synonymous with the connection between the terminal or these day terminal emulator, and the shell. Now they are all in the same box, but the original terminals would be the terminal emulators of today (clearly), but the tty or tty files would sort of act like the serial connection between the terminal and the shell/operating system. These days it seems like to me the terminal emulator is an environment/window for interacting with the /dev/tty... files and the shell sits at the other side? So writing to the /dev/tty file would be like writing to or reading form the serial port? I'm assuming this is not exactly how it works, any help would be greatly appreciated :-(.


MongoDB "service" on clean Redhat can not be started

I just bring up `Redhat 6.5 64-bit` from AWS and did the below things:   * Disabled SELinux   * Disabled Iptables   * All ports opened in Security Group   * Rebooted Then i just followed, both of the below instructions:   * http://docs.mongodb.org/manual/tutorial/install-mongodb-on-red-hat-centos-or-fedora-linux/   * http://docs.mongodb.org/manual/tutorial/install-mongodb-enterprise-on-red-hat-or-centos/ I tried the both Links separately after clean installations again.   Here is the version:               [root@www.example.com ~]# mongod --version     db version v2.6.4     2014-08-19T04:35:58.234-0400 git version: 3a830be0eb92d772aa855ebb711ac91d658ee910      **THEN HERE IS THE PROBLEM** :               [root@www.example.com ~]# service mongod start     Starting mongod:                          [FAILED]      And here are the logs:               [root@www.example.com ~]# tail /var/log/mongodb/mongod.log     2014-08-19T04:30:07.669-0400 [initandlisten] shutdown: going to close sockets...     2014-08-19T04:30:07.669-0400 [initandlisten] shutdown: waiting for fs preallocator...     2014-08-19T04:30:07.669-0400 [initandlisten] shutdown: lock for final commit...     2014-08-19T04:30:07.669-0400 [initandlisten] shutdown: final commit...     2014-08-19T04:30:07.669-0400 [initandlisten] shutdown: closing all files...     2014-08-19T04:30:07.669-0400 [initandlisten] closeAllFiles() finished     2014-08-19T04:30:07.669-0400 [initandlisten] journalCleanup...     2014-08-19T04:30:07.669-0400 [initandlisten] removeJournalFiles     2014-08-19T04:30:07.671-0400 [initandlisten] shutdown: removing fs lock...     2014-08-19T04:30:07.671-0400 [initandlisten] dbexit: really exiting now      This is quite a very clean installation.   What is happening please. Note:               [root@www.example.com ~]# ll /var/lib/mongo/mongod.lock      -rwxr-xr-x. 1 mongod mongod 0 Aug 19 04:32 /var/lib/mongo/mongod.lock


Multiple Command List After Shell Conditionals, &&, ||. Shell Script, Dash

I'm trying to do multiple commands after a condition, so for example...               [ $VAR ] || echo "Error msg" ; echo "exit"      and the Inverse               [ -z $VAR ] &&  echo "Error msg" ; echo "exit"      I know that won't work as intended, I actually knew how previously and forgot how to do this. I'm fully aware of the many alternatives, such as using `if`'s or bracketing via `()` and `{}` . Using `()` will create a sub process which wouldn't exit a running script. Using `{}` will work, but I know a more readable alternative exists. I have done this with a `:`, and it was perfect!!! I just can't remember now for the life of me, and I lost that previously written script. If anyone knows how to write this with the `:`'s, I would really appreciate any help!


Why use a pts for xterm or anything

I keep reading on multiple sites that pts device files are used for pseudo- terminals which are "not directly connected to the hardware" (ssh, telnet). _Since xterm running on you machine is directly connected the output on your keyboard and the display on your screen, why does this use a pseudo-terminal device file?_ I read the other question regarding ttys pts, ... and it didn't seem to cover this.. _Also, what is the need for a "pseudo terminal," if it's ultimately a device file with input and output why does it matter what it's coming from?_ Thanks in advance


Dell XPS 15 runs hot on linux

I'm worried about my Dell XPS notebook. When I'm on Linux, its temperature is always higher than on Windows. I was facing some pretty ugly slowdowns earlier today and it shut itself down the first time today too (then I noticed it was really hot). I'm on openSuse 12.1 currently, but on Ubuntu (10.10, 11) and Mint (Lisa, I think) I got worried about the notebook being too hot too. I know there's the Optimus stuff but I'm thinking this is not the answer I need, I'm on linux most of the time because I'm working and browsing and I switch to Windows only when I'll play something so I'm not worried about running Minecraft or anything too graphical on linux. I'm worried about it overheating, slowing down, shutting down and eventually breaking. Lets go to the numbers. `sensors` in openSuse 12.1 running gnome-shell (probably was higher when I had slow downs/shut down)               temp1: +84.0°C (crit = +100.0°C)     temp2: +84.0°C (crit = +100.0°C)          nouveau(GPU)          temp1: +73.0°C (high = +100.0°C, crit = +110.0C      `sensors` in openSuse 12.1 with iceWM (lighter graphical interface)               temp1: +74.0°C (crit = +100.0°C)     temp2: +74.0°C (crit = +100.0°C)          nouveau          temp1: +68.0°C (high = +100.0°C, crit = +110.0°C)      On Windows, CPU stays between 40°C-50°C and GPU in the mid 50°C. I'm guessing 84°C is too high. `lspci`               00:00.0 Host bridge: Intel Corporation 2nd Generation Core Processor Family DRAM Controller (rev 09)     00:01.0 PCI bridge: Intel Corporation Xeon E3-1200/2nd Generation Core Processor Family PCI Express Root Port (rev 09)     00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)     00:16.0 Communication controller: Intel Corporation 6 Series/C200 Series Chipset Family MEI Controller #1 (rev 04)     00:1a.0 USB Controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #2 (rev 05)     00:1b.0 Audio device: Intel Corporation 6 Series/C200 Series Chipset Family High Definition Audio Controller (rev 05)     00:1c.0 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 1 (rev b5)     00:1c.1 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 2 (rev b5)     00:1c.3 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 4 (rev b5)     0    0:1c.4 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 5 (rev b5)     00:1c.5 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 6 (rev b5)     00:1d.0 USB Controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #1 (rev 05)     00:1f.0 ISA bridge: Intel Corporation HM67 Express Chipset Family LPC Controller (rev 05)     00:1f.2 SATA controller: Intel Corporation 6 Series/C200 Series Chipset Family 6 port SATA AHCI Controller (rev 05)     00:1f.3 SMBus: Intel Corporation 6 Series/C200 Series Chipset Family SMBus Controller (rev 05)     01:00.0 VGA compatible controller: nVidia Corporation Device 0df5 (rev a1)     03:00.0 Network controller: Intel Corporation Centrino Wireless-N 1000     04:00.0 USB Controller: NEC Corporation uPD720200 USB 3.0 Host Controller (rev 04)     06:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 06)      So what to do? Is the GeForce card always running here (Linux) while on Windows it's on the Intel GPU?   If so, can I make it so it will only always on the Intel card? Can this help? Will I lose graphics acceleration (and gnome-shell) in this case? Edit: I had uninstalled Nouveau Nvidia driver in hopes that it would turn the Nvidia card off to see if I had a better luck. I don't know if this is related but just now my notebook was idle, I was watching a movie, and then came back to my laptop to check on it on imdb. I had a terminal open and 2 or 3 tabs of chrome, on gnome-shell, and when I ran `sensor` CPU was at 98.0°C, and GPU at 92.0°C... Edit: @Icarus I'd guess it's the second option, before when it was slowing down I was running top and the 'offending' processes were Chrome and Gnome- shell, but really it was probably the CPU/GPU getting too hot and lagging, it doesn't make much sense because this is a potent notebook, I play Battlefield 3 on 64 person maps without any problems Edit-part-two: I've switched the Nouveau driver to the proprietary Nvidia one, Ive lost graphic acceleration(this has always happened when using Nvidia driver on this notebook) but 'sensors' now is constant on 74.0°C and I can at least feel confortable enough to work here... I'm intrigued because there's got to be more people on this new Dell XPS running linux, but it's being way hard to find any useful info on this...


What Linux distro is good for music and well supported?

I'm pretty disappointed with Ubuntu. It's never been easy to sort out the mess that is Alsa / Jack / whatever and have it work with Pd, Supercollider, Ardour, Lillypad. I've upgraded to the latest and a) it immediately broke some audio software I was writing in openFrameworks (just stopped compiling, complaining about rtaudio), b) there seems to be no real-time kernel any more, and c) the audio I did get working is noisy. Does anyone out there make and support a good Linux distro that "just works" (ie. sets up whatever needs to be set up in terms of Alsa / Jack / etc.) that ensures that my (in principle) fast computer can actually generate clean sound? If not, what's the impediment? Is there some reason that audio can't be brought under control the way that different GUIs were in the past?


How to Install Oracle Java7 in Ubuntu13.04

I am trying to install Java 7 in Ubuntu 13.04 using this tutorial. > ## Preparing your system > > First you need to remove openjdk for this run the following command from > your terminal   >  `sudo apt-get purge openjdk*` > > If you installed java 7 from any other PPA and you are having problem with > java then you have to do following steps before installing the PPA > menctioned here   >  ` sudo rm /var/lib/dpkg/info/oracle-java7-installer* sudo apt-get purge > oracle-java7-installer* sudo rm /etc/apt/sources.list.d/*java* sudo apt-get > update` > > ## Install Oracle Java 7 in Ubuntu 13.04/12.10/12.04 > > Open the terminal and run the following commands > > ` sudo add-apt-repository ppa:webupd8team/java sudo apt-get update sudo apt- > get install oracle-java7-installer` All goes well until I reach the point:               sudo apt-get install oracle-java7-installer      Then I just get the error message               E: Unable to locate package oracle-java7-installer      What is the problem that is causing this?


Checking video card load via command line

Is there a command like `cpustat` or `iostat` or `memstat`, but for the video card? Or some indication in `/proc` or `/sys`?


match just one row in two files and return the whole column from file 2

If I have two files file1:               Reference Position     905894     1197693     3703749     92108275     114940633     114940633      file2:               Mapping  Reference Position Type    Length  Reference   Allele  Linkage Zygosity    Count     1 mapping   877831  SNV 1   T   C       Homozygous  48     1 mapping   883625  SNV 1   A   G       Homozygous  23     1 mapping   905894  SNV 1   C   T       Heterozygous    41     1 mapping   909768  SNV 1   A   G       Homozygous  85     1 mapping   1153944 SNV 1   T   G       Heterozygous    65     1 mapping   1197693 SNV 1   G   A       Heterozygous    23     1 mapping   1276973 SNV 1   G   C       Heterozygous    4     1 mapping   1276974 Insertion   4   -   ACAC        Heterozygous    52     1 mapping   1277533 SNV 1   T   C       Homozygous  73      I want the reference positions in both files to match and return the whole column in file 2 that matches with file 1.


Move and resize partitions proportionally

I have a clonezilla image from a disk with GPT, and I want to clone to a larger disk and then resize the partitions proportionally. By example if I have a 100 Gb disk and two partitions of 40 an 60 Gb, I want to make a clone to another disk of 200 Gb with the result of a 80 and a 120 Gb partitions. With clonezilla the only way that you can do this is with the -k1 option but only works with MBR disks, is there any other posibility to do this? Maybe the only option is to do a script to:   * View partitions and its porcentages (parted -l?)   * Calculate the new space   * Move the partitions (parted move?)   * Resize the partitions (parted resize?)   * Rebuild the filesystem (e2fsck -f && resize2fs /dev/sdaX)


Segmentation faults during compilation - where to begin?

I have a particular problem I need solved right now, but I'd really like to know a good strategy for approaching this type of problem - segmentation faults when compiling other people's code, so I'm happy for either particular or general type answers. ### The particulars I'm trying to install OpenSSL 1.0.1g on a Synology DS412+. The version of GCC I've got (v4.2.1) doesn't have 64bit compiled in, which OpenSSL complains about:               $ ./config --prefix=/opt         \                --openssldir=/etc/ssl \                --libdir=lib          \                shared                \                zlib-dynamic     $ make      snip!               cryptlib.c:1: sorry, unimplemented: 64-bit mode not compiled in     cryptlib.c: In function 'OPENSSL_ia32cap_loc':     cryptlib.c:677: warning: dereferencing type-punned pointer will break strict-ali     asing rules     make[1]: *** [cryptlib.o] Error 1      _So_ , I'm trying to install GCC 4.8.2 (I've tried several versions now) and each time it appears to fail in the GMP portion of the `make`. It's happened so much I decided to download GMP and try compiling that:               $ ./configure --prefix=/opt --build=i386-pc-linux-gnu     $ make          ./gen-fac 32 0 >fac_table.h || (rm -f fac_table.h; exit 1)     /opt/bin/bash: line 1: 20507 Segmentation fault      (core dumped) ./gen-fac 32     0 > fac_table.h     make: *** [fac_table.h] Error 1      I'm not a C programmer, and this isn't even my code so the likelihood of me whipping out Valgrind to inspect the core is low. I've had this happen plenty of times compiling libraries, and learning C isn't something that's on my priority list. Are there alternatives to...?   * learning C   * asking on a forum/mailing list The only package manager I have got access to is ipkg, and it provided the GCC that's not up to full muster. Could I set up a VM, build a binary for ipkg and put it on the DS412? Having not done something like that before, I don't know how feasible it is. Any help or insight is much appreciated.


How do I configure syslinux to boot immediately

I'm tweaking a Debian live system (built with live-build), and I want it to boot straight into the system from syslinux — no menu, no timeout. According to the syslinux documentation, a timeout value of 0 means that the timeout is disabled, ie. it won't boot at all without user intervention, which is the opposite of what I want. It might be nice to be able to hold down a key for those rare occasions where I **do** need to tweak the kernel line, but that's not essential. Really I just want an immediate boot. How do I get it? The current syslinux configuration is this: **syslinux.cfg** :               include menu.cfg     default vesamenu.c32     prompt 0     timeout 0      **menu.cfg** :               menu hshift 0     menu width 82          menu title Boot menu     include stdmenu.cfg     include live.cfg     include install.cfg     menu end      **stdmenu.cfg** :               menu background splash.png     menu color title    * #FFFFFFFF *     menu color border   * #00000000 #00000000 none     menu color sel      * #ffffffff #76a1d0ff *     menu color hotsel   1;7;37;40 #ffffffff #76a1d0ff *     menu color tabmsg   * #ffffffff #00000000 *     menu color help     37;40 #ffdddd00 #00000000 none     menu vshift 17     menu rows 10     menu helpmsgrow 15     # The command line must be at least one line from the bottom.     menu cmdlinerow 16     menu timeoutrow 16     menu tabmsgrow 18     menu tabmsg Press ENTER to boot or TAB to edit a menu entry      **live.cfg** :               label live-         menu label ^Live ()         menu default         kernel /live/vmlinuz         append initrd=/live/initrd.img boot=live config quiet ipv6.disable=1 console=tty0 console=ttyS0,115200n8      **install.cfg** : empty


Make a USB drive bootable for Windows 7 setup

What is the equivalent of `bootsect` command available in Windows, on a *nix system? **Usage:** In order to make a USB drive bootable for Windows 7 setup I have to boot-up VMWare and run `bootsect.exe /nt60 e: /force` (`e:` being the USB drive). So was wondering if I could perform that particular operation natively.


Not able to install internet explorer!

I followed this link for installing Internet explorer. A GUI opens when I run the following command:               ravbholua@ravbholua-Aspire-5315:~/ies4linux-2.99.0.1$ pwd     /home/ravbholua/ies4linux-2.99.0.1     ravbholua@ravbholua-Aspire-5315:~/ies4linux-2.99.0.1$ ./ies4linux     IEs4Linux 2 is developed to be used with recent Wine versions (0.9.x). It seems that you are using an old version. It's recommended that you update your wine to the latest version (Go to: winehq.com).      Please note the message after running the above command. But I don't think mine is old version as mentioned above. Please see below to know my version:               ravbholua@ravbholua-Aspire-5315:~/ies4linux-2.99.0.1$ wine --version     wine-1.7.4      Mine is latest version. Now in the GUI, I select IE6 to install. But it fails to install and I get the below error:               An error ocurred when downloading. Please run IEs4Linux again. Corrupted file: ie6/EN-US/VGX.CAB      Please say how to then install IE?


what is the zsh equivalent of bash's export -f

So I started using `zsh`. I like it all right. It seems very cool and slick, and the fact that the current working directory and actual command line are on different lines is nice, but at the same time, I'm noticing that `zsh` can be a bit slower than `bash`, especially when printing text to the screen. The thing I liked best was the fact that `zsh` was 'backward compatible' with all of the functions I defined in my `.bashrc`. One gripe though. The functions all work perfectly, but I can't figure out how the exporting system works. I had some of those `.bashrc` functions exported so that I could use them elsewhere, such as in scripts and external programs, with `export -f`. In zsh, exporting doesn't seem to even be talked about. Is it autoloading? Are those two things the same? I'm having a seriously hard time figuring that out.


Is there a tool to view and edit ,iso files like PowerISO?

I am looking for a archive manager that will allow me to look into the contents without needing to mount it and also to add or remove contents by drag and drop style. The Windows' equivalent would be PowerISO, MagicISO or even 7-zip. Many people suggested mounting and then copying into another directory, add/remove files, and make image again. Is that the only way?


Is there any solution Like SharePoint in Linux?

We have three server SharePoint , Project Server and CRM and we want to change them and migrate to Linux solutions. Now we have to change SharePoint by Linux solution ? we want to have a solution for **collaboration management** and **document management**


how to use grep for specific files?

for example I type               ls -altr | grep "23 Dec"      so it will show files for 23 Dec only and I want to use grep for them, like               ls -altr | grep "23 Dec" | xargs grep -l "some_string"      but this doesn't work) How to do that?


Access the Shift-Insert clipboard from script

How do I access the Shift-Insert (paste) clipboard from a script? You can see what I use here. **Edit** : A demonstration how it works, with `xclip`:               echo hello | xclip -selection secondary     xclip -o -selection secondary      **Edit 2** : Just implemented the solution below. This will make my life so much easier so I thought I'd share it. First, the script `pst`:               #!/bin/zsh          echo -n `xclip -d ":0" -o -selection clipboard`      then, in `.emacs`:               (defun pst ()      "Inserts the X clipboard (xclip -d :0 -o -selection clipboard) at     point. `M-1' (the '(1)) to insert in the current buffer."       (interactive)       (shell-command "pst" '(1))       (end-of-line) )      Now, in any tty, paste with `pst`, in Emacs (anywhere, but specifically in a tty, as in X, you already have Shift-Insert) `M-x pst`.


Setting up a minimal apt-get environment

I would like to set up a minimal environment with `apt-get` then selectively install packages one at a time. My understanding is that this is basically what the Debian installer does. Is this understanding accurate? If so, is it possible to have the installer (or some other program the installer uses) install only the bare minimum necessary to run apt-get? If not, how difficult would it be to build such an environment? Some notes:   * Some software I presume I will end up installing include:      * a standard file system with commonly required directories (e.g. `/dev`, `/bin` etc.)     * a boot-loader (e.g. Grub2)     * shell and minimum utilities to get around including init (e.g. coreutils or busybox, udev, and other utils that I imagine might be hard to get, or necessary for using apt-get)     * dpkg and other tools closely related to apt-get   * In particular, I don't necessarily need:      * network drivers (If necessary, I am hoping I can use a USB drive to move .deb packages and the necessary drivers around)     * logging daemons (I am hoping I can install these through apt-get)     * In general, anything that isn't required for running apt-get (or running the system), and can be easily installed through apt-get.   * In a previous adventure, I have had some success with creating a bootable environment running with busybox (with a lot of great help from unix.SE). However, due to my computer incompetency, it ended up with many rough edges (e.g. Grub wasn't installed properly so I have to enter grub prompt to boot properly; I never got a proper build environment installed; all installed programs are static; etc.).   * This time, I am hoping to obtain something that can easily evolve into something similar to a typical Debian, Ubuntu, or other full blown apt-get based distro through repository settings and a sequence of apt-get commands. As wimpy as it sounds, I would prefer to have as much automated, or prepackaged as possible (i.e. not LFS if it can be helped), as I would like to focus on roughly which packages are installed, rather than on how they are installed.


Any other distro offer like Ubuntu Software Centre?

I want to know does any other linux disto offer anything close to Ubuntu Software Centre? Some of the features I like about it is A) Sandboxing B) Ability to search any of the libs/apps with screenshot(if any) and description. [ Been a while since using Ubuntu - I remember _this_ description form when I was launched. And please DO NOT recommend Ubuntu :) ] I am ok with using yum and apt-get. But for graphical package kit I am not that impressed with what Fedora/Opensuse have in PackageKit. Half of the time it updates and when you search for anything you hardly find them. Finally have to resort to yum. So has any other linux distro got it better than Fedora and Opensuse?


Fast and Small C++ https proxy

I'm looking for a small, fast, and reliable https proxy that I can extend to do the following:   1. Look for https handshake requests.   2. Run a regular expression against the host name being requested.   3. If the expression matches the host name then don't send the request on but respond with a 302 redirect to a different site. So, I guess I have the following questions about this:   1. Is this possible? (I'm pretty sure the handshake request is not encrypted, I know I can do some pattern matching, the real question is...would I be able to send a fake 302 redirect to the client without it complaining about not having completed the handshake?)   2. If it is possible, is there a linux app out there that does some or all of this? (I found this: http://www.kubat.nl/pages/microproxy) I was considering trying to build the remaining features into it but didn't want to try that if something else already does it.   3. Do you have suggestions for other C++ Linux proxies I might be able to build this into? Thanks in advance for your feedback. EV


Get process list with logical intersection of selectors?

The Linux `ps` command allows multiple selectors, such as user and command name, but always returns the logical OR of those selectors (more than I want). Does anyone know of a method or tool already made that can get the intersection (AND) of process selectors?


Which Linux distro supports GNOME 3 by default?

I was planning on installing a new Linux distribution and I am thinking of trying GNOME 3 interface. Other than Fedora 16 (which has GNOME 3 as default) which other distro supports it? I know it can be installed from the repository, but I tried the GNOME 3 on OpenSuse and had hard time running it; it never really integrated fully. So would be good to know what distro supports GNOME 3 seamlessly. Any other distro than Fedora and Mint linux? (Not so keen on Mint so looking for others)


download only first few bytes of a source page

I am downloading the HTML source page of a website using `cURL` command. The problem is, I do not want most of the contents in the page. I just need the first 100 lines of the source page. Is there a way to stop the download of the page after first few lines? Currently, I have the below command working but it does not seem to be time effective.               curl -r[0-1] "http://www.freebase.com/m/045c7b" > foo.txt      I tried changing the value from `1` to `.5` and `.05` and still the entire web page is getting downloaded. I am looking at time less than a second to execute the above command. **EDIT** From the man page of `cURL`, I see that " _You should also be aware that many HTTP/1.1 servers do not have this feature enabled, so that when you attempt to get a range, you'll instead get the whole document._ " So if the server is not supporting the range querying, is there some other command in `nix` environment which will help me accomplishing what am trying to do?


Debugging bash functions

So here I have a simple function that I wish to debug. However, I am unable to debug the desired function even with `set -o functrace` enabled. Before resorting to asking this question, I had managed to find a possible solution that did not produce the desired results, which is located here. How can I get bash debug my functions?               #!/bin/bash     echo "Hello World"     hello() {         echo "Hello world"     }      output:               user@mac11:53:29~/desktop bash -x debug.sh      + echo 'Hello World'     Hello World     user@mac11:54:55~/desktop


Lost ls directory highlighting after a crash

Normally commands such as `ls` and `grep` offer nice syntax highlighting for me. But my system crashed (running an ubuntu VM) and after I restarted, I no longer have this highlighting, it's all a dreary grey. Nano, however, notably does do it's normal highlighting. I don't know where to start looking for why I don't have directory highlighting any more, or why grep doesn't highlight matched lines any more.


/opt/nvidia-smi from nvidia-drivers pack outputs "failed to load nvidia kernel module"

Actually I have nouveau string in make.conf. "Nvidia-smi has failed because it couldn't communicate with NVIDIA driver. Make sure that latest NVIDIA driver is installed and running."


How to mount a disk from destroyed raid system?

I have a horrible situation where I have to restore data from damaged raid system in a rescue Debian Linux. I just want to mount them all to /mnt/rescue in read only modus to be able to copy VMWare GSX images to another machine and migrate them to ESXi later on. The output for relevant commands is as follows.               fdisk -l          Disk /dev/sda: 1500.3 GB, 1500301910016 bytes     255 heads, 63 sectors/track, 182401 cylinders     Units = cylinders of 16065 * 512 = 8225280 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x0005e687             Device Boot      Start         End      Blocks   Id  System     /dev/sda1               1         523     4200997   fd  Linux raid autodetect     /dev/sda2             524         785     2104515   fd  Linux raid autodetect     /dev/sda3             786      182401  1458830520   fd  Linux raid autodetect          Disk /dev/sdb: 1500.3 GB, 1500301910016 bytes     255 heads, 63 sectors/track, 182401 cylinders     Units = cylinders of 16065 * 512 = 8225280 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x00014fc7             Device Boot      Start         End      Blocks   Id  System     /dev/sdb1               1         523     4200997   fd  Linux raid autodetect     /dev/sdb2             524         785     2104515   fd  Linux raid autodetect     /dev/sdb3             786      182401  1458830520   fd  Linux raid autodetect          Disk /dev/md0: 4301 MB, 4301717504 bytes     2 heads, 4 sectors/track, 1050224 cylinders     Units = cylinders of 8 * 512 = 4096 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x00000000          Disk /dev/md0 doesn't contain a valid partition table          Disk /dev/md1: 2154 MB, 2154954752 bytes     2 heads, 4 sectors/track, 526112 cylinders     Units = cylinders of 8 * 512 = 4096 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x00000000          Disk /dev/md1 doesn't contain a valid partition table      I was trying to mount the disks as follows.               mount -o ro /dev/sda1 /mnt/rescue      Then I get following error.               mount: unknown filesystem type 'linux_raid_member'      Guessing file system is not going well either.               mount -o ro -t ext3 /dev/sda1 /mnt/rescue/     mount: /dev/sda1 already mounted or /mnt/rescue/ busy      So I tried to create a virtual device as follows.               mdadm -A -R /dev/md9 /dev/sda1      This results in the following message.               mdadm: cannot open device /dev/sda1: Device or resource busy     mdadm: /dev/sda1 has no superblock - assembly aborted      Now I am lost, I have no idea how to recover the disks and get the data back. The following is the output of mda --examine for all 3 disks (I think it should be 3x raid1 disks). /dev/sda1:                         Magic : a92b4efc             Version : 0.90.00                UUID : 6708215c:6bfe075b:776c2c25:004bd7b2 (local to host rescue)       Creation Time : Mon Aug 31 17:18:11 2009          Raid Level : raid1       Used Dev Size : 4200896 (4.01 GiB 4.30 GB)          Array Size : 4200896 (4.01 GiB 4.30 GB)        Raid Devices : 3       Total Devices : 2     Preferred Minor : 0              Update Time : Sun Jun  2 00:58:05 2013               State : clean      Active Devices : 2     Working Devices : 2      Failed Devices : 0       Spare Devices : 0            Checksum : 9070963e - correct              Events : 19720                     Number   Major   Minor   RaidDevice State     this     1       8        1        1      active sync   /dev/sda1             0     0       0        0        0      removed        1     1       8        1        1      active sync   /dev/sda1        2     2       8       17        2      active sync   /dev/sdb1      /dev/sda2:                         Magic : a92b4efc             Version : 0.90.00                UUID : e8f7960f:6bbea0c7:776c2c25:004bd7b2 (local to host rescue)       Creation Time : Mon Aug 31 17:18:11 2009          Raid Level : raid1       Used Dev Size : 2104448 (2.01 GiB 2.15 GB)          Array Size : 2104448 (2.01 GiB 2.15 GB)        Raid Devices : 3       Total Devices : 2     Preferred Minor : 1              Update Time : Sat Jun  8 07:14:24 2013               State : clean      Active Devices : 2     Working Devices : 2      Failed Devices : 0       Spare Devices : 0            Checksum : 120869e1 - correct              Events : 3534                     Number   Major   Minor   RaidDevice State     this     1       8        2        1      active sync   /dev/sda2             0     0       0        0        0      removed        1     1       8        2        1      active sync   /dev/sda2        2     2       8       18        2      active sync   /dev/sdb2      /dev/sda3:                         Magic : a92b4efc             Version : 0.90.00                UUID : 4f2b3b67:c3837044:776c2c25:004bd7b2 (local to host rescue)       Creation Time : Mon Aug 31 17:18:11 2009          Raid Level : raid5       Used Dev Size : 1458830400 (1391.25 GiB 1493.84 GB)          Array Size : 2917660800 (2782.50 GiB 2987.68 GB)        Raid Devices : 3       Total Devices : 2     Preferred Minor : 2              Update Time : Sat Jun  8 14:47:00 2013               State : clean      Active Devices : 1     Working Devices : 1      Failed Devices : 1       Spare Devices : 0            Checksum : 2b2b2dad - correct              Events : 36343894                   Layout : left-symmetric          Chunk Size : 64K                Number   Major   Minor   RaidDevice State     this     1       8        3        1      active sync   /dev/sda3             0     0       0        0        0      removed        1     1       8        3        1      active sync   /dev/sda3        2     2       0        0        2      faulty removed          cat /proc/mdstat     Personalities : [raid1]     md2 : inactive sda3[1](S) sdb3[2](S)           2917660800 blocks          md1 : active raid1 sda2[1] sdb2[2]           2104448 blocks [3/2] [_UU]          md0 : active raid1 sda1[1] sdb1[2]           4200896 blocks [3/2] [_UU]      md2 seems to be damaged and it is probably the raid with my VMWare images. I would like to access the data from md2 (the data on the active and not damaged disk, that is /dev/sda3) by mounting it outside of the raid. Is it a good idea to just execute               mdadm --manage /dev/md2 --remove /dev/sda3       (would it even work as md2 is not seen by fdisk)? Should I re-assamble the other raids md0 and md1 by running               mdadm --assemble /dev/md0 /dev/sda1 /dev/sdb1      ? UPDATE 0: I am not able to assemble md0 and md2.               root@rescue ~ # mdadm --assemble /dev/md0 /dev/sda1 /dev/sdb1     mdadm: cannot open device /dev/sda1: Device or resource busy     mdadm: /dev/sda1 has no superblock - assembly aborted     root@rescue ~ # mdadm --assemble /dev/md2 /dev/sda3 /dev/sdb3     mdadm: cannot open device /dev/sda3: Device or resource busy     mdadm: /dev/sda3 has no superblock - assembly aborted      Mounting with mount -t auto is not possible.               root@rescue ~ # mount -t auto -o ro /dev/md0 /mnt/rescue/     /dev/md0 looks like swapspace - not mounted     mount: you must specify the filesystem type     root@rescue ~ # mount -t auto -o ro /dev/md2 /mnt/rescue/     mount: you must specify the filesystem type      Mounting /dev/md1 works but no VMWare data on it.               root@rescue /mnt/rescue # ll     total 139M     -rw-r--r-- 1 root root 513K May 27  2010 abi-2.6.28-19-server     -rw-r--r-- 1 root root 631K Sep 16  2010 abi-2.6.32-24-server     -rw-r--r-- 1 root root 632K Oct 16  2010 abi-2.6.32-25-server     -rw-r--r-- 1 root root 632K Nov 24  2010 abi-2.6.32-26-server     -rw-r--r-- 1 root root 632K Dec  2  2010 abi-2.6.32-27-server     -rw-r--r-- 1 root root 632K Jan 11  2011 abi-2.6.32-28-server     -rw-r--r-- 1 root root 632K Feb 11  2011 abi-2.6.32-29-server     -rw-r--r-- 1 root root 632K Mar  2  2011 abi-2.6.32-30-server     -rw-r--r-- 1 root root 632K Jul 30  2011 abi-2.6.32-33-server     lrwxrwxrwx 1 root root    1 Aug 31  2009 boot -> .     -rw-r--r-- 1 root root 302K Aug  4  2010 coffee.bmp     -rw-r--r-- 1 root root  89K May 27  2010 config-2.6.28-19-server     ...      UPDATE 1: I tried to stop md2 and md0 and assemble once again.               mdadm -S /dev/md0          root@rescue ~ # mount -t auto -o ro /dev/md0 /mnt/rescue/     /dev/md0 looks like swapspace - not mounted     mount: you must specify the filesystem type          mdadm -S /dev/md2          root@rescue ~ # mount -t auto -o ro /dev/md2 /mnt/rescue/     mount: you must specify the filesystem type      Any ideas? UPDATE 2: Assembling from one disk is not working due to following error message.               root@rescue ~ # mdadm -S /dev/md2     root@rescue ~ # mdadm --assemble /dev/md2 /dev/sda3     mdadm: /dev/md2 assembled from 1 drive - not enough to start the array.          root@rescue ~ # mdadm -S /dev/md2     mdadm: stopped /dev/md2     root@rescue ~ # mdadm --assemble /dev/md2 /dev/sdb3     mdadm: /dev/md2 assembled from 1 drive - not enough to start the array.      Even new raid fails.               root@rescue ~ # mdadm -S /dev/md9     mdadm: stopped /dev/md9     root@rescue ~ # mdadm --assemble /dev/md9 /dev/sda3     mdadm: /dev/md9 assembled from 1 drive - not enough to start the array.          root@rescue ~ # mdadm -S /dev/md9     mdadm: stopped /dev/md9     root@rescue ~ # mdadm --assemble /dev/md9 /dev/sdb3     mdadm: /dev/md9 assembled from 1 drive - not enough to start the array.      Creating new md disk fails too.               root@rescue ~ # cat /proc/mdstat     Personalities : [raid1]     md0 : active raid1 sda1[1] sdb1[2]           4200896 blocks [3/2] [_UU]          md1 : active raid1 sda2[1] sdb2[2]           2104448 blocks [3/2] [_UU]          unused devices: <none>     root@rescue ~ # mdadm -A -R /dev/md9 /dev/sda3     mdadm: failed to RUN_ARRAY /dev/md9: Input/output error     mdadm: Not enough devices to start the array.     root@rescue ~ # cat /proc/mdstat     Personalities : [raid1] [raid6] [raid5] [raid4]     md9 : inactive sda3[1]           1458830400 blocks          md0 : active raid1 sda1[1] sdb1[2]           4200896 blocks [3/2] [_UU]          md1 : active raid1 sda2[1] sdb2[2]           2104448 blocks [3/2] [_UU]          unused devices: <none>     root@rescue ~ # mdadm -S /dev/md9     mdadm: stopped /dev/md9     root@rescue ~ # mdadm -A -R /dev/md9 /dev/sdb3     mdadm: failed to RUN_ARRAY /dev/md9: Input/output error     mdadm: Not enough devices to start the array.      UPDATE 3: Removing disks from md2 is not working.               mdadm --remove /dev/md2 /dev/sda3     mdadm: cannot get array info for /dev/md2      UPDATE 4: Finally, running assemble with `\--force` hopefully did it. I am now copying files to another server.


scribus , in design and alternative application

We want to publish a electronic magazine according to `freesoftware applications` such as `gimp`, `inkscape`, `GNU\Linux` and so on.We need a magazine or book design application such as `In Design` of windows world, we found `scribus`, But `scribus` doesn't support `RTL` and our language has `RTL direction`. Do you have any suggesstion?


Easiest way to manage users for two machines

I'm administrating two ubuntu desktops and one debian server. There are abount ~20 active users on the desktops. A few (5-10) user accounts are added each year and about the same amount become inactive. I would like to share the user accounts and their respective homes between the two pcs. So far, my plan was to set up some kind of nfs + kerberos (+ldap/nis?), but I think kerberos is overly complicated for this simple purpose. In addition to that, the admin changes every ~2-3 years and I fear that complicated solutions will become unmaintainable for my successors (we are no professionals...). Is there a way to split up /etc/passwd etc. in different files, so I could store these on the server and copy them to the desktops? Or is there some PAM- module that provides a similar type of "modular" authentication ? (well, except pam_krb5). What would be the simplest way to achieve that?


Will formatting my drive TRIM my SSD?

Will a standard fresh linux (Ubuntu 11.10 to be exact) install and drive re- format (full) successfully TRIM my SSD, or do I need to do something extra? I know that ext4 will TRIM blocks on erase when I specify the `discard` option, but I want to start with a completely TRIMmed drive if possible.


Running a program automatically?

There is a Linux program I like which is Conky, when I run `conky -c mycustomconf.txt` it runs fine. I want this program to run automatically when I start my computer, without having to type in the command again to start it. How can I do this? I am using Ubuntu with Xfce4.


PXE boot with NFS: /sbin/init: No such file or directory

I'm trying to set up PXE boot with an ubuntu client.   * Created the dhcp-boot on my tomato router   * Added a tftp daemon on my FreeNas box   * Added a NFS mount on my FreeNas box   * Debootstrapped Ubuntu 11.10 to the NFS mount   * I've generated the vmlinuz and initrd from the debootstrap image and copied them to the tftp root.   * Created a pxelinux.cfg/default file in the tftp root pxelinux.cfg/default contains:               DEFAULT ubuntu-11.10          LABEL ubuntu-11.10     KERNEL vmlinuz-3.0.0-16-generic     APPEND root=/dev/nfs initrd=initrd.img-3.0.0-16-generic netboot=nfs nfsroot=192.168.1.160:/mnt/media/thinclient/base,nolock,ro ip=dhcp init=/linuxrc     ipappend 2      While booting my node/client it loads the vmlinux and initrd but "panics" while trying to load /sbin/init: ![Kernel panic](http://i.stack.imgur.com/XR9qS.jpg) I looked with tcpdump if the process is accessing my nfs server and I see data passing. Also, if I remove /proc or /dev from the image on my nfs server the node complains that it's missing the /dev and/or /proc directory. I've also tried passing init=/bin/bash but that threw the same kind of error. Why is my node throwing the `run-init: /sbin/init: no such file or directory` error?


Securely Deleting A File In Ram

I'm running a live distro in ram. I need to write a password to a file. Later, I need to delete it securely. I don't know how live file systems work, so I'm unsure if I open the file for writing, then write over it with data the length of the password, if it actually will write over that exact memory location or not. The goal is to securely delete the file by writing over it. I don't know if journaling happens in Live Linux distos. If so, is it possible to create a virtual file system in ram? I could then just write the password there and dd will securely write from beginnig to end of the volume. What are my options?


Excluding some of the commands from being getting stored in bash history

Is there any way to exclude commands like `rm -rf`, `svn revert` from being getting stored in bash history? Actually I, by mistake, have issued them a number of times even though I have no intent to do, just because I am doing things quickly and it happened. Hence results in lost of lots of work I have did so far.


Ubuntu install spanning multiple disks

Having to reinstall the operative system from scratch on an EeePC 901, which has two SSD disks, 4GB and 16GB, is it possible to install it using both disks as if they were one?


Lock on IBM DB2 database on Linux server

My db2 database is running on Linux server, Some time database table got lock by some of db user due to uncommiting the session. My question is that how we can find out through which machine/dbuser/ip database table got lock. if anyone have any idea abt same please help me


Is there an analog of apt-pinning in Fedora?

Apt pinning is a feature that allows to set install priority for a group of packages, determined by a number of attributes, such as package version, repository, distro version, etc. See man apt_preferences for more (http://linux.die.net/man/5/apt_preferences) Quote: > APT then applies the following rules, listed in order of precedence, to > determine which version of a package to install. > >   * Never downgrade unless the priority of an available version exceeds > 1000. ("Downgrading" is installing a less recent version of a package in > place of a more recent version. Note that none of APT's default priorities > exceeds 1000; such high priorities can only be set in the preferences file. > Note also that downgrading a package can be risky.) >   * Install the highest priority version. >   * If two or more versions have the same priority, install the most recent > one (that is, the one with the higher version number). >   * If two or more versions have the same priority and version number but > either the packages differ in some of their metadata or the --reinstall > option is given, install the uninstalled one. > Is there anything like that for Fedora? In other rpm-based distros?


Why do we need so many terminal emulator packages and what is their use?

This is something that has been so confusing to me for a long time.   I am using Linux but I have gaps in my understanding of certain aspects and one is about the terminal.   As I came to understand it what we mean with the console is an emulator of old terminals.   But I can not understand what is the deal with this.   As I read the best old terminals were the VT series and the vector graphics type (Tektronix).   So I assume that the current emulators emulate these.   Now my needs in Linux concerning display presentation has reached as far as using a colorscheme for vim and appreciating colors when doing diff in files.   But when I have issues I usually find advice to set `xterm-256` or `screen-256` etc.   Additionally when I do: `ls /lib/terminfo/` I see about a dozen of directories with configuration for (I assume) different kind of emulator types. So my question is, how does these `xterm-256` or `screen-256` and the rest fit in the idea of emulating just the top terminals in the past decades?   What is the need to have so many terminal types? Is it something I should look into more?   And why today with the modern technology need to emulate these old terminals like VT and not have something new? Perhaps my needs are too simple too appreciate the subtleties of this but it is has been something that puzzled me a lot. Since for instance if I have an issue with a colorscheme I just copy paste what I find in google about TERM etc without really understanding what am I doing or what is the problem. If someone helps me undertand this it would be really appreciated


How can I use my own snippets by using yasnippet in Emacs?

I installed yasnippet and it works fine with default snippets.But I can't add my own snippets. To expand a string `php` to `<?php ?>`, I've done like this. I wrote in my init file like this.               (require 'yasnippet)     (setq yas-snippet-dirs           '("~/.emacs.d/snippets"             "~/.emacs.d/site-lisp/yasnippet/snippets"             ))     (yas-global-mode 1)      I created `~/.emacs.d/snippets/web-mode/php.yasnippet` and wrote               # -*- mode: snippet -*-     # name: php tag     # --     <?php $1 ?>      and call function `yas-reload-all`. But I can't expand the string `php` in the web-mode. What am I doing wrong? What should I do something else?


How to send a file using xmodem protocol from the command line

Want to shell script this and my scripting skills are rather limited so please bear with me. Have scope attached to RX and TX lines of the serial port. If I do:               cat /dev/ttyS0      Get a steady stream of 'C' characters so the remote side is up and sending. If I do:               cat {filename} > /dev/ttyS0      I get a burst on TX line w/o any protocol. If I do the following:               /usr/bin/sx -vv -k -X -b -c send {filename}      TX line remains inactive. File is binary and expecting xmodem 1K protocol. What am I doing wrong? Nevermind. Apparently the magic is:               hello.uart1_divisor_change.xmodem.hex.no_pll0 > /dev/ttyS0 < /dev/ttyS0


Can't get kdelibs 4.10.0

I am compiling KDE Artikulate and it demanded a newer version of kdelibs. I downloaded kdelibs source and spent a night installing it. And again it is saying that it needs at least kdelibs 4.10.0 Error it shows is:               CMake Error at /usr/share/kde4/apps/cmake/modules/FindKDE4Internal.cmake:1390     (message):         ERROR: the installed kdelibs version 4.9.5 is too old, at least version         4.10.0 is required


mv failed halfway through - is source directory intact

I ran `mv a-folder /home/me` on a machine and half way through the move the destination device filled up. `a-folder` was made up of folders and files in various subdirectories. Does `mv` leave the source folder intact until the move has successfully completed? **The source and destination folders were on different filesystems.** The reason I ask is that I ran this command on the wrong machine, so if the source folder is intact then that makes my life a lot easier :)


Fedora 20: Anyway to install the default tools which comes with Fedora-Gnome on Cinnamon?

I just did a fresh install of Fedora 20 and chose Cinnamon as my desktop. To my surprise, Gnome was not install at all.. and thus I feel am I missing a bunch of "stuff" that's normally included in a default Fedora install (w. Gnome). Is there any way I can "fill the gaps" without actually installing the Gnome desktop itself? If so, how? If not, will installing the Gnome desktop itself give me what I am looking for; ie. all the stuff (apps, programs, options, etc) you would get in a default Fedora install? If so, then what's the best way to install the Gnome desktop in my situation?


iptables-restore just says “FAILED”

I am not sure what's wrong with my rule in the Iptables. I am actually trying to build a SSH server and following a cyberciti tutorial. My Iptables configuration looks like this:               # Firewall configuration written by system-config-firewall     # Manual customization of this file is not recommended.     *filter     :INPUT ACCEPT [0:0]     :FORWARD ACCEPT [0:0]     :OUTPUT ACCEPT [0:0]     -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT     -A INPUT -p icmp -j ACCEPT     -A INPUT -i lo -j ACCEPT     -A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT     -A INPUT -j REJECT --reject-with icmp-host-prohibited     -A FORWARD -j REJECT --reject-with icmp-host-prohibited     COMMIT     -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT      When I restart of iptables, this is the transcript:               [root@localhost raja]# service iptables restart     iptables: Setting chains to policy ACCEPT: filter          [  OK  ]     iptables: Flushing firewall rules:                         [  OK  ]     iptables: Unloading modules:                               [  OK  ]     iptables: Applying firewall rules: iptables-restore: line 14 failed                                                                [FAILED]     [root@localhost raja]#      I tried placing COMMIT at the end, but it didn't help:               [root@localhost raja]# cat /etc/sysconfig/iptables     # Firewall configuration written by system-config-firewall     # Manual customization of this file is not recommended.     *filter     :INPUT ACCEPT [0:0]     :FORWARD ACCEPT [0:0]     :OUTPUT ACCEPT [0:0]     -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT     -A INPUT -p icmp -j ACCEPT     -A INPUT -i lo -j ACCEPT     -A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT     -A INPUT -j REJECT --reject-with icmp-host-prohibited     -A FORWARD -j REJECT --reject-with icmp-host-prohibited     -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT     COMMIT     [root@localhost raja]# service iptables restart     iptables: Setting chains to policy ACCEPT: filter          [  OK  ]     iptables: Flushing firewall rules:                         [  OK  ]     iptables: Unloading modules:                               [  OK  ]     iptables: Applying firewall rules: iptables-restore: line 13 failed                                                                [FAILED]     [root@localhost raja]#      What's wrong? I am using CentOS 32-bit.


stdin/stdout names in BASH?

I have a program that takes a `-o log_file` option, which writes extra data to `log_file`. Is there any way for me to redirect that to stdout? i.e. is there a "special name" for stdout that can be used as a file name, like `CONOUT$` on Windows?


Find out what command I last ran that starts a certain way?

On bash commandline environment, you can do `!!` to rerun your last command. And you can press up arrow to see the the last command you ran. But what if you want to only **see** but not **run** the last command you ran that began in a certain way?


rsync dry-run not writing all information to log file

I am trying to get a log file for a dry-run of an rsync, but the actual file transfers are not showing up in the log file. My command is               rsync -aruzv --delete src/ usr@me.com:dest/ --log-file=rsyncLog.txt      My Log file looks like this:               2013/12/08 13:08:59 [30210] building file list     2013/12/08 13:09:14 [30210] 331080 files to consider     2013/12/08 13:09:32 [30210] .d..t.... Users/home/Dropbox/.     2013/12/08 13:09:37 [30210] .d..t.... Users/home/Dropbox      but my output in terminal also has lines like this which do NOT show up in the log file:               <f.st.... SystemFiles/rsync/rsyncLog.txt      How would I get lines like the above added to the log file for a dry-run (these lines appear on a regular run).


Cannot SSH after switching to Netgear router

I have Comcast Xfinity internet. When I was sent their Wifi router/Cable modem combo box, I was able to use SSH perfectly. However, since the Wifi from the box was weak, I decided to buy my own router: a Netgear WNR2500. I then called Comcast to put their router into "Bridge mode" so I can use the wifi from the netgear router. However, after that switch I can no longer SSH into my Amazon AWS instance. Here's the last lines of the log after running: ssh -vvv -i mypermissions.pem ec2-user@ec2- ***********.us-west-2.compute.amazonaws.com               debug1: channel 0: new [client-session]     debug3: ssh_session2_open: channel_new: 0     debug2: channel 0: send open     debug1: Requesting no-more-sessions@openssh.com     debug1: Entering interactive session.     debug2: callback start     debug2: fd 3 setting TCP_NODELAY     debug3: packet_set_tos: set IP_TOS 0x10     debug2: client_session2_setup: id 0     debug2: channel 0: request pty-req confirm 1     debug2: channel 0: request shell confirm 1     debug2: callback done     debug2: channel 0: open confirm rwindow 0 rmax 32768      This is on a Macbook Air, which worked before the router switch. However, using a Windows computer with PuTTY, everything works great, even now after the router switch. I'm really stuck and have been fighting with this problem for several days, so any help is tremendously appreciated!


Using dircolors, how do I change the color of my subversion folders

Below is a sample of my dircolors file, I want subversion folders (.svn) to be colored, but i guess the extension section only applies to file names. How do i set colors for directories with certain names?               NORMAL 00   # global default, although everything should be something.     FILE   00   # normal file     DIR    35   # directory     LINK   01;36    # symbolic link     FIFO   40;33    # pipe     SOCK   01;35    # socket     BLK    40;33;01 # block device driver     CHR    40;33;01 # character device driver          # This is for files with execute permission:     EXEC 01;32          # List any file extensions like '.gz' or '.tar' that you would like ls     # to colorize below. Put the extension, a space, and the color init string.     # (and any comments you want to add after a '#')     *~    01;33;41 # stuff we hate to find laying around (flashing red)     .svn  37     .cmd  01;32 # executables (bright green)     .exe  01;32     .com  01;32     .btm  01;32


Delete key doesn't work on command line

* _Note: I asked this same question on SuperUser, but didn't get any response. I now realize this is a more appropriate forum for this particular question._ In a ksh shell, the **Delete key doesn't work appropriately** on the command line. I get a ~ when I press Delete. How do I:   1. bind the functionality of _"Delete the character at the cursor"_ to the Delete keyboard button? (Control-D behaves like I expect the delete button to work and my attempts at using an alias were unsuccessful and likely naive.)    2. bind the functionality of " _Move to the first of the line"_ to the Home keyboard button? (Control A does this now, but I want Home to do it.)   3. bind the functionality of " _Move to the end of the line_ " to the End keyboard button? (Control E does this now, but I want end to do it.) **Final(?) Update** I stumbled across something that works, but I don't understand quite why. This works:               bind '^[[3'=prefix-2     bind '^[[3~'=delete-char-forward      According to http://www.qnx.com/developers/docs/6.3.2/neutrino/utilities/k/ksh.html#bind,               prefix-2     Key binding: ^X, ^[[     Introduces a 2-character command sequence.      So my **updated question is why do I need to use`prefix-2` for this?** Please translate for me so I can understand so I don't have to bug everyone again about this. OLD STUFF FOLLOWS **UPDATE** It turns out that ESC in QNX is `^[`. Using the command `bind '^[[3~'='delete- char-backward'` I am able to get the cursor to overwrite the character under the cursor with a `~`. This is some progress at least--I now know how to spell _Delete Key_ for the shell. Most things I have seen on the web say that the delete key is `^?`, but that doesn't seem to work for me. Also, I should mention I am accessing this via PuTTy. I don't understand because _Control D_ does what I want the delete key to do. I tried binding it to `eot-or-delete` again to no avail. This should be simple, right? **UPDATE 2:**                bind | grep prefix     ^X = prefix-2     ^[ = prefix-1     ÿ = prefix-3     ^[O = prefix-2     ^[[ = prefix-2               bind | grep '[^ -~]'     ÿ = prefix-3     à  = beginning-of-line     à¡ = up-history     à¤ = backward-char     à¦ = forward-char     à¨ = end-of-line     à© = down-history     à¬ = delete-char-forward     à´ = backward-word     à¶ = forward-word      **UPDATE 3: More of my settings** ENV setting                echo $ENV     /etc/kshrc      BIND Complete Output               bind     ^A = beginning-of-line     ^B = backward-char     ^C = abort     ^D = eot-or-delete     ^E = end-of-line     ^F = forward-char     ^G = abort     ^H = delete-char-backward     ^I = complete     ^J = newline     ^K = kill-to-eol     ^L = redraw     ^M = newline     ^N = down-history     ^O = newline-and-next     ^P = up-history     ^R = search-history     ^T = transpose-chars     ^U = kill-line     ^V = version     ^W = kill-region     ^X = prefix-2     ^Y = yank     ^[ = prefix-1     ^\ = no-op     ^] = search-character-forward     ^^ = quote     ^_ = eot     ^? = delete-char-backward     ÿ = prefix-3     ^[^H = delete-word-backward     ^[^X = complete-file     ^[^[ = complete     ^[^] = search-character-backward     ^[  = set-mark-command     ^[# = comment     ^[* = expand-file     ^[. = prev-hist-word     ^[0 = set-arg     ^[1 = set-arg     ^[2 = set-arg     ^[3 = set-arg     ^[4 = set-arg     ^[5 = set-arg     ^[6 = set-arg     ^[7 = set-arg     ^[8 = set-arg     ^[9 = set-arg     ^[< = beginning-of-history     ^[= = complete-list     ^[> = end-of-history     ^[? = list     ^[C = capitalize-word     ^[L = downcase-word     ^[O = prefix-2     ^[U = upcase-word     ^[[ = prefix-2     ^[_ = prev-hist-word     ^[b = backward-word     ^[c = capitalize-word     ^[d = delete-word-forward     ^[f = forward-word     ^[g = goto-history     ^[h = delete-word-backward     ^[l = downcase-word     ^[u = upcase-word     ^[y = yank-pop     ^[^? = delete-word-backward     ^X^X = exchange-point-and-mark     ^X^Y = list-file     ^X^[ = complete-command     ^X? = list-command     ^XA = up-history     ^XB = down-history     ^XC = forward-char     ^XD = backward-char     ^XH = beginning-of-line     ^XP = delete-char-forward     ^XY = end-of-line     ^Xc = forward-word     ^Xd = backward-word     ^Xw = end-of-line     à  = beginning-of-line     à¡ = up-history     à¤ = backward-char     à¦ = forward-char     à¨ = end-of-line     à© = down-history     à¬ = delete-char-forward     à´ = backward-word     à¶ = forward-word      /etc/kshrc               /etc # cat kshrc     case $- in     *i*)         export SHELL_COLOR_BLUE="print -n \\033[0;34m"         export SHELL_COLOR_GREEN="print -n \\033[0;32m"         export SHELL_COLOR_RED="print -n \\033[0;31m"         export SHELL_COLOR_LIGHTGRAY="print -n \\033[0;37m"         export SHELL_COLOR_YELLOW="print -n \\033[1;33m"              export COLOR_BLACK="\\033[0;30m"         export COLOR_BLUE="\\033[0;34m"         export COLOR_GREEN="\\033[0;32m"         export COLOR_CYAN="\\033[0;36m"         export COLOR_RED="\\033[0;31m"         export COLOR_PURPLE="\\033[0;35m"         export COLOR_BROWN="\\033[0;33m"         export COLOR_LIGHTGRAY="\\033[0;37m"         export COLOR_DARKGRAY="\\033[1;30m"         export COLOR_LIGHTBLUE="\\033[1;34m"         export COLOR_LIGHTGREEN="\\033[1;32m"         export COLOR_LIGHTCYAN="\\033[1;36m"         export COLOR_LIGHTRED="\\033[1;31m"         export COLOR_LIGHTPURPLE="\\033[1;35m"         export COLOR_YELLOW="\\033[1;33m"         export COLOR_WHITE="\\033[1;37m"              if [[ `id -u` -eq 0 ]]; then             export PS1=`$SHELL_COLOR_RED`'$(hostname -s):'`$SHELL_COLOR_YELLOW`'$(pwd) # '`$SHELL_COLOR_LIGHTGRAY`         else             export PS1=`$SHELL_COLOR_BLUE`'$(hostname -s):'`$SHELL_COLOR_GREEN`'$(pwd) $ '`$SHELL_COLOR_LIGHTGRAY`         fi          esac      PuTTy settings: ![enter image description here](http://i.stack.imgur.com/2XFT7.png) Notes that may or may not matter, but could provide background: The shell is "PD KSH v5.2.14 99/07/13.2". Yes, I have no option to upgrade... it's an embedded system. "Get a modern shell" is not a viable answer. The operating system is QNX Neutrino 6.4.1. bind shows the following:                bind | grep del     ^D = eot-or-delete     ^H = delete-char-backward     ^? = delete-char-backward     ^[^H = delete-word-backward     ^[d = delete-word-forward     ^[h = delete-word-backward     ^[^? = delete-word-backward     ^XP = delete-char-forward     à¬ = delete-char-forward      infocmp shows the following:               infocmp  #      Reconstructed via infocmp from file:     /usr/lib/terminfo/x/xterm xterm|vs100|xterm terminal emulator,             am, km, mir, msgr, xenl, xon,             cols#80, it#8, lines#65, vt@,             acsc=Oa``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,             bel=^G, blink=@, bold=\E[1m, clear=\E[H\E[2J, cr=^M,             csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=^H,             cud=\E[%p1%dB, cud1=\E[B, cuf=\E[%p1%dC, cuf1=\E[C,             cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\E[A,             dch=\E[%p1%dP, dch1=\E[P, dl=\E[%p1%dM, dl1=\E[M, ed=\E[J,             el=\E[K, el1=\E[1K$<3>, enacs=\E(B\E)0, home=\E[H, ht=^I,             hts=\EH, ich=\E[%p1%d@, ich1=\E[2~, il=\E[%p1%dL, il1=\E[L,             ind=^J, is1=\E=\E[?1l, kBEG=\ENn, kCPY=\ENs, kCRT=\ENt,             kDL=\ENv, kEXT=\ENw, kFND=\ENx, kHLP=\ENy, kOPT=\ENz,             ka3=\EOs, kb2=\EOr, kbs=^H, kc1=\EOq, kcan=\EOm, kclo=\ENc,             kclr=\ENa, kcmd=\EOu, kcub1=\E[D, kcud1=\E[B, kcuf1=\E[C,             kcuu1=\E[A, kdch1=\E[P, kend=\E[9, kf1=\E[11~, kf10=\E[21~,             kf11=\E[23~, kf12=\E[24~, kf2=\E[12~, kf3=\E[13~,             kf4=\E[14~, kf5=\E[15~, kf6=\E[17~, kf7=\E[18~, kf8=\E[19~,             kf9=\E[20~, kfnd=\ENf, khlp=\ENh, khome=\E[8, khts=\ENb,             kich1=\E[2~, kmov=\ENi, kmrk=\ENm, kmsg=\ENe, knp=\E[6~,             kopn=\ENo, kopt=\ENk, kpp=\E[5~, kref=\ENl, kres=\ENp,             krfr=\ENg, krpl=\ENr, krst=\ENj, ksav=\ENq, kslt=\EOM,             ktbc=\ENd, kund=\ENu, rc=\E8, rev=\E[7m, ri=\EM, rmacs=^O,             rmam=\E[?7l, rmkx=\E>, rmso=\E[m,             rs1=\E>\E[1;3;4;5;6l\E[?7h\E[m\E[r\E[2J\E[H, rs2=@,             sc=\E7,             setb=\E[4%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m,             setf=\E[3%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m,             sgr=\E[0%?%p1%p6%|%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;m,             sgr0=\E[m, smacs=^N, smam=\E[?7h, smkx=\E=, smso=\E[7m,             tbc=\E[3g,      stty shows the following:               stty Name:  /dev/ttyp0 Type:  pseudo Opens: 2     +edit +echok +echonl     +osflow  intr=^C  quit=^\ erase=^?  kill=^U   eof=^D start=^Q  stop=^S  susp=^Z lnext=^V   min=01  time=00   pr1=^[   pr2=5B  left=44 right=43     up=41  down=42   ins=40   del=50  home=48   end=59


How do I allocate a key shortcut to moving GNOME 3 workspaces up/down?

In GNOME 3, in the Keyboard Shortcuts area of the Keyboard settings page, it is possible to allocate shortcuts to move between workspaces and move windows between workspaces. Unfortunately, however, there is no ability to move workspaces _themselves_ up/down. Is there a way I can achieve this through a custom shortcut? Is there, perhaps, a good extension out there? I haven't been able to find out, so if anyone could answer my questions I would be immensely grateful. :)


Fast utility that indexes files/directories on centos 6 for faster searching through the filesystem

I need to often search a large directory structure (with 1 G / 13K files of data). find / grep take a lot of time. Is there any utility (or can one make an index of these files) for faster searching.


Ubuntu 12.04: Random freezes

I get random freezes with Ubuntu 12.04 (kernel 3.2.0-31). The entire system freezes, mouse pointer doesn't move, keyboard input doesn't work. I'd say this happens about once per week on a system that is up 24/7. A hard reboot solves the problem. My questions: (1) Has anyone else experienced this? (2) I have a suspicion that a kernel upgrade may solve this. How much of a pain in the ass is it to upgrade an Ubuntu kernel, and how much will I break things like apt-get if I do upgrade the kernel myself?


mplayer -msglevel all=-1 doesn't make it completely silent!

I'm trying to open `mplayer` to play video without **any** terminal output using this:               mplayer -msglevel all=-1 /path/to/video      also:               mplayer -really-quiet /path/to/video      but it doesn't make it completely silent! and these are printed to output:               [flv @ 0x9a5d100]Estimating duration from bitrate, this may be inaccurate     [ass] Init     [ass] Updating font cache      How can I make `mplayer` completely silent? Thanks


Samba 3 on Arch Linux, streams_xattr behaviour

I'm running Samba 3.6.8-1 on my x64 Arch Linux installation. I recently decided to have my samba share support NTFS's Alternate Data Streams by using `streams_xattr` or `streams_depot`. With `streams_xattr` I discovered that if I copy a file having an ADS from a Win7 box to my samba share, on the Linux console I can see the ADS as an `xattr` attached to the file. However when I copy the file back to my Win7 box using Windows Explorer, there are no ADS entries on it. This is not true if I use `streams_depot`. Looking at Wireshark captured network traffic I see that in response to QUERY_FILE_INFO (Query File Stream Info), Samba does not return all streams associated with the file. The response consists of only one stream, which is the file data. Does anyone know what might be going on here? PS: On a side not, when I first enabled `streams_xattr` (true about `streams_depot` too), I was getting an `NT_STATUS_NETWORK_BUSY` from smbd which was also causing Windows to report an 'unexpected error'. Upon some research I found this: https://bugzilla.samba.org/show_bug.cgi?id=7537 . Upon disableing kernel oplocks, this error was gone. I'm wondering if I could still have the kernel oplocks on and there's another way to solve it, since that bug is 2 years old. UPDATE - I've a Macbook Pro running OS X Lion (10.7) with Windows filesharing turned on, and I see the same behavior on that too! .. apparently it uses Samba too


Bash command in string is executing when I create the string, not when I use it later

I'm relatively new to shell scripting, but have nearly completed a script which makes use of the lftp program. The part of the script I am having trouble with is when I create a long string of commands (separated by `;`).               for var in something     do         ...         commands_to_run+="echo Result is `tail -n 1 $somefile`;"     done      What I'm noticing is that the `tail` program - wrapped in the backticks - is being run when the for loop is iterating, but not when I invoke the string of commands later in my script. Unfortunately, the contents of $somefile isn't at this stage ready to be inspected. How can I get the command to execute when I need it, and not while I'm creating the string?


Knowing default clipboard manager

There are many Clipboard Manager for _Unix-based_ Operating System but is there a way to actually know which one is being used? I am on _Fedora 20_ under _Gnome 3.10.1_ and I know that I'm using _GPaste 3.10_. But I would like to know if there is a _command line_ which would ouput `GPaste 3.10` (except `gpaste --version` obviously).


String replacement in file

I have the following file:               <?xml version="1.0" encoding="utf-8"?>     <!--Generated by crowdin.net-->       <string name="test" >- test</string>       <string name="test" >test-test</string>       <string name="test" >test - test</string>      and I would like to replace the `en dash` with its unicode value, but not all of them, just the one in the `string` tag I run several `sed` with different regex, but I couldn't figured it out. One of those was               sed -i.bak "s/-[^-\<\>0-9]/\&#8211\;/g" strings.xml      the output was:               <?xml version="1.0" encoding="utf-8"?>     <!-–enerated by-->       <string name="test" >–test</string>       <string name="test2" >test–est</string>       <string name="test3" >test –test</string>      my problem is that is also replacing _empty spaces_ and the _first char_ of the second word. I have not that big experience with `regex` and `sed`. Could you please explain me what I am doing wrong? Note: I'm using OSX.


How do display managers log a user in?

I'm about to start working on my own display/login manager. I think I'll be able to handle all of the X11 stuff, but I realized I have no clue what to do when the user types in their username and password. Once a display manager has a username and password, what does it do? How does it log you in? Are there any other specific requirements a login manager has to do, like sourcing any configuration files, or is that all left up to the desktop environment?


Networksetup, how do I make an IF loop for error on connection?

I'm attempting to connect to a network in Mac OSX with this command: networksetup -setairportnetwork eno "NETWORK_NAME" and can most often connect to the network. But I need to make an IF loop for when the network connection fails for some reason. Can anyone help me with that please? Don't know what responses I get from that command or how to use them.. Thanks!


Mounting Windows shares using cifs results in "Error:13(Permission denied)"

Ubuntu 12.04.1 LTS, kernel 3.2.0-57-generic Windows Server 2008 R2 SP1 x64 Trying to setup a network share from Ubuntu 12.04 to a Windows Server 2008 R2 however no matter what changes are made the share fails to mount due to error(13): permission denied. Firewall port 445 has been opened between the two servers which enabled me to ping the servers from each other so it's not something on the firewall blocking the connection. The windows server is not part of a domain so I've tried with and without workgroup option. The windows account isn't disabled, I check often to make sure that I haven't locked it. Trying to use a 16 char password with lower/upper alphanumeric. No special characters. Windows Advanced Share permissions has Everyone(full/read/write) and the user account(full/read/write) permissions. Windows Folder Security has Everyone(Full/read/write) and the user account (full/read/write). I can access the windows share from my local box using the same username/password as used for the mount commands below. The windows share is located at C:\Share. Windows Event viewer is reporting it as Unknown user name or bad password with or without the sec=ntlmv2 or sec=ntlm. Any changes to the sec option still provides a error(13). The user account is an administrator on the server and i've typed and retyped and reset the password from something complex to something simple and still not going through. My local box can connect through the windows share no problem with any version of the password set. The windows network connection is considered a public network. Under Network and Sharing Center the Advanced Sharing Settings->Home/Work and Public - Public Folder sharing have been set to turned On. Password protected sharing-> turned on since I'm trying to use an admin account local to the server. The /mnt/share directory has been created and has been tested with rw- rw-r--,rwxrwxrwx,rw-rw-rw-,rwxrwxrw- permissions just in case it had something to do on the linux side. I tried both user= and username= with all of the commands listed below. Also made sure not to use any extra white spaces unless needed. No quotation marks are used anywhere in the commands, I've read some people were doing username='user' **Following received a Error:13(Permission denied)**               sudo mount -t cifs //{ipaddress}/share /mnt/share -o user={user},password={pass}     sudo mount -t cifs //{ipaddress}/share /mnt/share -o user={user},password={pass},nosuid     sudo mount -t cifs //{ipaddress}/share /mnt/share -o user={user},password={pass},sec=ntlm     sudo mount -t cifs //{ipaddress}/share /mnt/share -o user={user},password={pass},sec=ntlmssp     sudo mount -t cifs //{ipaddress}/share /mnt/share -o user={user},password={pass},workgroup=workgroup,file_mode=0777,dir_mode=0777,iocharset=utf8     sudo mount -t cifs //{ipaddress}/share /mnt/share -o user={user},password={pass},workgroup=workgroup,file_mode=0777,dir_mode=0777,iocharset=utf8,sec=ntlm          sudo mount.cifs //{ipaddress}/share /mnt/share -o user={user},password={pass},port=445     sudo mount.cifs //{ipaddress}/share /mnt/share -o user={user},password={pass},port=445,nosuid     sudo mount.cifs //{ipaddress}/share /mnt/share -o user={user},password={pass},port=445,sec=ntlm     sudo mount.cifs //{ipaddress}/share /mnt/share -o user={user},password={pass},port=445,sec=ntlmssp     sudo mount.cifs //{ipaddress}/share /mnt/share -o user={user},password={pass},port=445,workgroup=workgroup,file_mode=0777,dir_mode=0777,iocharset=utf8     sudo mount.cifs //{ipaddress}/share /mnt/share -o user={user},password={pass},port=445,workgroup=workgroup,file_mode=0777,dir_mode=0777,iocharset=utf8,sec=ntlm      **Following received a Error:22(Invalid Argument)**               sudo mount.cifs //{ipaddress}/share /mnt/share -o user={user},password={pass},port=445,sec=ntlmv2     sudo mount -t cifs //{ipaddress}/share /mnt/share -o user={user},password={pass},sec=ntlmv2     sudo mount -t cifs //{ipaddress}/share /mnt/share -o sec=ntlmv2,user={user},password={pass},port=445      I also downloaded and tried the outdated SMBFS which also produced a Error:13 Any thoughts?


How to get rid of the “scanning for btrfs file systems” at start-up?

After upgrading from Ubuntu 12.04 to Ubuntu 12.10, I get a message "scanning for btrfs file systems" at starting-up. I don't have any BTRFS filesystem. It delays the booting for about 15 seconds. How can I get rid of this?


How can I kill child processes with start-stop-daemon?

I'm writing a simple web server using nc and bash. It looks like this:               #!/bin/bash     rm -f /var/run/streamman/out     mkfifo /var/run/streamman/out     trap "rm -f /var/run/streamman/out" EXIT          while true     do         cat /var/run/streamman/out | nc -l 8080 > >( # parse the netcat output, to build the answer redirected to the pipe "out".         while read line         do           line=$(echo "$line" | tr -d '[\r\n]')           if echo "$line" | grep -qE '^GET /\?action' # if line starts with "GET /"           then             action=$(echo "$line" | cut -d '=' -f2 | cut -d ' ' -f1 | cut -d '&' -f1) # extract the request             query_str=$(echo "$line" | cut -d '&' -f 2-)             args=$(query_string_to_args $query_str)                  fn_exists $action && eval ${action} ${args} || echo "No route for $action"             elif [ "x$line" = x ] # empty line / end of request           then                 header=$(cat /var/www/header.html)                 footer=$(cat /var/www/footer.html)                 echo  "$header somecontent $footer" > /var/run/streamman/out           fi         done       )     done      There are some extra functions in there but I left them out for brevity. I start it as a daemon using the followin init script:               #!/bin/bash     user=streamman     name=streamman-httpd     prog=/usr/sbin/streamman-httpd          case $1 in         start)             start-stop-daemon --start --user $user --chuid $user --background --umask 0000 --exec $prog > /var/log/streamman/streamman.log 2>&1             ;;         stop)             /sbin/start-stop-daemon --stop --user "$user" --name "$name" --retry=TERM/5/KILL/1             ;;         restart)             ;;         *)             ;;     esac      Here is the output of `ps afx` after starting the service:               3023 ?        S      0:00 /bin/bash /usr/sbin/streamman-httpd     3065 ?        S      0:00  \_ nc -l 8080     3066 ?        S      0:00      \_ /bin/bash /usr/sbin/streamman-httpd      As you can see, a child process has started up for some reason. I think it's to do with the way I use nc and the named pipe. Now when I try to stop the service I get this:               Program streamman-httpd, 1 process(es), refused to die.      And the output of `ps afx`:               3065 ?        S      0:00 nc -l 8080     3066 ?        Z      0:00  \_ [streamman-httpd] <defunct>      For some reason the child process won't die. I've tried using pid files, but I can't get my server script to output the _child's_ pid to a file. How can I make it kill both processes?


bash function to handle file through symlink : problem with command line arguments

I wrote a little code that will copy files given either their name or symlinks to a given directory.               linkcp() {     cp `echo "$(realpath $1)"` "$2"     }      here is the file list:               $ ls -l     drwxr-xr-x 2 user1 users 4096 apr. 30 01:20 temp     -rw-r--r-- 1 user1 users 50 apr. 30 01:20 file1     -rw-r--r-- 1 user1 users 34 apr. 30 01:20 file2     lrwxrwxrwx 1 user1 users 26 apr. 30 01:20 lnk1 -> file1     lrwxrwxrwx 1 user1 users 26 apr. 30 01:20 lnk2 -> file2      This works if I use:               $ linkcp lnk1 temp     $ ls temp/     $ file1      but not if I use wildcards (I need to move all files beginning with lnk):               $ rm temp/*     $ linkcp lnk* temp     $ ls temp/     $      If I do:               $ arg=lnk*     $ cp `echo "$(realpath $arg)"` "temp/"     $ ls temp/     $ file1  file2      I don't know why using `$1` in the function causes a problem?


How to execute a remote command and pass in local file as input?

Is it possible to do this: `ssh user@socket command /path/to/file/on/local/machine` That is to say, I want to execute a remote command using a local file in one step, without first using `scp` to copy the file.


Put Linux server into sleep and wake it up using WOL packets

I am looking for a way to put my Linux home server in standby after a period without any "heart beat" network activity. I would like to use WOL packets as a heart beat signal. These packages will be send by several clients each with an interval of, lets say, every 15 minutes. I am quite a rookie concerning Linux scripting, but I can understand code after some studying. An actual example is therefore more than welcome.


Driver for Intel 2200BG wireless network card

I'm trying to make work my wireless network card `Intel 2200BG` in my laptop `Acer Travelmate 4002WLMI`. I tried so far:               $ sudo lshw -C network     *-network:1            description: Wireless interface            product: PRO/Wireless 2200BG [Calexico2] Network Connection            vendor: Intel Corporation            physical id: 4            bus info: pci@0000:02:04.0            logical name: eth1            version: 05            serial: 00:0e:35:b0:a7:88            width: 32 bits            clock: 33MHz            capabilities: pm bus_master cap_list ethernet physical wireless            configuration: broadcast=yes driver=ipw2200 driverversion=1.2.2kmprq firmware=ABG:9.0.5.27 (Dec 12 2007) latency=64 link=no maxlatency=24 mingnt=3 multicast=yes wireless=IEEE 802.11bg            resources: irq:10 memory:d0208000-d0208fff          $ sudo modprobe ipw2200      $ dmesg | grep ipw     [   12.087836] libipw: 802.11 data/management/control stack, git-1.1.13     [   12.087839] libipw: Copyright (C) 2004-2005 Intel Corporation <jketreno@linux.intel.com>     [   12.209561] ipw2200: Intel(R) PRO/Wireless 2200/2915 Network Driver, 1.2.2kmprq     [   12.209566] ipw2200: Copyright(c) 2003-2006 Intel Corporation     [   12.335295] ipw2200 0000:02:04.0: PCI INT A -> Link[LNKB] -> GSI 10 (level, low) -> IRQ 10     [   12.335329] ipw2200: Detected Intel PRO/Wireless 2200BG Network Connection     [   12.652808] ipw2200: Radio Frequency Kill Switch is On:     [   12.667645] ipw2200: Detected geography ZZM (11 802.11bg channels, 0 802.11a channels)     [   55.212245] ipw2200: Failed to send POWER_MODE: Command timed out.     [   57.368256] ipw2200: Failed to send POWER_MODE: Command timed out.      or               sudo apt-get install linux-headers-$(uname -r) build-essential     wget http://aceracpi.googlecode.com/files/acer_acpi-0.11.1.tar.bz2     tar -xvjf acer_acpi-0.11.1.tar.bz2     cd acer_acpi-0.11.1     sudo make # this command never ends      or to search here useful information:               $ uname -r     3.2.0-24-generic          $ sudo rfkill list     0: phy0: Wireless LAN             Soft blocked: no             Hard blocked: no          distribution : Ubuntu 12.04 LTS      Do you know how to solve this? Should I further try to get my wireless card work or is this hopeless and I should give this up?


get cpu by user

Working with monit I need create an alert that get cpu usage of system users, so:               top -b -n 1 -u user1 | awk 'NR>7 { sum += $9; } END { print sum; }'      seems a good solution but I'm not sure about reliable because when I do above command, every time change (obviously) the value. So, I need an "exact" use of cpu by user within 2-5 seconds, because the VALUE will send like an email alert.


How can I have new ~/.vnc/xtartup files be configured for normal desktop by default?

When a user first runs `vncserver`, the following `~/.vnc/xstartup` file gets created:               #!/bin/sh          # Uncomment the following two lines for normal desktop:     # unset SESSION_MANAGER     # exec /etc/X11/xinit/xinitrc          [ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup     [ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources     xsetroot -solid grey     vncconfig -iconic &     xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &     twm &      I want to modify the default file so that the following lines are uncommented:               unset SESSION_MANAGER     exec /etc/X11/xinit/xinitrc      How should I go about this?


What is a good example of a bash script to study in order to learn good coding conventions?

I've learnt the basics of programming in bash. I'd like to study a few examples of bash scripts so that I can learn good habits for bash scripting. In particular, I'm interested in examples of bash scripts that show:   * how to process arguments and trigger conditional functionality   * how to check for input errors   * how to perform command completion   * how to organise a bash script into functions, commands, and so forth   * how to present help messages For example, I learnt a lot from autorandr on github. Are there any other such scripts or script repositories where I could learn about bash scripting conventions?


How to write a column of consecutive integers in Vim over existing text?

For example, imagine I had the following text:               / apple     / orange     / banana     / bread      How could I efficiently add consecutive integers in a column to make?               /1 apple     /2 orange     /3 banana     /4 bread      Note that in real problems, the list might be 20, 50, or more lines long.


how to take the file names from folder

i want to write a program for the below logic:   * Take the names of files in a folder   * For each file:      * print file name     * move the file to another new folder (with the name in `dd_mm_yy` format)


what is 'nogroup' group's purpose

When I list al groups I see one called 'nogroup'. What is this for? Is it supposed to be least privileged one or something? I'm using ubuntu 11.04.


HP Deskjet 3050A scanner not working in Debian

I have an HP Deskjet All-in-one 3050A. In Debian Testing I installed it through CUPS and the printer works fine. However I can't say the same about the scanner. I've tried install it using HPLIP, but it's the same. SANE or Simple Scan detect the scanner but at the time of use it, both say that there was a problem with I/O. The weird part is that I've tried the scanner in two virtual machines (W7 and Linux Mint 14) hosted in the Debian Testing, and works fine in both VM's.


Mint 14 Floppy error

Error reported = Error mounting system managed device /dev/fd0. Command line ... /media/flopp0 exited with non-zero . /dev/fd0 is not a valid block device.      I've got a physical floppy drive, working (well it stops boot ups if a floppy is inserted) and occasionally I need to use it, so how do I rectify the error? * * * Reading elsewhere on the web, it appears to be a module as the exact message is:- ''Error mounting system-managed device /dev/fd0: Command-line `mount "/media/floppy0"' exited with non-zero exit status 32: mount: /dev/fd0 is not a valid block device''


Is using a read only root file system a good idea for embedded setup?

I have been tasked with running Linux as an operating system on an embedded device. The target has an x86 processor and has 8 GB CompactFlash device for storage. I have managed to use buildroot to create the kernel image and cross compilation tools. I have partitioned the CF device into a small FAT partition where the kernel image resides as well as `syslinux` boot configuration and an `ext3` file system where I have decompressed the root file system generated by buildroot to. The system boots successfully using `syslinux` by setting the root directory to the CF ext3 partition where my buildroot file system is located. My question is centred around the need for robustness in the face of immediate (and frequent) power loss as it is crucial for the device to boot successfully after power outages. I have read that mounting the root file system as read only is a way of ensuring data integrity. Is this a sensible way for me to proceed? I have also read about the possibility of loading the root file system into RAM to achieve the same thing but as yet do not know how to do so. Is there a preferred way of achieving this goal and if so what is the best way for me to proceed?


ddrescue: reread only good sectors?

Before imaging the corrupted filesystem to a file on another hard drive, I decided to dry-run `ddrescue` (throwing rescued output to `/dev/null`) just to see how much data is unreadable:               # ddrescue -d -b 4096 -r 3 -f /dev/sda1 /dev/null sda1.log      In the end it took 3 days to finish. Now I'm ready to make a real image, but I don't want to wait another 3 days until it finishes. But, luckily because I have a logfile, is it possible to force `ddrescue` to rescue only the good sectors and do not touch bad ones? Having read some documentation, I've came up with the following idea:               # ddrescue -d -b 4096 --fill=+ /dev/sda1 /mnt/sda1.img sda1.log      Will this work? Is there another (preferred) way of rereading only good sectors?


How to pass a CTRL-D to a command line within a script?

I am using this line                ( cat bodyText.txt; uuencode backup.tar ) | mail -s "backup" myEmail@myserver.com      inside a bash script that will be fired by cron. This line is almost perfect, but it hangs waiting for `Ctrl`-`D` to be typed, so the message and the attachement could be sent. How do I include a `Ctrl`-`D` inside a bash script to make this line work?


Questions about nmap

I have several questions about `nmap`. First, `nmap` can detect servers via:   * link-layer   * network-layer   * transport-layer What are the differences (not in the layer, but in the way that `nmap` does it) and how does `nmap` do this? Second, when I port scan with `nmap`, the UDP scan takes much longer then the TCP scan. Why? Third: are there any different methods to explore the OS then to use the `-O --osscan-guess` command (I mean totally different, not e.)?


Ubuntu 12.04, black background for some areas of GTK programs under KDE

I use ubuntu 12.04, x86_64, kernel 3.2.0-35-generic. I use KDE desktop. However, under KDE the GTK programs have black background in some areas. e.g. ![enter image description here](http://i.stack.imgur.com/9vF6n.png) How to solve the problem?