title: How to enable user_xattr in Mint Cinnamon?

text: I just installed Netflix Desktop on my Cinnamon Mint, but I can't start it. When I run the program, I get the following message: > It appears that you do not have extended file system attributes enabled. > Please enable the user_xattr option for your filesystem and try again. I tried to edit the `fstab` file as told in a couple different posts, but they don't work; I don't have a line that looks like this in my file:               UUID=94f7fc1e-fa27-4b24-99f3-4b461665a4a4       /       ext4    errors=remount-ro,user_xattr       0       1      And when I add it and restart, nothing changes.


title: Emacs - finding the cursor in multiple windows

text: I've started splitting my emacs frame into two side-by-side windows, but often I'm unable to tell at a glance which window the cursor is currently in. I've bound the other-window command to a special key, so it's easy to hit that -- would there be a way to flash the cursor maybe three times right after switching to the other window? Or maybe there are better solutions people have thought of?


title: Internet stopped working after installing Xfce on Arch

text: Let me preface this by saying I'm not experienced in any of this. I followed the in-depth beginners guide for installing Arch using VirtualBox. I was able to install Arch just fine. After everything was installed I was able to ping different websites so it looked like the internet was working, not to mention I was able to download packages just fine from the internet with pacman. I then went to install Xfce because I heard it is a nice desktop environment. I think I also installed some stuff to do with VirtualBox Guest Additions (not really sure what they are). I was able to install that just fine, and rebooted my machine. After I logged in with my new desktop, I found that I have no internet. I searched around all last night and nobody seems to have my issue. From the "Network Configuration" page, it simply says to try pinging a website like so: `ping -c 3 google.com` Which fails with "unknown host google.com". If that fails, it says to do so like this: `ping -c 3 8.8.8.8` But that fails for me saying the network is unreachable. The website does not say what else to do in this case. I'm just completely lost on what to try next. edit: Also, I tried some sort of `pacman -Syu` command last night because the guide I was using said to do that for the Guest Additions stuff. Could that have contributed to this problem? edit: So not even a few minutes after posting this I tried just running `dhcpcd` in the terminal and I have internet again (at least ping works now). How do I make it do that when I boot up?


title: Frequent disconnections in OpenVPN

text: I'm suffering random disconnections with OpenVPN. I don't know much about the subject, maybe you can point me in the right direction? Here is the tail for `/var/log/messages`, it contains a `<warn>` and other relevant-looking lines:               Jul 15 21:27:58 notebook NetworkManager[907]: <info> Tunnel Device: tun0     Jul 15 21:27:58 notebook NetworkManager[907]: <info> IPv4 configuration:     Jul 15 21:27:58 notebook NetworkManager[907]: <info>   Internal Gateway: 10.8.0.65     Jul 15 21:27:58 notebook NetworkManager[907]: <info>   Internal Address: 10.8.0.66     Jul 15 21:27:58 notebook NetworkManager[907]: <info>   Internal Prefix: 32     Jul 15 21:27:58 notebook NetworkManager[907]: <info>   Internal Point-to-Point Address: 10.8.0.65     Jul 15 21:27:58 notebook NetworkManager[907]: <info>   Maximum Segment Size (MSS): 0     Jul 15 21:27:58 notebook NetworkManager[907]: <info>   Static Route: 10.8.0.1/32   Next Hop: 10.8.0.1     Jul 15 21:27:58 notebook NetworkManager[907]: <info>   Forbid Default Route: no     Jul 15 21:27:58 notebook NetworkManager[907]: <info>   Internal DNS: 10.8.0.1     Jul 15 21:27:58 notebook nm-openvpn[5675]: Initialization Sequence Completed     Jul 15 21:27:58 notebook NetworkManager[907]: <info>   DNS Domain: '(none)'     Jul 15 21:27:58 notebook NetworkManager[907]: <info> No IPv6 configuration     Jul 15 21:27:59 notebook NetworkManager[907]: <info> VPN connection 'Some VPN' (IP Config Get) complete.     Jul 15 21:27:59 notebook NetworkManager[907]: <info> Policy set 'Some VPN' (tun0) as default for IPv4 routing and DNS.     Jul 15 21:27:59 notebook NetworkManager[907]: <warn> /sys/devices/virtual/net/tun0: couldn't determine device driver; ignoring...     Jul 15 21:27:59 notebook NetworkManager[907]: <info> VPN plugin state changed: started (4)     Jul 15 21:28:44 notebook NetworkManager[907]: <info> VPN plugin state changed: stopping (5)     Jul 15 21:28:44 notebook NetworkManager[907]: <info> VPN plugin state changed: stopped (6)     Jul 15 21:28:44 notebook NetworkManager[907]: <info> VPN plugin state change reason: 0     Jul 15 21:28:44 notebook avahi-daemon[910]: Withdrawing workstation service for tun0.     Jul 15 21:28:44 notebook avahi-daemon[910]: Withdrawing address record for 192.168.0.5 on em1.     Jul 15 21:28:44 notebook avahi-daemon[910]: Leaving mDNS multicast group on interface em1.IPv4 with address 192.168.0.5.     Jul 15 21:28:44 notebook avahi-daemon[910]: Interface em1.IPv4 no longer relevant for mDNS.     Jul 15 21:28:44 notebook avahi-daemon[910]: Joining mDNS multicast group on interface em1.IPv4 with address 192.168.0.5.     Jul 15 21:28:44 notebook avahi-daemon[910]: New relevant interface em1.IPv4 for mDNS.     Jul 15 21:28:44 notebook avahi-daemon[910]: Registering new address record for 192.168.0.5 on em1.IPv4.     Jul 15 21:28:44 notebook nm-openvpn[5675]: SIGTERM[hard,] received, process exiting     Jul 15 21:28:45 notebook NetworkManager[907]: <info> Policy set 'System em1' (em1) as default for IPv4 routing and DNS.     Jul 15 21:28:45 notebook NetworkManager[907]: <warn> error disconnecting VPN: Could not process the request because no VPN connection was active.     Jul 15 21:28:45 notebook NetworkManager[907]: <warn> (5) failed to find interface name for index     Jul 15 21:28:45 notebook NetworkManager[907]: nm_system_iface_flush_routes: assertion `iface != NULL' failed     Jul 15 21:28:45 notebook NetworkManager[907]: <warn> (5) failed to find interface name for index     Jul 15 21:28:49 notebook NetworkManager[907]: <info> VPN service 'openvpn' disappeared


title: Can I use Synaptics' output in KVM?

text: I have been looking at MenuetOS, a simple graphical OS written entirely in FASM. The only reason I don't actually use it is that its touchpad support is pure garbage: every time I try to run MenuetOS, I struggle to control the cursor and I have difficulty doing simple things like closing windows. There is no keyboard-based navigation interface that I am aware of. Obviously I won't be able to run MenuetOS on this hardware, but I hoped I could run it in KVM. KVM normally allows the OS to use the input from the touchpad directly, so it doesn't solve the problem, but I was hoping that I could get X to intervene. Is it possible to force KVM to use the cursor position data generated by X's Synaptics touchpad driver instead of the raw touchpad input?


title: add-apt-repository Raises A Python Error

text: I wanted to install Numix icon theme, therefore I needed to add ppa, but it strangely raised this error:               Traceback (most recent call last):       File "/usr/bin/add-apt-repository", line 163, in <module>         if not sp.add_source_from_shortcut(shortcut, options.enable_source):       File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 750, in add_source_from_shortcut         self.set_modified_sourceslist()       File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 484, in set_modified_sourceslist         self.save_sourceslist()       File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 650, in save_sourceslist         self.sourceslist.save()       File "/usr/lib/python3/dist-packages/aptsources/sourceslist.py", line 415, in save         files[source.file] = open(source.file, "w")     FileNotFoundError: [Errno 2] Böyle bir dosya ya da dizin yok: '/etc/apt/sources.list.d/numix-ppa-trusty.list'      From code, I understand Python wants to open a configuration file, but since it cannot find it, it cannot create it as well. (Or whatever...) What is the source of this error? How to deal with it? And more, does Linux use Python for repository commands (since this is more interesting)? I ran those codes:               sudo apt-add-repository ppa:numix/ppa     sudo apt-get update     sudo apt-get install numix-icon-theme numix-icon-theme-circle      OS: Xubuntu 14.04 LTS **EDIT: Editing sources.list** Whenever I run this code, I run across https://launchpad.net/~numix/+archive/ubuntu/ppa link. So I tried those in sources.list:               ###############################################     # Number One: Add The Link To The End Of File #     ###############################################     deb https://launchpad.net/~numix/+archive/ubuntu/ppa trusty partner     deb-src deb https://launchpad.net/~numix/+archive/ubuntu/ppa trusty partner     # I used "deb", "deb-src" and "trusty partner" patterns to achieve my goal, but it failed.          ###################################     # Number Two: Change Link Pattern #     ###################################     deb https://launchpad.net/~numix/+archive/ubuntu trusty partner     deb-src deb https://launchpad.net/~numix/+archive/ubuntu trusty partner     # I also tried those since other repository links ends with "ubuntu" instead of "ppa" but this also failed.


title: Subprocess.call() and gunzip error

text: I'm trying to use Python's package subprocess to gunzip and gzip files. I'm using the following command:               subprocess.call(['gunzip', a_path+myfile_gz], shell=True) Then I get the error message: > gzip: compressed data not read from a terminal. Use -f to force > decompression. So I typed:               subprocess.call(['gunzip', '-f', a_path+myfile_gz], shell=True) And I get exactly the same error message. If I type `shell=False`, it's worse. It's really weird because if I do it from my terminal, it works fine! Does anybody knows what's wrong?


title: Arch suspend when I close laptop lid?

text: I'm in fluxbox on Arch on a Macbook 5,1. New to linux. I'm trying to get Arch to suspend when I close my laptop. Lately I've just been using `sudo pm- suspend`. I installed slimlock, and inserted               button/lid)         case $3 in             close)                 #echo "LID switched!">/dev/tty5              /usr/sbin/pm-suspend &              DISPLAY=:0.0 su -c - username /usr/bin/slimlock                 ;;      in my /etc/acpi/handler.sh, which I read to do here, but it doesn't work. I tried installing xscreensaver, but I get a weird error:               error: perl-lwp-mediatypes: signature from "Justin Davis (juster) <jrcd83@gmail.com>" is unknown trust     error: failed to commit transaction (invalid or corrupted package (PGP signature))


title: How to remove an audio track from an mp4 video file?

text: I have an mp4 video file with multiple audio tracks. I would like to strip away the rest of the tracks and keep just one. How do I do this?


title: What is the most advanced video editing FLOSS?

text: There are so many video editors out there (at least half a dozen during my search), and I wonder which is the most advanced among them? How does it compare with commercial offerings?


title: Poor Man's GNU Parallel implemented in ksh?

text: I'd like to use the feature of GNU parallel where it can execute the command and the list it's fed in parallel and spit it out after it's all done, however, I don't want to install GNU parallel across all of our servers. Or perhaps a parallel version of `xargs`? Is there a ksh implementation of what GNU Parallel does? In this case, it doesn't have to be done in order as GNU Parallel does -- just as long as all the output can be piped or stored. I'd also like to avoid using temporary files.


How can I move tmux's status bar to the top? Can't find it on the man page.


title: How to build my own kernel ? Where should I start?

text: I have completed my graduation recently. And I have only basic knowledge in C. But I would like to work on the Linux Kernel, and customize it according to my needs. Not only customize I would also like to contribute my own ideas to Linux kernel. But I am starting from 0 now! So please suggest me how to start, where to start and what more to do for understanding and writing programs on kernel ?


title: Sending a tab key event using applet to a unix machine?

text: i have an applet , that interacts with a remote unix machine . Everything works fine . I'm following the ganymede-ssh code . below is the code excerpt .               session = CLIUtil.createTerminal();     if (session != null) {         in = session.getStdout();         out = session.getStdin();              thread = new RemoteThread();         thread.start();     public void keyPressed(KeyEvent key) {     int keyCode = key.getKeyCode();     try {           else if (keyCode == KeyEvent.VK_L && ctrlMask)         {             cmd = CLIConstants.CLEAR_COMMAND;             out.write(new String(cmd + "\n").getBytes());         }         else if ((keyCode >= KeyEvent.VK_A && keyCode <= KeyEvent.VK_Z && !ctrlMask) ||                 (keyCode >= KeyEvent.VK_0 && keyCode <= KeyEvent.VK_9 && !ctrlMask) ||                 keyCode == KeyEvent.VK_QUOTE || keyCode == KeyEvent.VK_MINUS ||                 keyCode == KeyEvent.VK_PERIOD || keyCode == KeyEvent.VK_SLASH ||                 keyCode == KeyEvent.VK_BACK_SLASH || keyCode == KeyEvent.VK_SPACE)         {                  int cursorPosition = terminalArea.getCaretPosition();             System.out.println("Cursor Position = " + cursorPosition);             terminalArea.append("" + key.getKeyChar());             cmd = cmd + key.getKeyChar();             terminalArea.setCaretPosition(cursorPosition + 1);         }         else if (keyCode == KeyEvent.VK_ENTER)         {             try {                 out.write(new String(cmd + "\n").getBytes());             } catch (IOException e) {                 e.printStackTrace();             }        }      }          class RemoteThread extends Thread {     int x = 100;          int y = 3000;          char[][] lines = new char[y][];          int posy = 0;          int posx = 0;          @Override     public void run() {         try {             while (true) {                 byte[] buff = new byte[8192];                 int len = in.read(buff);                 if (len != -1) {                     addTextToTerminal(buff, len);                     if (cmd.startsWith(CLIConstants.CLEAR_COMMAND))                         out.write("\n".getBytes());                     cmd = "";                 } else {                     CLIUtil.terminateConnection();                 }         public void addTextToTerminal(byte[] buff, int len) {         if (cmd.startsWith(CLIConstants.CLEAR_COMMAND)) {             try {                 lines = null;                 posx = posy = 0;                 while (in.available() <= 10)                     ;                 while (in.available() > 0) {                     in.skip(in.available());                 }             } catch (IOException e) {                 e.printStackTrace();             }             return;         }              if (lines == null)             lines = new char[y][];              for (int i = 0; i < len; i++) {             char c = (char) (buff[i]);                  // Backspace key             if (c == '\b') {                 if (posx < 0)                     continue;                 posx--;                 continue;             }                  // Carriage Return             if (c == '\r') {                 posx = 0;                 continue;             }                  // New Line             if (c == '\n') {                 posy++;                 if (posy >= y) {                     for (int k = 1; k < y; k++)                         lines[k - 1] = lines[k];                     posy--;                     lines[y - 1] = new char[x];                     for (int k = 0; k < x; k++)                         lines[y - 1][k] = ' ';                 }                 continue;             }                  // Special Characters             if (c < 32) {                 continue;             }                  if (posx >= x) {                 posx = 0;                 posy++;                 if (posy >= y) {                     posy--;                     for (int k = 1; k < y; k++)                         lines[k - 1] = lines[k];                     lines[y - 1] = new char[x];                     for (int k = 0; k < x; k++)                         lines[y - 1][k] = ' ';                 }             }                  if (lines[posy] == null) {                 lines[posy] = new char[x];                 for (int k = 0; k < x; k++)                     lines[posy][k] = ' ';             }             lines[posy][posx] = c;             posx++;         }         StringBuffer sb = new StringBuffer(x * y);         for (int i = 0; i < lines.length; i++) {             if (i != 0)                 sb.append('\n');             if (lines[i] != null) {                 sb.append(lines[i]);             }         }              String text = sb.toString().trim();         terminalArea.setText(text + " ");         terminalArea.setCaretPosition(((x-1) * 100) + y);         terminalArea.repaint();     }      } Here i am able to capture the tab key event , but wat to write to the remote unix machine ?                if(keyCode == KeyEvent.VK_TAB){             String temp = new String();             System.out.println("tab key event");             terminalArea.setFocusTraversalKeysEnabled(false);             //split_string(cmd);             out.write(); ?????              }


title: Inconsistent field separator behaviour of space in awk

text: The following awk script shows how a leading space `' '` is ignored as a field separator, but other characters are treated as a separator with a preceding null $1 field. Is there some way to make this behaviour consistent for all values of the field separator?               echo -e " Data\tdlm\t\$1\t\$2\t\$3"       for d in '^' ':' '"' 'x' '/' ' ' ;do       echo "${d}1${d}2${d}" |awk -F"$d" '            { printf "|%s|\t|%s|\t|%s|\t|%s|\t|%s|\n", $0, FS, $1, $2, $3; }'     done      The output:                Data   dlm     $1      $2      $3     |^1^2^| |^|     ||      |1|     |2|     |:1:2:| |:|     ||      |1|     |2|     |"1"2"| |"|     ||      |1|     |2|     |x1x2x| |x|     ||      |1|     |2|     |/1/2/| |/|     ||      |1|     |2|     | 1 2 | | |     |1|     |2|     ||


title: Why linux is a monolithic kernel, while you can load/unload modules (e.g. drivers)?

text: Hybrid- and Microkernels are flexible, in the way one can add any higher-level functionality as a module, is it not the same for linux kernels? Why then linux is called a monolithic?


title: Warn users that the system is going down for a reboot

text: I'm new to linux server administration, and I wonder how you would warn users that the system is going down for a restart. According to LPIC1 Training here: http://www.ibm.com/developerworks/library/l-lpic1-v3-101-3/ There are 2 possibilities:               echo "I'm about to restart" |wall      or               shutdown 10 about to restart&      Are there any other ways to warn end users the system is about to reboot?


title: How to I change GNOME 3.8 top bar font?

text: It can not be changed through GNOME Tweak Tool, so anyone know the answer?


title: With NIS users, how to find out which users are currently logged in?

text: I'm using a NIS server to control 100 clients. I'm using NIS for centralized authentication and NFS to share the home directory. The main problem I'm facing is that I cannot find out which users are logged in and which are logged out. Is there any way to find users who are logged in and logged out of the NIS? My environment is Ubuntu 12.04 LTS.


title: MediaTomb fast image resize

text: The goal is to setup MediaTomb to (almost) instantaneously resize a 4-7MB jpeg from its original 8 or 12MP resolution down to somewhere about 1280x* so that it can be viewed on a mobile device. Information on my setup: VM running arch with MediaTomb and another VM running arch and BubbleUPnP server to allow me to connect to all of my UPnP servers at home wherever I am. The problem is that I don't want to convert all of the pictures I take on trips. I simply want to browse them remotely and have the images resized quickly enough that I don't notice a lag when displaying/viewing pictures. Obviously the resizing is also to decrease the time it takes to display them. I've tried using Imagemagick and it is very slow (5-10 seconds per picture) and `ffmpeg` is unsuitable for images over 5,000px. What are my options here? VM 1: 2x3.00Ghz, 768mb ram (MediaTomb) VM 2: 2x3.00Ghz, 512mb ram (XBMC, BubbleUPnP) Original image resize script contained:               convert "$1" -filter lanczos -resize 1280x* "$2"      In the mediatomb config.xml I have added the following to their appropriate sections:   Under mimetype-profile-mappings:               <transcode mimetype="image/jpeg" using="jpeg-small"/>      And under profiles:               <profile name="jpeg-small" enabled="yes" type="external">       <mimetype>image/jpeg</mimetype>       <agent command="convert" arguments="%in -resize 1280x1280 %out"/>       <hide-original-resource>yes</hide-original-resource>       <buffer size="10485760" chunk-size="131072" fill-size="2621440"/>       <accept-url>no</accept-url>       <first-resource>yes</first-resource>     </profile>      UPDATE: Now it "works", but I can only find sub-200x200 pictures when I browse MediaTomb share from a UPnP client. Not sure why as I'm telling it to make 1280 the maximum length of a side.


title: Block network access of a process?

text: Is it possible to block the (outgoing) network access of a single process?


title: Block specific application with iptables

text: I have to harden a Linux desktop as an assignment in my college. But I got stuck at a specific problem: I have to control the outgoing traffic with iptables. It should be possible to prevent a specific application (like LibreOffice) to access the internet. My professor said "look for the 'match' option". But I can't figure out how to do it. I thought of setting a rule which drops all packets of a specific group id with the `-m owner --owner-gid` option. But how can I configure my applications to run under this particular group? Or is this just the wrong way to do it? The OS is Debian 7.


title: Run command when temperature exceeds threshold, without daemon

text: I need to run a specific command if my laptop gets too hot (for example, send a STOP signal to Firefox or Virtualbox in order to prevent my laptop from shutting down violently and damaging my hard disks). I can easily write a program that loops indefinitely while periodically checking the temperature. This question's answer uses this approach. However, I would like to avoid running my own daemon and instead attach my program to an existing one. For example, I can see in my syslog: > May 5 02:52:27 myhostname kernel: [ 9141.022262] intel ips 0000:00:1f.6: MCP > limit exceeded: Avg temp 9276, limit 9000 So there is already code in my machine checking for temperature, which fires some action depending on a condition (eg log warning message when temperature exceeds 9000). Another example is that the fan speeds up based on the same temperature. How can I attach my program to this existing code in my machine? Are the fan driver speed change and kernel temperature warning message fired from the same code? How can I find this out?


title: Type 1 Hypervisor hardware privileges, make use of host drivers.

text: I guess a "type 1" hypervisor is one that is running directly on the host's hardware to control the hardware and manage the guest operating systems, so, does that imply that it would be able to make use of the drivers available on the host operating system? Maybe yes.


title: Redirect grep out to a file does not work

text: I am doing a recursive grep by the following command:               grep -r "load" . > tmp.txt      However, when I hit enter, the command does not execute and bash is waiting for more inputs.. My OS is Ubuntu 12.04. I have checked the following two answers but they could not solve my problem. Why does grep not work with redirection? how do i redirect output from tailf & grep to a file


title: What does "fno" stand for in g++'s fno-stack-limit compile option?

text: In the following command:               $ g++ -fno-stack-limit      what does `fno` _stand for_?


title: User-friendly command to list all users on Ubuntu system?

text: Is there a user-friendly command I can use to list users in a console on an Ubuntu system? When I `cat /etc/passwd` I get a hard-to-read list of users. It would be nice to see an alphabetized list, with entries arranged into columns, and with group names in parentheses beside the group IDs.


title: Mail forward: 550 5.7.1 Anonymous client does not have permissions to send as this sender

text: I want to install a small mailing list that forwards mails related to a specific project to all project members. So, lets say there are two members in that project `userA@mailA.tld` and `userB@mailB.tld`, and on my mail server `server.tld` I configured an alias by adding a line to my virtual maps:               project23@server.tld    userA@mailA.tld,userB@mailB.tld      So far, everything works as expected. If I send an email to `project23@server.tld` it gets forwarded to all users in that project. But it turns out, that certain mail servers don't like to receive mails from foreign mail servers containing a `From` claiming to be sent from their domain. (Seems like especially Microsofts SMTP servers have this _problem_ ). In that case I get an answer like:                [...] said: 550 5.7.1 Anonymous client does not have permissions to send as this sender. (in reply to RCPT TO command))      That means `userA@mailA.tld` is able to receive mails sent to `project23@server.tld` by `userB@mailB.tld`, but he won't receive any mails sent from addresses in `mailA.tld`. So my first question is: Did I isolate the problem correctly? And if so, is there any smart workaround? I could setup a real mailing list, such that mails are stored in an archive on the server and users get notifications/digests from a mail address like `list@server.tld`, but that would be too much overhead for our purposes...


title: The importance of the order in domain controler names for setting an LDAP server, is there any reason?

text: I wonder if there is any reason to speficically put the domain controlers in the proper order, when configurung a LDAP server using autofs. For example if specify on a RedHat/CentOS the dc domain controlers in this order :                ou=example, dc=hostname1,dc=people       the LDAP is active and I may see it. But if by a simple "mistake" I write                ou=people, dc=hostname1,dc=example      I do not see any mounted LDAP server, what it is exactly the meaning of the ou and dc domain names and where I could look to see which order I have to follow.


title: How to get the group that a user belongs to in SCO

text: I can see how to add a user, but is there a way to get information on a user, such as the group that it belongs to?


title: How to catch an error in a linux bash script?

text: I made the following script:               # !/bin/bash          # OUTPUT-COLORING     red='\e[0;31m'     green='\e[0;32m'     NC='\e[0m' # No Color          # FUNCTIONS     # directoryExists - Does the directory exist?     function directoryExists {         cd $1         if [ $? = 0 ]                 then                         echo -e "${green}$1${NC}"                 else                         echo -e "${red}$1${NC}"         fi     }          # EXE     directoryExists "~/foobar"     directoryExists "/www/html/drupal"      The script works, but beside my echoes, there is also the output when               cd $1      fails on execution.               testscripts//test_labo3: line 11: cd: ~/foobar: No such file or directory      Is it possible to catch this?


title: grep surrounding characters of a match

text: I'm looking to do a find and replace within a giant database dump, and it's not doing what I think should happen. I'd like to grep for my target string in the file, and then see the surrounding 8 characters or so (I might need to adjust that number, depending). How can I do that? The reason I can't eyeball this is because there are many hundreds, if not thousands of matches. I want to get some number of characters surrounding the string, and then pipe it into `uniq` or something to see why my find and replace is having unexpected behaviors. Also, there can be multiple matches on the same line!


title: Why do we have to wait for a Video (over samba share) in VLC?

text: So.. We have a router that has an HDD on it and I share videos through samba. Our problem is, when we want to watch videos like these:               file NOTX264AVI.avi     NOTX264AVI.avi: RIFF (little-endian) data, AVI, 720 x 304, 25.00 fps, video: XviD, audio: MPEG-1 Layer 3 (stereo, 48000 Hz)      then we can scroll VLC to ex.: the half of the video and it plays it in the moment (that's great, because We don't have to wait for two minutes for the video..). But. When We watch videos like these:               file X264AVI.avi     X264AVI.avi: RIFF (little-endian) data, AVI, 576 x 320, 25.00 fps, video: H.264 X.264 or H.264, audio: MPEG-1 Layer 3 (stereo, 48000 Hz)      with VLC... we have to wait for a very long time until the video continues (if we scroll to ex.: to the half of the video). **QUESTION** : So why does VLC downloads the X264AVI.avi until the part we want to watch, and why doesn't it downloads it when we want to watch NOTX264AVI.avi? Videos using X264 codecs can't be "streamed*"? So I need to do something to VLC (?) so that it will "stream*" (?) the X264 videos too, but how? *with streaming I mean that if we go to 1h10 minutes in a video (not using x264 video codec) then it will start immediately. But we have to wait minutes if we want to go to ex.: 1h10 minutes in a video that uses x264 codec.. (and I can see great network traffic when we are waiting for the video to ""load"")


title: How to make a list and count LaTeX keywords in a source file?

text: I am a beginner, trying to make lists (and eventually count and make statistics) the LaTeX keywords appearing in some documents. Basically a LaTeX "valid" keyword can be identified by:   1. The fact that it does not begin with a "%" sign (it would be commented therefore not in use)   2. It starts with a backslash.   3. Is is followed by either a left curly bracket (or a left bracket, in case there are options.) I understand there are other "special" cases: keywords followed by nothing (a white space), or another keyword, but these are relatively rare and I do no mind the inaccuracy. My primary goal is to get eventually a rought idea of the number of different keywords in various types of documents. I have tried various ways using awk, but could not get anything working... I have attached a MWE (meaningless and not functional!) of a LaTeX file for reference.               \documentclass[a4paper]{scrreprt} % Mode production     \usepackage[T1]{fontenc}     \renewcommand{\thechapter}{\Alph{chapter}}     \fancypagestyle{FrontPageTestReportStyle}     \fancyfoot[C]{}     \newcommand{\WaterMark}[1]{%     \begin{tikzpicture}[remember picture,overlay]     \node[rotate=60]     \end{tikzpicture}%     \begin{figure}[H]     \centering     \begin{minipage}[b]{.46\textwidth}     \centering     \includegraphics[width=#2]{#3}\caption {#4}     \end{minipage}     \caption {#3}     \end{figure}     \raggedright     \begin{tabular}{|c|cS|cS|}     \hline     \multirow{2}{*}{Part number}&\multicolumn{2}{c|}{Cavity A}&\multicolumn{2}{c|}{Cavity B}\\     \end {tabular}     \end{table}


title: telling network manager to temporarily ignore a network device

text: I have a laptop with debian. Networking is configured with NetworkManager. Now occasionally I want to connect a device to its wired ethernet port and then bridge wireless to it. That all works in so far: I need to terminate NetworkManager first manually to ignore the ethernet port or else it is going to try to configure it which interferes with the static address required. My question now is: how can I, using a dbus command, say to NetworkManager that it should ignore eth0 for a while? And later to manage it again?


title: Getting error whenever trying to add a repository

text: Whenever I try to add a repository I get a `NoDistroTemplate Exception`. I am using Linux Mint 14 Nadia.               tusharmakkar08@tusharmakkar08-Satellite-C660 ~ $  sudo add-apt-repository ppa:webupd8team/java           You are about to add the following PPA to your system:      Oracle Java (JDK) Installer (automatically downloads and installs Oracle JDK6 / JDK7 / JDK8).       There are no actual Java files in this PPA.       More info: http://www.webupd8.org/2012/01/install-oracle-java-jdk-7-in-ubuntu-via.html      More info: https://launchpad.net/~webupd8team/+archive/java     Press [ENTER] to continue or ctrl-c to cancel adding it     Traceback (most recent call last):       File "/usr/bin/add-apt-repository", line 161, in <module>         sp = SoftwareProperties(options=options)       File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 104, in __init__         self.reload_sourceslist()       File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 592, in reload_sourceslist         self.distro.get_sources(self.sourceslist)           File "/usr/lib/python3/dist-packages/aptsources/distro.py", line 87, in get_sources         raise NoDistroTemplateException("Error: could not find a "     aptsources.distro.NoDistroTemplateException: Error: could not find a distribution template      How to remove this exception ?


title: Reading encrypted partition with broken LVM2 inside?

text: I overwrote some LVM2 metadata in much the same way as Recovering overwritten LVM metadata . That is, I attempted to install Debian 6.0.7 on a system with existing encrypted volumes and LVM2 volumes. The structure of the disk was that a LUKS volume covered a 90% partition (sdc1) on the disk; an LVM2 physical volume used up the LUKS volume; and this physical volume had its own volume group and two logical volumes. I used these commands to generate a hex dump:               cryptsetup luksOpen /dev/sdc1 sdc1_crypt     dd if=/dev/mapper/sdc1_crypt of=text count=100000     hexdump -C text | less      Part of the hex dump:               00000000  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|     *     00000200  4c 41 42 45 4c 4f 4e 45  01 00 00 00 00 00 00 00  |LABELONE........|     00000210  1a d0 74 52 20 00 00 00  4c 56 4d 32 20 30 30 31  |..tR ...LVM2 001|     00000220  39 4b 4d 34 48 30 37 43  6c 5a 6d 62 5a 46 32 43  |9KM4H07ClZmbZF2C|     00000230  78 6b 69 72 72 58 61 62  52 64 35 48 38 66 62 79  |xkirrXabRd5H8fby|     00000240  00 10 0e 8c d1 00 00 00  00 00 03 00 00 00 00 00  |................|     00000250  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|     00000260  00 00 00 00 00 00 00 00  00 10 00 00 00 00 00 00  |................|     00000270  00 f0 02 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|     00000280  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|     *     00000800  d2 6d b3 03 e3 88 08 0f  0f 60 17 31 60 2a a5 86  |.m.......`.1`*..|     00000810  a8 2b 87 77 cb 73 bf 52  c6 36 92 ec ee 9f b7 e0  |.+.w.s.R.6......|     *     00000a00  f4 6c 87 31 71 aa 28 b8  44 9e 03 75 fc 58 9b b4  |.l.1q.(.D..u.X..|     00000a10  a8 2b 87 77 cb 73 bf 52  c6 36 92 ec ee 9f b7 e0  |.+.w.s.R.6......|     *     00000c00  13 30 81 66 9a 7a 33 eb  dd e7 b6 93 c5 e6 42 f0  |.0.f.z3.......B.|     00000c10  a8 2b 87 77 cb 73 bf 52  c6 36 92 ec ee 9f b7 e0  |.+.w.s.R.6......|     *     00000e00  c2 71 8f 11 f4 70 b4 e3  af e0 a0 d7 86 bd ad 5b  |.q...p.........[|     00000e10  a8 2b 87 77 cb 73 bf 52  c6 36 92 ec ee 9f b7 e0  |.+.w.s.R.6......|     *     00001000  1b c7 35 60 20 4c 56 4d  32 20 78 5b 35 41 25 72  |..5` LVM2 x[5A%r|     00001010  30 4e 2a 3e 01 00 00 00  00 10 00 00 00 00 00 00  |0N*>............|     00001020  00 f0 02 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|     00001030  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|     ***     00004c00  82 12 42 63 c4 c1 b3 2b  f5 f9 d1 17 06 60 64 c3  |..Bc...+.....`d.|     00004c10  a8 2b 87 77 cb 73 bf 52  c6 36 92 ec ee 9f b7 e0  |.+.w.s.R.6......|     *     00004e00  4a eb 67 e4 80 7d e7 72  d3 b4 52 36 31 3d 36 01  |J.g..}.r..R61=6.|     00004e10  a8 2b 87 77 cb 73 bf 52  c6 36 92 ec ee 9f b7 e0  |.+.w.s.R.6......|     *     00005000  dc da e7 8d 9b f1 37 8f  97 92 ee a4 8d 9a 42 1e  |......7.......B.|     00005010  a8 2b 87 77 cb 73 bf 52  c6 36 92 ec ee 9f b7 e0  |.+.w.s.R.6......|     *     00005200  d2 2d 71 cb d1 31 27 c8  aa aa 03 60 a2 5f 8e 14  |.-q..1'....`._..|     00005210  a8 2b 87 77 cb 73 bf 52  c6 36 92 ec ee 9f b7 e0  |.+.w.s.R.6......|     *     00005400  fe 7b fd cd 20 5b cd 99  9a bf 23 92 10 b5 f9 c2  |.{.. [....#.....|     00005410  a8 2b 87 77 cb 73 bf 52  c6 36 92 ec ee 9f b7 e0  |.+.w.s.R.6......|     *     00005600  86 a2 ce 88 2f ba 9b 3b  ba 55 f4 d2 a5 a1 3e b7  |..../..;.U....>.|     00005610  a8 2b 87 77 cb 73 bf 52  c6 36 92 ec ee 9f b7 e0  |.+.w.s.R.6......|     *     00005800  33 37 62 46 24 43 3b a1  6b 4d 65 8f 5a ca 1b 46  |37bF$C;.kMe.Z..F|     00005810  a8 2b 87 77 cb 73 bf 52  c6 36 92 ec ee 9f b7 e0  |.+.w.s.R.6......|     *     00005a00  bd d5 b4 41 46 08 b9 b9  87 a2 53 ab ff 01 2a 1b  |...AF.....S...*.|     00005a10  a8 2b 87 77 cb 73 bf 52  c6 36 92 ec ee 9f b7 e0  |.+.w.s.R.6......|     *     00005c00  2f a8 ae 97 6d 56 8a 71  9e 16 60 2c f3 68 c2 f4  |/...mV.q..`,.h..|     00005c10  a8 2b 87 77 cb 73 bf 52  c6 36 92 ec ee 9f b7 e0  |.+.w.s.R.6......|     *     00005e00  d3 44 a7 ca bc 21 61 f4  58 c4 f2 78 9c 34 95 18  |.D...!a.X..x.4..|     00005e10  a8 2b 87 77 cb 73 bf 52  c6 36 92 ec ee 9f b7 e0  |.+.w.s.R.6......|     *     00006000  5d df c9 11 56 ec 92 03  ac 02 4e 91 40 76 a6 b3  |]...V.....N.@v..|     00006010  a8 2b 87 77 cb 73 bf 52  c6 36 92 ec ee 9f b7 e0  |.+.w.s.R.6......|     *     00006200  e2 19 26 d8 4e bc ae 44  a1 47 f9 bd 6d 0f 86 57  |..&.N..D.G..m..W|     00006210  a8 2b 87 77 cb 73 bf 52  c6 36 92 ec ee 9f b7 e0  |.+.w.s.R.6......|     *     00006400  82 52 57 e2 35 e7 82 af  53 fb d4 04 93 89 48 aa  |.RW.5...S.....H.|     00006410  a8 2b 87 77 cb 73 bf 52  c6 36 92 ec ee 9f b7 e0  |.+.w.s.R.6......|     *     00006600  49 86 60 90 1e a5 da d3  55 4c 26 31 80 fb a5 2d  |I.`.....UL&1...-|     00006610  a8 2b 87 77 cb 73 bf 52  c6 36 92 ec ee 9f b7 e0  |.+.w.s.R.6......|     *     00006800  cf 2a ae 71 e8 5b ac 8e  dd 70 9e 05 2b bb c5 9c  |.*.q.[...p..+...|     00006810  a8 2b 87 77 cb 73 bf 52  c6 36 92 ec ee 9f b7 e0  |.+.w.s.R.6......|     *     00006a00  43 e2 38 92 9a 1d c7 c4  fe bf df 13 7f bf 5b f9  |C.8...........[.|     00006a10  a8 2b 87 77 cb 73 bf 52  c6 36 92 ec ee 9f b7 e0  |.+.w.s.R.6......|     *     00006c00  38 40 94 3c 21 3e ce 63  e8 c3 5d 1d 35 08 3e 7c  |8@..c..].5.>||     00006c10  a8 2b 87 77 cb 73 bf 52  c6 36 92 ec ee 9f b7 e0  |.+.w.s.R.6......|     *     00006e00  71 52 d0 15 44 78 ad 13  fa c5 a0 ec 74 4c a7 5b  |qR..Dx......tL.[|     00006e10  a8 2b 87 77 cb 73 bf 52  c6 36 92 ec ee 9f b7 e0  |.+.w.s.R.6......|     *     00007000  4f 2d b5 50 57 6b ac 02  23 82 28 05 f5 5e d1 f1  |O-.PWk..#.(..^..|     00007010  a8 2b 87 77 cb 73 bf 52  c6 36 92 ec ee 9f b7 e0  |.+.w.s.R.6......|     *     00007200  37 43 9a f7 68 e7 94 59  13 10 66 e8 56 53 e3 cb  |7C..h..Y..f.VS..|     00007210  a8 2b 87 77 cb 73 bf 52  c6 36 92 ec ee 9f b7 e0  |.+.w.s.R.6......|      If the installation had overwritten the LUKS block with a new one that used the same passphrase, could I still see the recurring "+.w.s.R.6", or would that be improbable? If this isn't what happened, what did? I think the installation had overwritten the PV metadata, which accounts for the readable LVM2 line at 0x1000. But searching the disk for keywords that existed on the disk prior to installation returned nothing.


title: file type determine

text: As part of the product, there were several scripts which was provided. In one of the scripts, I've found the following line which seems not to work properly               find . -name *.old -type f -mtime +7 | xargs compress -f      when executing the `file` command on one of the *.old files I get the following result: `ASCII text, with very long lines` Do you have any suggestion what could be done?


title: How can I uninstall packages from the command line on Ubuntu?

text: I am wondering how one would uninstall software from the command line/terminal. What commands would I use?


title: Why does linux-based laptops have weak wifi signal in comparison to windows-based laptop?

text: I have faced this problem many times. First, I thought it has something to do with laptop model and brand but later I came to know that same hardware with different OS was having different results. Laptop using Windows, Windows 8 to be more specific were recieving wifi signal more easily than in my linux-based laptop(ubuntu 13.10). Why is this? Is there any solution to this?


title: Blacklisting Drivers

text: What does it mean to blacklist a driver in Linux/Unix? How do you go about doing it?


title: diff a gzipped tarball against a directory?

text: Is there a way I can diff a gzipped tarball against an existing directory? I would like to be able to do it without extracting the data from the tarball.


title: Get load average excluding niced processes

text: Is there a way to return the load averages, excluding any load caused by nice'd processes? We have a load balancing mechanism in place that checks the load of multiple Linux servers, and submits a job to the server having the lowest load. We had a scenario where all servers had too high a load and so no server could be selected in the load balancing. However, I noticed that the servers were handling a bunch of nice'd processes, so although the load averages were high, it was still "safe" to submit another job. Let me know if clarification is needed. Thanks.


title: Aliases interpretation

text: I have a few aliases in `.bash_aliases`. I defined `c` alias as follows, but it does not work as it should:               ...     alias cd='cd; ls -r --time=atime'     alias c='cd'     ...      In `.bashrc` there is a line:               alias ls='clear; ls --color=auto'      Commnand `c` gives bad output now. It should give the same output as `cd; clear; ls -r --time=atime --color=auto`. Other problem: When I type `cd dir` I should stay in `dir` but I'm in `$HOME` as a result. How can I solve this and improve in defining aliases? Is `.bash_aliases` interpreted as a `regular grammar`?


title: How can I move the home directory to a separate partition?

text: I would like to install another distribution but keep my home directory. Is there a way to move the home directory to a separate partition? I don't have an external hard drive available to back up my data. I would like to set up my partitions as suggested here.


title: Why does $((40-35)) turn into 5?

text: What kind of strange shell syntax is hidden behind `$((40-35))` and how come it calculates a value? Example:               $> echo $((40-35))     5


title: PS/2 Keyboard & Mouse not working AFTER boot

text: My CPU is 64 bit, I have a PS/2 keyboard and a PS/2 mouse and I have tried Live CDs of Ubuntu, Kubuntu, Fedora, Arch Linux, Wubi installations, 32 and 64 bit (my CPU is 64 bit) and Puppy Linux. I am able to navigate between the menu options when there is one, but when I boot, the keyboard and mouse stop responding. Puppy Linux booted completely, but the keyboard and mouse didn't respond. Besides, pressing NumLock, CapsLock does nothing. Note that Windows doesn't have this problem. My keyboard and mouse work flawlessly in Puppy Linux 3.01, but don't in 4.x. **IMPORTANT** : I can confirm that keyboard and mouse work in Ubuntu 8.04.4 LTS with linux 2.6.22-14-generic, but **DON'T** with 2.6.24-29-generic.


title: Long gcc compile time

text: So far my compilations have either succeeded or failed but his time it just got stuck. I'm compiling gcc on a Linux Synology NAS. However, the compilation process has run for 3 days and I start to think that it will never finish. From ps I get the following output:               27513 root      2536 S    /opt/bin/bash -c r=`${PWDCMD-pwd}`; export r; \ s=`cd .; ${PWDCMD-pwd}`; export s; \ if test -f stage1-lean  ; then \   echo Skipping rebuild of     27866 root      2468 S    /opt/bin/bash -c build/genautomata ../.././gcc/config/rs6000/rs6000.md \   insn-conditions.md > tmp-automata.c     27867 root      432m D    build/genautomata ../.././gcc/config/rs6000/rs6000.md insn-conditions.md     31539 root      2924 S    grep build      The last write to tmp-automata.c was 2.5 days ago. The NAS has only 64 MB RAM so I expected long compile time but not at this level. The average CPU load for the build process is 5-10%. What could be wrong? How do I troubleshoot?


title: What mount points exist on a typical Linux system?

text: I have 2 questions.   1. During Linux installation we specify memory space for 2 mount points - root and swap. Are there any other mount points created without the users notice?    2. Is this statement correct: "mounting comes into the picture only when dealing with different partitions. i.e, you cannot mount, say, /proc unless it's a different partition"?


title: Count the number of executable programs in a directory

text: How can I count the number of executable regular files in the current directory in a shell script?


title: Advanced usage/command of shell

text: > **Possible Duplicate:**   >  Is there any book , Tutorial on very very advanced shell scripting Is there a way/book to learn advanced usage of shell by practice? I find that most shell programming books only teach you the grammar of shell script. Grammar is important but as in C programming the standard library is also important.


title: Is it possible in unix to search inside zip files

text: I have 100s of directories and within those I have a few zip files. Now there are images named abc.jpg in those zip files. The zip files may be in any folder or in any subfolder so its difficult to extract them all in one place. I just want to collect those image files. Is this possible?


title: What is the relevance of 'en_AU' in 'LC_CTYPE'? and what is `locale LC_CTYPE` output all about?

text: First off: Although I can understand the relevance of geographic-region detail for LC_TIME, LC_NUMERIC, and most other LC_* vars, I don't quite see how 'en_AU' relates to LC_CTYPE...   Isn't UTF-8 (and other encodings) enough of a definition in themselves (for LC_CTYPE), as and _encoding_ by definiton is consistant?... Thinking about it as I write, it may be that different regions of the world capitalize their lower-case letters differently... If this is the case, how does `iconv` handle this?..   This `iconv` point is actually what started me on this line of thought, becaue it doesn't ask for a locale, it only asks for the input encoding format. My next puzzle is: What do the line-items in the output from `locale LC_CTYPE` refer to, and/or where is a good place to get a layout... Perhaps a more relevant question is: By whom, and where, would this info be needed? ..   I'm pretty sure I don't need it... but it all help to fill in the picture of 'scripts' and 'encodings' and 'locales'; which is surprisingly _non-trivial_ as soon as you leave the _world of ASCII_.


title: Configure Lightdm (GTK) for last saved or a default user and focus on password?

text: I've looked at the man pages and the configuration files but found nothing (but maybe I'm missing something). I see only many options for autologin. From a few googles I've read that the KDE version does work this way, but I would like to continue using the GTK version. **update** I still haven't found a solution and sometime I come back to this issue, looking around have seen some screenshots of `lightdm-gtk-greeter` that support themes and a popup menu for the user list. I'm surely missing something in the configuration or need to install some package. I'm using openbox not gnome, below a picture of my poor greeter. **howto make it remember last user and focus to the password?** ![enter image description here](http://i.stack.imgur.com/OrSZl.png) **update 2** I'm using a GNU/Debian/unstable (jessie/sid) here some details of the installed `lightdm*`               $ dpkg -l "*lightdm*" | grep ^ii     ii  liblightdm-gobject-1-0 1.10.0-3     i386         simple display manager (gobject library)     ii  lightdm                1.10.0-3     i386         simple display manager     ii  lightdm-gtk-greeter    1.8.4-1      i386         simple display manager (GTK+ greeter)          $ apt-cache show lightdm-gtk-greeter|grep Homepage     Homepage: https://launchpad.net/lightdm-gtk-greeter      and a debug log (launched from desktop eventually I can add the version from `/var/log`)               $ /usr/sbin/lightdm --test-mode --debug     [+0.00s] DEBUG: Logging to /home/alex/.cache/lightdm/log/lightdm.log     [+0.00s] DEBUG: Starting Light Display Manager 1.10.0, UID=1000 PID=477     [+0.00s] DEBUG: Loading configuration dirs from /usr/share/lightdm/lightdm.conf.d     [+0.00s] DEBUG: Loading configuration from /usr/share/lightdm/lightdm.conf.d/01_debian.conf     [+0.00s] DEBUG: Loading configuration dirs from /usr/local/share/lightdm/lightdm.conf.d     [+0.00s] DEBUG: Loading configuration dirs from /etc/xdg/lightdm/lightdm.conf.d     [+0.00s] DEBUG: Loading configuration from /etc/lightdm/lightdm.conf     [+0.00s] DEBUG: Using D-Bus name org.freedesktop.DisplayManager     [+0.00s] DEBUG: Running in user mode     [+0.00s] DEBUG: Using Xephyr for X servers     [+0.00s] DEBUG: Registered seat module xlocal     [+0.00s] DEBUG: Registered seat module xremote     [+0.00s] DEBUG: Registered seat module unity     [+0.00s] DEBUG: Registered seat module surfaceflinger     [+0.01s] DEBUG: Adding default seat     [+0.01s] DEBUG: Seat: Starting     [+0.01s] DEBUG: Seat: Creating greeter session     [+0.01s] WARNING: Error getting user list from org.freedesktop.Accounts: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.Accounts was not provided by any .service files     [+0.01s] DEBUG: Loading user config from /etc/lightdm/users.conf     [+0.01s] DEBUG: User alex added     [+0.01s] DEBUG: User trustno1 added     [+0.01s] DEBUG: Seat: Creating display server of type x     [+0.01s] DEBUG: Could not run plymouth --ping: Failed to execute child process "plymouth" (No such file or directory)     [+0.01s] DEBUG: Seat: Starting local X display     [+0.01s] DEBUG: DisplayServer x-1: Logging to /home/alex/.cache/lightdm/log/x-1.log     [+0.01s] DEBUG: DisplayServer x-1: Writing X server authority to /home/alex/.cache/lightdm/run/root/:1     [+0.06s] DEBUG: DisplayServer x-1: Launching X Server     [+0.08s] DEBUG: Launching process 482: /usr/bin/Xephyr :1 -seat seat0 -auth /home/alex/.cache/lightdm/run/root/:1 -nolisten tcp     [+0.08s] DEBUG: DisplayServer x-1: Waiting for ready signal from X server :1     [+0.08s] DEBUG: Acquired bus name org.freedesktop.DisplayManager     [+0.08s] DEBUG: Registering seat with bus path /org/freedesktop/DisplayManager/Seat0     /bin/rm: impossibile rimuovere "/var/lib/lightdm-data/lightdm": Permesso negato     [+0.16s] DEBUG: Got signal 10 from process 482     [+0.16s] DEBUG: DisplayServer x-1: Got signal from X server :1     [+0.16s] DEBUG: DisplayServer x-1: Connecting to XServer :1     [+0.16s] DEBUG: Seat: Display server ready, starting session authentication     [+0.16s] DEBUG: Session: Not setting XDG_VTNR     [+0.16s] DEBUG: Session pid=487: Started with service 'lightdm-greeter', username 'alex'          ** (process:487): WARNING **: Error getting user list from org.freedesktop.Accounts: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.Accounts was not provided by any .service files     [+0.18s] DEBUG: Session pid=487: Authentication complete with return value 0: Success     [+0.18s] DEBUG: Seat: Session authenticated, running command     [+0.18s] DEBUG: Session pid=487: Not setting XDG_VTNR     [+0.18s] DEBUG: Session pid=487: Running command /usr/sbin/lightdm-gtk-greeter     [+0.18s] DEBUG: Creating shared data directory /var/lib/lightdm-data/alex     [+0.18s] DEBUG: Session pid=487: Logging to /home/alex/.cache/lightdm/log/x-1-greeter.log     [+0.26s] DEBUG: Session pid=487: Greeter connected version=1.10.0     [+0.79s] DEBUG: Session pid=487: Greeter start authentication     [+0.79s] DEBUG: Session: Not setting XDG_VTNR     [+0.79s] DEBUG: Session pid=504: Started with service 'lightdm', username '(null)'     [+0.79s] DEBUG: Session pid=504: Got 1 message(s) from PAM     [+0.79s] DEBUG: Session pid=487: Prompt greeter with 1 message(s)     [+3.23s] DEBUG: Got signal 2 from process 0     [+3.23s] DEBUG: Caught Interrupt signal, shutting down     [+3.23s] DEBUG: Stopping display manager     [+3.23s] DEBUG: Seat: Stopping     [+3.23s] DEBUG: Seat: Stopping display server     [+3.23s] DEBUG: Sending signal 15 to process 482     [+3.23s] DEBUG: Seat: Stopping session     [+3.23s] DEBUG: Session pid=487: Sending SIGTERM     [+3.23s] DEBUG: Seat: Stopping session     [+3.23s] DEBUG: Session pid=504: Sending SIGTERM     [+3.23s] DEBUG: Session pid=504: Terminated with signal 2     [+3.23s] DEBUG: Session: Failed during authentication     [+3.23s] DEBUG: Seat: Session stopped     [+3.23s] DEBUG: Session pid=487: Terminated with signal 2     [+3.23s] DEBUG: Seat: Session stopped     [+3.23s] DEBUG: Process 482 exited with return value 0     [+3.23s] DEBUG: DisplayServer x-1: X server stopped     [+3.23s] DEBUG: DisplayServer x-1: Removing X server authority /home/alex/.cache/lightdm/run/root/:1     [+3.23s] DEBUG: Seat: Display server stopped     [+3.23s] DEBUG: Seat: Stopped     [+3.23s] DEBUG: Display manager stopped     [+3.23s] DEBUG: Stopping daemon     [+3.23s] DEBUG: Exiting with return value 0      here the `/etc` config files               $ grep -v ^# /etc/lightdm/*.conf     /etc/lightdm/keys.conf:[keyring]     /etc/lightdm/lightdm.conf:[LightDM]     /etc/lightdm/lightdm.conf:[SeatDefaults]     /etc/lightdm/lightdm.conf:greeter-session=lightdm-gtk-greeter     /etc/lightdm/lightdm.conf:greeter-hide-users=true     /etc/lightdm/lightdm.conf:greeter-allow-guest=false     /etc/lightdm/lightdm.conf:[XDMCPServer]     /etc/lightdm/lightdm.conf:[VNCServer]     /etc/lightdm/lightdm-gtk-greeter.conf:[greeter]     /etc/lightdm/lightdm-gtk-greeter.conf:background=/usr/share/images/desktop-base/login-background.svg     /etc/lightdm/lightdm-gtk-greeter.conf:theme-name=Adwaita     /etc/lightdm/lightdm-gtk-greeter.conf:xft-antialias=true     /etc/lightdm/lightdm-gtk-greeter.conf:xft-hintstyle=hintfull     /etc/lightdm/lightdm-gtk-greeter.conf:xft-rgba=rgb     /etc/lightdm/lightdm-gtk-greeter.conf:show-indicators=~language;~session;~power     /etc/lightdm/users.conf:[UserAccounts]     /etc/lightdm/users.conf:minimum-uid=500     /etc/lightdm/users.conf:hidden-users=nobody nobody4 noaccess     /etc/lightdm/users.conf:hidden-shells=/bin/false /usr/sbin/nologin      **update 3** I've check version 1.1.6-2/stable with no results. Installed `accountsservice`. (in the while `lightdm-gtk-greeter` dist-upgraded to 1.8.5-1) below `/usr/share/lightdm/lightdm.conf.d/01_debian.conf` commented out are values as coming from the Debian installation, I changed them (but seem they are overwritten by `/etc/lightdm/lighdm.conf`)               [SeatDefaults]     #greeter-session=lightdm-greeter     #greeter-hide-users=true     greeter-session=lightdm-gtk-greeter     greeter-hide-users=false     session-wrapper=/etc/X11/Xsession      also changed `greeter-hide-users` in `/etc/lightdm/lightdm.conf`, the popup menu now appear, it show `others...`, user `alex`is bold as if it is the current or default but below the popup there's still the user input text field with focus and empty (I'll update the screenshot and the test/debug log later).


title: less freezes at last line when paging output from a running command

text: I have a CLI app that produces lots of debug output and I have a really big need to search in the output. I'm using `less` for that but it freezes when I reach the last line with `j` or `G`. And it returns back to live only after `Ctrl`+`c`, but that way I kill my app. The problem can be easily reproduced when paging output from `find`, just use `G` right after running it.               find / | less      Is it a bug in `less`?


title: Is there an equivalent of addr2line on AIX system?

text: I'd like to debug proftpd on AIX and according to the documentation, `addr2line` is a usefull binary to identify what is not working. _Extract of proftpd debugging documentation:_                The key here for tracking down the location of the segfault is that [0]       frame, and the memory address: 0x809b1e1.       Using that address and a very handy command called addr2line, you can determine the location of that address in the source code:       addrline -e ./proftpd 0x809b1e1     In this example, I saw:           golem/tj>addr2line -e ./proftpd 0x809b1e1       /home/tj/proftpd/cvs/proftpd/modules/mod_auth.c:1723     which is the location of test code added to trigger the segfault.       But I can't find it on AIX, does an equivalent exist ?   and if yes what it is ? **Edit 1**   I find `dbx` which is the AIX debugger, the man says this:               dbx [-a ProcessID] [-c CommandFile] [-d NestingDepth] [-I Directory]     [-p [OldPath=NewPath:... | File]] [-v] [-k] [-u] [-x] [-F] [-L] [-r]     [-C CoreFile | ObjectFile [CoreFile]]              -a ProcessID        Attach to specified process         -c CommandFile      Run dbx subcommands in specified file first         -d NestingDepth     Set limit for nesting of program blocks         -I Directory        Include Directory in list of directories                             searched for source files         -p OldPath=NewPath  Substitute library path for core examination            File             Read library path substitutions for core                             examination from File         -C CoreFile         Allow to analyze core dump without ObjectFile         -v                  Relax core file validity checking         -k                  Map memory addresses         -u                  Prepend file name symbols with an '@'         -x                  Strip postfix '_' from FORTRAN symbols         -F                  Read all symbols at start-up time         -L                  Keep linkage symbols         -r                  Run object file immediately      Does this program can help me ?   and how (I'm very not comfortable with `C` compilation and debugging without an IDE )


title: Calendar software for Linux

text: I'm wondering and searching a calendar for Linux (Centos). Here calendar means to save important notes and points by date and time in all days,for this purpose I'm asking this question. Is there any possible package is there for my environment or is there any other method to full fill my requirement?


title: Where node.js was installed?

text: I have installed node.js by :               $ yaourt -S nodejs      But where node.js (Dir) was installed?


title: How to defer variable expansion

text: I was wanting to initialize some strings at the top of my script with variables that have no yet been set, such as:               str1='I went to ${PLACE} and saw ${EVENT}'     str2='If you do ${ACTION} you will ${RESULT}'      and then later on `PLACE`, `EVENT`, `ACTION`, and `RESULT` will be set. I want to then be able to print my strings out with the variables expanded. Is my only option `eval`? This seems to work:               eval "echo ${str1}"      is this standard? is there a better way to do this? It would be nice to not run `eval` considering the variables could be anything.


title: sudo -E cannot excute some commands located in home dir?

text: symptom:               $ sudo -E adb     sudo: adb: command not found          $ which adb     /home/usr/opt/android/platform-tools/adb          $ sudo -E echo ${PATH}     ...:/home/usr/opt/android/platform-tools          $ stat ~/opt/android/platform-tools/adb     Access: (0775/-rwxrwxr-x)  Uid: ( 1000/ usr)   Gid: ( 1000/ usr)      @richard, thanks. I did this:               $ echo 'echo $PATH' | sudo sh     /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin     $ echo 'echo $PATH' | sudo -E sh     /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin      so it is not in the path of sudo. But how can I make the sudo respect the PATH temporarily?


title: Why doesn't /dev/sda3 created?

text: I did a pvresize (decrease) on `/dev/sda2` so that I can have about 48 GBytes free... and I wanted to create a partition on that free space, **but the`/dev/sda3` device didn't created.. why?** Do I need a reboot for it? (didn't rebooted after the reducing of the PV...)               [root@SERVER ~]# parted -s /dev/sda print free     Model: ATA Hitachi HTS72503 (scsi)     Disk /dev/sda: 320GB     Sector size (logical/physical): 512B/4096B     Partition Table: msdos          Number  Start   End     Size    Type     File system  Flags         32,3kB  1049kB  1016kB           Free Space      1      1049kB  538MB   537MB   primary  ext4         boot      2      538MB   272GB   271GB   primary               lvm         272GB   320GB   48,3GB           Free Space          [root@SERVER ~]#     [root@SERVER ~]#       [root@SERVER ~]# parted /dev/sda print     Model: ATA Hitachi HTS72503 (scsi)     Disk /dev/sda: 320GB     Sector size (logical/physical): 512B/4096B     Partition Table: msdos          Number  Start   End    Size   Type     File system  Flags      1      1049kB  538MB  537MB  primary  ext4         boot      2      538MB   272GB  271GB  primary               lvm          [root@SERVER ~]#      [root@SERVER ~]#      [root@SERVER ~]# parted /dev/sda mkpart primary 272GB 320GB     Warning: WARNING: the kernel failed to re-read the partition table on /dev/sda (Az eszköz vagy erőforrás foglalt).  As a result, it may not reflect all of     your changes until after reboot.     [root@SERVER ~]#      [root@SERVER ~]#      [root@SERVER ~]#      [root@SERVER ~]# parted /dev/sda print     Model: ATA Hitachi HTS72503 (scsi)     Disk /dev/sda: 320GB     Sector size (logical/physical): 512B/4096B     Partition Table: msdos          Number  Start   End    Size    Type     File system  Flags      1      1049kB  538MB  537MB   primary  ext4         boot      2      538MB   272GB  271GB   primary               lvm      3      272GB   320GB  48,3GB  primary          [root@SERVER ~]#      [root@SERVER ~]# parted -s /dev/sda print free     Model: ATA Hitachi HTS72503 (scsi)     Disk /dev/sda: 320GB     Sector size (logical/physical): 512B/4096B     Partition Table: msdos          Number  Start   End     Size    Type     File system  Flags         32,3kB  1049kB  1016kB           Free Space      1      1049kB  538MB   537MB   primary  ext4         boot      2      538MB   272GB   271GB   primary               lvm      3      272GB   320GB   48,3GB  primary         320GB   320GB   352kB            Free Space          [root@SERVER ~]#      [root@SERVER ~]#      [root@SERVER ~]#      [root@SERVER ~]# env LC_MESSAGES=EN ls -la /dev/sda*     brw-rw----. 1 root disk 8, 0 Jun 29 18:53 /dev/sda     brw-rw----. 1 root disk 8, 1 Jun 28 12:56 /dev/sda1     brw-rw----. 1 root disk 8, 2 Jun 28 12:56 /dev/sda2     [root@SERVER ~]#      [root@SERVER ~]#      [root@SERVER ~]#      [root@SERVER ~]# partprobe     Warning: WARNING: the kernel failed to re-read the partition table on /dev/sda (Az eszköz vagy erőforrás foglalt).  As a result, it may not reflect all of your changes until after reboot.     [root@SERVER ~]#     [root@SERVER ~]#     [root@SERVER ~]# env LC_MESSAGES=EN ls -la /dev/sda*     brw-rw----. 1 root disk 8, 0 Jun 29 18:55 /dev/sda     brw-rw----. 1 root disk 8, 1 Jun 28 12:56 /dev/sda1     brw-rw----. 1 root disk 8, 2 Jun 28 12:56 /dev/sda2     [root@SERVER ~]#      [root@SERVER ~]# env LC_MESSAGES=EN fdisk -l          Disk /dev/sda: 320.1 GB, 320072933376 bytes     255 heads, 63 sectors/track, 38913 cylinders     Units = cylinders of 16065 * 512 = 8225280 bytes     Sector size (logical/physical): 512 bytes / 4096 bytes     I/O size (minimum/optimal): 4096 bytes / 4096 bytes     Disk identifier: 0x0007e24d             Device Boot      Start         End      Blocks   Id  System     /dev/sda1   *           1          66      524288   83  Linux     Partition 1 does not end on cylinder boundary.     /dev/sda2              66       33039   264859648   8e  Linux LVM     /dev/sda3           33039       38914    47185920   83  Linux     [root@SERVER ~]# head -1 /etc/issue     Scientific Linux release 6.4 (Carbon)     [root@SERVER ~]#       UPDATE:               [root@SERVER ~]# kpartx -av /dev/sda     device-mapper: reload ioctl on sda1 failed: Invalid argument     create/reload failed on sda1     add map sda1 (0:0): 0 1048576 linear /dev/sda 2048     device-mapper: reload ioctl on sda2 failed: Invalid argument     create/reload failed on sda2     add map sda2 (0:0): 0 529719296 linear /dev/sda 1050624     device-mapper: reload ioctl on sda3 failed: Invalid argument     create/reload failed on sda3     add map sda3 (0:0): 0 94371840 linear /dev/sda 530769920     [root@SERVER ~]#      [root@SERVER ~]# env LC_MESSAGES=EN ls -la /dev/sda*     brw-rw----. 1 root disk 8, 0 Jun 29 22:05 /dev/sda     brw-rw----. 1 root disk 8, 1 Jun 28 12:56 /dev/sda1     brw-rw----. 1 root disk 8, 2 Jun 28 12:56 /dev/sda2     [root@SERVER ~]#      [root@SERVER ~]#      [root@SERVER ~]#      [root@SERVER ~]# sh rescan-scsi-bus.sh      WARN: /usr/bin/sg_inq not present -- please install sg3_utils      or rescan-scsi-bus.sh might not fully work.     Host adapter 0 (ata_piix) found.     Host adapter 1 (ata_piix) found.     Host adapter 2 (ahci) found.     Host adapter 3 (ahci) found.     Host adapter 4 (ahci) found.     Scanning SCSI subsystem for new devices     Scanning host 0 for  SCSI target IDs  0 1 2 3 4 5 6 7, all LUNs      Scanning for device 0 0 0 0 ...                OLD: Host: scsi0 Channel: 00 Id: 00 Lun: 00           Vendor: MATSHITA Model: DVD/CDRW UJDA775 Rev: CB03           Type:   CD-ROM                           ANSI SCSI revision: 05     Scanning host 1 for  SCSI target IDs  0 1 2 3 4 5 6 7, all LUNs     Scanning host 2 for  SCSI target IDs  0 1 2 3 4 5 6 7, all LUNs      Scanning for device 2 0 0 0 ...                OLD: Host: scsi2 Channel: 00 Id: 00 Lun: 00           Vendor: ATA      Model: Hitachi HTS72503 Rev: GHBO           Type:   Direct-Access                    ANSI SCSI revision: 05     Scanning host 3 for  SCSI target IDs  0 1 2 3 4 5 6 7, all LUNs     Scanning host 4 for  SCSI target IDs  0 1 2 3 4 5 6 7, all LUNs     0 new device(s) found.                          0 device(s) removed.                      [root@SERVER ~]#      [root@SERVER ~]#      [root@SERVER ~]# env LC_MESSAGES=EN ls -la /dev/sda*     brw-rw----. 1 root disk 8, 0 Jun 29 22:05 /dev/sda     brw-rw----. 1 root disk 8, 1 Jun 28 12:56 /dev/sda1     brw-rw----. 1 root disk 8, 2 Jun 28 12:56 /dev/sda2     [root@SERVER ~]#


title: How should I check to see if the remote smb serv is mounted?

text: I'm pretty new to `mount`. Basically, I have a remote SMB serv on the local network that I want copy images from a directory on, then repeat every 5 min. I think what I need to do is make a script that checks to see if the server is mounted, if it isn't mount it, if it is, do nothing, then run rsync. I was able to setup crontab (for the first time) to remove all the existing files in the directory and then run`rsync`, but I'm not sure how I should approach the SMB stuff. Should I mount it, copy the files and unmount, or should I leave the connection be? Btw, I'm using OSX.


title: How to make an entry of Slackware into grub2

text: I want to manually add the Slackware entry into the GRUB2 configuration file `/boot/grub/grub.cfg`. But the problem is that there is no initrd or initramfs present in `/boot` directory of Slackware. I saw that there is some utility named `mkinitramfs` which generates the initramfs, but I don't know how to use it for a kernel which is not running and is placed at a particular folder. Can somebody please help me out in solving my problem.


title: Install older version of GLibc on RHEL

text: I'm trying to install GCC 4.4 on RHEL6: `sudo rpm -ivh /mnt/dvd/Packages/gcc-4.4.3-1.el6.x86_64.rpm`. But the problem is that is depends on `glibc` and `glibc-common` libraries. When I try to install them using the command               sudo rpm -ivh /mnt/dvd/Packages/glibc-common-2.11.1-1.10.el6.x86_64.rpm /mnt/dvd/Packages/glibc-2.11.1-1.10.el6.x86_64.rpm      I get following the error:               file *.so from install of glibc-2.11.1-1.10.el6.x86_64 conflicts with file from package glibc-2.12-1.7.el6.x86_64      How could I make GLibc 2.11 installed instead of 2.12? Is there any other way to install GCC without downgrading to GLibc 2.11?


title: I have replicated partition after I delete it using diskmgmt

text: I'm a linux newbie, and I messed my partition. I have 5 partition in my 500GB HD, Windows 7, Data, Data, Linux Mint and Lubuntu. I accidentally deleted Lubuntu partition using diskmgmt in Windows 7. After I rebooted, I can't enter windows past the splash screen, and I can't boot into my linux mint either, after I use a crunchbang live usb. I found that I have 255 partitions in my HD with 4 of it I can recognize them as my old partitions, but the other 251 are fake partitions with exact same size as the deleted Linux Mint partition. Whenever I open gparted, my live usb just hang while gparted scan my partitions Is it possible to fix my partitions without reformating my HD? I haven't backup my partition table before. Here is my crunchbang live usb File Manager screenshot. http://en.zimagez.com/zimage/screenshot-03262013-050907pm.php


title: Seagate external hard disk creating problems

text: I've bought a new hard disk, a Seagate (Backup Plus), but I'm having problems with it. Firstly, it doesn't mounts every time I plug it in. In such cases, I've got to restart the machine to work with it. Secondly, whenever removing it, the `rsyslogd` and `kworker` commands go berserk , hogging the CPU and the `rsyslogd` command writes this to the `/var/log/syslog` file: > cmd urb submission failed My observations: for the first problem of mounting ,I tried to mount it manually but this was the result of `dmesg`:               [ 3791.677885] usb 1-1.1: >new high-speed USB device number 5 using ehci_hcd     [ 3791.831989] usb 1-1.1: >New USB device found, idVendor=0bc2, idProduct=a013     [ 3791.831995] usb 1-1.1: >New USB device strings: Mfr=2, Product=3, SerialNumber=1     [ 3791.831998] usb 1-1.1: >Product: Backup+ BK     [ 3791.832001] usb 1-1.1: >Manufacturer: Seagate     [ 3791.832003] usb 1-1.1: >SerialNumber: NA533ZTL     [ 3791.832846] scsi7 : uas     [ 3791.834099] scsi 7:0:0:0: >Direct-Access Seagate Backup+ BK 0410 PQ: 0   ANSI: 6     [ 3791.834843] sd 7:0:0:0: >Attached scsi generic sg3 type 0     [ 3791.835062] sd 7:0:0:0: >[sdc] Spinning up disk...     [ 3792.835724] ....ready     [ 3795.843334] sd 7:0:0:0: >[sdc] 1953525167 512-byte logical blocks: (1.00 TB/931 GiB)     [ 3796.014772] sd 7:0:0:0: >[sdc] Write Protect is off     [ 3796.014783] sd 7:0:0:0: >[sdc] Mode Sense: 4f 00 00 00     [ 3796.015652] sd 7:0:0:0: >[sdc] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA     [ 3796.026527] sdc: sdc1     [ 3796.029091] sd 7:0:0:0: >[sdc] Attached SCSI disk     [ 3826.329960] sd 7:0:0:0: >uas_eh_abort_handler tag 0     [ 3826.329973] sd 7:0:0:0: >uas_eh_device_reset_handler tag 0     [ 3826.329981] sd 7:0:0:0: >uas_eh_target_reset_handler tag 0     [ 3826.329985] sd 7:0:0:0: >uas_eh_bus_reset_handler tag 0     [ 3826.333953] usb 1-1.1: >URB BAD STATUS -71     [ 3826.402029] usb 1-1.1: >reset high-speed USB device number 5 using  ehci_hcd     [ 3826.555545] sd 7:0:0:0: >Device offlined - not ready after error recovery      One more observation is that it works fine when I start the laptop with the drive already attached. It neither has the auto mount problem , nor the CPU hogging problem.


title: according root permission to www-data

text: I have a perl script `dhcpmanip.pl` which contain this line:               system "hostapd /etc/hostapd-1.0/hostapd/hostapd.conf"`      It's a command to start `hostapd` and I get this error :               Insecure `$ENV{PATH}` while running setuid at `/var/www/cgi-bin/dhcpmanip.pl` line 46      After searching on the net I realised that I should accord root permission to www-data user (apache user) then I tried to modify the file `/etc/sudoers` by inserting this line:               www-data ALL=NOPASSWD: /var/www/cgi-bin/dhcpmanip.pl      but it still not working...does anyone have any idea about how solving this problem?


title: How not to boot from RAMDISK?

text: My all files and folders get disappeared after a system reboot. I am running petalinux on zynq chip by xilinx. I got some hint why is this happening. Actually my entire system is booting from RAM. perhaps default behavior. Looking at xilinx forum I found that I can modify the rootfs as described here Build and Modify a Rootfs. From the link I followed the following steps: Initrd To modify an initial ramdisk:   1. Extract the initrd image from the gzip archive. gunzip ramdisk.image.gz   2. Mount the initrd image. chmod u+rwx ramdisk.image mkdir tmp_mnt/ sudo mount -o loop ramdisk.image tmp_mnt/ cd tmp_mnt/   3. Make changes in the mounted filesystem.  I am stuck here. What changes shall I make here to achieve my goal? After mounting I get the following folders:               $ ls      bin  etc   lib       linuxrc     mnt  proc    root  sys  update_qspi.sh  var     dev  home  licenses  lost+found  opt  README  sbin  tmp  usr


title: Launch a process with limited permissions

text: I'd like to be able to launch processes with very limited permissions from the command line, basically so that I can run a process that I don't understand without it having access to things in my user area. For example, if I get a package from some colleague who has a tendency to write overly intrusive installers, I could do something like this:               > subdo make      would run `make` in such that it wouldn't be allowed to touch any parent directories. Does any such functionality exist in Unix?


title: Replacing string in all files found by grep. Can't get it to work

text: I'm trying to do what title says. So I find all needed files with grep: `grep --include=\\*.{php,ini,conf,sh} -ril -P "'([\d\w\\-\\_\\.]+)(@domain.com)'" '/var/www_data/somepath/'` Now I assume it's either use of sed or perl to for replacement process, alas I can't figure out how to use above regexp in either of them. I saw this way and this way but as I said, I couldn't get it work with my pattern (and by that I mean that I get > in the next line after executing command. I assume it's problem with regexp shown above when used with sed or perl), so any advice on that matter would be nice. Also, I don't know if it's possible (it's not really important) but I'd like to print some string for each file in with replacement occurred, for example `File fixed: /path/to/file/` (file names taken from grep list maybe?)


title: Error: invalid arch independent ELF magic, while loading a VirtualBox machine with Ubuntu Tinyos

text: I've created a virtual machine with Ubuntu (having TinyOS). The problem arises when I start the machine. I immediately get a black screen with written:               GRUB loading.     error: invalid arch independent ELF magic     grub rescue>      What kind of a problem is it, and more importantly how can I solve it? I tried it on my laptop which has Windows 7 64 bit, and so I also tried it on my Ubuntu partition and also with Ubuntu, once I launch the virtual machine I get the same error!


title: RHEL how to sync network settings between GUI and configuration files in /etc/sysconfig/network-scripts/?

text: In RHEL, we can change network settings either using GUI or editing the configuration files in `/etc/sysconfig/network-scripts/`. I would like to know how the network settings (e.g. IP address, gateway, etc) in the configuration files are sync with the GUI and vice versa. Do I need to restart any service to sync the data?   1. When NetworkManager is running, do I need to turn off network service? e.g. `/etc/init.d/network stop`?   2. If I have edited the configuration files in `/etc/sysconfig/network-scripts/`, and I want to sync the new configuration with the GUI, do I need to use `/etc/init.d/network restart`? If `/etc/init.d/network` has been stopped due to `#1` above, how can I sync the new configuration from text files to GUI without restarting `/etc/init.d/network`?   3. When I change network settings in the GUI, will it automatically edit the configuration files in `/etc/sysconfig/network-scripts/`? It will edit the file immediately or users need to reboot?   4. What is the relation between `NetworkManager` and `system-config-network` GUI? Is `system-config-network` GUI part of the NetworkManager package?   5. If I have stopped `/etc/init.d/network` service, can I still use the `system-config-network` GUI to configure network settings? Thanks.


title: Unreadable backup directory on a USB drive

text: The title pretty much sums it up. I was editing a script I wrote some time ago to automatically backup the contents of my Raspberry Pi SD card, and in the course of editing, I missed a "/", and so here is the entire shell script:               #!/bin/bash     date     echo BACKING UP RASPBERRY PI     sudo dd if=/dev/mmcblk0p2  of=/media/USBDRIVE/RPi-Backups/RPi-Backup-$(date +"%m_%d_%Y").img bs=10M     echo COMPRESSING RASPBERRY PI BACKUP     sudo gzip -9 -c /media/USBDRIVE/RPi-Backups/RPi-Backup-$(date +"%m_%d_%Y").img > /media/USBDRIVE/RPi-Backups/RPi-Backup-$(date +"%m_%d_%Y").img.gz      and once I did this, I realized that I made a mistake and stopped the script. I checked the directory where my backups are kept, and they were all gone. What was strange, was that there was as much space taken up in the drive as there had been before I ran the script, about half the 500 GB USB drive. As far as I can tell, the backups are gone, which kind of undermines the whole point of the backups. Is there a way to recover these files? If not, is there a way to recover the space without wiping and reformatting the drive?


title: Can't explain "crash" entries in output of the 'last' command

text: Last shows "crash" at 12:02 and 14:18, but the system didn't stop working at that time. The reboot at 15:03, on the other hand, was to recover from an actual crash - our system stopped responding at 14:46. Why does last show two "crashes" prior to the actual crash of the machine?               [admin@devbox log]$ last | head     myuser pts/2        myhostname  Wed Sep 28 15:12   still logged in     myuser pts/2        myhostname  Wed Sep 28 15:09 - 15:12  (00:02)     myuser pts/2        myhostname  Wed Sep 28 15:07 - 15:09  (00:01)     myuser pts/1        myhostname  Wed Sep 28 15:06   still logged in     myuser pts/0        myhostname  Wed Sep 28 15:04   still logged in     reboot   system boot  2.6.18-274.el5PA Wed Sep 28 15:03          (00:09)     myuser pts/1        myhostname  Wed Sep 28 14:18 - crash  (00:44)     myuser pts/0        myhostname  Wed Sep 28 12:02 - crash  (03:01)      EDIT: The reboot at 15:03 is real enough - but the two "crash" entries at 14:18 and 12:02 I can't explain.


title: Can Vim be made simpler?

text: I have a 300MB file I want to edit, search, remove duplicate lines, compare 2 files, that sort of stuff. I tried Sublime Text 3, which was slow and crashed often. I asked for recommendations and was pointed to Vim. But Vim is too complicated for me. I don't want to spend a lifetime learning to use a text editor. Can Vim be made simpler? I'm talking _simple_ as in as Sublime or `nano`. I just don't want to memorize hundreds of commands. I might want to re-enable those commands when I become a power user, but as a newbie, they're too much to chew. Even just the movement commands are a handful.


title: How to get the relative paths with ls?

text: I'd like to do something like this to move the last two downloaded files:               mv ` ls -rt ~/Downloads/ | tail -2 ` .      Unfortunately, `ls` only gives the filenames. How can I adapt the code above? (Before someone points it out, I'm aware of the problems in piping the output of `ls`. I'd only use this when I know the filenames in question.)


title: CUPS authentication failure

text: I'm running slackware 13.37 on an HP pavillion g series. I'm trying to add a printer. I run "Manage Printers" which opens up http://localhost:631/ in my browser. I press the 'Add Printer" button and get a pop-up window titled, "Authentication Required", with the text, "A username and password are being requested by http://localhost:631. The site says: 'CUPS' " over two fields labeled 'User Name' and 'Password'. Neither my username and password nor root's username and password are accepted. Does anyone know what is going on here and how I can get CUPS to recognize valid username-password pairs? Thanks.


title: SELlinux security domains

text: I'm studying SELinux, but I can't find any clear definition for security domains. What is a security domain and what is its difference with security context?


title: single bind mounted file gets out of sync in linux

text: I am bind mounting a single file on top of another one and after making changes with an editor, I don't see the modifications in both files. However, if I make the changes with the shell using redirection, >>, e.g., I do see the changes in both files. Below is an example to demonstrate: First case:               -bash-3.00# echo foo >| foo     -bash-3.00# echo bar >| bar     -bash-3.00# diff foo bar     1c1     < foo     ---     > bar     -bash-3.00# mount --bind foo bar     -bash-3.00# echo modified >> foo     -bash-3.00# diff foo bar     -bash-3.00# umount bar      Everything in the above case is as I expect; the two files show no differences after appending "modified" to the file "foo". However, if I perform the same test but use vi to edit foo, I get a different result. Second case:               -bash-3.00# echo foo >| foo     -bash-3.00# echo bar >| bar     -bash-3.00# diff foo bar     1c1     < foo     ---     > bar     -bash-3.00# mount --bind foo bar     -bash-3.00# diff foo bar     -bash-3.00# vi foo     # append "modified with vi" and :wq vi     "foo" 2L, 21C written     -bash-3.00# cat foo     foo     modified with vi     -bash-3.00# cat bar     foo      -bash-3.00# diff foo bar     2d1     < modified with vi     -bash-3.00#       Here, the two files are different even though one is bind mounted onto the other. Anyone here know what is going on in this case? Thanks!


title: FIrefox/Thunderbird storage locations

text: By default, Firefox and Thunderbird save their files to `~/.mozilla` and `~/.thunderbird`. I am wondering if there's an environment variable I can set, to have either of them save their data to a different location. I want to have multiple instances of them available, each with their own settings for server and application testing. I can do this with the`-no-remote` option and Profile Manager of each, but I was wondering if I could totally keep the testing profiles separate from my `main` configuration. This would also enable me to keep the profiles in source control if I so desired.


title: Multiline PS1 prompt

text: Is the a way to specify a multi line prompt in Korn shell? I am planning to swhitch from bash to ksh. In bash I have a very simplistic prompt, but it is 2 line prompt. I hate when input position changes depending on directory depth. My PS1 in bash is:               PS1='$(echo $?): \w\n>> '      Which results in prompt like:               0: /var/log     >> _


title: Gnome shell Alt+Tab

text: I am using Gnome-shell on arch linux. I use `Alt`+`Tab` frequently to switch between applications. Recently, I have assigned the language switcher to `Left Alt`+`Left shift`. This breaks `Alt`+`Shift`+`Tab` to switch application backwards, while this doesn't happen in windows. Any suggestions to fix this?


title: Turn off autohide feature of GNOME shell bottom panel

text: This one is specific to Gnome shell 3. I like bottom panel of GNOME Shell, but its autohide feature is a turn-offs. There are a lots of extensions out there, but none provides this facility. You can help me by pointing to the right extension. (I am going through this https://live.gnome.org/GnomeShell/Extensions/StepByStepTutorial/ tutorial but I cannot say if I can finish working on this.


title: Debian sheevaplug internet not working

text: I have a sheevaplug with debian 5.0..internet was always working fine until today. I have a bunch of pcs connected via wireless to my router and internet works fine. From today though my debian won't connect to the internet and i have no idea why... when I run `ping google.com` I get this:               ping google.com     PING google.com (173.194.35.8) 56(84) bytes of data.     ^C     --- google.com ping statistics ---     443 packets transmitted, 0 received, 100% packet loss, time 442006ms      It stays like this forever and I am unable to wget anything. Here is some info that might be useful : Content of `/etc/network/interfaces`:               # Used by ifup(8) and ifdown(8). See the interfaces(5) manpage or     # /usr/share/doc/ifupdown/examples for more information.     auto lo     iface lo inet loopback          auto eth0     iface eth0 inet dhcp      Output of `ifconfig`:               eth0      Link encap:Ethernet  HWaddr f0:ad:4e:01:40:78               inet addr:192.168.2.12  Bcast:192.168.2.255  Mask:255.255.255.0               inet6 addr: fe80::f2ad:4eff:fe01:4078/64 Scope:Link               UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1               RX packets:2200 errors:0 dropped:0 overruns:0 frame:0               TX packets:2926 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:1000               RX bytes:229615 (224.2 KiB)  TX bytes:466378 (455.4 KiB)               Interrupt:11          lo        Link encap:Local Loopback               inet addr:127.0.0.1  Mask:255.0.0.0               inet6 addr: ::1/128 Scope:Host               UP LOOPBACK RUNNING  MTU:16436  Metric:1               RX packets:0 errors:0 dropped:0 overruns:0 frame:0               TX packets:0 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:0               RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)      Content of `/etc/resolv.conf`:               nameserver 192.168.2.1      Here is the output of `netstat -rn`:               debian:~# netstat -rn     Kernel IP routing table     Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface     192.168.2.0     0.0.0.0         255.255.255.0   U         0 0          0 eth0     0.0.0.0         192.168.2.1     0.0.0.0         UG        0 0          0 eth0      Output of `arp -na`:               debian:~# arp -na     ? (192.168.2.1) at 00:1a:2a:27:c0:68 [ether] on eth0      Output of `route`:               Kernel IP routing table     Destination     Gateway         Genmask         Flags Metric Ref    Use Iface     192.168.2.0     *               255.255.255.0   U     0      0        0 eth0     default         .               0.0.0.0         UG    0      0        0 eth0      I tried everything : static IP, restarting network connection, restarting router, no luck... Any ideas what might be wrong? * * * **Edit** : Here's the output of `route`:               Kernel IP routing table     Destination     Gateway         Genmask         Flags Metric Ref    Use Iface     192.168.2.0     *               255.255.255.0   U     0      0        0 eth0     default         .               0.0.0.0         UG    0      0        0 eth0      * * * **Edit** : Here's the output of `netstat -rn`:               debian:~# netstat -rn     Kernel IP routing table     Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface     192.168.2.0     0.0.0.0         255.255.255.0   U         0 0          0 eth0     0.0.0.0         192.168.2.1     0.0.0.0         UG        0 0          0 eth0      and `arp -na`:               debian:~# arp -na     ? (192.168.2.1) at 00:1a:2a:27:c0:68 [ether] on eth0


title: I need data from a csv file which is not present in the second csv file

text: For example: I have a CSV file (first file ) with below data (vertically):               1     2     3     4     5     6      Second CSV with below data (vertically):               5     6     7     8      I want my resultant file (action needs to be performed using Unix shell scripting) to show only values (vertically) in first file but not in second file:               1     2     3     4


title: Formatting numbers using awk / print

text: I found this very cool code to get upload/download speed:               awk '{ if (l1) {             print "↓"($2-l1)/1024"kB/s ","↑"($10-l2)/1024"kB/s"         } else {             l1=$2; l2=$10;         }     }' <(grep wlan0 /proc/net/dev) <(sleep 1; grep wlan0 /proc/net/dev)      However, it returns up to 4 decimals. I rather have no decimals whatsoever. I have previously been able to round numbers using bc or printf, but I seem to only be able to use `print` in `awk`. What is a good solution to this issue?


title: Create a DVD Video ISO image from a directory

text: I've prepared myself a DVD Video image using 3rd-party tools. It has created a `VIDEO_TS` folder et al, and looks great. What I'd like to do next is to add another folder to store additional non-DVD- video content alongside the DVD. The goal is that the DVD will play without any issues on consumer DVD players, but if inserted into a computer and "browsed," there will be an additional folder there containing pictures and whatever else I'd like to put there. How can I build a DVD-Video compatible ISO image from an existing folder structure? I'm running Ubuntu 12.04.


title: Adding a self-signed certificate to the "trusted list"

text: I've generated a self-signed certificate for my build server and I'd like to globally trust the certificate on my machine, as I created the key myself and I'm sick of seeing warnings. I'm on Ubuntu 12.04. How can I take the certificate and globally trust it so that browsers (Google Chrome), CLI utilities (wget, curl), and programming languages (Python, Java, etc.) trust the connection to https://mysite.com without asking questions?


title: Cannot upen libusb shared object

text: I'm trying to use `heimdall` to install a custom Android ROM. When I run it, I get this:               ./heimdall: error while loading shared libraries: libusb-1.0.so.0:     cannot open shared object file: No such file or directory      But I have libusb installed. Why can't it find the file?


title: Is there a variation of Linux or Unix that does not require open licensing?

text: In the future I may be building a system with an embedded operating system. Given the commercial properties of this system, it will make sense to have all of the internals as closed source as possible. I have seen in the past many router manufacturers being forced to release source code due to them using a system under an open license. Is there a variation of Linux/Unix that does not have this requirement (e.g. no GNU or similar licensing)? From my limited understanding of Red Hat, don't they have a "commercial only" distro these days? I'd assume based on this that the source is not available then?


title: Difference between wine-wingdings and wingdings?

text: Is there any difference between wine-wingdings and wingdings (the true-type font available with Microsoft Windows)? By difference, I just mean is there any symbol that could be represented by wingdings (the true-type font available with Microsoft Windows) could not be represented by wine-wingdings.


title: Virtual Wireless Access Point

text: Basically, I want to be able to connect to a wireless network from my laptop. Then, I want my virtual machine to acquire internet access via a bridged connection from ETH0 of the VM to the host’s primary wireless adapter.I have already successfully accomplished this much. Now, I have eth1 configured as a DHCP server on the virtual machine (aka DEBIAN Router). Currently, I have this bridged to the physical 10/100 nic on my laptop (for now, Ill address the wifi part of this connection later). The NIC itself obtains IP from the VM, which is fine, i assume. I connected my netbook to the physical 10/100 port; it receives an IP address from ETH1 just fine, but fails to connect to the internet. I have ip forwarding enabled, but don't know how to route internet requests outside of the LAN the VM is hosting, to the WAN the laptops physical wifi nic is connected to. I can access the virtual machines web server, but no resources outside of the virtual LAN. So this is where I am stuck. In the end, I want to configure a second wireless NIC on the Host machine as “virtual access point”, not ad-hoc. A client computer will see the virtual ap listed in wireless connections as a standard wireless router, connect to it, and be online. My ultimate goal is to set up traffic analyzing for any clients connected through the “virtual access point” by routing all wireless traffic connected to the second wifi nic, through the internet connection of the primary wireless connection on the host machine.


title: Removing consecutive newlines with ed

text: Input file:               1 line1\     2 line2\     3 line3\     4 \     5 line4\     6 \     7 \     8 line5\      Desired output:               1 line1     2 line2     3 line3     4     5 line4     6     7 line5      Is it possible with POSIX `ed`? Removing the trailing backslashes is easy, but how can I also handle consecutive blackslashes as expected output?


title: Is there any way of prompt a message when a command in /usr/sbin/ is tried to run as nonroot?

text: In most Linux distros I've used when you type for example _ifconfig_ as a normal user, you get a prompt message telling you that only root can execute such command. In Debian, it only says command not found (because it's looking for it in /usr/bin/). I'm wondering if there is any way for prompt a message, like "ifconfig must be run as root" or something like that.


title: How can I fix the location of polkit and glib include headers?

text: I am developing an application in which I require to use PolicyKit and it appears PolicyKit uses Glib libraries. What happens is that I installed PolicyKit, but the location of the headers are on `/usr/include/polkit-1/` and `/usr/include/glib-2.0`. and the headers have on their inside locations like `/usr/include/`, `/usr/include/polkit`, `/usr/include/gobject`. I can't compile because the compiler doesn't find the headers in the location the headers say they are supposed to be. I tried modifying each header individually, but its taking too long and I don't know when I'll be done. The problem here is that when they are installed, they are installed in `/usr/include/polkit-1` and `/usr/include/glib-2.0` when they are supposed to be installed in `/usr/include` alone. In other words, the folder `polkit-1` and `glib-2.0` shouldn't be there. Anyone know of anyway to fix this quickly by putting the files and folders in their respective locations?


title: How to pass data outside process for zenity progress?

text: Usually this would be a question about how to pass data from a subprocess to a main process, but maybe `zenity` has some extra quirks so please focus on `zenity`. Example:               #!/bin/sh     (     echo "10" ; sleep 1     echo "# Updating mail logs" ; sleep 1     echo "20" ; sleep 1     echo "# Resetting cron jobs" ; sleep 1     echo "50" ; sleep 1     echo "This line will just be ignored" ; sleep 1     echo "75" ; sleep 1     echo "# Rebooting system" ; sleep 1     echo "100" ; sleep 1     ) |     zenity --progress \       --title="Update System Logs" \       --text="Scanning mail logs..." \       --percentage=0          # ... here main process continues (x)      Each step in practice can fail (there is more than just an echo -- tar, computing md5, zipping, unzipping, you name it), and I would like to set, for example, variable ERR to some message and quit the progress subprocess, and after that display content of ERR and quit for good. The problem is, ERR is local variable, so I can break the subprocess, but nevertheless I cannot pass ERR outside. I cannot also display it locally, because the main script will continue anyway, unaware that the subprocess failed. So the question is, how can I pass an error code, message, anything to the main process (continuing at the (x) point)? Process substitution:               #!/bin/sh     zenity --progress \       --title="Update System Logs" \       --text="Scanning mail logs..." \       --percentage=0 < <(     echo "10" ; sleep 1     echo "# Updating mail logs" ; sleep 1     ...      This didn't work for me too, i.e. ERR was not visible to the main script.


title: Why does this incrementing for loop return a bad variable?

text: I'm trying to call this shell script from within the CLI of GRASS GIS:               for (( day=5; day<367; day+5 )); do       # commands that I've tested without a loop.     done     exit 0      returns               Syntax error: Bad for loop variable


title: How to get gnome-terminal in English?

text: Is it possible to select a different language for a specific application? On some systems I run Fedora15/Gnome in German, but want to use the Terminal in English including for the simple prompt questions like: Y/N instead of j/N = Ja/Nein etc.