title: Using EXIFTool to add EXIF data from filenames

text: There is a set of photos with timestamps in their filenames like these:               Photo on 3-09-12 at 9.24 PM #2.jpg          Photo on 3-09-12 at 9.24 PM #1.jpg          Photo on 3-09-12 at 8.23 PM.jpg      etc. ("3-09-12", means "3rd Sep 2012" or DD-MM-YY) But these photos have no EXIF data at all. Before you imported them to a larger collection, how would you pipe this information to `exiftool` and also tell it to add new timestamps as EXIF data, all from the photos' filenames? **_Update_** : (The now Pt. 1 of) my question about parsing filenames with DD- MM-YY and 12 hour time has been very kindly answered by @Stephane. But I discovered that the same batch of photos contains filenames with one variation I had missed. I hope it makes more sense to add a 'Pt. 2' instead of starting a whole new question. **In short** : How could I change @Stephane's brilliant answer --               exiftool '-CreateDate<${FileName;use Date::Manip;                           Date_Init("DateFormat=non-US");                           /on (.*?at.*?[AP]M)/;$_=$1;                           y/./:/;$_=UnixDate($_,"%Y-%m-%d %T")                           }' ./*on\ *at*[PA]M*.jpg      -- so that it might work with filename format below, which is slightly different from the first part of the question, in that it uses YYYY-MM-DD and 24-hour time:               Photo on 2010-09-15 at 18.44 #4.jpg          Photo on 2010-09-15 at 18.44 #3.jpg          Photo on 2010-09-15 at 18.44.jpg      **More explanation:** Trying to edit the `Date::Manip` part of the Stephane's script seems to show up my ignorance of what's going on in the most important parts of it. I tried omitting the `Date_Init` line since we are back to an ISO-esque full- year date format and then having               /on (.*?at.*?)/;$_=$1;     y/./:/;$_=UnixDate($_,"%Y-%m-%d %T")     ' ./*on\ *at*.jpg      But `exiftool` is giving me `no writeable tags` and `FileName not defined`. Instructions at http://search.cpan.org/~sbeck/Date- Manip-5.56/lib/Date/Manip.pod don't seem to be helpful (at least to me) in understanding what's going on with those periods, that 'y' at the start of the line, semicolon etc, and they're rather ungoogleable :S


title: Cross-compile any aptitude package?

text: I have an ARM Chromebook. There is a project called Crouton that is able to install Ubuntu to the internal harddrive pretty easily (I've done it). But most packages in the repositories are of course only for X86 and X64.   1. Is it even possible technically to take an arbitrary apt package and cross-compile it to run on my ARM Chromebook?   2. If it is possible, how can I do so relatively painlessly? I have access to a very fast 24-core system for the compilation if I can figure out a way to automate the process of making ARM packages.


title: can't receive mails to thunderbird via postfix local server

text: A small introduction. I have a SMTP server ( Haraka - http://haraka.github.io/ ) on port 25 and a local postfix server on port 9267. I intercepts mails in Haraka and then I send them to my postfix server. I can see the mails received using mail -u username command but I want to use a email client(Thunderbird) to have access to them. I've created an account in Thunderbird via this http://askubuntu.com/questions/192572/how-read-local-email-in-thunderbird , but without any result and I think the problem is the postfix server configuration. Here is my postfix main.cf file .               # See /usr/share/postfix/main.cf.dist for a commented, more complete version               # Debian specific:  Specifying a file name will cause the first     # line of that file to be used as the name.  The Debian default     # is /etc/mailname.     #myorigin = /etc/mailname          smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)     biff = no          # appending .domain is the MUA's job.     append_dot_mydomain = no          # Uncomment the next line to generate "delayed mail" warnings     #delay_warning_time = 4h          readme_directory = no          # TLS parameters     smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem     smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key     smtpd_use_tls=yes     smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache     smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache               #transport test     #transport_maps = hash:/etc/postfix/transport          # See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for     # information on enabling SSL in the smtp client.          myhostname = mydomain.com     alias_maps = hash:/etc/aliases     alias_database = hash:/etc/aliases     myorigin = /etc/mailname     mydestination = mydomain.com, localhost.mydomain.com, localhost     relayhost =      mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128     mailbox_size_limit = 0     recipient_delimiter = +     inet_interfaces = all      I appreciate any help.


title: Making a tty9 on a openvz VE

text: I am in a virtual environment. I am installing Asterisk and freepbx. They use this script amportal and it has a requirement to check for tty9 there is alot of mention on folks running this in a VE who just modify the script to remove the tty reference i do not want to do that I want to actually add this how do I do this. there is this mknod command but I really do not understand how to work it. anyone enlighten myself and otheres on how to create a tty9!


title: Secondary bridge only working at random in debian wheezy

text: We are currently migrating from vmware server to kvm. So far everything works smooth, with the exception of the secondary bridge. Our network layout is as follows: Firewall with 3 ports               eth0 Public Internet IP address     eth1 Internal network 192.168.200.x     eth2 DMZ internal network 192.168.202.x      On the KVM host we also have two NIC's, one attached to the eth1 port of the firewall and the secondary to the eth2 port of the firewall. We defined two bridges in the KVM host, so we have a bridge for the internal servers (192.168.200.x) and one for the DMZ servers (192.168.202.x) The network config of the KVM host looks like this:               auto lo br0 br1 eth0 eth1     iface lo inet loopback          iface eth0 inet manual     iface br0 inet static             address 192.168.200.249             netmask 255.255.255.0             broadcast 192.168.200.255             network 192.168.200.0             bridge_ports eth0             gateway 192.168.200.4          iface eth1 inet manual     iface br1 inet static             address 192.168.202.249             netmask 255.255.255.0             broadcast 192.168.202.255             network 192.168.202.0             bridge_ports eth1             gateway 192.168.202.4      KVM guest which are located in the 192.168.200.x network (bound to br0) can communicate just fine. But KVM guests with IP's 192.168.202.x (bound to br1) have connectivity only at random. Sometimes the guest have connectivity for 20 seconds, then for several minutes/hours no connection. Any ideas?


title: What does % utilization mean in htop if only 1 process can execute at a time?

text: I see that the `htop` command reports respective the % of utilisation of each CPU core and also that of the processes. We know that only 1 process can execute at a time in the CPU. How is it possible for processes to occupy a certain "Percentage" of the CPU ? Does it have anything to do with the Instruction Pipeline ?


title: no install buttons in extensions.gnome.org

text: I just got a new computer, and I wanted to install all the nice shell extensions I had on my old one. Both of them are running Debian 7.5, and have gnome shell version 3.4.2. The only difference I could find is that my new computer has a 64 bit version of Debian, and my old one has a 32 bit version. But now, when I go to https://extensions.gnome.org/, all the extensions look greyed out and there are no install buttons. ![a screenshot. The reviews never load.](http://i.stack.imgur.com/m3UiW.png) Also, it looks like the user reviews just never load. Probably a related issue. They do load on my old computer.


title: Why does the setxkbmap compose key mess with other keys?

text: I just found a tip to set the compose key manually:               setxkbmap -option compose:caps      Unfortunately, after running this several keypresses act as if the compose key had been pressed. For example, to get a tilde, I now have to press `Shift`-`~` _twice_ , and I can no longer figure out how to get a single or double quote - When I press that key twice ( _without_ pressing Caps Lock) I get a single `´` (without `Shift`) or `¨` (with `Shift`) character.               $ setxkbmap -print      xkb_keymap {         xkb_keycodes  { include "evdev+aliases(qwerty)" };         xkb_types     { include "complete"  };         xkb_compat    { include "complete"  };         xkb_symbols   { include "pc+us(dvorak-intl)+inet(evdev)+level3(ralt_switch)+compose(caps)"  };         xkb_geometry  { include "pc(pc105)" };     };      Setting the compose key to the more popular `Right-Alt` did not help - The results are the same with the following settings:               $ setxkbmap -print      xkb_keymap {         xkb_keycodes  { include "evdev+aliases(qwerty)" };         xkb_types     { include "complete"  };         xkb_compat    { include "complete"  };         xkb_symbols   { include "pc+us(dvorak-intl)+inet(evdev)+level3(ralt_switch)+compose(ralt)"  };         xkb_geometry  { include "pc(pc105)" };     };      Stranger still, even after disabling the compose key with `setxkbmap -option` the keys are still messed up. On a different machine with GNOME 3 and similar settings it works just fine (`Caps Lock`, `a`, `a` produces `å`, while a single press of `Shift`-`~` produces `~`):               $ setxkbmap -print      xkb_keymap {         xkb_keycodes  { include "evdev+aliases(qwerty)" };         xkb_types     { include "complete"  };         xkb_compat    { include "complete"  };         xkb_symbols   { include "pc+us(dvorak-alt-intl)+ch:2+inet(evdev)+compose(caps)" };         xkb_geometry  { include "pc(pc105)" };     };      Maybe it's an LXDE issue - I'll test it next week.


title: How to set separate global/user keyboard settings in LXDE?

text: I need to have `English (US)` and no compose key for the _system_ , and I'd like `English (Dvorak alternative international no dead keys)` + `Caps Lock` as the compose key for _myself_. How can I set this up? I tried setting `dvorak-alt-intl` in `lxkeymap`, but it only worked until I logged in again. I also tried to set `@setxkbmap -option compose:caps` in `~/.config/lxsession/LXDE/autostart`, but that didn't work after logging in again.


title: Making UDEV ignore certain devices during boot.

text: I'm trying to make UDEV stop mounting one of my devices at boot time, and I've created a rule in _/etc/udev/rules.d/_ called _1-myblacklist.rules_. All the rule does is matches the device by kernel identifier (ie. "sdb") and and set the attribute OPTION to "ignore_device"               udevadm test /sys/block/sdb       Shows that the my rules file is parsed as the first entry, but all subsequent rules still gets applied. And the partitions on the drive still shows up on my desktop (XFCE).


title: Error with grub2 installation on Backtrack 5

text: I installed BackTrack 5 r1 and I can't select boot option between Windows and BackTrack on start up. How can I fix this, or how can I install grub 2?


title: What are the (dis)advantages of ext4, ReiserFS, JFS, and XFS?

text: What purpose is each suitable for?


title: Identity Management with ActiveDirectory

text: What is the best, or most reliable, way to manage my Unix/Linux user accounts with ActiveDirectory? Or, is this even feasible?


title: How can I identify processes that use network facilities, and can they be killed?

text: In the output of               netstat -a | grep LISTEN      there are usually a lot of processes. How (where) can I find out information about them, what is their purpose in the system and if I can kill them? Which of them can be insecure and which are safe?


title: symbolic link to a directory and relative path

text: I've created symlink with absolute path to the directory (Blink) and have for example following tree:               $ ls -l /tmp/A     total 0     lrwxrwxrwx 1 root root 6 Apr  3 12:27 Blink -> /tmp/B     -rw-r--r-- 1 root root 0 Apr  3 12:27 foo          $ ls -l /tmp/B     total 0     -rw-r--r-- 1 root root 0 Apr  3 12:27 bar      then I go to /tmp/A and change directory to Blink:               $ cd /tmp/A     $ pwd     /tmp/A     $ cd Blink     $ pwd     /tmp/A/Blink      `cd ..` returns me to `/tmp/A` but if I type for example `ls ../foo` I'll got error:               ls: ../foo: No such file or directory      builtin cd command resolve path as needed, but external ls consider the .. as up-level of /tmp/B and therefore cannot find foo. What is the problem here? Can I get the foo file from /tmp/A/Blink by relative path like ../foo?


title: What does this [number] beginning many lines during the Linux boot screen represent?

text: My Linux sandbox boots into the text mode. During the boot process many lines are prefixed with a number between brackets ie. [40.000] Normally this number reaches upwards to 80. Recently I've noticed this number can be as short as 40 and today it was at a completely different magnitude and ended around 1200.   1. What is it called?    2. What does it represent?    3. Any idea why a stable install without auto update would suddenly change this value?


title: When using awk /pattern/ { print "text"} /patern/ {print ""} is there an ELSE pattern?

text: Let's say I have text file like:               R1 12 324 3453 36 457 4 7 8     R2 34 2342 2525 25 25 26 26 2 2     R3 23 2342 32 52 54 543 643 63     R4 25 234 2342 4 234242      I want to use `awk` to process these lines differently, like               awk '/R1/ { print "=>" $0} /R2/ { print "*" $0} '      and I want to also print all the rest of the lines as they are (without making duplicates of the lines I've already processed), basically I need an `/ELSE/ { print $0}` at the end of my `awk` line. Is there such a thing?


title: convert WAV music library to FLAC on command line and achieve best quality

text: I would like to produce (nearly) perfect FLAC files by verifying/checking all conversion steps. I'm hoping to do this in a single command, although a short bash script would be acceptable as a second choice. I am on Kubuntu 12.04 and I installed flac 1.2.1. Here is my starting point:               find ~/Music -type f -iname "*.wav" | while read fn; do flac --keep-foreign-metadata --ogg --verify "$fn"; done      How can I improve this? If `shntool` is recommended, how would I include it? How would I include checksum comparisons? How can I make FLAC test the integrity of each file? A working example is appreciated. BTW, I took a look at perfect-flac-encode, but it is too complicated for me. I don't even fully understand the first sentence of the project's description! The installation steps also look too complex. If there is a similar project that might fit my needs, please let me know.


title: Wrap command in the prompt

text: Is it possible to insert a separator after the command in a prompt? This is an example:               ~/Desktop: ls -al     -------------------------------------     total 80     drwx------+  6 eddie  staff   204B Apr 29 16:57 .     drwxr-xr-x+ 54 eddie  staff   1.8K Apr 30 10:54 ..          ~/Desktop:      Specifically I want to add the --------- part after issuing a command to easier distinguish the command from the result


title: How to circumvent "Too many open files" in debian

text: If I want to see all relevant log files of my apache2 server at once, I use               tail -f /var/kunden/logs/*log /var/kunden/logs/*log /var/log/apache2/*log |grep -v robots|grep -v favicon      But since those are too many files by now, I would like to encrease that limit. How can I increase it for one ssh session? And How could I increase it globally systemwide? I can see the open files limit is 1024 on my machine:               ulimit -n     1024


title: Installing Simon Listens on Linux Mint

text: Recently I've heard about the Simon Listens package which enables you to create a speech recognition engine on Linux as well as windows. I have Linux Mind 14 - cinnamon installed on my laptop. I wanted to install Simon Listens on this system, I downloaded the most recent version (0.4.0) from here and extracted the files. However there is no way form me to run the build.sh script. When I double click on it a window pops up asking me if I want to run it or run it in terminal. Regardless which option I select a terminal window flashes briefly and closes (before I can read it). I can't install it. How can I get it to work?


title: Does ~ always equal $HOME

text: I know this has probably been asked before, but I couldn't find it with Google. Given   * Linux Kernel   * No configurations that change $HOME   * bash Will `~ == $HOME` be true?


title: Remount an SSHFS mount without umounting it

text: What is the equivalent to `mount -o remount,ro` in an `sshfs` mount? The only way I know is to do `fusermount -u` and then mount it again with `sshfs -o ro`.


title: NFS file owner(uid) = 4294967294, can't do much with my mount, How do I fix this?

text: I have a somewhat strange setup going on here, I have Android as the client and it's kernel does not support NFSv4, also my /etc/exports file on the server side has no NFSv4 style entries. I am trying to build some toolchains (I have gcc-4.8-armhf and all that on my phone as well as apt-get with repositories set up so I can install stuff if needed) as well as following LFS, but I can't build some programs such as perl due to not being able set file ownership and what not. My /etc/exports (server) :               /media/usb3/Android     192.168.1.209(rw,sync,subtree_check,no_root_squash)      A `ls -l` looks like this (client):               drwxr-xr-x  6 4294967294 4294967294      4096 Jun 21 17:23 toolchains     -rw-r--r--  1 4294967294 4294967294         0 Jun 25 18:51 rootu      A `sudo chown root:root` looks like this (client) (rootu is just a test file):               sudo chown root:root rootu     chown: changing ownership of `rootu': Invalid argument      My mount command (client) :               sudo mount -t nfs 192.168.1.210:/media/usb3/Android /home/edge-case/Android-Lab/ -o tcp      I've gone over the man pages and read some tutorials and other questions but they all say to just set no_root_squash, which I did from the start, and that doesn't work. I don't have LDAP or Kerberos, or any sophisticated authentication set up at the moment, that is all beyond my skill ( and 0 pay ) level at the moment. I'm at home so I have complete root access and ownership of everything and not too worried about security other than maybe war-drivers, but I do have a good wireless password, so no tin foil hat really needed for me ;P I used to have this working, but it seems some changes to Debian have been made and things are not working so well anymore. Are Windows agents screwing up Linux source!? J/k Really what is this? Where can I find a simple way to mount a directory with files owned by me, or root (via sudo chown) if I choose, and not some strange "4294967294" user that doesn't exist on the client or server?


title: Difference between the Unity shell interface and a desktop environment

text: I am writing a report and I have stumbled across a topic I am not quite sure how to to discuss. Essentially I have been doing a little research on the Unity shell system and its usage in Ubuntu primarily. I understand that Unity is a shell interface and that it runs with GNOME desktop environment. My question is in a broad description how does it do this is the shell interface simply how the user triggers certain programs to do certain tasks within the GNOME desktop environment? My questions stems from the fact that everywhere I have researched seems to compare GNOME and Unity yet how I understand it they serve different processes almost entirely. Am I missing something?


title: How do I obtain the kill signal / message / reason within a script?

text: I am using the following trap:               trap OnExit EXIT      And in my `OnExit` function I would like to capture all the info I can on what happened so I can write it to a log file. Id like to know who, why, how, when etc.. Is any of this possible?


title: Linux Mint 17 - Get Blank screen after login

text: I was trying to setup a dual monitor environment on my Linux desktop. I have an ATI graphic card and it was working correctly. It mirrored by default and I went into my AMD ATI Admin to enable the Xinerama feature so that I could have the dual monitor work like I want it to. it then asked me to reboot which after I did things went south. I can boot up and login with no issue but after that I get a blank screen and as a result I'm dead in the water. I'm hoping someone can help me resolve this issue without having to resort to a complete reinstall.


title: Install PLoP Bootmanager to GRUB2 on an HP 2000 Series to Dual-boot with Windows 7?

text: I know this sounds complicated, but how can I pull this off? So, basically after installing Ubuntu 14.04, it might have done some BIOS MOD or something because my PC lost the ability to boot from CD/DVD. So, in this case, I have manually tweaked GRUB2's settings to make it show up when I start the PC (I know, I could have just held shift.) So, what I want to do is Install Plop Boot Manager and make it an option when you go into the GRUB2 menu, then be able to install Windows 7, and if possible not overwrite GRUB2, and in case it does overwrite GRUB2, I'd need instructions on how to get GRUB2 back. (My best idea is installing to a Virtual Hard Disk and making it bootable on the real machine, would that overwrite the boot loader?) Okay, now that I told you all I wanna do, I'm gonna post my grub2.cfg and my 40_custom right here in this sentance.


title: Playing MP3 in Firefox on Debian

text: Is there a way to get MP3 playback within Firefox 31+ without installing plugins? I know about the entire encoding issues, but I have read somewhere that Firefox will look for native OS encoders like LAME to add support for audio HTML5 tags. What is the best way to add MP3 support for Firefox 31+ on Debian 7/Crunchbang?


title: Multiple named processes for bind9 in Debian

text: I'm running a name server using `bind9` on Debian. I noticed that there are multiple "named" processes running, when `bind` starts: ![htop output](http://i.stack.imgur.com/cM5lH.jpg)   * How can I limit this to n `bind` instances (processes)?   * What is the recommended use of multiple `bind` processes? I know that `bind` is a relatively low intensive application in terms of CPU and network.


title: Why is the PGID of my child processes not the PID of the parent?

text: So I keep reading everywhere that this command should terminate all child processes of the parent process:               kill -- -$$      Using a negative ID with the kill command references a PGID and from the examples I have seen it appears the PGID of child processes should be the PID of the parent but its not the case on my system. On my system the PGID of the child is the same as the PGID of the parent script which turns out to be bash. Whats going on here? Were the examples wrong or is my system set up differently? What I need to achieve is to terminate child processes without terminating the parent so I don't want to send a kill signal to the PGID the parent is in...


title: How to to remove libgcj from Debian?

text: I am doing Java programming on Debian. By default Debian 6.x ships with libgcj JVM. On starting eclipse it shows a warning that `this JVM is deprecated and may cause problems`. For this reason I downloaded the JVM from Oracle's site and installed it. However after installing the Oracle JVM the default JVM on system is still libgcj. When I type `java -version` I get following output -               java version "1.5.0"     gij (GNU libgcj) version 4.4.5      How should I remove this from my system? And after that how should I set the newly installed JVM to be the default one. This would involve two things -   1. Setting the bin directory on system path.   2. Making javaw the default program when a jar is double clicked. I'm familiar with these tasks on Windows but not on Linux. Thanks.


title: Pulling out keywords using standard command line utilities?

text: As an example, this is the pronunciation of "when" according to Wiktionary. enPR, IPA and X-SAMPA are different schemes for showing pronunciations.               when:* {{a|US}} {{enPR|wĕn|hwĕn}}, {{IPA|/wɛn/|/ʍɛn/}}, {{X-SAMPA|/wEn/|/WEn/}}      I'd like to pull out the keyword `when` and its two IPA pronunciations, and put them on separate lines:               when wɛn     when ʍɛn      There may be one, two or more IPA pronunciations of a word, and there may or may not be enPR or X-SAMPA pronunciations. I'm thinking PHP, lists within lists, but this seems to be overkill, and I don't want the users to have to install it if possible. Is there a way to do this in awk, sed, cut or other standard Unix command line utility?


title: Can I create a bootable distribution backup

text: I'm interested in trying out a couple of distributions, but for extended periods of time (so using a LiveCD is not really an option). However, I would like to create a backup of my current distribution (Ubuntu- Gnome) with it's settings and extra packages/dependencies. Would it be a case of simply backing up a list of packages and settings folders (if so which ones) and reapplying these to a new installation, or can I create my own bootable installation?


title: How many sections can I create in object file?

text: I'm following the course of Baking Pi – Operating Systems Development. In it they created another section `.init`. So can we create as many sections as we want (not just `.data, .bss, .text`) and can we put code and data (initialized of no) in any of them?. If so, what's the purpose of sections then?


title: Capabilities for a script on Linux

text: If I want to set a capability (`capabilities(7)`), such as `CAP_NET_BIND_SERVICE`, on an executable file and that file is _a script_ , do I have to set the capability (`setcap(8)`) on the interpreter starting that script or is it sufficient to set it on the script file itself? Note: the question concerns Scientific Linux 6.1 in particular, but I think it can be answered generically.


title: file system uid and gid in linux

text: I came across a linux kernel tutorial and there they talked about 4 pairs of identifiers and one of them was **_file system uid and gid._** Could someone explain me what it is and how it is different from **_uid and gid_**?


title: View pdf file in terminal

text: I want to see pdf files available on our cluster rather than copying them into my local machine and than visualize. Please tell me how can i do this.


title: Screen resolution problems on Thinkpad E520

text: I'm having some troubles with screen resolution.   First of all, I'm using a Lenovo Thinkpad E520, with BackTrack 5 R2 installed. My natural resolution is 1366x768, but I'm stuck with 1024x768.   This is my hardware:               lspci | grep VGA     00:02.0 VGA compatible controller: Interl Corporation 2nd Generation Core      Processor Family Integrated Graphics Controller (rev 09)      How can I fix that?   Is there a ready-to-use driver or I have to compile that from source?   At least, is there a solution, at all? :( This is the output of `xrandr` command:               Screen 0: minimum 1024x768, current 1024x768, maximum 1024x768        default connected 1024x768+0+0 0mm x 0mm         1024x768            0.0*


title: External disk partitions with identical UUIDs

text: I have two external USB drives of the same make and model, and one of them is driving me slightly nuts by never being assigned a UUID (or, at least, it doesn't show up in `/dev/disk/by-uuid`). What could cause that, and how can I fix it? FWIW, ext2fs on Windows was never able to assign a drive letter to that disk automatically, and always complains that "GUID is 0" when I assign a drive letter to it manually (but after that it works fine). The device block information seems to pinpoint the problem (thanks @dchirikov): **Both partitions have the same UUID.** How can I fix this?               $ sudo blkid /dev/sd[ab]*     /dev/sda: PTUUID="0002866e" PTTYPE="dos"      /dev/sda1: LABEL="Elements1" UUID="DACC0069CC0041ED" TYPE="ntfs"      /dev/sdb: PTUUID="83529362" PTTYPE="dos"      /dev/sdb1: LABEL="Elements2" UUID="DACC0069CC0041ED" TYPE="ntfs"


title: FTP timeout FIRST time

text: I'm using PureFTPd on MacOSX (Snow Leopard, not server version). When trying to access the FTP account from the outside via dyndns (e.g. using https://www.wormly.com/test_ftp_server) the connection always **times out the FIRST time**. When I try **AGAIN in the next few seconds it works**. What is this about? I have forwarded the ports to my apple router and tried disabling the OSX firewall as well.


title: Centos 6.5 laptop with multiple KVM on roaming networks

text: I have Laptop with CentOS 6.5 with 16GB RAM and many KVMs are created for testing purpose. Situation is I have to move from site to site, and due to that physically connected network eth0 to Host changes, one could be on 192.168.0.X and while another could be on 100.100.100.X IP ranges. So if physical adapter IP, Subnet, Gateway and DNS changes does it also required to change my Guest's Network settings to communicate in following situation: - To communicate between Guest and Host - To communicate between Guest to Guest **My Questions are:** - How to make everything auto tune? For example when I was in network (i.e 192.168.0.X) I've configured WinSCP on Windows 7 Guest having IP 192.168.0.72 on KVM to connect Host having IP 192.168.0.71. Now when I goes with my laptop to another network, Host IP has been changed to 192.168.8.110, but still existing configuration on guest is referring to 192.168.0.71. Kindly requested to suggest the possible solutions and also if possible briefly explain technically how internally it works for the same.


title: installing grub and a working kernel over an old and broken debian system

text: I have an old debian system, which I always have been able to upgrade over the years. I had installed an old kernel, compiled by me from sources. After my last dist-upgrade (using testing distribution), I had a kernel panic at boot. My old kernel and my new libc are not able to work together anymore (I presume). Even device names are changed: with my latest working kernel, I had `/dev/hda` and `/dev/hdb`, now those devices are recognized as `/dev/sda` and `/dev/sdb`. Additionaly, two partitions (`/dev/hda2` and `/dev/hdb2`) were joined in a raid array, which name was `/dev/md0` (mounted as root), and now is `/dev/md127`. Partition `/dev/hda1` was mounted as `/boot`, and `/dev/hdb1` was the swap partition. I used lilo as boot manager. Now that everything is broken, I tried to use debian rescue mode, without success. I removed lilo and installed grub2, still nothing works. So I decided to install a new minimal debian system in the old swap partition (`/dev/hdb1`, now `/dev/sdb1`) and, from there, I tried to rescue the system. Still nothing: I can't install a working kernel (this time a precompiled one) in the old partitions. I tried to rebuild my old raid array, mount my boot partition, chroot-ed ant apt-get installed a new kernel: grub is not able to see nothing. I don't know what else I could try...


title: Schedule job at irregular intervals

text: It's simple enough to use `cron` to schedule a job to occur periodically. I'd like to have something occur less regularly -- say, run the job, then wait 2 to 12 hours before trying again. (Any reasonable type of randomness would work here.) Is there a good way to do this?


title: Check if content of file has length X and contains only specific characters

text: Let's say, I have files that contain only one docker id: `myid.id`:               28fe2baadbe8da32ed0b99c69b11c01b2d141bc5b732b81e0960086de52fc891      I want to check if the content of `my.id` is exactly `64` characters long and contains only characters in the range [0-9] and [a-z] (maybe [a-f]).   * How can I do that?   * If the file contains a newline `0x0a`, how can I include/exclude it in this check?


title: How to install wine via brew?

text: I am trying to install wine via homebrew on Mac OS Mountain Lion 10.8.4.               $ brew install wine     Error: wine dependency jpeg not installed with:       --universal      How do I resolve this?


title: How to read a text file line by line which is not constant in shell scripting

text: I need to read a text file line by line and the lines are not constant it may vary.For example               $ cat file1.txt     syntax error at or near "?" at character 1     syntax error at or near "[" at character 1     syntax error at or near "," at character 1     syntax error at or near "desc" at character 1     syntax error at or near "describtion" at character 1 `      After reading that line it must get automatically passed to the grep command and give me the result set. Since the number of lines & errors captured in the text file is not predictable. Everything needs to be done automatically               $ find file1.txt | xargs grep 'syntax error at or near "?" at character 1' | tail -1      How can I put the 2nd line,3rd line...nth line & automate it in the shell script.


title: The processing order and printing of files with find

text: This simple BASH script collects msgstrs in a PHP project:               #!/bin/sh     TARGET=/path/to/project     LPATH=locale/cy_GB/LC_MESSAGES     POFILE=messages.po     mkdir -p $LPATH     touch $TARGET/$LPATH/$POFILE     cd $TARGET     find . -name '*.php' -print | xargs xgettext -j --from-code=UTF-8 -o $TARGET/$LPATH/$POFILE      I have 2 questions:   1. Why doesn't -print list the files it has found - all the docs say it should?   2. Is there any way to specify the order in which find deals with the files? If I run an equivalent PHP script, it deals with the files in the order they are listed by ls, and then goes into the dirs. But find seems to do its own thing, with the files jumbled up in no apparent order, and the dirs interspersed with them?


title: Inappropriate ioctl for device

text: I can write to the tape drive (tar -cf /dev/st0 file) and retrieve files from the tape drive (tar xvf /dev/st0 file). But the problem is when I attempt to use the 'mt' command to check the status of the tape drive, **command.**               mt -f /dev/st status      the following error is shown               /dev/st0: Inappropriate ioctl for device      The tape drive is being recognized by the server since I can retrieve and write to the tape drive. How can I get the status of the tape drive using the `mt` command or any other command?


title: How to do svn update without password on crontab

text: I'm new to svn and ssh. I'm trying to do svn update of 5 repositories in my local system every 3 hours on crontab. So, to achieve this I have setup `ssh passwordless login` using the below steps:   1. `ssh-keygen`   2. `ssh-copy-id -i ~/.ssh/id_rsa.pub test@repo.test.in`   3. I did `ssh test@repo.test.in` Until here it works fine for me. I'm able to login without password. But, when I try to do `sudo svn update` on the 5 repositories, it is prompting for password. How to make svn update without password. Is there any way that I can do update of the repositories every 3 hours on cron. I referred to this, but could not get it.   I'm using               Ubuntu version : Ubuntu 13.04`              OpenSSH_6.1p1 Debian-4, OpenSSL 1.0.1c 10 May 2012


title: Does "mount -o remount,ro" flush filesystem buffers?

text: On Linux, does `mount -o remount,ro` flush filesystem buffers/cache, or should I also run `sync` to achieve that?


title: Can swap be shared safely while hibernating?

text: Suppose I have two different Linux installations _A_ and _B_ , both using the same swap partition. As I understand, running _A_ or _B_ will cause no problems with swap as only one of them is using it at a given time. However, if I boot _A_ , hibernate, then boot _B_ , swap is being used by _both_ ( _A_ in a passive form, but data is there). The question is: Will the hibernated system survive after this? If not, will the memory be corrupted or will _A_ just be unable to resume, causing a regular boot? Note: My main concert are live systems that detect and use available swap partitions on the hard drive. Will they destroy hibernated systems?


title: What does mean ` AWK=@AWK@` in shell scripting

text: I found `AWK=@AWK@` while reading `sh` script, it's something like `AWK=$(which awk)`, but it's not working. So can anyone explain this ? Script :               #!/bin/sh -     # makelist.sh: Automatically generate header files...          AWK=@AWK@     USAGE="Usage: $0 -n|-h|-e|-fc|-fh|-bc|-bh|-m <filenames>"          if [ "x$1" = "x" ]     then         echo $USAGE 1>&2         exit 1     fi          .....     .....     .....     -h)         set - `echo $FILES | sed -e 's/\\./_/g'`         hdr="_h_`basename $1`"         cat $FILES | $AWK '             BEGIN {                 printf("/* Automatically generated file, do not edit */\n");                 printf("#ifndef %s\n#define %s\n", "'$hdr'", "'$hdr'");             }             /\(\):/ {                 pr = substr($2, 1, 2);                 if (pr == "vi" || pr == "em" || pr == "ed") {                     # XXXMYSQL: support CRLF                     name = substr($2, 1, index($2,"(") - 1);     ...


title: Unable to install Atheros AR8161 Ethernet controller driver for centOS 6

text: I've installed CentOS 6.3. However, **eth0 does not show up on ifconfig**. So I figured out that I need to install alx Ethernet driver from here. Since my internet is not working, as ethernet drivers are not installed, I've installed Development Tools from the DVD. **Steps performed:**   1. ./scripts/driver-select alx   2. On 'make' I get this error. http://paste.ubuntu.com/5669506/ How do I solve this issue? Would be grateful for any kind of help. Thanks.


title: How to make Linux application (all in one fille) installer?

text: I am working on some Linux application. It is the right moment to start thinking about deployment. So my question is: How to create a one file installer like for example *.run or *.sh files that sometimes can be found in internet (for example nVidia drivers or Wolfram Mathematica CDF).


title: unionfs filesystem

text: I recently learned about unionfs and aufs and would like to put it to some real use. The scenario I have in mind is the following. Boot a machine with ubuntu on it which will serve as our base. Make sure the root partition for the base is ro. Overlay an empty rw partition over the root partition using unionfs or aufs magic. Go to town on the system and maybe break some things. Now instead of wiping and re-installing everything from scratch I can just wipe the rw partition and reboot the system to restore it to a working state. So I want to know what I need to learn to accomplish the above task. Googling for aufs/unionfs has already brought up things like initramfs and I would like to know what other keywords I should look up if I want to do this right.


title: Writing a bash script for apache conf files

text: I'm trying to automate creating vhosts on my computer. This is merely a learning experience for bash scripting. I'm currently novice. I'm trying to learn more about awk, sed. No, this isn't homework. I work full-time. Anyways, this is my conf file. What would be the most efficient way to find and replace from command line? I'll eventually replace some forms with tokens, like {DOMAIN} and {PATH}               NameVirtualHost commerce.l:*          <Directory "/home/chris/workspace/dev.commerce/html">             Options Indexes Includes execCGI             AllowOverride All             Order Allow,Deny             Allow From All     </Directory>          <VirtualHost commerce.l>         DocumentRoot /home/chris/workspace/dev.commerce/html         ServerName commerce.l         ErrorLog logs/commerce.error         <IfModule mod_rewrite.c>             <Directory "/home/chris/workspace/dev.commerce/html">                 RewriteEngine on                 # needed by Drupal 7 for "clean URLs"                 RewriteCond %{REQUEST_FILENAME} !-f                 RewriteCond %{REQUEST_FILENAME} !-d                 RewriteCond %{REQUEST_URI} !=/favicon.ico                 RewriteRule ^ index.php [L]             </Directory>         </IfModule>     </VirtualHost>      P.S. I'm on Ubuntu 11.04 natty


title: Configuring ProFTPd securely in a shared environment

text: We currently have a LAMP stack for shared webhosting, and are using ProFTP with that. Currently the ProFTP config is fairly stock - users are chrooted to `~`. Currently running as the default user/group. We only use system users - no virtual users. We use SuPHP to run each PHP process as the appropriate user/group. **What I'd really like is to have ProFTP automatically set the`user:group` of uploaded files to whomever is logged in. So if I login to FTP as "customer-a", I'd like any uploaded files be owned by "customer-a".** The main reason for this is, it seems, if I login as someone right now, they don't have permission to write to their home directory. Instead of loosening permissions, I'd like ProFTP to switch the user context appropriately. ## Possible Solutions One thing I've considered is perhaps declaring a virtual-host for each customer domain, which would then allow me to configure the User and Group directives individually. 1) This is a pain to do, I'd rather avoid having to append config for each user created. 2) ProFTP doesn't seem to support name-based virtual hosts. Alternatively, I could make use of the UserOwner and GroupOwner directives, and create a new `<Directory>` block for each customer in the config. I imagine something like this might work:               <Directory /home/customer-a/>         UserOwner customer-a         UserGroup customer-a     </Directory>      But it would be nice to be able to do this in a more general fashion, similar to the `%u` variable, documented here. But I don't think that will work with UserOwner. ## Some details   * Using Ubuntu   * ProFTP 1.3.4a   * Apache 2.2   * Using SuPHP with PHP-CGI.


title: Software (SciTe) runs differently when opened from Terminal Vs GUI

text: When I open SciTe from the terminal everything works fine. When I open it via Ubuntu 10.04 GUI drop down boxes I get this error every time I try to run a ruby program: `sh: ruby: not found` At this point I'm satisfied with knowing I can just open it from the terminal, but I'm curious why this difference might be occurring.


title: which and find not working to locate ruby.exe path

text: From the home directory   `which ruby.exe` & `find ruby.exe` return "no such file or directory" However, I'm able to execute .rb programs in rubymine.


title: What signal does X send to its clients when it receives SIGINT?

text: If I terminate the Xorg server with a SIGINT signal (eg. when I press `Ctrl`+`C`), what signal does it send to its clients?


title: bash if statement behaviour question

text: I wrote this following piece of bash script.               if [ $(tmux has -t junk) ]     then     echo zero     else     echo one     fi      It always returns one, no matter if the session exists or not. I checked in the command line by executing the tmux statement and then running $? . It behaves as expected, zero if session exists and one if session does not exists Why isn't if statement is not behaving the same way. I tried changing the if statement like below               tmux has -t junk     if [ $? -eq 0 ]     then     echo zero     else     echo one     fi      The above thing works. So whats wrong with the first statement block ?


title: how to skip install libphp5.so when buidling php?

text: I'm trying configure and install older php 5.3 version on my archlinux, and I don't want it to copy `libphp5.so` to `/usr/lib/httpd/modules/` because there's an existing version (newer) there.               /usr/share/apr-1/build/libtool --mode=install install libphp5.la /usr/lib/httpd/modules/     libtool: install: install .libs/libphp5.so /usr/lib/httpd/modules/libphp5.so     install: cannot remove '/usr/lib/httpd/modules/libphp5.so': Permission denied      I think there should be a configure flag to control that, can anyone help me?


title: Allow su without password for users in a particular Active Directory group when using pam_winbind

text: I know on my Gentoo system, the /etc/pam.d/su file comes with the following commented out:               auth       sufficient   pam_wheel.so use_uid trust      Which allows a user to su to root without a password as long as he or she is in the wheel group. It also has an example using a list:               auth       sufficient   pam_listfile.so item=ruser sense=allow onerr=fail file=/etc/security/suauth.nopass      I'm currently working with openSuse 11.4 and I successfully joined it to a domain using Yast (which automatically does all the winbind/kerberos/ad stuff) and was wondering if there was a way to modify the /etc/pam.d/su in openSuse to do the same thing if a user is in a specific AD group. I tried the following for my /etc/pam.d/su config:               #%PAM-1.0     auth     sufficient     pam_rootok.so     auth     include        common-auth     auth     sufficient     pam_winbind.so require_membership_of=MYDOMAIN\\LinuxAdmins     account  sufficient     pam_rootok.so     account  include        common-account     password include        common-password     session  include        common-session     session  optional       pam_xauth.so      But obviously that doesn't work. Is this possible using the pam_winbind.so module and if so, how?


title: Don't lose the current command when up is pressed in a terminal

text: How can I configure my Linux terminal so that the current command isn't lost when I press the up arrow key?


title: Concatenating thousands of files: > vs >>

text: I found two seemingly contradictory answers on StackOverflow to the following questions:   * Concatenating Thousands of Text Files Across Hundreds of Directories (while keeping some structure)   * How do I concatenate files in a subdirectory with Unix find execute and cat into a single file? The top answer to the first question suggests: `find . -name *.txt -print0 | xargs -0 cat >> out.txt` while the top answer to the second question suggests: `find . -name *.txt -print0 | xargs -0 cat > out.txt` As far as I know, the first one is correct since it uses the `>>` (append) operator, but not the second one since it uses the `>` operator which I thought simply redirects output to a file. However, the second answer has more votes (10) and was also accepted with no comments. Are both answers correct? Why? What is the purpose of having these two operators then?


title: Why does iptables still block my samba?

text: I'm currently fighting with iptables and samba. I read that samba needs ports 137-139 and 445 open on both tcp and udp. Here is the relevant part of my iptables config               ...     # forward valid incoming connections from lan to lan-services chain     -A INPUT -i eth1 -s 192.168.17.0/24 -p udp -m conntrack --ctstate NEW -j LANSERV     -A INPUT -i eth1 -s 192.168.17.0/24 -p tcp -m tcp --tcp-flags FIN,SYN,RST,ACK SYN -m conntrack --ctstate NEW -j LANSERV     ...     # samba     -A LANSERV -p tcp -m tcp --sport 137:139 --dport 137:139 -j ACCEPT     -A LANSERV -p udp -m udp --sport 137:139 --dport 137:139 -j ACCEPT     -A LANSERV -p tcp -m tcp --sport 445 --dport 445 -j ACCEPT     -A LANSERV -p udp -m udp --sport 445 --dport 445 -j ACCEPT      okay, 192.168.17.* is my local subnet which is connected to eth1. What is wrong with these rules? Does samba need even more ports? It is definetly the firewall since adding `-A INPUT -i eth1 -s 192.168.17.0/24 -j ACCEPT` on top makes samba work. edit: I'm trying to connect from a Windows 7 machine.


title: Select/extract columns based on the values on a certain row

text: Here is an example text file:               A B C D E F G     1 2 3 4 5 6 7     2 3 4 5 6 7 8     3 4 5 6 7 8 9      I would like to extract specific columns based on the values on the 3rd row, that is, 2 3 4 5 6 7 8. Let's say, I would like to extract all the columns with a value on the 3rd row larger than 5. That will be the final 3 columns. Hence, my goal is to select and generate the following:               E F G     5 6 7     6 7 8     7 8 9      Here is my code:               NR==3 {         for (i=1; i<=NF; i++) {             if ($i > 5)   x[j++] = i         }     }     NR>= 1 {       for (i=0 ;  i < j-1; i++ )          printf("%s ",$x[i])       printf("%s\n",$x[j-1])     }      However, this generates the following:               A B C D E F G     1 2 3 4 5 6 7     6 7 8     7 8 9      What did I miss?


title: Grant ssh access for single session

text: I wonder if there is a tool/modified ssh-server/ssh option which enables me to grant ssh access for a single session to a given user. What I want to avoid is creating a user account and password for the specific guest. It could instead use an existing user account with certain access rights to be set once. I do not want to share the same account information with everybody I grant access to. The access permission should either work only once/time out after a given interval or the tool should ask me if it detects an access whether I want to grant it. The idea is to share a line like               ssh tempuser001@host      where `tempuser001` is tells the server who tries to access but does not correspond to a real user. The user could use his temporary privileges to do all the fancy things you can with ssh connections, like `scp`, `rsync`, and whatever works through tunnels like`vnc`, ... The inspiration for this comes from teamviewer, a kind of vnc which permits a remote user to access my desktop once I shared an id with him.


title: Multimedia keys (Fn+[F1..F12]) don't work anymore after upgrade

text: I'm experiencing a strange issue with the multimedia keys on Archlinux with XFCE 4. I used to change the sound level with `Fn``F11`/`F12` keys but after a reboot, I'm not able to use it anymore. Moreover, I can't set new keyboard shortcut (in XFCE keyboard configuration utility) using a `Fn` key combination (where 3 days ago I've successfully set the `Fn``Space` shortcut (alias `XF86Launch6`). However, it seems that the `Fn``F2` shortcut works and properly disable/enable Wifi network AND everything works on Gnome (volume, keybinding)...


title: md5 String and File different

text: Why do I become a different hash when I try:   `md5 <<< "Hello"`   `md5 -s "Hello"`   Is it because of a possible line break in the first example?


title: Split parent pane instead of the active one

text: Let's say I've obtained this configuration by using `splitw -h` once, with `A` currently active:               +---+---+     | A | B |     |   |   |     |   |   |     +---+---+      How can I add a new split _below_ those 2 splits?               +---+---+     | A | B |     +---+---+     |   C   |     +---+---+      I'm not sure how to search for this... Everything I've found is about splitting _inside_ a pane with `splitw`, which is not what I want:               +---+---+     | A | B |     +---+   |     | C |   |     +---+---+      _For those familiar withi3, this would be the equivalent of sending `focus parent; split v` before opening the new window._ Is `tmux` able to do this? I'd rather stop searching now if that's not the case :)


title: Possibile sources of 5us-20us latency gap when sending long block of of serial data to tty device?

text: I have a trivial C program that just sends a large block of data out the serial port at a fast baud rate. When looking at the bits actually coming out of the port, I see that there is a almost always a gap in the serial bytes that comes near the beginning of the block (between 6ms and 20ms in) and lasts about the width of a couple of bytes (5us - 20us). Here is a picture... ![Scope view of data gap](http://i.stack.imgur.com/ZCQdg.png) The gap only comes at most 1 time per transmission, and once it happens the rest of the 100ms long transmission goes uninterrupted. The gaps happen about 9 out of 10 times I send a block. The gap always occurs between bytes, so would not show up on a receiving computer as corrupted bytes and would not be a problem for normal serial communication (except that you are loosing a tiny amount of throughput), but it is important in my application because I want to use the serial port in a non-conventional application where the signal needs to be continuous. At first I though it might be a scheduling issue, but nice-ing the process does not seem to have any effect on the gap. There are no other ready processes running on the machine.               pi@raspberrypi ~ $ ps all     F   UID   PID  PPID PRI  NI    VSZ   RSS WCHAN  STAT TTY        TIME COMMAND     4     0  2101     1  20   0   3744   804 n_tty_ Ss+  tty1       0:00 /sbin/getty     4     0  2102     1  20   0   3744   804 n_tty_ Ss+  tty2       0:00 /sbin/getty     4     0  2103     1  20   0   3744   804 n_tty_ Ss+  tty3       0:00 /sbin/getty     4     0  2104     1  20   0   3744   804 n_tty_ Ss+  tty4       0:00 /sbin/getty     4     0  2105     1  20   0   3744   804 n_tty_ Ss+  tty5       0:00 /sbin/getty     4     0  2106     1  20   0   3744   804 n_tty_ Ss+  tty6       0:00 /sbin/getty     0  1000 16370 27290  20   0   4136   956 -      R+   pts/1      0:00 ps all     0  1000 27290 27289  20   0   8252  5508 wait   Ss   pts/1      1:04 -bash     pi@raspberrypi ~ $ ./sendzeros /dev/ttyAMA0     Please start with ./sendzeros /dev/ttyS1 (for example)      I am trying to track down where this gap comes from in the hopes of eliminating it. Any ideas as to what might be the cause? Next step will be to write an interrupt triggered device driver that directly keeps the UART's buffers full, but I'd prefer to stay in userland if that is at all possible. I'd also just like to know at this point even just so I can better understand where sources of latency like this can come from in the kernel. The machine is a Raspberry Pi running Raspbian (wheezy). Here is the code in case it might be relevant...               #include <string.h>     #include <stdlib.h>     #include <stdio.h>     #include <unistd.h>     #include <fcntl.h>     #include <termios.h>               #define COUNT 24000             // Number of bytes to send...          int main(int argc,char** argv)     {             struct termios tio;             int tty_fd;                  printf("Please start with %s /dev/ttyS1 (for example)\n",argv[0]);                  tty_fd=open(argv[1], O_WRONLY );                  tcgetattr(tty_fd,&tio);                  tio.c_iflag=0;             tio.c_oflag=0;             tio.c_cflag=CS8|CREAD|CLOCAL;           // 8n1, see termios.h for more $             tio.c_lflag=0;                  cfmakeraw( &tio );                  int ssr = cfsetospeed(&tio,  B2500000 );                  tcsetattr(tty_fd,TCSANOW,&tio);                  // This bit pattern makes it possible to see disruptions on an attached$                  char buffer[ COUNT ];                  memset( buffer , 0 , sizeof(buffer ) );                  write(tty_fd,&buffer,sizeof(buffer));                     // if new dat$                  close(tty_fd);                  return EXIT_SUCCESS;     }


title: eCryptfs key in kernel image or initramfs

text: I have an embedded Linux system with unencrypted kernel image and initramfs in NAND flash. My RootFS is in SD card. I want to encrypted some files on SD Card as my SD card is easily accessible physically. For this I am planing to use eCryptfs. But I want to keep the keys inside NAND flash in kernel image or initramfs. What are my options, what is best way to secure some files on my SD card.


title: How can I get 1080p to work on my TV with HDMI using xrandr?

text: I'm using Arch Linux on a small HTPC called an Xtreamer, which has an Nvidia GT218/ION graphics card and HDMI out. My television is an Orion DL40-71BK (manual, note everything's in Japanese). HDMI video output works fine on some settings, for example 1440x900 and 1280x720, and xrandr shows many modes without any X11 configuration, including 1920x1080@60Hz (which it lists as the preferred mode). Full xrandr output follows:               Screen 0: minimum 8 x 8, current 1440 x 900, maximum 8192 x 8192                          DVI-I-0 disconnected primary (normal left inverted right x axis y axis)                   DVI-I-1 disconnected (normal left inverted right x axis y axis)                           HDMI-0 connected 1440x900+0+0 (normal left inverted right x axis y axis) 160mm x 90mm        1920x1080     60.05 +  60.00    59.94    60.00                                            1440x900      59.89*                                                                      1360x768      60.02                                                                       1280x1024     60.02                                                                       1280x768      59.87                                                                       1280x720      60.00    59.94                                                              1024x768      60.00                                                                       800x600       60.32                                                                       720x480       59.94    60.05                                                              640x480       59.94    59.93                                                            One thing I do not understand here: What are the columns to the right of 60.00 in the 1920x1080 line? Anyway, the problem is if I use xrandr to switch to the 1920x1080 mode (or let X11 do so by default on startup) my television shows a black screen and an error (非対応の入力信号, "unsupported input signal"). This also happens if I use the `nvidia-settings` tool to set the resolution (it also lists 1920x1080 as supported, but has the same error). I can find this error a few places online, but nothing to with Linux, just people having problems with game consoles and older versions of the TV. I know the TV works with 1920x1080; the manufacturer lists it and my PS3 uses 1080p just fine. **What can I do to use 1920x1080 on my TV?** Is there some configuration I've overlooked?


title: LVM: is this mirrored? is copy this slow?

text: Background: My Windows Home Server bit the dust - some kind of OS Hang. The drives and hardware were still good; after making sure I had all my data backed up, I decided to investigate Ubuntu and LVM, (along with btsync and samba, but that's another story) I had the following drives available to me: 1TB, 1.5TB, and 2TB. I was trying to figure out how to partition them and raid them together. I ran around in several circles. What I ended up doing was:   * 1 partition on each disk for the whole disk   * pvcreate /dev/sd[b,c,d]   * vgcreate all of the above together into a single vg "vg1"    * lvcreate -m1 on that vg1.  I played with the sizes. Sure enough it would let me lvcreate and extend up to 1.8tb, but not more. Question #1: Is it really mirrored? I think it is; however, I didn't follow any guidelines of "pair this drive with that drive because they are the same size" (which is pretty much every example I've found on LVM). Output of lsblk, excluding the O/S drive:               sdb                            8:16   0   1.4T  0 disk     └─sdb1                         8:17   0   1.4T  0 part       └─vg1-lv1_mimage_0 (dm-1)  252:1    0   1.8T  0 lvm         └─vg1-lv1 (dm-3)         252:3    0   1.8T  0 lvm  /srv/samba/share     sdc                            8:32   0   1.8T  0 disk     └─sdc1                         8:33   0   1.8T  0 part       └─vg1-lv1_mimage_1 (dm-2)  252:2    0   1.8T  0 lvm         └─vg1-lv1 (dm-3)         252:3    0   1.8T  0 lvm  /srv/samba/share     sdd                            8:48   0 931.5G  0 disk     └─sdd1                         8:49   0 931.5G  0 part       ├─vg1-lv1_mlog (dm-0)      252:0    0     4M  0 lvm       │ └─vg1-lv1 (dm-3)         252:3    0   1.8T  0 lvm  /srv/samba/share       └─vg1-lv1_mimage_0 (dm-1)  252:1    0   1.8T  0 lvm         └─vg1-lv1 (dm-3)         252:3    0   1.8T  0 lvm  /srv/samba/share      Question #2: When is the !#$!$% copy going to be done? Its been running for about 24 hours so far. Is it really this slow? Or is it falling behind because I'm also currently btsync'ing my data back to the array? Or is there something wrong that I can go tweak and fix? Output of lvs -a:                 LV             VG        Attr      LSize   Pool Origin Data%  Move Log      Copy%         root           ubuntu-vg -wi-ao--- 697.39g       swap_1         ubuntu-vg -wi-ao---   1.00g       lv1            vg1       mwi-aom--   1.80t                         lv1_mlog  43.83       [lv1_mimage_0] vg1       Iwi-aom--   1.80t       [lv1_mimage_1] vg1       Iwi-aom--   1.80t       [lv1_mlog]     vg1       lwi-aom--   4.00m      Thanks for any feedback and direction in advance. Other details if its at all relevant:   * EX485 former HP Media server   * Ubuntu Desktop 32bit 14.something as of 3 days ago (<2G of ram)    * Installed by mounting boot drive elsewhere, installing, adding sshd, and then moving it over, so maybe its a low level disk driver problem _update #1_ I caught some of the fine print here (my bold added): > When a mirror is created, the mirror regions are synchronized. For large > mirror components, the sync process **_may take a long time_**. When you are > creating a new mirror that does not need to be revived, you can specify the > nosync argument to indicate that an initial synchronization from the first > device is not required. This might indicate that the "long copy time" is correct.


title: How to get banshee music name through dbus?

text: qdbus org.bansheeproject.Banshee /org/bansheeproject/Banshee/PlayerEngine      how to get the value of this property?               property read QVariantMap org.bansheeproject.Banshee.PlayerEngine.CurrentTrack


title: Command in variable one are affecting output of other variable when displayed together in UNIX

text: I am having two file naming Extra_info and Class_info Class_info contains data :               stuId stuName stuClass      S01    jagdeep  First     S02    harsh    First     S03    Roop     Second     S04    Kali     Third      Extra_info contains extra information about student like               stuId stuCity stuEmail         stuPhone     S01    Sirsa  faltu@gmail.com  1234567890      I am getting result from both files using grep for stuId and displaying the result as:               res1=`grep $stuId $locDir/Class_info`     res2=`grep $stuId $locDir/Extra_info|cut -d" " -f2-`      ## also I tried res2=`grep $stuId $locDir/Extra_info|awk '{$1="" ; print $0}'`     echo $res1 $res2      Instead of displaying:                    S01 jagdeep First Sirsa  faltu@gmail.com  1234567890      It is displaying:                    Sirsa  faltu@gmail.com  1234567890      As I could think at the time of echo the variable res2 is nullifying result from res1. Please, suggest the possible reason for this and please provide solution for the same.


title: Unable to see eth0 after ifconfig

text: Yesterday, I have done some changes in `/etc/sysconfig/network-scripts/ifcfg- eht0` in centos 6. I have edited the value of `nm_controlled= "no"` after `"Yes"`.   Now, I am unable to see the "eth0" after doing `ifconfig` and lost internet and no ping .


title: How do I search for files from the gnome GUI in debian?

text: I sometimes spend time in the standard classic gnome GUI in `debian wheezy`, and today I wanted to search for files containing some text in a certain folder. I tried to do it the windows way by going to the folder I wanted to search in, clicking on "Search" and typing in the text. But when I press "Enter" all I see is a bar saying "Search Results", with the location I'm searching in and a little `+` icon to add criteria to my search. There's no results... To confirm it's not finding anything I created a folder called `abc` on the desktop and placed a file called `text` into it. I then double-clicked the folder, clicked on `search`, typed "text" and got a blank results page (with only the aforementioned "Search Results" bar and an option to add other criteria). Is this a bug, permission issue or a bad feature? And what's the workaround?


title: Configure Emacs to use Chrome as the web browser of choice?

text: Using Emacs on a Linux system I click:               Scala>Browser Scala API      which produces a terminal window with this message:               /usr/bin/xterm: Can't execvp lynx: No such file or directory      How do I inform Emacs that the correct web browser to use is Chrome?


title: getting a gui program to start on boot

text: I have a C program I wrote for debian on the raspberry pi that asks the user to enter a number, 1-4 which it then stores in a configuration file. This only happens if the configuration file is missing. I'd like to run this program on boot. Problem is, I can get it to run on boot, but haven't had any luck getting the terminal window to show up so I can see it. I've tried editing /etc/rc.local and adding commands there. I've tried editing crontab. I've tried all the tricks with "export display=:0 && command". Any suggestions? ### Edit: Here is the command I am actually running in /etc/rc.local:               x-terminal-emulator --command=/opt/vc/src/hello_pi/initialConfig/./initialConfig.bin --display=:0      The program uses scanf() to capture keyboard input and display feedback.


title: Redirecting all IP over USB traffic to a fixed address

text: I'ma bit of a network newbie, so apologies for the inaccurate vocabulary. Say I have a device connected by IP over USB to my computer (running Ubuntu), that connects to 10.0.0.1. I configured my Ubuntu's Wifi over USB so that my computer's IP on that connection is 10.0.0.1, but I would actually like to redirect all traffic (on all ports) to another server, and just use my computer as a proxy. I played around with some solutions, but my lack of familiarity with network concepts is slowing me down (I spend too much time looking stuff up, and the documentation is often a bit lacking). I'm not even sure if I want to set up a proxy, a firewall (I don't think so), or use the routing tables. What I want to do sounds pretty simple ("redirect anything coming from IP over USB to that server over there"). So is there a standard way of doing that? iptables? squid? ufw?


title: Auto login problems with slim

text: I have installed Arch and am having problems with the auto login options within `slim.conf`. I have installed the following X packages:               xorg-server     xorg-xinit     xorg-twm, xterm     and for the graphics: xf86-video-fbdev I have also added a user and password, and altered the `sudoers` file to suit. I have changed the following lines:               # default_user simone     # auto_login no to:               default_user jon     auto_login yes I have managed to get the slim login prompt to appear on boot by editing `/etc/inittab`, but the changes made for bypassing this have not been as successful. Anybody know what I have missed? Maybe something to do with adding a user to some group?


title: Vim gg=G (reindent whole file) without losing current position

text: Recently my main work was editing .xml files. Google told me that for re- indenting a file I need to press `gg=G` in normal. But moving to `gg` is something that I don't want. Is there any way to do the same without losing the current position?


title: openBSD static ip can't connect

text: I have set /etc/hostname.msk0 to               inet 192.168.1.102 255.255.255.0 NONE      and /etc/mygate to               192.168.1.1       but still can't ping the router (192.168.1.1) do I need to configure dns to ping ?               ifconfig msk0     msk0: flags=8843<UP, BROADCAST, RUNNING, SIMPLEX MULTICAST> mtu 1500     groups:egress     media: Ethernet autoselect     status active     inet6 xxxxxxxxxxxxx...........     inet 192.168.1.102 netmask 0xffffff00 broadcast 192.168.1.255          route -n show     destination    gateway     flags  mtu Iface      default        192.168.1.1 UGS    _   msk0


title: Split screen just like Windows or Unity do

text: I'm looking in Debian wheezy for a way to split screen in two windows just like you can do in Ubuntu or Windows7/8. I mean I'm used to select a window and push windowskey+left and select another one and windowskey+right, so I can take advantage of the 16:9 screen. Is there any package or external app to do this in Debian wheezy with GNOME 3.4?


title: Aliases for 'sudo /etc/init.d/'

text: Are there any standards for aliasing `sudo /etc/init.d/`? I'm sure many people have considered cutting down these 17 characters to just 2 or so.


title: install 2.6.32.59 on squeeze

text: I'm suffering from a kernel bug in a production environment. The problem isn't causing a complete outage, but it's degrading service. These are soft lockups. I'd like to try a newer kernel, however Squeeze only has 2.6.32.5, but kernel.org has 2.6.32.59. I've compiled from source in the past, but should this really be necessary? I'd really rather not put other admins through manual tracking of security bugs. Backports seems to no longer have 2.6 kernels, they're all 3.2. 3.2 is a PITA to install because it pulls in a mountain of dependencies. E.g., linux-base > 3 http://packages.debian.org/squeeze-backports/linux-image-3.2.0-0.bpo.2-686-pae Those dependencies could break my abilty to boot back in 2.6, cutting out my backout plan and potentially leading to a very long production outage. There are references online of backports having a newer 2.6.32 kernel. Where did they go? Thanks,


title: Remove specific file from directory if it's the only one

text: I have a lot of directories and sub-directories. I want to recursively remove one specific file from a directory if it's the only one there. Also assume that there are no sub-directories in that directory. So, to summarize, the assumptions are:   * The file name is README.TXT (case insensitive)   * There are no other files or directories in the directory where that file is found Structure:                mkdir usecase      cd usecase      mkdir destroy_this      touch destroy_this/readme.txt      mkdir do_not_destroy_this      touch do_not_destroy_this/readme.txt      touch do_not_destroy_this/something-else.txt      mkdir do_nothing      cd do_nothing      mkdir rm_this      touch rm_this/README.TXT      cd ..      mkdir do_nothing_here      cd do_nothing_here      mkdir has_sub_dir      touch README.TXT      cd ..      Running the above would results in this tree structure:               $ tree .     .     `-- usecase         |-- destroy_this         |   `-- readme.txt         |-- do_not_destroy_this         |   |-- readme.txt         |   `-- something-else.txt         |-- do_nothing         |   `-- rm_this         |       `-- README.TXT         `-- do_nothing_here             |-- has_sub_dir             `-- README.TXT      This is what I've got so far:               find . -type f -iname "readme.txt" -exec sh -c 'ls $(dirname "{}") | wc -l' \;      The idea is that I count the number of files and directories and if it's one then remove the file.


title: Shell script and crontab to capture file size, name and date in a CSV file and then send via email?

text: I have a number of zip files in a certain folder. I want to capture file name and the size of the files in a CSV format in day wise and put it in crontab so I can report on a daily basis, and then mail it in each report. Files are in `/somedirectory/archive/test`:               -rw-rw-r--+ 1 AAAA AAAA 9.3M May  30 17:09 XXXXX_20140530_0401_28.txt.gz     -rw-rw-r--+ 1 AAAA AAAA 9.3M May  30 17:09 XXXXX_20140530_0401_29.txt.gz     -rw-rw-r--+ 1 AAAA AAAA 9.3M May  31 17:09 XXXXX_20140531_0401_01.txt.gz      Now I want to crate a cronjob to run everyday and capture the same CSV which we prepared in day wise. ### example _test30052014.csv_ :               "XXXXX_20140530_0401_28.txt.gz", "9.3","May 30"     "XXXXX_20140530_0401_29.txt.gz", "9.3","May 30"      _test31052014.csv_ :               "XXXXX_20140531_0401_01.txt.gz", "9.3","May 31"      And after generated the CSV file I should be able to send mail as well via crontab.


title: How ignore PATH with `source` completion

text: I can't find any 'detailed enough' documentation about `zstyle`, and I'm surprised that no one faced this problem before: here is what I get with tab completion:               source l<TAB>     l2ping*                  lefty*                   libwmf-fontmap*          locate*                  lpq.cups      this is certainly/obviously the executable files of my `$PATH`. However, I would like to use `source` with a **local** file, but I can't understand how to change it. Basically, the command `file` is completed as I expect, so I'd like to tell `zstyle` to use the same rules. I _guess_ that I could adapt `:completion:*:killall:* 'ps -u $USER -o cmd h'`, to do the job, but this would be quite ugly and I'm looking for a zstyle- builtin option. I _thought_ that I could adapt something like `':completion:*:cd:*' ignore- parents parent pwd` to `source`, but the completion result never changes ... * * * for information:               $ zsh --version     zsh 4.3.17 (x86_64-redhat-linux-gnu)     $ zstyle     cache-path             :completion::complete:* /home/kevin/.oh-my-zsh/cache/     command             :completion:*:*:*:*:processes 'ps -u kevin -o pid,user,comm -w -w'             :completion:*:killall:* 'ps -u $USER -o cmd h'     hosts             :completion:*:hosts 192.168.0.101 git.bri.st.com crx672 bastion.inrialpes.fr 192.168.0.5 idrouille 129.88.69.73 idrouille.imag.fr koguis 192.168.1.4 127.0.0.1 koguis.imag.fr localhost crx672.cro.st.com 192.168.1.100 github.com 192.168.1.101 sourceware.org gnx2034.gnb.st.com gnx2528.gnb.st.com ctf.stri.pe 10.0.0.2 127.0.0.1 kevin localhost.localdomain localhost ::1 kevin localhost6.localdomain6 localhost6 kevin localhost     ignored-patterns             :completion:*:*:*:users adm amanda apache avahi beaglidx bin cacti canna clamav daemon dbus distcache dovecot fax ftp games gdm gkrellmd gopher hacluster haldaemon halt hsqldb ident junkbust ldap lp mail mailman mailnull mldonkey mysql nagios named netdump news nfsnobody nobody nscd ntp nut nx openvpn operator pcap postfix postgres privoxy pulse pvm quagga radvd rpc rpcuser rpm shutdown squid sshd sync uucp vcsa xfs             :completion:*:functions '_*'     list-colors             :completion:*:*:kill:*:processes '=(#b) #([0-9]#) ([0-9a-z-]#)*=01;34=0=01'             :completion:* ''     menu             :completion:*:*:*:*:* select     single-ignored             * show     tag-order             :completion:*:cd:* local-directories directory-stack path-directories     url-globbers     (eval)  :url-quote-magic 'zmodload -i zsh/parameter;          reply=( noglob              ${(k)galiases[(R)(* |)(noglob|urlglobber|globurl) *]:-}              ${(k)aliases[(R)(* |)(noglob|urlglobber|globurl) *]:-} )'     url-local-schema             :urlglobber ftp file     url-metas             :url-quote-magic:* '*?[]^(|)~#{}='     url-other-schema             :urlglobber http https ftp     url-seps     (eval)  :url-quote-magic:* 'reply=(";&<>${histchars[1]}")'     use-cache             :completion::complete:* 1     user-commands             :completion:*:*:git:* 'flow:description for foo'


title: Why is the default umask value for useradd in openSuSE set to 022?

text: I recently built a very simple test environment with oepnSuSE. As I tried to configure a shared directory, **wihtout** using ACLs, but with SetGID on that directory instead for some reason, I noticed that the default umask for every user is set to 022 (i.e. 755 on directories & 644 on files). This is done in `/etc/login.defs`. I am used to a umask 002 (i.e. 775 directories / 664 files) for normal users and 022 for the root-user instead. Shall I change the umask value for useradd in the above mentioned file, if I want to set it as default for all future useradds and how can I change the umask for all existing users on my system (except the root account, of course)?


title: how to run shell on a remote server with root priviledge

text: I want to execute a shell script on a remote server, and the script should be run by root with no password required (or use `sudo` in the script). Can anyone give me some suggestions?


title: Using perl to modify a LaTeX document

text: I am trying to use `perl` in order to modify a `LaTeX` document. In fact, I am trying to change the citation format from for example:               . \cite{poelma20113d}      to               \cite{poelma20113d}.      In other words, I want to find those citations which are preceded by a period and a space and replace them with blank then put the citation and then place a period after it. Could someone help me how I can do that via `perl` one liner? The reason I want to do this is that I want to change the format of my manuscript that was prepared for the Journal of Physics of Fluids to the Journal of Physical Review E.


title: uXlib.h Which package have this lib file?

text: I am getting an error uXlib.h not found while compiling a program, written in c++ I think the lib file is related UIM/X from the following link motif.ics.com/sites/default/files/ReferenceManual.pdf


title: rename multiple files recursively and remove multiple characters such as ? : or newline from names

text: I have seen a few similar questions, but nothing that shows how to remove any of a set of special characters from all file names recursively. I want to keep uppercase and lowercase letters, numbers and underscores and get rid of all special characters in the filenames. I have seen colons and question mark chars and a couple file names with newlines.


title: reverse extending the LVM group volume

text: I accidentally extended the volume to utilized 100% free disk space on LVM group volume. I need it to utilized only `/dev/sdb` disk but it took free space from both disk, since they were on the same group. Is there a way to reverse this.               [root@server]# pvscan       PV /dev/sda3   VG myvg   lvm2 [13.84 GB / 13.84 GB free]       PV /dev/sdb3   VG myvg   lvm2 [22.06 GB / 8.22 GB free]       Total: 2 [35.91 GB] / in use: 2 [35.91 GB] / in no VG: 0 [0   ]          [root@server]# lvextend -l +100%FREE /dev/myvg/rootvol       Extending logical volume rootvol to 35.91 GB       Logical volume rootvol successfully resized          [root@server]# pvscan       PV /dev/sda3   VG myvg   lvm2 [13.84 GB / 0    free]       PV /dev/sdb3   VG myvg   lvm2 [22.06 GB / 0    free]       Total: 2 [35.91 GB] / in use: 2 [35.91 GB] / in no VG: 0 [0   ]      I actually need to remove `/dev/sda3`. This is on RHEL 5.9 system. Please note that I do not want to loss the data Updated: If I use temporary disk then I will need about the same size of the disk, if I pvmove only one volume then how can I make sure there there is nothing in other disk and the data will not get corrupted. Updated: I added a new larger disk and `pvmove` `/dev/sda3` and `/dev/sdb3` to `/dev/sdc3` (new disk). I am not sure why df still showing newly added free space on root volume.                [root@server]# pvscan        PV /dev/sdc3   VG myvg            lvm2 [47.06 GB / 11.16 GB free]        PV /dev/sda3                      lvm2 [13.85 GB]        PV /dev/sdb3                      lvm2 [22.07 GB]        Total: 3 [82.98 GB] / in use: 1 [47.06 GB] / in no VG: 2 [35.92 GB]           [root@server]# lvscan        ACTIVE            '/dev/myvg/rootvol' [35.91 GB] inherit           [root@server]# df -kh .      Filesystem            Size  Used Avail Use% Mounted on      /dev/mapper/myvg-rootvol                             14G   12G  1.3G  91% /


title: Protected environment variables?

text: Are there names of environment variables that cannot be overwritten by the user/a call to `setenv`? As I understand from POSIX1.2008, any process may edit the environment block, but must avoid overwriting such vars as LANG etc.


title: Public Key Auth + Kerberos

text: I've setup public key authentication for ssh'ing into my university machine. However, it only logs me in on the local machine and doesn't give me Kerberos credentials which I need for accessing my network folder. This causes problems with tools like git. Is there a way for me to automatically get Kerberos credentials when ssh'ing without having to enter my Kerberos password? My client machine is OSX 10.6 and my university machine is Ubuntu 12.04


title: Where to securely place files needed by PHP in Linux filesystem (according to FHS)

text: I have a PHP script running on my LAMP server that requires certain files in order to produce HTML content. The script is publicly accessible (i.e. `http://example.com/script.php`) but the files required by the script must secured. I could probably place the files in any directory other than `/var/www` and they would be relatively safe, but I'm trying to learn the Linux filesystem and I'd like to use the most _appropriate_ place (according to FHS). Any help would be great.


title: daemon function in /init.d does not run the program in the background in fedora13

text: I use Fedora 13 and am trying to create a service for `darkice`. I put the script in the `/etc/init.d` directory and if I use the command `service darkice start`, the `darkice` is running in the foreground and the command prompt is not returned. How do I make `darkice` run in the background? The following is the excerpt from the `darkice` script.               PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin     DAEMON=/usr/local/bin/darkice     NAME=darkice     DESC="Darkice live audio streamer"          test -x $DAEMON || exit 0     CONFIGFILE="/etc/darkice.cfg"          # Source function library.     . /etc/rc.d/init.d/functions               # See how we were called.     case "$1" in       start)         # Start daemon.         echo -n $"Starting darkice streaming daemon: "         daemon "$DAEMON -c $CONFIGFILE > /dev/null"         RETVAL=$?         echo         [ $RETVAL -eq 0 ] && touch /var/lock/subsys/darkice         ;;       stop)


title: port forwarding to internal lan server

text: I've ppp0 --> eth1 and eth0 (internal lan). I need forwarding externel 10022 port to port 8999 of the server 192.168.1.254               iptables -t nat -A PREROUTING -p tcp -i ppp0 --dport 10022 -j DNAT --to 192.168.1.254:8999     iptables -A FORWARD -p tcp -d 192.168.1.254 --dport 10022 -j ACCEPT      I also have:               cat /proc/sys/net/ipv4/conf/ppp0/forwarding           1      connection time-out... any idea? iptables -L -nv               Chain INPUT (policy DROP 14 packets, 1609 bytes)      pkts bytes target     prot opt in     out     source               destination                  0     0 ACCEPT     all  --  lo     *       0.0.0.0/0            0.0.0.0/0                    0     0 DROP       all  -f  *      *       0.0.0.0/0            0.0.0.0/0                    0     0 DROP       all  --  *      *       0.0.0.0/0            0.0.0.0/0           state INVALID       2037  136K ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0           state RELATED,ESTABLISHED          0     0 ACCEPT     icmp --  ppp0   *       0.0.0.0/0            0.0.0.0/0                    0     0 ACCEPT     icmp --  eth0   *       0.0.0.0/0            0.0.0.0/0                    0     0 ACCEPT     icmp --  tap0   *       0.0.0.0/0            0.0.0.0/0                   14  1609 LOG        all  --  *      *       0.0.0.0/0            0.0.0.0/0           LOG flags 0 level 4           Chain FORWARD (policy DROP 0 packets, 0 bytes)      pkts bytes target     prot opt in     out     source               destination                  0     0 TCPMSS     tcp  --  *      ppp2    0.0.0.0/0            0.0.0.0/0           tcp flags:0x06/0x02 tcpmss match 1400:1536 TCPMSS clamp to PMTU          0     0 TCPMSS     tcp  --  *      eth1    0.0.0.0/0            0.0.0.0/0           tcp flags:0x06/0x02 tcpmss match 1400:1536 TCPMSS clamp to PMTU          0     0 TCPMSS     tcp  --  *      eth0    0.0.0.0/0            0.0.0.0/0           tcp flags:0x06/0x02 tcpmss match 1400:1536 TCPMSS clamp to PMTU          0     0 TCPMSS     tcp  --  *      ppp0    0.0.0.0/0            0.0.0.0/0           tcp flags:0x06/0x02 tcpmss match 1400:1536 TCPMSS clamp to PMTU         16  2368 ACCEPT     all  --  *      *       0.0.0.0/0            192.168.1.0/24      state RELATED,ESTABLISHED          0     0 ACCEPT     all  --  *      *       192.168.1.0/24       0.0.0.0/0                    0     0 LOG        all  --  *      *       0.0.0.0/0            0.0.0.0/0           LOG flags 0 level 4           Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)      pkts bytes target     prot opt in     out     source               destination                  0     0 ACCEPT     all  --  *      lo      0.0.0.0/0            0.0.0.0/0                    0     0 DROP       all  -f  *      *       0.0.0.0/0            0.0.0.0/0                    0     0 DROP       all  --  *      *       0.0.0.0/0            0.0.0.0/0           state INVALID       3097 4268K ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0           state NEW,RELATED,ESTABLISHED


title: How to change the output color of ls comman in terminal in OS X and iTerm2?

text: I know that a similar question has been as in: > How to colorize output of ls ? Though, I didn't really understand the answer and couldn't really make it work. However, I have tried something different. I decided to read the manual page for ls and it mentions different environments variables that can be set when dealing with the ls command. If one goes to the -G option it says to look at the CLICOLOR environment variables. So I did and that one links you to documentation for the LSCOLORS environment variable. So I went to it and it mentions: > "The value of this variable describes what color to use for which attribute > when colors are enabled with CLICOLOR. This string is a concatenation of > pairs of the format fb, where f is the foreground color and b is the > background color. " It also mentions that the default value of LSCOLORS is "exfxcxdxbxegedabagacad" and that each part specifies the color of some specific thing in the ls comand. For examle, the first pair ex in example specifies the color of directories. the second fx the color of symbolic links etc... e means blue and x means default "foreground". 1) First what does "when colors are enabled with CLICOLOR"? 2) What does foreground mean? What do the environment variables need to be for the ls command to color the output however I desire? * * * I also tried:               ls --color      But it threw me the following error:               ls: illegal option -- - usage: ls [-ABCFGHLOPRSTUWabcdefghiklmnopqrstuwx1] [file ...]      the same error happened when I did `ls --color=auto` alone also throws an error. No idea why, not sure if it was due to iTerm2 or OS X or why that happened. It seems it works on other systems...


title: Installing cppman

text: I've tried to install cppman in Fedora 19 or Linux mint 15 and it installs successfully. But when I try to use it I get the error:               Python IOError: [Errno 13] Permission denied      I've installed it in Ubuntu 12.04 and had no problem. Can you help me? Update: I fixed this problem, but I have a new problem. when for example I enter `cppman cout` the output shown is not in right format:               1mNAME0m            std::cout - Standard output stream          1mTYPE0m            object            <iostream>     1mSYNOPSIS0m            extern ostream cout;          1mDESCRIPTION0m            Object of class ostream that represents the standard output stream oriented to narrow characters (of type              char                      ). It corresponds to the C stream stdout.      It seems that I need to install or configure something. Can you help me?


title: The other users: avahi, root, syslog, messagebus,, nobody, ntp, rtkit and whoopsie

text: What are all these other users (found them with top) when running Ubuntu: avahi, root, syslog, messagebus, nobody, ntp, rtkit and whoopsie. I am aware that whoopsie, for example, is for reporting errors to Canonical. When I run 'who' I only see me (terminal and graphical display). Why don't they all run as root or as my user name? (I suppose that they run because I as a user needs them).


title: How do you set an environment variable?

text: Please explain how to set environment variables. I need to point an environment variable to a xml file.


title: Force X to use second video card so I can pass through first card to XEN VM?

text: So I am trying to get X to start on my second (PCI 02.00:00) video card and stop using the main card (PCI 1.00:00). I would like to do this because I want to pass through the PCI 1 card to a XEN HVM VM and use the second card as the main display for the dom0. I am led to believe that only the the first card on the PCI bus is compatible with XEM PCI VGA Pass thou. I'm using CentOS 6 with XEN 4.1; standard X with VESA drivers for now. Both cards are NVIDIA GeForce 8400 series. I have played around with custom `xorg.conf` by commenting out the references to the first device and screen, but that does not seem to work. I am also familiar with the PCIBACK module and can get the first video card to show up correctly in the `xm pci-list-assignable-devices` command.


title: What is the X desktop start up process / program hierarchy?

text: How do all the components that make up an "X desktop session" fit together? I've gone through http://en.wikipedia.org/wiki/X_Window_System , and I see that there are all sorts of components like X Servers, Login Managers, Session Managers, Window Managers, Desktop Environments, ... But, I'm not clear on how they all fit together. One reason I'm trying to figure this out so that I can insert my own logic into the boot process such that in certain cases, the system will directly boot to a particular user's desktop session, rather than a login greeter. But, I'm also just trying to understand the architectural design, so that I can extend this to Xvnc style setups as well. Thank you


title: Accidentally executed sudo rm /* on a remote server

text: I accidentally executed `rm /*` while logged in as root in a remote Ubuntu Server and deleted pretty much all binaries and currently I can neither log in via ssh or ftp to restore the files (and hope for the best). Is there a way to somehow fix this mess, or should I call the datacenter and ask for a format?


title: Efficiency of lots of inotify watches or stat calls

text: I am developing software that will utilize inotify to track changes on a large amount of files (tens to hundreds of thousands of files). I have come up with these ideas:   * one watch per file   * one watch per parent directory   * avoid inotify and periodically scan the fs for changes (not preferred) I will have a database of all of the files I am watching and some basic stat information (like mtime and size), however, I would have to stat each file in that directory until I found the one that changed. **Which would be faster, tons (100,000+) of inotify watches or tons of stat calls?** I'm thinking that reducing the number of stat calls would be better, but I don't know enough about inotify. Note: This will be running on a workstation, not a server. It's main purpose is to synchronize changes (potentially to an entire filesystem) between a client and a remote server.


title: Does LAMP Stack have a GUI?

text: I just bought a VPS server with LAMP. I have SSH access, however no clue how to use LAMP. I used to work with cPanel in the past. So far, when I type the server address I get the default "Apache 2 Test Page". I wonder if LAMP has some sort of GUI control panel? If so what would be the way to install and access it on CentOS 6?


title: understanding the output of "apt-cache policy"

text: I ran `apt-cache policy sudo` before and after installing `sudo`: _before install:_               # apt-cache policy sudo     sudo:       Installed: (none)       Candidate: 1.8.5p2-1+nmu1       Version table:          1.8.5p2-1+nmu1 0             500 http://ftp.se.debian.org/debian/ wheezy/main i386 Packages     #      _after install:_               # apt-cache policy sudo     sudo:       Installed: 1.8.5p2-1+nmu1       Candidate: 1.8.5p2-1+nmu1       Version table:      *** 1.8.5p2-1+nmu1 0             500 http://ftp.se.debian.org/debian/ wheezy/main i386 Packages             100 /var/lib/dpkg/status     #       How to understand numbers 500 and 100? Are those some sort of status codes? In addition, what is the meaning of _***_ in front of the package version once it is installed?


title: Bind conky to single worksapce

text: Is it possible to run different conky configuration on different workspaces? I've checked `man conky`, only to find the `desktop` directive, but that doesn't work. Conky still runs on all workspaces.


title: W2K3 DC:  Samba file sharing access permission problem

text: I want to access SAMBA shares from a Windows Server 2003 domain controller without a password. But, I am receiving a permission error each time. I'm using RedHat 5.5. `# ls -l`               total 96     -rw------- 1 root          root  1611 Mar 25 18:45 anaconda-ks.cfg     drwxr-xr-x 2 root          root  4096 Mar 25 16:57 Desktop     -rw-r--r-- 1 root          root 55367 Mar 25 18:45 install.log     -rw-r--r-- 1 root          root  4010 Mar 25 18:38 install.log.syslog     drwxrwxrwx 2 administrator root  4096 Jun  3 15:54 rpmler (shared folder)      `# vi /etc/samba/smb.conf // ***I edited as below*** [global] ve [share]`               [global]         workgroup = argela         // the name of DC         security = user               //           smb passwd file = /etc/samba/smbpasswd               load printers = no            //           [share]         comment = file server         path = /root/rpmler                   // those folders that is want to share         valid users = administrator        //          admin users = administrator            read only = no         public = yes         browseable = yes      `# rpm -qa | grep samba`                system-config-samba-1.2.41-5.el5      samba-common-3.0.33-3.28.el5      samba-client-3.0.33-3.28.el5      samba-3.0.33-3.28.el5


title: Fetching email automatically then reading it locally

text: My email is kept on a remote server and accessible from anywhere by IMAP. What I'd like is a mail client that will periodically sync that remote mail to my laptop in the backgroun, so that when I open my mail client, today's email is instantly there and does not need to be downloaded. The background sync process could be some separate daemon or a function of the mail client itself. What I have now is just Thunderbird accessing the remote mail server via IMAP. But it means that mail only syncs when I start Thunderbird, and it takes ages to do so before I can read it. It's a slow process. I have a feeling that fetchmail could form part of what I want, as it can download mail to a local maildir. But then what's the easiest way to access this mail locally? And would fetchmail be smart enough to handle two-way sync, so that when I delete, move or save a mail locally the change will make its way to my remote IMAP server? Or is there some other Thunderbird-like mail client that can sync in the background (I work in Gnome), solving my problem?