title: How can I open port 21 on a Linux VM?

text: I need to open port 21 on a Linux (CentOS 5) virtual machine I have. I have tried several Google solutions, but none are working. I was wondering if someone could tell me how to do this. * * * Below is the output of `netstat -tulpn`: > tcp 0 0 127.0.0.1:2208 0.0.0.0:* LISTEN 3576/hpiod   >  tcp 0 0 0.0.0.0:611 0.0.0.0:* LISTEN 3397/rpc.statd   >  tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 3365/portmap   >  tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 3020/cupsd   >  tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 3629/sendmail: acce tcp 0 0 > 127.0.0.1:2207 0.0.0.0:* LISTEN 3582/python   >  tcp 0 0 :::22 :::* LISTEN 3595/sshd   >  udp 0 0 0.0.0.0:68 0.0.0.0:* 3278/dhclient   >  udp 0 0 0.0.0.0:605 0.0.0.0:* 3397/rpc.statd   >  udp 0 0 0.0.0.0:608 0.0.0.0:* 3397/rpc.statd   >  udp 0 0 0.0.0.0:5353 0.0.0.0:* 3729/avahi-daemon:   >  udp 0 0 0.0.0.0:111 0.0.0.0:* 3365/portmap   >  udp 0 0 0.0.0.0:57333 0.0.0.0:* 3729/avahi-daemon:   >  udp 0 0 0.0.0.0:631 0.0.0.0:* 3020/cupsd   >  udp 0 0 192.168.201.90:123 0.0.0.0:* 3611/ntpd   >  udp 0 0 127.0.0.1:123 0.0.0.0:* 3611/ntpd   >  udp 0 0 0.0.0.0:123 0.0.0.0:* 3611/ntpd   >  udp 0 0 :::5353 :::* 3729/avahi-daemon:   >  udp 0 0 :::52217 :::* 3729/avahi-daemon:   >  udp 0 0 fe80::20c:29ff:fe66:123 :::* 3611/ntpd   >  udp 0 0 ::1:123 :::* 3611/ntpd   >  udp 0 0 :::123 :::* 3611/ntpd * * * And here is the output of `iptables -L -n`: > Chain INPUT (policy ACCEPT) target prot opt source destination > > Chain FORWARD (policy ACCEPT) target prot opt source destination > > Chain OUTPUT (policy ACCEPT) target prot opt source destination


title: Scrolling through ls output without a mouse

text: In some directories there are quite a few files. When I use ls the output is more than my terminal can handle. Typically I just use one of the following:               ls | less     ls | more      depending on my mood. However, I lose the color coding and I only get a single file/directory per line. Is there a way to emulate scrolling through my terminal with my mouse after I use ls without actually having to scroll? I checked the man page for ls and I didn't see anything that would allow for this but I may have missed something.


title: Reasons to partition an encrypted ssd

text: I am just setting up a new system with Lubuntu 13.04. I have an SSD and the whole system will be encrypted with the standard LVM + dm-crypt method (as offered by the lubuntu installer). In the past I was used to create a sophisticated partitioning scheme. However in the this case I am wondering if it makes sense at all to partition it. Since it is an SSD I will not see any performance improvements if the system partition is on the beginning of the disk as in the HDD case. Also since everything is encrypted I don't see any advantages when I must access the SSD from another machine for possible troubleshooting. Also with only one partition the available space of the SSD seems to be used more efficiently. So my question is, are there any good reasons to make partitions in this case? Also are there any good reasons to go with just one large partition?


title: How creation of new USB device file in /dev/bus/usb/001/ directory work?

text: I noticed that every time I connect a USB device, a new device gets created in the `/dev/bus/usb/001/` directory. Further on each reconnection of the same device, the _"Device Number"_ and _"ID"_ change. So, I'd like to know how the creation of new device file (in `/dev/bus/usb/001/`) work? Can I **_control the behaviour_** , say limit the device number to `002`, by making changes in some configuration file _(if any)_? Here's a the output for reference:               $ ls /dev/bus/usb/001     001  002     $ lsusb     Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub     Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub     Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub     Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub     Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub     Bus 001 Device 002: ID 0781:5406 SanDisk Corp. Cruzer Micro U3     $ lsusb     Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub     Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub     Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub     Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub     Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub     Bus 001 Device 003: ID 08ec:0015 M-Systems Flash Disk Pioneers Kingston DataTraveler ELITE     $ lsusb      Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub     Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub     Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub     Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub     Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub     Bus 001 Device 008: ID 0781:5406 SanDisk Corp. Cruzer Micro U3     $ ls /dev/bus/usb/001/     001  008      _( Also I don't know why Kingston Flash Disk was shown in the output. I don't have a Kingston device!... Maybe it's just a glitch, or is it? )_ ### Another contextual topic of interest:   * How can I get all USB storage device to mount as read-only or offer no mount options at all?


title: How is nice working?

text: sched_setscheduler says : > All scheduling is preemptive: if a process with a higher static priority > becomes ready to run, the currently running process will be preempted and > returned to the wait list for its static priority level. while setpriority says > This causes very low nice values (+19) to truly provide little CPU to a > process whenever there is any other higher priority load on the system, and > makes high nice values (-20) deliver most of the CPU to applications that > require it So, how is changing the nice value going to influence the execution of programs? Is it similar to RT scheduling (where a program with higher nice value is going to interrupt program with lower nice value)? * * * All information on internet is how to use nice, and how to change priority of a process. No link explains how exactly process with different priority works. I couldn't even find the source code. So, any help is appreciated :)


title: Can I use FAT partition for /home?

text: I'm new to Debian. I've been using Ubuntu for almost 5 years now and I want to switch and use a different distro. I chose Debian. I would like to know if is it possible store the home directory in a different partition on Debian? I'll use Debian 6.0.3. I would like to use a FAT partition for /home directory, is it possible? I want to use fat because sharing files between Windows and Debian would be easier this way, and storing /home in a FAT partition would allow me to browse my documents whenever I need. Also, having /home directory would help me to keep my current /home directory or when I change OS if Debian is not for me.


title: Why can't I edit links and directories directly?

text: There are programs such as `hexedit` that allow one to edit each bit of a file, and as I keep hearing that in Unix "everything is a file", I tried to edit some directory, expecting bytes referring to inodes or filenames. Instead, I get:               hexedit: teste: not a file      However, I was happy in finding that it did work with many `dev` files (partitions, entire hard drives, fake components (such as `/dev/null`), you name it). And for soft links, `hexedit` follows them, and the error is the same as the destination's, though with the name of the link instead, in my test:               hexedit: testeln: not a file      Even if the original file is removed and the link invalid, the behaviour is the same. But this isn't all. If one copies symbolic links without a special option to preserve (or use `rsync`'s options), they become regular files, and fortunately, I had an old link like that:               00000000   49 6E 74 78  4C 4E 4B 01  2F 00 73 00  72 00 76 00  2F 00 73 00  61 00 6D 00  62 00 61 00  2F 00 73 00  IntxLNK./.s.r.v./.s.a.m.b.a./.s.     00000020   68 00 61 00  72 00 65 00                                                                                h.a.r.e.      In the case of `/dev/initctl`, `loop-control`, `snapshot` and `tty2` (even if it's open and I have read/write privileges), `hexedit` gives (after clearing the screen, in the last line):               the long seek failed (-1 instead of 0), leaving :(      For `/dev/log`:               hexedit: log: No such device or address      Can I see directories in such a way? Why are links automatically followed? How can I change that behaviour? Why does `hexedit` behave like that just (AFAIK) for symlinks and directories? I suspect some weird files I found in `/dev` are only seemingly empty, even if I use `sudo`.


title: Automatically moving files to a directory, one by one, and only when the target folder is empty

text: Is it possible? And in _reverse_ alphabetical order? Essentially, this: How can I move files by type recursively from a directory and its sub-directories to another directory? Except that each file is not moved to the destination directory _unless_ a separate process has fetched the sole file in that destination directory and moved it elsewhere (thus the target folder is empty and 'ready' for the next file to be moved there).


title: Index names of all the files in a plain text file

text: I've got this directory full of images, and I can do this:               echo *.jpg     image1.jpg image2.jpg image3.jpg # and so on      How can I get the output in a plain text file in this format?               image1.jpg     image2.jpg     image3.jpg


title: Are there any disadvantages against using qsub to run tasks all the time?

text: When I'm running a task on a computer network? I've just started to realize that if I qsub _any_ task, then the task won't hog up my terminal, and I can do other things on the same terminal (which is quite useful even if the task only takes a single minute to finish). And then I run qstat to see which taks have finished and which ones haven't. http://pubs.opengroup.org/onlinepubs/009604599/utilities/qsub.html is a good explanation of qsub.


title: Xubuntu Oneiric won't start XFCE

text: I tried upgrading the Ubuntu on my trusty netbook and found 11.10 was way too slow. So I switched to xubuntu by installing the `xubuntu-desktop` package and then following the crazy instructions here : http://www.psychocats.net/ubuntu/purexfce Now when I try to start up I get the xubuntu load-screen. But then my screen starts flashing between text mode and blank. Text mode starts with the ominonus line               could not write bytes: Broken pipe      and then continues with further startup info about PostgreSQL, Apache etc. After it reaches the line               * Checking battery state...      it freezes. The flashing stops but no GUI seems to load. I can still get into the machine using `Ctrl``Alt``F2` etc. But not much idea how to fix this. Has anyone else tried to revert to pure XFCE with Oneiric and come up against the same problem?


title: Replacing text from a list of replacements. Added complication: backslashes

text: I have a file A that contains pairs of strings, one per line:               \old1 \new1     \old2 \new2     .....      I would like to iterate over file A, and for each line perform the replacement (e.g. "\old1 -> \new1") globally in some file B. I had no trouble getting it to work without backslashes using sed or perl -pi -e using something like the following:               while read -r line     do      set -- $line      sed -i -e s/$1/$2/g target     done < replacements      However, I can't figure out how to make either sed or perl treat the backslashes verbatim in the replacement strings. Is there a clean solution for this?


title: Emacs: How to insert 'λ' instead of 'lambda' in Scheme mode?

text: Long ago, I came across a text editor function that replaced the word 'lambda' with the character 'λ'. I would like to do this in emacs. My preferences:   * I would like to activate this function in certain modes only (activate it for Scheme-mode but turn it off for C-mode for example).   * At work I still use an older version of emacs, so the solution should work for emacs22 and emacs23. How should I proceed?


title: What are the relative merits of the various standard Unix archival utilities?

text: There are many archival tools for Unix, with varying degrees of availability. To make matters more confusing, many of them can write each other's formats. I am seeking more information on their relative merits, and why I would want one over another (in differing circumstances). The landscape of archivers, as I understand it (only considering F/LOSS software): ### Tar family archivers   * GNU Tar   * BSD/libarchive Tar   * star ### CPIO family archivers   * GNU cpio   * BSD/libarchive cpio ### Pax   * The MirBSD PAX included w/ Linux distros ### Dump/Restore   * dump included with your OS/distro ### Other Archivers   * 7zip   * zip   * dar ## The Question I am aware of this comparison, showing that `dump` beats (old) `tar` and `cpio` for dealing with various anomalies in the file system and exactly replicating its contents. However, `dump` is mostly oriented towards file- system-level archiving and doesn't get great support on Linux (at least Linus isn't very interested in keeping it running). In general, why would I choose one of these archivers, particularly tar/cpio/pax, over another, and why? Which one should I generally reach for first?


title: Setting file permissions in bash script

text: This script is not working the way I thought it would .   I though it would find all the scripts that have every one rwx permissions changed to the permissions of xx5               #!/bin/bash     # the / makes find inclusive               for file in `find . -perm /007 `     do     permissions=`stat -c %a $file`     permissions=${permissions:0:2}5     echo $permissions $file     chmod $permissions $file     done                    #find . -perm /007      My intentions are to at least secure some files


title: Http proxy to select external interface based on host header

text: I have a very specific use-case at work where I have several external IP addresses (a full class C), and I need to select the outbound IP address I'm using. The requests are http, and the application server is a different machine on the internal network. For simplicity, I'd like to keep this as an http proxy so I don't have to change my application code. Requirements:   * Proxy looks for a header like "External-Ip: x.y.z.a" and sends traffic through the interface with that external IP address. I am able to easily modify the header so if I need to send the interface name that's fine.   * If the header doesn't exist the proxy will pick a random one, and then return which interface it used as an http header. What's the easiest way to accomplish this?


title: Unix command to rename multiple files

text: I have some dirs with different `plugin-cfg.xml` files that I want to take a backup of and keep in the same dir. E.g.               Plug6_a1/plugin-cfg.xml     Plug6_a2/plugin-cfg.xml     Plug6_a3/plugin-cfg.xml      How can I make a copy of `plugin-cfg.xml` rename to `plugin-cfgbk.xml` for each directory?


title: cclive: what kind of regexes are allowed?

text: Is there a place where I can look, what kind of regexes I can use with the `\--tr` option from `cclive`?


title: USB external drive not working

text: I have an external usb drive that is not working properly:               Jun 13 10:36:38 sleipneir kernel: [ 1022.548241] usb 1-3.1: new high speed USB device using ehci_hcd and address 28     Jun 13 10:36:38 sleipneir kernel: [ 1022.784404] usb 1-3.1: configuration #1 chosen from 1 choice     Jun 13 10:36:38 sleipneir kernel: [ 1022.790785] scsi11 : SCSI emulation for USB Mass Storage devices     Jun 13 10:36:43 sleipneir kernel: [ 1027.835728] scsi 11:0:0:0: Direct-Access     ST320082 6A               3.03 PQ: 0 ANSI: 0     Jun 13 10:36:43 sleipneir kernel: [ 1027.842150] sd 11:0:0:0: Attached scsi generic sg2 type 0     Jun 13 10:36:43 sleipneir kernel: [ 1027.845294] sd 11:0:0:0: [sdb] 390721968 512-byte logical blocks: (200 GB/186 GiB)     Jun 13 10:36:43 sleipneir kernel: [ 1027.847235] sd 11:0:0:0: [sdb] Write Protect is off     Jun 13 10:36:43 sleipneir kernel: [ 1027.849562]  sdb: sdb1 sdb2 < >     Jun 13 10:36:43 sleipneir kernel: [ 1027.900206] sd 11:0:0:0: [sdb] Attached SCSI disk      When I try to mount it, or to do anything else, here the errors:               Jun 13 10:37:51 sleipneir kernel: [ 1095.556228] usb 1-3.1: reset high speed USB device using ehci_hcd and address 28     Jun 13 10:37:51 sleipneir kernel: [ 1096.068294] usb 1-3.1: reset high speed USB device using ehci_hcd and address 28     Jun 13 10:37:52 sleipneir kernel: [ 1096.572234] usb 1-3.1: reset high speed USB device using ehci_hcd and address 28     Jun 13 10:37:52 sleipneir kernel: [ 1097.004421] sd 11:0:0:0: Device offlined - not ready after error recovery     Jun 13 10:37:52 sleipneir kernel: [ 1097.004451] sd 11:0:0:0: [sdb] Unhandled error code     Jun 13 10:37:52 sleipneir kernel: [ 1097.004457] sd 11:0:0:0: [sdb] Result: hostbyte=DID_ABORT driverbyte=DRIVER_OK     Jun 13 10:37:52 sleipneir kernel: [ 1097.004466] sd 11:0:0:0: [sdb] CDB: Read(10): 28 00 0b 44 32 00 00 00 f0 00     Jun 13 10:37:52 sleipneir kernel: [ 1097.004564] sd 11:0:0:0: [sdb] killing request     Jun 13 10:37:52 sleipneir kernel: [ 1097.004630] JBD: recovery failed     Jun 13 10:37:52 sleipneir kernel: [ 1097.004895] sd 11:0:0:0: [sdb] Unhandled error code     Jun 13 10:37:52 sleipneir kernel: [ 1097.004901] sd 11:0:0:0: [sdb] Result: hostbyte=DID_NO_CONNECT driverbyte=DRIVER_OK     Jun 13 10:37:52 sleipneir kernel: [ 1097.004909] sd 11:0:0:0: [sdb] CDB: Read(10): 28 00 0b 44 32 f0 00 00 10 00     Jun 13 10:37:52 sleipneir kernel: [ 1097.006532] usb 1-3.1: USB disconnect, address 28     Jun 13 10:37:52 sleipneir kernel: [ 1097.120164] usb 1-3.1: new high speed USB device using ehci_hcd and address 29     Jun 13 10:37:53 sleipneir kernel: [ 1097.636231] usb 1-3.1: new high speed USB device using ehci_hcd and address 30     Jun 13 10:37:53 sleipneir kernel: [ 1098.148342] usb 1-3.1: new high speed USB device using ehci_hcd and address 31     Jun 13 10:37:54 sleipneir kernel: [ 1098.652390] usb 1-3.1: new high speed USB device using ehci_hcd and address 32      Any ideas to recover it? Thanks.


title: Does HylaFax server run in OS X?

text: From their FAQ: > HylaFAX is intended to run on any UNIX system that supports a particular set > of features: FIFO special files, BSD-style sockets and the TCP/IP > communication protocols, BSD-style file locking (`flock`) or equivalent > functionality from which it can be emulated (`fcntl`, `lockf`), and POSIX > 1003.1-style interfaces, including `termios` for manipulating `tty` devices. There there is a long list of compatible operating systems, but it does not include OS X. My knowledge of OS X low-level features is limited, so I would like to ask you if OS X supports the aforementioned features


title: Can continually assigning a variable in a shell script cause a memory leak?

text: I've written a short script to copy Apache's server status to a log:               #Save date and time to a variable     dt=$(date)          #Echo date and time to the log file as it's not included in server-status     echo "Time :" $dt >> /var/logs/server-status.log          #Grab machine readable server-status and add it to the log     curl localhost/server-status?auto >> /var/logs/server-status.log      I'm running it every five minutes from a cron job in /var/spool/cron/root but taking a look at the sysstat logs it seems to be using progressively more memory: ![enter image description here](http://i.stack.imgur.com/Veb4q.png) So my question is: Could I be causing a memory leak by continually writing to this variable? Do I need to kill it after the script is run?


title: Do live (versions of) unix distributions ever automatically pick up config info from a OS already installed on the machine?

text: Maybe this is a silly question, the answer is probably no; but I gotta ask. For example, if I have an Ubuntu Live USB running on a machine with Ubuntu already installed, might the Live OS ever look for any kind of useful configuration info on the OS already installed on the hard drive without asking me first? Does any *nix live distro have this kind of behavior?


title: Dual/Triple Booting with dmraid and non-raid disk

text: I currently have 3 hard drives in my computer The first two disks are in a RAID-1 array, using an Intel P55 chipset, and accessed through `dmraid`, with the third drive partitioned like so:               Filesystem     1K-blocks     Used Available Use% Mounted on     /dev/sdc2       26144164 18395184   6438260  75% /     /dev/sdc4      183149032 40603992 133376044  24% /media/Home     /dev/sdc1       26144164 15521608   9311836  63% /media/ArchLinux     /dev/sdc3        8388608                         /swap      with `sdc1` as the home partition for Arch Linux, and symlinks to the desktop, documents, etc. folders. When I tried updating GRUB2, it could not find the Windows disk to boot from. I'd like to be able to boot all three from one GRUB menu, and preferably a solution that is automated, though I don't mind getting my hands dirty, so to speak, and editing conf files.


title: send email to approximately 10,000 users in bcc using mailx

text: We have a requirement to send an email to ~ 10,000 users in BCC. We have used mailx command to send email to 10-15 users by using -b option and delimiting all the email id's with "," is there any way/any command which picks up the email id's from a file as comma separating 10,000 email id's at once and providing it as an argument could be difficult.


title: Understand debug messages from sshd

text: I'm using **OpenSSH_5.8p1** in my machine,I'm connecting my machine using putty client but its slower so I have ran sshd in debug mode and found following messages can any one explain me in detail about each messages?               debug1: sshd version OpenSSH_5.8p1     debug1: read PEM private key done: type RSA     debug1: private host key: #0 type 1 RSA     debug1: read PEM private key done: type DSA     debug1: private host key: #1 type 2 DSA     debug1: read PEM private key done: type ECDSA     debug1: private host key: #2 type 3 ECDSA     debug1: rexec_argv[0]='/sbin/sshd'     debug1: rexec_argv[1]='-d'     Set /proc/self/oom_adj from 0 to -17     debug1: Bind to port 22 on 0.0.0.0.     Server listening on 0.0.0.0 port 22.     debug1: Bind to port 22 on ::.     Server listening on :: port 22.          debug1: Server will not fork when running in debugging mode.     debug1: rexec start in 6 out 6 newsock 6 pipe -1 sock 9     debug1: inetd sockets after dupping: 4, 4     Connection from 192.168.0.57 port 33962     debug1: Client protocol version 2.0; client software version PuTTY_Release_0.63     debug1: no match: PuTTY_Release_0.63     debug1: Enabling compatibility mode for protocol 2.0     debug1: Local version string SSH-2.0-OpenSSH_5.8     debug1: list_hostkey_types: ssh-rsa,ssh-dss,ecdsa-sha2-nistp256     debug1: SSH2_MSG_KEXINIT sent     debug1: SSH2_MSG_KEXINIT received     debug1: kex: client->server aes256-ctr hmac-sha1 none     debug1: kex: server->client aes256-ctr hmac-sha1 none     debug1: SSH2_MSG_KEX_DH_GEX_REQUEST_OLD received     debug1: SSH2_MSG_KEX_DH_GEX_GROUP sent          delay of 1.5 second          debug1: expecting SSH2_MSG_KEX_DH_GEX_INIT     debug1: SSH2_MSG_KEX_DH_GEX_REPLY sent     debug1: SSH2_MSG_NEWKEYS sent     debug1: expecting SSH2_MSG_NEWKEYS     debug1: SSH2_MSG_NEWKEYS received          delay of 1.8 second          debug1: KEX done     Connection closed by 192.168.0.57


title: Does NetBSD supports ppc64?

text: Searching for ppc64 on NetBSD's website: > site:www.netbsd.org "ppc64" didn't returned any good hits.. https://en.wikipedia.org/wiki/Ppc64 **My question:** Does NetBSD supports the ppc64 architecture? Would it work OK on an ex.: POWER7? The: http://www.netbsd.org/ports/ shows many powerpc's, but how can I be sure that it will work on a POWER7?


title: Can I make "There are stopped jobs" harder to kill?

text: **Typical scenario:** I temporarily need to access a file that my vhost prevents me from accessing. I fire up vim, edit the settings and background vim to tell apache to reload its configuration. **Problem:** If I now forget about this, my shell will tell me "There are stopped jobs", when I CTRL+D the session. However, since I have a habit of having shells in shells in shells, due to ssh, tmux and similar, I also frequently repeatedly send EOF when I wrap my work up and close my windows. This in turn causes me to accidentally kill the shell, despite the warning. Can I make it harder to kill such shells?


title: How can I download install Linux on a Windows PC while using Windows as little as possible?

text: My brother's Windows (Vista) PC has recently become incredibly slow, to the point where you can't really do anything without waiting at least 15 minutes. I think it's got a fair amount of space left on the hard drive, so I don't really know what's going on. I thought if I installed Linux on his computer then he would at least be able to connect to the Internet and use his computer quickly. The thing is, the Windows on his computer is so slow that I want to spend as little time as possible using Windows in order to install Linux. I imagine you'd have to connect to the Internet to download the distribution and things, but I'd otherwise like to use the existing OS as little as possible when installing the new one. I have got a working computer (the one I'm using to write this question) if that helps.


title: SELinux re-labeling problem while attempting to run OpenVPN

text: I'm trying to run OpenVPN under Fedora 19 with selinux (selinux-policy- targeted) in enforcing mode, and I'm running into an AVC I'm not entirely sure how to handle. Starting OpenVPN from the command line as root works fine, but starting it via systemd (`systemctl start openvpn@vpcbridge`, where `/etc/openvpn/vpcbridge.conf` exists) results in:                 ERROR: Cannot ioctl TUNSETIFF tap0: Permission denied (errno=13)      And in `/var/log/audit`:                 type=AVC msg=audit(1376412420.435:60): avc:  denied  { relabelfrom } for       pid=720 comm="openvpn" scontext=system_u:system_r:openvpn_t:s0       tcontext=system_u:system_r:ifconfig_t:s0 tclass=tun_socket      For reference, here's the OpenVPN configuration:               port 1194     user openvpn     dev tap0     proto udp     secret vpcbridge.key     keepalive 10 120     persist-tun     persist-key      If I run `audit2allow`, I get a module file that looks like this:                 module openvpn 1.0;            require {             type openvpn_t;             type ifconfig_t;             class tun_socket relabelfrom;       }            #============= openvpn_t ==============       allow openvpn_t ifconfig_t:tun_socket       relabelfrom;      But loading that generates an error:                 # semodule -i openvpn.pp       libsepol.print_missing_requirements: openvpn's global requirements were       not met: type/attribute openvpn_t (No such file or directory).       libsemanage.semanage_link_sandbox: Link packages failed (No such file or       directory).       semodule:  Failed!      I'm not sure what to do with this error. **Update** : As requested, the output of `seinfo -t ...`:               # seinfo -t | grep openvpn        openvpn_tmp_t        openvpn_unconfined_script_exec_t        openvpn_status_t        openvpn_etc_rw_t        openvpn_var_lib_t        openvpn_var_run_t        openvpn_port_t        openvpn_server_packet_t        openvpn_etc_t        openvpn_initrc_exec_t        openvpn_var_log_t        openvpn_unconfined_script_t        openvpn_exec_t        openvpn_t        openvpn_client_packet_t


title: PC sudden shutdown, Sensors show normal temps, Thermal event interrupts shows 1276

text: I'm experiencing sudden shutdowns on my Linux systems.   * Using Ubuntu 12.04, my kernel version is 3.5.0-37-generic #58~precise1-Ubuntu.    * Running a Acer M5 581t(G) with 6 gigs ram laptop. I have been experiencing this for more then two weeks. Its shuts off all a sudden with no warning. The temperatures are listed below at shut off. I have Windows 8 on the same machine and no problems running Windows, no shut off. Only once, and I had to update the BIOS firmware.               $sensors         Physical id 0:  +51.0°C         Core 0:         +52.0°C         Core 1:         +45.0°C      My current `/proc/interrupts` shows my Thermal event interrupts as follows:               TRM:        1277       1278       1276       1276   Thermal event interrupt      There is **no** indication in `syslog` that a request to shutdown has been issued. What could be the cause of this behavior? I've attached links below to my `dmesg` log, `/proc/interrupts`, system log, and kernlog. I had two unexplained shut downs at roughly 12:24 and 12:26. both back to back. The first one occured right after I opened the lid after it being closed. The other was during boot-up to recover from the first crash. ### Included logs   * System log   * /procs/interrupts   * dmesg log   * kernlog


title: How can I jump to files from vim opening them in a separate tab?

text: I have installed `tags` so I can jump to a function body in another file via `CTRL + ]`   I know that I can do `gf` to jump to another file.   I know that I can do `CTRL-w s` to split the vim window.   What I don't know and I am very interested in, is how can I combine the first 2 with the last.   I.e. how could I jump to another file via tag or `gf` _opening_ the file in a separate tab?


title: Transfer files using scp: permission denied

text: I try to transfer files from remote computer using `ssh` to my computer :               scp My_file.txt user_id@server:/Home This should put My_file.txt in the home folder on my own computer, right? I get > scp/Home: permission denied Also when I try: `...@server:/Desktop`, in order to copy the files from the remote computer to my desktop. What am I doing wrong?


title: Debian Desktop working inside virtual machine

text: I installed debian wheezy on a virtual box hard disk but I don't see any desktop icons and things like desktop shorcuts don't work. I have the latest updates. How do I fix this?


title: Mail ID creation

text: I have a Linux box in which squirrel client installed for mail configuration. There are 100 employees whose mail id's are running on this.I have grouped 25 employees each to make a group and gave an alias name to send mail to a group.Now they are able to send mail one to one and to a group as well.I want 5 users amongst the group (from any group)who can send mail to a group only.rest of the members can send mail one to one.Is it possible ?


title: Am I using bash after this ordeal?

text: On Mountain Lion, host `Coguaro`, I login as user `coconutpowder` using `bash`:               Coguaro:~ coconutpowder$ echo $0     -bash      I need to run a command with elevated privileges so I try to `su` switch to `root` but it won't let me:               Coguaro:~ coconutpowder$ su -     Password:     su: Sorry      Feir enough. I read the `man` page for `su` and get this:               PAM is used to set the policy su(1) will use.     In particular, by default only users in the ``admin'' or ``wheel''     groups can switch to UID 0 (``root'').      I notice I am not part of either group allowed to `su` by doing this:               Coguaro:~ coconutpowder$ id     uid=502(coconutpowder) gid=20(staff) groups=20(staff),12(everyone),61(localaccounts)      so I re-run the `su` command prefixing it with a `sudo`, which I am allowed to do as I am in `/etc/sudoers`:               /etc/sudoers: coconutpowder ALL=(ALL) ALL          Coguaro:~ coconutpowder$ sudo su -     Coguaro:~ root# echo $USER $0 $BASH_VERSION     root -sh 3.2.48(1)-release     Coguaro:~ root#       Now I have what I think is a problematic scenario as I am actually running `sh` for what I can see, that is my login shell for `root` after all, but I have the `BASH_VERSION` environment variable set from my earlier login, passed along via the `sudo` mechanism? Correct me if I am wrong. This means some shell-detection tricks like this break:               if [ ${BASH_VERSION-not_running_within_bash} = not_running_within_bash ]; then       # ...     fi      I am at a total loss as to how to properly `su` to `root` and have some way of determining with **certainty** whether I am using `bash` or not. The script uses Bash arrays extensively and could destroy filesystem paths if some values go spurious. I found the `ps -p $$` hacks mentioned elsewhere a bit of a hack (?!) so I am looking for the best way to accomplish what I am trying to accomplish, considering I must login first as `coconutpowder` and can't just do so as `root` directly. If I am doing the user switching wrong, I believe this question is distinctively different from the others that have proliferated around merely detecting the current (not _"default"_ or _"assigned"_ ) shell. So far I am edging towards parsing $0, possibly removing any prefixed `-` character to denote a login shell. Unless any of you can teach me how to `su` to `root` with login (i.e. reading $HOME/.profile) and directly switch to `bash` from the default `sh`, which can't be changed.


title: What is the easiest way to check if column A and B values goes both ways with AWK?

text: What is the easiest way to check if column A and B values goes both ways? Output to check:               Mike John     John Mike     Pamela Barbara     Barbara Pamela     Mike Paul     Roger Paul      Desired output               Mike <-> John     Pamela <-> Barbara     Mike -> Paul     Roger -> Paul      PS. First it could be like looking all the possible values in A and B column, then doing wordcount for each line               Mike John 1 1     Pamela Barbara 1 1     Mike Paul 1 0      Roger Paul 1 0      Then change is output to desired one.


title: VISUAL vs EDITOR what's the difference?

text: I generally set both `VISUAL` and `EDITOR` environment variables to the same thing, but what's the difference? Why would I set them differently? When developing apps, why should I choose to look at `VISUAL` before `EDITOR` or vice versa?


title: How to make a printer which is recognized but not working print

text: I'm running a Debian 6.0. I connected an HP 1000 J110 to my server which I access via SSH. Listing the USB ports it recognized it. Also I Pasted the PPD on the `/etc/cups/ppd/` folder. Is the PPD my PC uses to print when attached directly to the PC. I installed another printer and had no problem. I Use `lpstat -p` and it shows the printer there :               printer DESKJET-1000-J110 is idle.  enabled since Fri 22 Mar 2013 08:05:33 PM UTC      Then I use:               lp -d DESKJET-1000-J110 filetoprint.txt      where DESKJET-1000-J110-111 is the request id (1 file), and it appears that the file is sent to the printer. It actually appears as completed, but it just doesn't print anything. I also tryed with HPLip And when trying to run `hp-setup` it says:               error: No device selected/specified or that supports this functionality.      I checked and this printer _is_ supported by HPLip. What am I missing? I can post any additional needed info


title: Implementing "cp" command in C language

text: How to implement `cp` command in C language?I know it can be done with the `system()` function but I want to do it with `execl()` or some other related functions. For example:               execl("/bin/ls","/bin/ls",NULL)      will execute the command `ls` in a child shell.


title: how to reverse the effect of sgdisk -R=/dev/sdb /dev/sda?

text: I accidentally used `sgdisk -R=/dev/sdb /dev/sda` instead of `sgdisk -R=/dev/sda /dev/sdb` after replacing a broken drive in a raid. Can I recover from this or is all data lost now?


title: Where has my RAM gone & how to interpret atop's memory output?

text: For a while, I encounter RAM-shortages on my Debian webserver (VPS/virtual machine). This would not be unusual, if they happend on a regular basis. But they do not. Here's a chart from Munin:                  ![Daily memory use, by munin](http://i.stack.imgur.com/zSxcy.png) To solve such riddles, I tracked my system with `atop`. Here're two snapshots from 7:00AM and 9:00AM - during and after the RAM shortage (using the `-m` option to see the memory-related information):               ATOP - <snip>                           2014/09/10  07:00:02                           ------                             10m0s elapsed     <snip>     MEM |  tot     2.0G |  free   79.1M  | cache 102.4M  |  dirty   0.1M |  buff   53.2M  |  slab   90.8M |                |               |     SWP |  tot     2.0G |  free    2.0G  |               |               |                |               |  vmcom 748.1M  | vmlim   3.0G  |     DSK |           sda |  busy      1%  | read     917  |  write   1695 |  KiB/w     13  |  MBr/s   0.01 |  MBw/s   0.04  | avio 1.22 ms  |     <snip>            PID     MINFLT     MAJFLT     VSTEXT      VSIZE      RSIZE      VGROW      RGROW     RUID         EUID          MEM     CMD       1/15     13717        102         18     10709K     874.5M     206.2M         0K       128K     mysql        mysql         10%     mysqld      4086        166          0       450K     228.1M     21896K         0K         0K     www-data     www-data       1%     apache2     19131       1659         99       450K     225.5M     19604K     -2652K     -2292K     www-data     www-data       1%     apache2      1469        608          0       450K     222.6M     18508K       256K        64K     www-data     www-data       1%     apache2     23038        347          0       450K     222.3M     18496K         0K         0K     www-data     www-data       1%     apache2      4085        721          0       450K     222.1M     18308K         0K         0K     www-data     www-data       1%     apache2     10639        790          0       450K     224.9M     18284K       768K       932K     www-data     www-data       1%     apache2     19158        199          1       450K     222.1M     18064K         0K        52K     www-data     www-data       1%     apache2      1895        330          0       450K     221.8M     18020K         0K         0K     www-data     www-data       1%     apache2      6661       3346         22       450K     224.0M     17700K      1512K      -780K     www-data     www-data       1%     apache2     12570        808          0       450K     221.7M     17668K       512K       508K     www-data     www-data       1%     apache2     19817          0          0       450K     214.5M     15336K         0K         0K     root         root           1%     apache2     18209       3996          0      2277K     55592K     14728K     55592K     14728K     till         till           1%     python     18210       2760          0         4K     43292K     10544K     43292K     10544K     munin        munin          1%     munin-update     11976        506          0       149K     18788K      6512K         0K         0K     root         root           0%     atop      1934        175          0         4K     52228K      5852K         0K         0K     root         root           0%     munin-node     17993          0          0         4K     67020K      5712K         0K         0K     postgrey     postgrey       0%     /usr/sbin/post      2000          0          0       346K     244.3M      5668K         0K         0K     root         root           0%     rsyslogd     14557          0          0      7163K     234.9M      5284K         0K         0K     root         root           0%     php5-fpm     14558          0          0      7163K     234.9M      4564K         0K         0K     www-data     www-data       0%     php5-fpm     14559          0          0      7163K     234.9M      4564K         0K         0K     www-data     www-data       0%     php5-fpm       328          0          0       134K     572.6M      2932K         0K         0K     root         root           0%     console-kit-da     <snip>      And...               ATOP - vmd1989                           2014/09/10  09:00:02                           ------                             10m0s elapsed     <snip>     MEM |  tot     2.0G |  free    1.5G  | cache  88.8M  |  dirty   0.1M |  buff   19.2M  |  slab   25.8M |                |               |     SWP |  tot     2.0G |  free    2.0G  |               |               |                |               |  vmcom 748.0M  | vmlim   3.0G  |     DSK |           sda |  busy      0%  | read     453  |  write   1991 |  KiB/w     12  |  MBr/s   0.01 |  MBw/s   0.04  | avio 1.01 ms  |     <snip>            PID     MINFLT     MAJFLT     VSTEXT      VSIZE      RSIZE      VGROW      RGROW     RUID         EUID          MEM     CMD       1/16     13717        189          0     10709K     874.5M     206.3M         0K         0K     mysql        mysql         10%     mysqld     23038        743          7       450K     222.6M     18620K         0K        40K     www-data     www-data       1%     apache2     23930        692          0       450K     220.6M     18568K         0K         0K     www-data     www-data       1%     apache2     28738       4784          0         4K     126.4M     18328K     126.4M     18328K     munin        munin          1%     munin-update     26990        392          1       450K     220.5M     18088K         0K       112K     www-data     www-data       1%     apache2     26552       1150          2       450K     220.3M     17788K       512K       576K     www-data     www-data       1%     apache2     28744       1443          0         4K     129.1M     17636K     129.1M     17636K     munin        munin          1%     /usr/share/mun     27424        602          0       450K     219.8M     17504K         8K       240K     www-data     www-data       1%     apache2     27000        216          0       450K     219.8M     17308K         8K       104K     www-data     www-data       1%     apache2     28290       2977          0       450K     219.9M     17200K     219.9M     17200K     www-data     www-data       1%     apache2     19817         68          0       450K     214.5M     15340K         0K         0K     root         root           1%     apache2     28287        429          1       450K     215.0M     10384K     215.0M     10384K     www-data     www-data       1%     apache2     28727        184          0       450K     214.5M      9300K     214.5M      9300K     www-data     www-data       0%     apache2     28728        191          0       450K     214.5M      9300K     214.5M      9300K     www-data     www-data       0%     apache2     11976        490          0       149K     18788K      6512K         0K         0K     root         root           0%     atop      1934        428          0         4K     52228K      5852K         0K         0K     root         root           0%     munin-node      2000          0          0       346K     244.3M      5668K         0K         0K     root         root           0%     rsyslogd     28745       1036          0         4K     52228K      5580K     52228K      5580K     root         root           0%     munin-node [::     14557          0          0      7163K     234.9M      5284K         0K         0K     root         root           0%     php5-fpm     17993          0          0         4K     67020K      4844K         0K         0K     postgrey     postgrey       0%     /usr/sbin/post     14558          0          0      7163K     234.9M      4564K         0K         0K     www-data     www-data       0%     php5-fpm     14559          0          0      7163K     234.9M      4564K         0K         0K     www-data     www-data       0%     php5-fpm       328          0          0       134K     572.6M      2932K         0K         0K     root         root           0%     console-kit-da     <snip>      Sorry for the long lists - just do not want to miss the cause. Yet, my problem is: I do not see the cause. There is significantly less "free" memory in the status (top), but no process that would explain why, where is the memory going... Is my thinking incorrect with this? **Update** According to Patrick's advice, I collected `/proc/meminfo` - during a phase of RAM shortage and later. In sake of easy visibility, I put the content into one table:                              mem-shortage   a bit later          MemTotal:        2060776 kB    2060776 kB     MemFree:          252896 kB    1608532 kB   *     Buffers:           15464 kB      12060 kB     Cached:            71864 kB      62800 kB     SwapCached:         4160 kB       4160 kB     Active:           268020 kB     253368 kB     Inactive:         134988 kB     132300 kB     Active(anon):     225940 kB     220872 kB     Inactive(anon):    97296 kB     220872 kB   *     Active(file):      42080 kB      32496 kB     Inactive(file):    37692 kB      29116 kB     Unevictable:        6540 kB       6680 kB     Mlocked:            6540 kB       6680 kB     SwapTotal:       2096476 kB    2096476 kB     SwapFree:        2081568 kB    2081568 kB     Dirty:                 0 kB        116 kB     Writeback:             0 kB          0 kB     AnonPages:        318084 kB     313364 kB     Mapped:            20692 kB      20408 kB     Shmem:              4208 kB       9896 kB     Slab:              24336 kB      23936 kB     SReclaimable:      10252 kB       9316 kB     SUnreclaim:        14084 kB      14620 kB     KernelStack:        1464 kB       1544 kB     PageTables:         8396 kB       9544 kB     NFS_Unstable:          0 kB          0 kB     Bounce:                0 kB          0 kB     WritebackTmp:          0 kB          0 kB     CommitLimit:     3126864 kB    3126864 kB     Committed_AS:     744764 kB     761812 kB     VmallocTotal:   34359738367 kB  34359738367 kB     VmallocUsed:         272976 kB       272976 kB     VmallocChunk:   34359464431 kB  34359464431 kB     HardwareCorrupted:     0 kB          0 kB     AnonHugePages:         0 kB          0 kB     HugePages_Total:       0             0     HugePages_Free:        0             0     HugePages_Rsvd:        0             0     HugePages_Surp:        0             0     Hugepagesize:       2048 kB       2048 kB     DirectMap4k:      282560 kB     282560 kB     DirectMap2M:     1814528 kB    1814528 kB      I only see two signficant (not in the statistical sense) differences, marked with an asterisk (*), but I do not think, they tell me where the RAM went. I also checked for shared memory (as good as I could) ... and found none.               # ipcs -m          ------ Shared Memory Segments --------     key        shmid      owner      perms      bytes      nattch     status      I also check for hidden processes using `unhide`. But except for a false positive (known issue with Debian), there seem not to be any hidden processes. Any more ideas why 1.2 GB RAM are in use - and then not? Could this be an issue caused by the virtual server architecture?


title: How to change file owner from root to apache?

text: I am using apache server on Linux fedora 17. I have one php code which creates a .ini file. If I create the .ini file by running php code through apache web server then rest php code files are able to read the .ini file data as its owner is apache. But if I run the php code from Linux terminal and generate that .ini file then rest php code files are not able to read the file data as the owner is root. I tried changing group and file owner of .ini file from root to apache from terminal but still it is not working.


title: how to concatenate a file with multiple header into one

text: Can you suggest me how I can combine. a.fasta with 10000 sequences having headers 1, 2, 3, .... 10000 .......................into just one header e.g               >1     AAATTTTGGGGCCC     >2     ACCCCGGGTTT     ..........     >10000     ATGCCCCCCCCCC      Output:               >1     AAATTTTGGGGCCCACCCCGGGTTTATGCCCCCCCCCC


title: How to create a fingerprint of the hardware from a dedicated root server?

text: Recently our ubuntu root server has been replaced after some failures. Unfortunatelly we cannot confirm if it really has been replaced or just some parts. What is the best and most thorough way to get as much information of a system as possible? I'm thinking of serial numbers, chip types, ... With fingerprint I don't mean any fancy calculations, just to create a file that contains all that information for comparison when they claim again something has been changed.


title: How can I tell *which* application is asking for access to gnome-keyring/Seahorse?

text: Whenever I log in on Ubuntu Lucid Lynx 10.04 I get a Seahorse/gnome-keyring prompt telling me an application wants to access my keyring. It isn't the network manager, because if I cancel the request my network connection is still established (also, this only started happening recently). How can I tell which application is making this request? The prompt doesn't provide this information.


title: DD-WRT and /bin folder permission

text: I have a project with a wrt54gl modem, and we need to copy a file from computer into modem (in modem `/bin` folder), but we have a problem when we copy the file with `scp` copy: "permission denied". We try to set permissions on `/bin` folder, but it does not change. Is there a way for changing permissions on `/bin` folder (in wrt54)?


title: Files replaced with Finder on Mac creating a copy on Samba's .recycle

text: # Scenario: Ad Agency with Samba Server and multiple Mac users, 0 Windows users.               vfs objects = recycle     recycle:keeptree = yes     recycle:repository = /storage/files/.recycle/%U      # Workflow: Before start working with some PSD file (or whatever they use) they copy it locally to not overload our network. After finishing it they upload it again on the server. # Problem: Once the designer paste the file on the server using Finder, two things happens:   1. The original file is moved into .recycle   2. The file is overwritten # Expected: Only step two should happen, no file should be moved to recycle (this is taking lots of space). So far, I've readed on samba man page that by setting `vfs objects = recycle`, that it will intercept all deleting requests and move the file to recycle. Is it expected that Finder (or any other file manager) raise an delete call everytime someone tries to overwrite a file?


title: How to run xrestop remotely?

text: I need to run `xrestop` on a remote machine. When I connect through `ssh` and run `xrestop` I get the results for my local machine. I see that there is an option `-display` but I don't know how to use it. How to run `xrestop` remotely ?


title: Ubuntu 13.04 seems to randomly crash

text: I'm using an x64 distro of Ubuntu 13.04 on a Dell inspiron 1464, but it keeps crashing for no apparent reason. Took some pictures of the error screen (first picture is of one instance, the rest are from another single instance) http://imgur.com/a/TixyL I tried accessing the logs and the computer crashed again. I have Windows 7 on a dual boot and there doesn't seem to be any issue with it. How can I tell what the problem is? I want to know if this is a general issue or is it specific to me


title: udevadm slow boot

text: After I upgraded from Slackware 13.70 to 14.0, when the machine is booting, it takes it 15 seconds to execute this line: > /sbin/udevadm trigger --action=add I understand, that it tries to detect the new hardware. But it's really long. How can I fix it?


title: Screen very dim after resume from suspend

text: I'm unable to resume from 'Suspend to RAM'. It resumes properly, albeit with a very very dim screen (so dim I can barely make out the desktop). Trying to brighten the screen using the `Fn` keys doesn't work, and the only option is to switch the machine off and on. I'm running Bodhi Linux 2.3 with onboard Intel graphics. I think the driver being used is `i915`, according to `lsmod`, but I could be wrong. Output of `uname -a` and `lsb-release -a`: > Linux bodhiman 3.8.0-12-generic #21 SMP Tue Mar 12 17:39:30 CDT 2013 x86_64 > 86_64 x86_64 GNU/Linux > > Distributor ID: Ubuntu   >  Description: Bodhi 2.3.0   >  Release: 12.04   >  Codename: precise What can I do to diagnose this and fix it?


title: SMTP Auth - SASL on Dovecot, Postfix and CentOS 6.2 (and Open-Xchange)

text: I am trying to get open SASL to work on CentOS 6.2. I followed this tutorial: http://wiki.centos.org/HowTos/postfix_sasl I suspect it works perfectly for CentOS 5.x so all I really need is an update for use on CentOS 6.2. I was feeling confident right up until I discovered half way through that dovecot.conf goes mad with these settings. This link recommends that people running CentOS 6 use a different method. http://wiki2.dovecot.org/HowTo/PostfixAndDovecotSASL Neither of the methods outlined in these links work. Also I don't know how to get Open-Xchange to use SMTP authentication. It seems to be very poorly documented and their CE forum is not letting me post, nor is it showing much activity at all.


title: In linux console (no X), how to stretch console screen to fit monitor

text: Google could not help me with this problem. I hope you guys can. When I boot my computer, the first few screens presented to me by BIOS and boot menu are stretched to fit the LCD screen. Once Linux boots, however, the screen shrinks so one pixel of the console font uses only one pixel of the screen, causing the usable area of screen to shrink to only the upper left part of the screen, since the console uses only 640x480 of the 1280x1024 size monitor. I know I can use the VGA= boot flag to set modes that increases the number of rows and columns of text, so that the whole screen is used. However, what I want to do is keep the number of rows and columns _as they are_ but scale the whole screen to fit the monitor, just like the BIOS boot messages. I need to do this in a way that will work on any monitor automatically. **EDIT** : I've not given info on hardware on purpose, because I want the solution to be hardware-agnostic. The distribution I'm using is Ubuntu 10.10.


title: Gentoo how to compile LVM statically linked?

text: A Gentoo install still in the livecd stage (unable to boot so far) fails to emerge LVM statically. I need a statically compiled lvm in order to use it in my initrd. My make.conf:               CFLAGS="-O2 -march=native -pipe"     CXXFLAGS="${CFLAGS}"     CHOST="x86_64-pc-linux-gnu"     USE="bindist mmx sse sse2 static"      The emerge compile error:               /usr/lib/gcc/x86_64-pc-linux-gnu/4.6.3/../../../../lib64/libudev.a(time-util.o): In function `now': (.text.now+0x8): undefined reference to `clock_gettime'      I also note that:   * Warning, we no longer overwrite /sbin/lvm and /sbin/dmsetup with   * their static versions. If you need the static binaries,   * you must append .static to the filename! What does this mean? How am I supposed to append this ".static" to the filename? I see that this person had the same issue, but with no answer: http://archives.gentoo.org/gentoo- user/msg_eb40f5d76161fda72d134551cc26d989.xml I also notice this thread: http://forums.gentoo.org/viewtopic-p-4892618.html?sid=e41b07d9b8554c10430619e1f51d564a I tried export LDFLAGS=" -lrt " However it didn't appear to change anything, still the same error.


title: SSH agent loses keys after logging out

text: I added my SSH key having typed `ssh-add ~/.ssh/id_rsa` and `ssh-add -l` printed my key. But after logging out and logging in again I see > The agent has no identities. I've tried setting a very big lifetime period but it didn't help. OS: Ubuntu 12.04.2 LTS


title: Accidentally deleting crucial libraries

text: If you accidentally delete a crucial library folder, such as /usr/lib, how can you recover from that?


title: Time validation with regex

text: I'd like to make validation about time stamp of one of my log file. But it seems I have problem on my expression in case statement. TIME value might be something like 11:49 or 2011. And I just want to check whether it is HH:MM format or not. Code is in below.   It is always saying year format althought file is in HH:MM format               #!/usr/bin/ksh     TIME=`ls -lrth  /var/log/*.log |  grep -i upg | tail -1 | awk '{print $8}'`     echo "$TIME"     validation=false     if [[ $TIME != "" ]]      then       case TIME in          "[0-23]+ :[0-59]")             validation=true             break;;       *) echo "Year format";;     esac     fi          echo "$validation      Update : I tried "[0-2][0-9]:[0-5][0-9]") but validation still return fail.


title: Can I make `cut` change a file in place?

text: The `man` page doesn't give me much hope, but I'm hoping it's an undocumented (and/or GNU-specific) feature.


title: How to install Fedora&Ubuntu with encrypted VG's on one disk?

text: I installed Fedora 14 first, then Ubuntu 10.04. I installed them using dm_crypt/aes256/lvm, so I used encrypted VolumeGroups. At the end of the Ubuntu install it said it cannot install GRUB, so I had to use SuperGRUBdisk to start Fedora and give the command:               # grub-install /dev/sda      Now I can boot to Fedora normally, without using supergrubdisk, but the problem is, I can't boot to Ubuntu! Is there any working way to install Fedora 14 & Ubuntu 10.04 using (separated) encrypted VolumeGroups (each volumegroup with other password)? Such that 2 users (who knows the root passwords of their own distro) can use 1 PC but not see each other's files? Update: I tried it in reverse order: I first installed the Ubuntu, then the Fedora. Fedora didn't gave error messages regarding grub when installing, but it's still the same: I can't see the Ubuntu in the "grub boot list", when booting the PC.      What could be the problem? The boot manager doesn't recongize that, that there is another distro on the HDD? Why? What should i do?      Update#2: Here is my idea on a picture :) (on other pict. host)      Update#3: I'm trying this whole thing in VirtualBox (VirtualBox-3.2-3.2.12_68302_fedora14-1.i686)


title: Can the focus of a Microsoft LifeCam HD-5000 be fixed at infinity under linux?

text: I have two Microsoft LifeCam HD-5000 webcams which I am using as a home security system with the Motion package for linux. One problem I have is that because these webcams have auto-focus, sometimes they will try to automatically adjust the focus and will create false positive motion detection. It seems like you can fix the focus at infinity under windows. Is there any way I could do that under linux, using `uvcvideo`?


title: How to use keyfiles,for ZFS whole disk encryption?

text: Does anyone have a working implementation using keyfiles, preferably on SD Card, instead of a prompt for ZFS? I know how to do this with linux LVM/LUKS. In my opinion the FreeBSD full disk encryption solutions are WAY more secure, but I would really like to use keyfiles instead of getting prompted during boot. I can't find a way to do it with google-magic.


title: mount.cifs is slow

text: Using mount.cifs on openSUSE 11.3, I'm getting very slow performance on a gigabit network, usually around 4-5MB/s. The following mount command has yielded me the best performance so far:               mount.cifs //server/share /mnt/share -o user=aduser,domain=ADDOMAIN,uid=aduser,nogrp,nobrl      Windows 7 on the same network gets almost full gig. What else can I try to make it faster?


title: Differences between Debian bigmem and amd64 kernels

text: Debian 6 has multiple Linux kernel packages, and I'm interested in two of them:   * linux-image-2.6.32-5-686-bigmem   * linux-image-2.6.32-5-amd64 Consider that:   * I'm not going to be running any application that eats over 4GB RAM   * I have > 3GB of RAM installed   * I want to remain on 32-bit userland Why should I choose one over the other, if I have a processor capable of running each of them?


title: Rebooting without shutting off?

text: I have been using Linux Mint Debian with Debian unstable and noticed that when I press restart, instead of going all the way back to the BIOS, then grub, then booting up, I seem to be shutting down then loading back up without going back to the BIOS or GRUB. This is an amazing feature I have not seen before until now. What is this called and when did it happen? I had been a user of Ubuntu for a long time.


title: How to create LV

text: I want to create some LV in my VG **I have this:** > LV Name /dev/vg_appli/lv_grt   >  LV Size 10,00 GB > > LV Name /dev/vg_appli/lv_sap LV Size 7,00 GB > > LV Name /dev/vg_appli/lv_PRC   >  LV Size 15,00 GB > > LV Name /dev/vg_appli/lv_archDCM   >  LV Size 20,00 GB **I create like this:**               fdisk -l         pvcreate /dev/sdc        vgcreate vg_appli /dev/sdc       lvcreate -l **?** vg_appli -n lv_grt         lvcreate -l **?** vg_appli -n lv_sap         lvcreate -l **?** vg_appli -n lv_PRC         lvcreate -l **?** vg_appli -n lv_archDCM          lvdisplay /dev/vg_appli              mkfs.ext3 -m 0 /dev/vg_appli/lv_grt          mkfs.ext3 -m 0 /dev/vg_appli/lv_sap          mkfs.ext3 -m 0 /dev/vg_appli/lv_PRC          mkfs.ext3 -m 0 /dev/vg_appli/lv_archDCM      I do not know what to put in place of **'?'**


title: Linux Mint XFCE, command to launch menu

text: What is the command that launches the whisker menu in the Linux Mint xfce edition. For another distribution that used xfce it was `xfce4-popup-whisker menu` but that doesn't seem to work. I would like to assign the super key to launch the menu.


title: How to bind 'tab' and 'shift+tab' in gnu screen?

text: As the title says, how do I bind the keys 'tab' and 'shift+tab' in screen? My problem is that I don't know what to pass to the screen command "bind" to designate these keystrokes. BTW, I'm aware of GNU screen: move between regions but the answer is not there. All of the following fail with the error `-X: bind: character, ^x, or (octal) \032 expected`:               screen -X bind "\033[Z" focus up     screen -X bind "^[[Z" focus up     screen -X bind "\t" focus up     screen -X bind \033[Z focus up     screen -X bind ^[[Z focus up     screen -X bind \t focus up      Same thing if I hit `Ctrl+A`, `:` to input the command


title: How to awk printf additional string with backslash

text: I have a csv that I want to add a preceding column to and a trailing column. The trailing column is a date (manual string right now). Every time I try to get that date, it ends up replacing some text at the front of the read in data (print $0). How can I add that info? Sample data from stdin               UNDEFINED,1089,19.3,-0.1      awk               awk -F, '{ printf ", %, %s\n", $0,"12\/15\/2012"}'      results               , 12/15/2012 1089, 19.3, -0.1      desired results               ,UNDEFINED,1089,19.3,-0.1,12/15/2012      I've even tried separating the fields into individual columns, same result. Tried triple double-quotes around the date, same results (maybe an error i can't remember). What am I doing wrong with that date?


title: sctp traffic generator

text: I'm looking for a free SCTP/TCAP traffic generator (specially for MAP, Camel and INAP protocols). I need to build some message flow scenario and generate load in order to test some application Thanks


title: Kill nohup command on cluster

text: Last night I launched a command via nohup on a cluster and then closed the connection. Today I would like to kill this job (I know it's still running because output is being generated in an output file) but I can't even determine its PID. If I type `ps -ax`, for instance, the name of my executable does not show up. Just typing `ps` only shows me executables that I have launched this login session. Any suggestions?


title: Is the ELF format bound to a CPU architecture or not?

text: If you go through wikipedia it states that "ELF is flexible and extensible by design, and it is not bound to any particular processor or architecture." Then why are there so many packages like   * elf_i386    * elf_x86_64    * elf32_x86_64    * i586-elf  etc...


title: How can I automatically log in to a list of servers to prevent account lockout?

text: I have started a new contract, and need to have an active account on almost 200 servers. Security has accounts lock after 30 days of inactivity, as well as if you do not log in within 1 hour of having the account unlocked. To keep everything from locking up, I would like to create a script that runs through the list of servers, logs in with my username and password, and then logs out. We are running RHEL 5 on most machines, with a few OEL 6's as well (mostly RHEL5 though). Googling for the topic keeps bringing me to the SSH keygen topic (which we have/use), but I want my generic account to not get locked out all the time on the other servers, in case of network problems where I have to physically go and log in.


title: How to perform off-line live upgrade?

text: openSUSE supports for some time online live upgrade. However I see two issues here:   * minor -- I already have DVD downloaded and burned   * major -- until now my eth0 card is not **oficially** supported, so on every upgrade it is disabled, and later I have to install drivers for it. I am afraid it might be the case with live upgrade as well -- i.e. upgrader would "upgrade" the driver for eth0, disabling it, and eventually breaking entire upgrade process So I am wondering if I could treat DVD as repository and point it for zypper to perform live upgrade "downloading" packages from the disc? Is it possible? How to do it? _I cannot run DVD and perform upgrade from there, because installer from the disc has hard time recognizing my LVM partitions, in short -- it does not recognize them. So I though why not try it from running system with fully working partitions._


title: Find file by a part of its content

text: I have many files in a specific repository and i must find a file which has a specific string in its content (actually referencing the file `Version.cc.in`). What is the best solution to find it?


title: Installing boost 1.46 in Linux Mint

text: I've just installed Linux Mint 14. Some application I need requires Boost 1.46. For some reason, it fails to compile with the Boost available in Mint's repo (1.49). Is there a way to install Boost 1.46 in Linux Mint 14?


title: grub> : not able to find files?

text: I have installed grub legacy on my system Ubuntu 13.04 for testing & learning. In the shell terminal I typed `grub` & the grub terminal showed up. Then I searched stage1 file as below but got error. What's the issue?               grub> find /boot/grub/stage1          Error 15: File not found          grub>      I'm following this link for study.


title: gpg asks for password even with --passphrase

text: I expect the following command to extract the gpg file without asking for password:                 gpg --passphrase 1234 file.gpg      But it asks for the password. Why? This also have the same behavior:                 gpg --passphrase-file passfile.txt file.gpg      I use Ubuntu with gnome 3, and remember that it was working in Fedora


title: How to avoid 404 error with git instaweb?

text: I have tried running `git instaweb start` in two different repositories. In one it works fine, and indexes all the repositories in my home directory (even though run in a subdirectory). When run in another the web site simply says "404 - No projects found". More information:   * The top-level repository directories both have the same owner and permissions.   * The "non-working" repository has an `@` sign in the directory name.


title: How to rename devices for graphical output such as VGA0

text: On my Laptop the names of my graphical outputs change depending on what chip is activated in the BIOS. This leads to problems in some scripts where outputs such as VGA-0 or LVDS-0 are specified. So I want to rename the graphical outputs, similar to how you can specify persistent names for network devices with `udev`. But I can't find anything that would explain how or if this is even possible at all. In /sys I could find kernel names such as as:               /sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-DVI-D-1     /sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-VGA-1      while `xrandr` reports the names as `DVI1` and `VGA1`. So they have to be renamed somewhere(?) When I call `udevadm info` on one of those devices I get a lot of information but not the names used by `xrandr` and other X tools. So is it possible to create a `udev` rule to rename the outputs and if so how? Are the names even set by `udev`?


title: How to enter/choose session after logout without password in (Linux Mint) Xfce?

text: I have Linux Mint 14 Xfce (4.10) and have also installed LXDE desktop, so I can choose between these sessions if I want. Normally I would set one as default and **at startup I am not asked for username &password and am logged in automatically as intended**. (Under Settings/Login Window/Security - "Enable automatic login" is checked; and have also verified that `/etc/lightdm/lightdm.conf` contains the line `autologin-user=cipricus`.) But even before installing LXDE I was **asked for username and password after logout** despite the fact that **in Settings/Users and Groups I have the setting of not being asked for password on login**. ![enter image description here](http://i.stack.imgur.com/R73K2.png) In `/etc/mdm/mdm.conf` I see the line: `AutomaticLoginEnable=true`. (Settings/Session and startup/General - 'Display session chooser' is unchecked. But this regards the other type of 'session': not the first type that involves selecting between users-passwords-desktops, but the one that involves selecting between sets of saved settings of the same user and desktop. More on this distinction/confusion **here**.) I find it odd that if I restart the computer I can enter default session without password, but if I just log out the username&password are needed to log in. Opening computer and entering default session/DE: no username&password; **selecting between sessions** : username&password needed. In the future I might decide to activate password at startup but I still don't want a password being asked in order to change or re-enter a session **after** the system has started. Are there other settings to make?


title: Convincing boss that I need to use Linux

text: I am shortly going to be joining a statistics consultancy where the software I'll be using is R and SAS in Windows. For years I have been using R with Linux (most previous Windows knowledge has probably been lost) and I know that my job will be far easier this way. I mentioned this at the interview and they were sceptical and asked the reasons why it would be better, and at the time I didn't have a very good reply. Certainly the cost to moving to Linux will be making collaboration with others at work a little harder, however I want some convincing ideas of the benefits:   * Familiarity:      * Lots of little things I take for granted, but don't always come directly to mind, e.g. some of the coreutils packages which I know will help when dealing with large data files     * I use Emacs with ESS, Auctex (this is meant to work on Windows also)   * Remote working:      * The ease of ssh to quickly do something while I'm not at work     * I use xpra quite a lot when I need X   * HPC:      * I currently have access to a multi-user server with grid engine to queue jobs. To my knowledge there isn't an equivalent software for windows.   * Others? I know that I could run Linux in a virtual machine either as host or guest, but this sometimes add more problems and if Linux is the guest then there are performance/memory issues. Also dual booting just seems like it would waste more time than it saves.


title: Is there a command line tool to insert line breaks into a long string?

text: Given a long string that needs to be displayed with limited text-width, is there a command line tool in *nix that converts the single-line string to a multi-line string with each line being no longer than a given text-width? For example, given the following string               $ MYSTRING="Call me Ishmael. Some years ago - never mind how long precisely - having little or no money in my purse, and nothing particular to interest me on shore, I thought I would sail about a little and see the watery part of the world."      I would like to format somewhat like this:               $ echo $MYSTRING | special-format-command --width=30     Call me Ishmael. Some years ag     o - never mind how long precis     ely - having little or no mone     y in my purse, and nothing par     ticular to interest me on shor     e, I thought I would sail abou     t a little and see the watery      part of the world.


title: Links browser shortcut for clear history?

text: If in `Elinks`, I can press `h`, `l` then `Enter` and `c` (Quite long, but better than nothing) But in `Links` browser, I have no idea in any way to clear the history.


title: customise ls color for directories contain specified file/s

text: How can I colorize directories contain files with word **INCORRECT** inside? Example: I have 3 directories which contain log file.               dir_a/log     dir_b/log     dir_c/log      The file log in dir_c contain word **INCORRECT** Is it possible to get colorized ls output as following?               dir_a --> blue     dir_b --> blue     dir_c --> red


title: Strange Character in my Bash prompt?

text: I'm somewhat new to Bash prompts, but I was finally able to get things somewhat working. However, I have a strange character at the beginning of my prompt: ![Screenshot of prompt](http://i.stack.imgur.com/1s09R.png) Here's my actual `PS1` prompt:               PS1='\[\e]2;\u@\h\a${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[01;34m\] \w \$\[\033[00m\] '      Can anyone spot the problem? What am I doing wrong here?


title: GLIB_GSETTINGS not found while compiling gnome extension

text: having failed to install a gnome extension from their website I looked for another way on Google. The guide I found was like:               sudo apt-get install gnome-common     git clone git://git.gnome.org/gnome-shell-extensions     cd gnome-shell-extensions     ./autogen.sh –prefix=$HOME/.local – enable-extensions=”dock”      The last command failed with the following error:               ./configure: line 4276: GLIB_GSETTINGS: command not found     configure: error: invalid extension drop-down-terminal      Unfortunately I couldn't find anything helpful on Google this time.   Any suggesion? Thanks.


title: How can I prevent my bluetooth keyboard from sleeping?

text: I like to type using a bluetooth keyboard. After about 5 or 10 minutes of being idle, the keyboard seems to go to sleep. Once the keyboard is asleep, there is a 5 to 10 between the next key press and when it registers on the computer. I presume this is so that wake up and pair with my laptop again. Is there any way to configure how much time to wait until the keyboard sleeps, or disable the keyboard sleeping all together?


title: How to save guake tabs

text: I add some tabs in guake by default everytime like `ssh`, `root`, `mysql` and etc. How I can save this tabs that when restart ubuntu, guake start with my default tabs?


title: Why did my debian server crash?

text: I have a debian server newly installed yesterday evening. I used an image called debian-7.0-amd64-minimal from my hoster. Just installed apache2, mysql, php, vim, lynx and configured a few webpages. Afterwards I configured a crontab (which runs every 10mins). I had a similar issue before (I thought reinstalling might fix it). After a few hours the server crashes somehow. I can't reach the webserver, can't access the machine via ssh but somehow it still runs. I can see the machine running in the web-interface from my hoster. Still since I can't access any service I have to restart it (via the web-interface provided by my hoster). After restarting it I always checked all logs in /var/log having relevant timestamps. However there is only one sporadic error               [Fri Mar 28 12:40:17 2014] [error] [client x.x.x.x] PHP Warning:  file_get_contents(http://www.bloomberg.com/quote/DAX:IND): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known      This is caused by a php-script called via crontab (a webpage is invoked using lynx) The DNS server is the one from google 8.8.8.8 . However this happens only sometimes and usually the services continue working after that. This is why I guess this is a different issue. I disabled the crontab after the last crash and update this post if the issue resolves itself now. The other thing which makes me believe that the server not totally crashes is that those crontabs still continue to work               Mar 28 10:00:01 aryx /USR/SBIN/CRON[10947]: (root) CMD (lynx -dump http://[webpage]/cron/cronjob.php)     Mar 28 10:00:06 aryx /USR/SBIN/CRON[10946]: (CRON) info (No MTA installed, discarding output)     Mar 28 10:09:01 aryx /USR/SBIN/CRON[11068]: (root) CMD (  [ -x /usr/lib/php5/maxlifetime ] && [ -d /var/lib/php5 ] && find /var/lib/php5/ -depth -mindepth 1 -maxdepth 1 -type f -ignore_readdir_race -cmin +$(/usr/lib/php5/maxlifetime) ! -execdir fuser -s {} 2>/dev/null \; -delete)     Mar 28 10:10:01 aryx /USR/SBIN/CRON[11088]: (root) CMD (lynx -dump http://[webpage]/cron/cronjob.php)     Mar 28 10:10:21 aryx /USR/SBIN/CRON[11087]: (CRON) info (No MTA installed, discarding output)     Mar 28 10:20:01 aryx /USR/SBIN/CRON[11221]: (root) CMD (lynx -dump http://[webpage]/cron/cronjob.php)     Mar 28 10:20:21 aryx /USR/SBIN/CRON[11220]: (CRON) info (No MTA installed, discarding output)      even though the webserver already crashed (or whatever crashed by that time) somewhere between 10:00 and 10:10 (at which time the next cron call was executed)               [webpage]:80 [ip-address] - - [28/Mar/2014:09:50:01 +0100] "GET /cron/cronjob.php HTTP/1.0" 200 208 "-" "Lynx/2.8.8dev.12 libwww-FM/2.14 SSL-MM/1.4.1 GNUTLS/2.12.18"     [webpage]:80 [ip-address] - - [28/Mar/2014:10:00:01 +0100] "GET /cron/cronjob.php HTTP/1.0" 200 208 "-" "Lynx/2.8.8dev.12 libwww-FM/2.14 SSL-MM/1.4.1 GNUTLS/2.12.18"     [webpage]:80 [ip-address] - - [28/Mar/2014:12:00:02 +0100] "GET /cron/cronjob.php HTTP/1.0" 200 208 "-" "Lynx/2.8.8dev.12 libwww-FM/2.14 SSL-MM/1.4.1 GNUTLS/2.12.18"      The one irregularity though also occurs before 10am               Mar 28 09:39:01 aryx /USR/SBIN/CRON[10658]: (root) CMD (  [ -x /usr/lib/php5/maxlifetime ] && [ -d /var/lib/php5 ] && find /var/lib/php5/ -depth -mindepth 1 -maxdepth 1 -type f -ignore_readdir_race -cmin +$(/usr/lib/php5/maxlifetime) ! -execdir fuser -s {} 2>/dev/null \; -delete)*      Any suggestions what could be wrong? **update:** Using plog, the only noticeable event around the crash-time (which was between 19:31 and 32) is the logfile of a apache process:               3-28 19:31   S     20         0s      1   185.34MB     7.46MB 96.2%     1012kB    16.66MB    17.73MB         429       0     3-28 19:32   S     20         0s      1   187.50MB     9.68MB 89.1%     1804kB    16.79MB    17.86MB        1281       0     3-28 19:33   S     20         0s      1   187.50MB     9.68MB 89.1%     1804kB    16.79MB    17.86MB        1281       0


title: Forcing keys to run bash scripts

text: Is it possible to define bash scripts for all keys on keyboard so that by pressing any key the bash script for that key will be run? The scripts may do anything, for instance they may save the key code in an (undo list) file, or any thing else. In KDE, if a key can be set as a (Qt) hotkey there's a simple solution for it, but for example `A` cannot be a hotkey and it seems impossible to urge it to run any scripts.


title: death_handler: Fatal signal 15 received

text: I have problem with my Linux when I try to shut it down.               init 0      I get the following error:               death_handler: Fatal signal 15 received     setsockopt recvref[30]: Protocol not available      The sytem will be blocked. Sometimes it shuts down after a while, sometimes not. How can I solve this problem? The system should be efficient in that way. Should I modify something in `systemd`?


title: chmod does not change permissions of certain directories

text: System file: `ext4` I changed the owner of files to `apache:` with the command:               chown -R apache: wp.localhost      Then, I could not change the permissions of directories in wp.localhost nor the wp.localhost itself I use the command `chmod +w wp.localhost` for example. and I do not see any permission change on it. I also changed the group of folders by the command again, But did not solve the problem.               chown -R apache:users wp.localhost      **Commads and permissions before and after:**               #ls -ld wp.localhost     drwxr-xr-x 6 apache users 4096 Mar 28 15:26 wp.localhost/     # chmod +w wp.localhost     # ls -ld wp.localhost     drwxr-xr-x 6 apache users 4096 Mar 28 15:26 wp.localhost/


title: df command not showing correct values

text: This is a RHEL server, I'm running a MySQL server on it, the database and log files (however, logging is disabled) are located on the `/srv` directory where plenty of space is available. Recently I had a crashed table, so I tried fixing it but on the next day I found that MySQL can't respond to many of queries with an error indicating that there is no disk space:               ERROR 1030 (HY000): Got error 28 from storage engine      So I ran the following command to see what's taking space               [root@tms /]# df -h     Filesystem            Size  Used Avail Use% Mounted on     /dev/mapper/server-slash                           9.9G  9.5G     0 100% /     tmpfs                 7.8G     0  7.8G   0% /dev/shm     /dev/sda1             485M   58M  402M  13% /boot     /dev/mapper/server-var                           739G  252G  450G  36% /srv      Surprisingly it's the `/` directory. But more surprisingly is that the directories under `/` do not indicate used space more than **2 GB** , while `df` shows total space **9.9 GB** for `/`.               [root@tms /]# du -sh /*     7.5M    /bin     48M     /boot     200K    /dev     24M     /etc     4.0K    /home     223M    /lib     21M     /lib64     16K     /lost+found     4.0K    /media     4.0K    /mnt     183M    /opt     ...deleted some file-not-found errors for files under /proc     0       /proc     144K    /root     14M     /sbin     4.0K    /selinux     252G    /srv     0       /sys     44K     /tmp     917M    /usr     259M    /var      So why does `df` show wrong values ? And how can I findout what's actually taking space ?


title: How to check well-formedness of 4GB XML file?

text: I want to check well-formedness of a big XML file. (about 4GB.) However, when I try `xmlwf`, all it tells me is               filename.xml: Value too large for defined data type      What to do with it? Is there any other way to check it? (I am using debian linux and gentoo linux)


title: Backspace deletes Bash prompt

text: I recently modified my Bash prompt via the `$PS1` variable so that I could have color. It is in my `.bashrc` file:               PS1="\\[\e[0;32m[\h::\W] >>\e[m "      Now if I type something and then have to backspace to clear it the entire prompt disappears. If I hit enter a new one shows up. Looking at this question regarding the same issue it would appear that I am missing a closing bracket. I don't know where it would go, though.


title: Grub not loading after Windows 8 Install

text: My system was configured to dual boot Ubuntu 12.04.1 LTS and Windows 7. Today I got my hands on the MSDN release of Windows 8 and I installed it over my Windows 7. Now the computer just boots to Windows 8 directly without loading the GRUB screen. So I followed the steps as suggested in: https://help.ubuntu.com/community/RecoveringUbuntuAfterInstallingWindows. Running this command:                   ls -l /dev/disk/by-label/      gives the following output:                   total 0         lrwxrwxrwx 1 root root 10 Sep 11 07:51 Entertainment -> ../../sda2         lrwxrwxrwx 1 root root 10 Sep 11 02:45 PENDRIVE -> ../../sdb1      Also `fdisk -l` command gives this as the output:                   Disk /dev/sda: 320.1 GB, 320072933376 bytes         255 heads, 63 sectors/track, 38913 cylinders, total 625142448 sectors         Units = sectors of 1 * 512 = 512 bytes         Sector size (logical/physical): 512 bytes / 512 bytes         I/O size (minimum/optimal): 512 bytes / 512 bytes         Disk identifier: 0x1246aa23                 Device Boot      Start         End      Blocks   Id  System         /dev/sda1   *        2048   319582199   159790076    7  HPFS/NTFS/exFAT         /dev/sda2       319582208   602906623   141662208    7  HPFS/NTFS/exFAT         /dev/sda3       602908672   625135615    11113472   83  Linux              Disk /dev/sdb: 1939 MB, 1939865600 bytes         64 heads, 63 sectors/track, 939 cylinders, total 3788800 sectors         Units = sectors of 1 * 512 = 512 bytes         Sector size (logical/physical): 512 bytes / 512 bytes         I/O size (minimum/optimal): 512 bytes / 512 bytes         Disk identifier: 0xc3072e18                 Device Boot      Start         End      Blocks   Id  System         /dev/sdb1   *        2248     3788799     1893276    c  W95 FAT32 (LBA)      So I assume that I have to run this: `sudo grub-install /dev/sda3` to get GRUB up and running. But I am getting this error:                   /usr/sbin/grub-probe: error: cannot find a device for /boot/grub (is /dev mounted?).      Can anyone please guide me in the right direction? The current Ubuntu installation is far too customized to my needs to lose it to a boot manager issue! Any help is much appreciated!


title: Automation of openldap installation

text: In my group we often install ldap on new servers. We have two different configurations currently. A mirrored configuration and just a regular standalone configuration. The installation process gets repetitive and is difficult for some team members to perform due to their lack of experience performing the install. Essentially it's a waste of time. Do you have any suggestions on how to automate the process? My current idea is to provide a zipped up directory with all the source packages necessary to install. It will also include an 'installation' script that will unzip and compile all source packages and proceed to install them and configure anything related to ldap and even prepopulate openldap with some base data. What do you think?


title: "[Errno 256] No more mirrors to try."

text: I am having some problem installing 32-bit Fedora20 OS over the network. At the installation summary page, under the software installation source section, using the default closest mirror option, I keep getting the following fatal error during installation:               The following error occurred while installing.     This is a fatal error and installation will be aborted.          error populating transaction: failure:     Packages/b/biosdevname-0.5.0-2.fc20.i686.rpm from anaconda:     [Errno 256] No more mirrors to try.      As it appears that Fedora has some problem locating mirrors, I tried manually specifying a URL for the base repository, such as:               http://ftp.cuhk.edu.hk/pub/linux/fedora/releases/20/Fedora/i386/os/      I tried a few URLs, but all, except the URL closest to where I stay which causes the above fatal error, give me the following error: > Error setting up base repository Am I missing something?


title: How to find 32-bit libraries in 64-bit Linux and delete them?

text: I am running 64-bit OpenSUSE. My partition is filling up and running out of space.I need to delete some programs and librarires. How can I find all 32-bit libraries and delete them? Can I use `yast` to delete all 32-bit programs and libraries?


title: Tool for todo notes and lists for linux which allows tagging

text: I am looking for a handy (offline) tool to manage todo-notes and lists on linux. As a necessary requirement it should be possible to assign tags and sort, filter and search for tags. It should support web-links. Nice to have (but not neccessary):   * mark progress of the item   * mark importance   * have a calendar to easily insert dates for deadlines for example   * some rudimentary versioning control system for the lists   * should be able to handle images or even video embeddings   * tables   * support for math-formulas   * should be keyboard friendly Any suggestions? I do not have any restricion whether is has to have a GUI or not, it may something which runs in a browser, it may have an ordinary GUI, or just an ncurses interface, it's important that it's handy. _But there is one restriction_ : It should not be an applet which works only together with gnome-panel or something like that (I don't use a panel or tray bar).


title: Umount all attached usb disks with a single command

text: Is there a (safe) way to umount all partitions on all attached usb devices (usb-hdds, usb-sticks) with a single commandline command, including several encrypted luks partitions? Only the partitions on the usb-devices should be umounted, nothing more!


title: Gvim opening files in new tabs

text: I was wondering how I can modify the gvim.desktop file so that it opens files in new tabs. Also I want it to create a new instance of vim in case it is not supplied with any files(eg. Invoked from the applications menu) similarly to gedit's behaviour. Any suggestions?


title: Writing a systemd service to be executed at resume

text: my Dell laptop is subject to this bug with kernel 3.14. As a workaround I wrote a simple script /usr/bin/brightness-fix:               #!/bin/bash          echo 0 > /sys/class/backlight/intel_backlight/brightnes      (and made executable: `chmod +x /usr/bin/brightness-fix`) and a systemd service calling it that is executed at startup: /etc/systemd/system/brightness-fix.service               [Unit]     Description=Fixes intel backlight control with Kernel 3.14          [Service]     Type=forking     ExecStart=/usr/bin/brightness-fix     TimeoutSec=0     StandardOutput=syslog     #RemainAfterExit=yes     #SysVStartPriority=99          [Install]     WantedBy=multi-user.target      and enabled: `systemctl enable /etc/systemd/system/brightness-fix.service` That works like a charm and I can control my display brightness as wanted. The problem comes when the laptop resumes after going to sleep mode (e.g. when closing the laptop lip): brightness control doesn't work anymore unless I manually execute my fisrt script above: `/usr/bin/brightness-fix` How can I create another systemd service like mine above to be executed at resume time? **EDIT:** According to comments below I have modified my `brightness- fix.service` like this:               [Unit]     Description=Fixes intel backlight control with Kernel 3.14          [Service]     Type=oneshot     ExecStart=/usr/local/bin/brightness-fix     TimeoutSec=0     StandardOutput=syslog          [Install]     WantedBy=multi-user.target sleep.target      also I have added `echo "$1 $2" > /home/luca/br.log` to my script to check whether it is actually executed. The script it is actually executed also at resume (`post suspend`) but it has no effect (backlit is 100% and cannot be changed). I also tried logging `$DISPLAY` and `$USER` and, at resume time, they are empty. So my guess is that the script is executed too early when waking up from sleep. Any hint?


title: Print the number of values which have the special characters in them

text: I have a text file like the one below. I want to check the second column and print the count of values which have some special characters in them.               101,aaa,d01     102,*&%,d02      103,$%&,d03     104,###,d04      I tried with awk:               awk -F, '{if ($2 ~ (/^[$*&%#]+$/) count+1;} END {print count}' sample.txt      but it's not working. Is there any way other than awk to do it?


title: Reading a path from a nested grep yields "No such file or directory"

text: Essentially, I have a file containing the path to another file. A single line looks like this.               "/home/self/file"      Now, separately...               > cat "/home/self/file"     blah blah     ...          > grep '".*"' /path/to/containing/file     "/home/self/file"          > cat $(grep '".*"' /path/to/containing/file)     cat: "/home/self/file": No such file or directory      The results are weird. How do I circumvent this?


title: LXC: How do I mount a folder from the host to the container?

text: I'm trying to mount a folder on the host to an LXC container. The host has a folder `/mnt/ssd/solr_data` created (this is currently on the root filesystem, but later I'll mount an SSD drive there, so I'm prepping for that). I want that folder to mount as `/data` in the container. So in the containers fstab file I have the following:               /mnt/ssd/solr_data      /var/lib/lxc/Solr4StandAlone/rootfs/data        ext4    defaults,noatime        0       0      But that's a no-go, I get this error starting the container:               lxc-start: No such file or directory - failed to mount '/mnt/ssd/solr_data' on '/usr/lib/x86_64-linux-gnu/lxc//data'     lxc-start: failed to setup the mounts for 'Solr4StandAlone'     lxc-start: failed to setup the container     lxc-start: invalid sequence number 1. expected 2     lxc-start: failed to spawn 'Solr4StandAlone'


title: pipe function arguments to command line arguments in python

text: I have a python code (`cmd.py`) which accepts files as command line arguments and process using parse_args. I want to pass files from another code (`files.py`) to `cmd.py`, just like passing function arguments.   Can this be done without modifying cmd.py?


title: How to forbid the execution of /bin/rm -f *?

text: I cannot remember how many times I've listed a subdirectory and executed `/bin/rm -f *` in the current directory. Can anyone give suggestions to help me avoid this? What should I do if I want the system to warn me of the danger when I try to execute `/bin/rm -f *` ?


title: How to stop many process like unicorn and sidekiq using single command in certain environment

text: I am using Ubuntu 12.04. I remotely access remotely EC2 instance, i will stop and start unicorn and sidekiq by following commands                cap development unicorn:start      cap development unicorn:stop      cap development sidekiq:start      cap development sidekiq:stop      how can i do this using single command to stop and start these unicorn and sidekiq. Thanks in advance.


title: How can I use wget to download large files?

text: I want to get the ISO for a particular version of Linux, say 'Mint 14 “Nadia” KDE '. I tried using `wget` in the terminal to download the ISO of this distro:               $ wget http://mirror.ufs.ac.za/linuxmint/stable/14/linuxmint-14-kde-dvd-64bit.iso      or more generically:               $ wget http://server.com/path/to/some/largefile      After downloading to the point where it was ~30% (after like 2 hours), I was disappointed to see that it stopped downloading. I used `wget` because I didn't want to leave my browser on for the entire duration of the download. In general is there some method where I can get `wget` to be able to resume if it fails to download a complete file? Do I need to do something different when using `wget`?


title: In what situation would it be more beneficial to use AutoFS over vfstab for shares dedicated to just one server?

text: Consider an environment of three Solaris servers (Server1-3):   1. Where Server1-3 all share a mount `nas-server.company.com:/vol/appls-backup`, for storing backups and recovery related files at periodic intervals (once every few hours).      * Here I think the choice of using AutoFS has obvious advantages - here the automounter has the purpose of conserving local system resources and of reducing the coupling between systems which share filesystems with a number of servers [Reference].    2. Now each server has a share mounted onto some mount-point where the application assemblies and live data is located. I placed these mounts in `/etc/vfstab` so the mounting would occur once on system boot. As they are accessed continuously, AutoFS might cause delays if it automatically un-mounted the share at some time.  Now for case #2, in what situation would AutoFS be more desirable or required than using vfstab?


title: Gnome/Nvidia driver installation fails after upgrading to Wheezy

text: I upgraded one of my Debian 6 machines to Debian 7 but the graphical login never appears. All I get is a blinking cursor. When I switch to tty and try to install the proprietary Nvidia driver, something strange happens: the Nvidia installer warns me that I should use gcc 4.6 since my 2.6 kernel is built with this version of gcc. I am actually using Linux 3.2 and I purged all 2.6.* kernels from the system after the upgrade. When I continue, I get this error `ERROR: Installation has failed. Please see the file '/var/log/nvidia- installer.log' for details. You may find suggestions on fixing installation problems in the README available on the Linux driver download page at www.nvidia.com.` The log file contains exactly the same message. I use Debian 7.6, kernel linux-image-3.2.0-4-amd64 (3.2.60-1+deb7u3), driver NVIDIA-Linux-x86_64-280.13.


title: Run 64 bit app on 32 bit system (Ubuntu)

text: All the questions I've seen refer to running a 32 bit app in a 64 bit system. I'm running Ubuntu 12.04 32 bit (actually elementary OS Luna, which is based on it) and I'm trying to run a 64 bit app which refuses open. Running:               ./64bit_app.run      (where `64bit_app.run` is the 64 bit app I'm trying to run) results in:               bash: ./64bit_app.run: no se puede ejecutar el fichero binario      which translates to " _can't execute/run/open binary file_ ". Should I be able to run it? Is it possible to run a 64 bit app in a 32 bit system? If so, how?


title: Which USB distributions may fit as notebook/development/demonstration platforms?

text: I want to build a (very) nomad work platform and I don't want it to be on the cloud but on a USB drive. (I know I will have to create backups and/or disk images to make it USB disk failure proof.) I am very fond of Dokuwiki on a stick as a portable notebook: it's a Dokuwiki install with a micro-Apache server, and it lets me have my research notes and papers and work on it everywere. But I would also like to work on my LaTeX papers, on my IPython notebooks, and why not embed my IPython notebooks in my dokuwiki pages. I would then have (nearly) everything I need to work properly and make demos anywhere without bothering with configurations. And even make several USB images for several contexts. I am then looking for a lightweight live distribution where I can easily install this environment. I know Debian more than other distributions but I'm ready to try any good alternative.