What ~/.config refers to and how to put files there?

I want to set up a plugin for the Geany editor on a Debian system. It's a theme changing plugin, so I am following this manual. It says: > The simplest way to do this is to copy the contents of the archive into the > ~/.config/geany/filedefs/ folder. I don't understand this. What do they mean by `~/.config`? Is that the default directory where Geany is installed? I have its files at `/usr/lib/geany` but that doesn't seem to be location they are talking about.


Linux user interface programming? (esp. for Python and Fortran)

What are my options for programming a GUI in Linux? I have several programs in Fortran and Python that I would like to create simple UI's for. I also plan on incorporating graphics in the form of plots.


How do I impersonate a windows domain account user from a linux process?

I'm running a process on a Unix box (I think it's a recent version of Red Hat, I can check for more detailed info if relevant), under a local user. I would like to access some network resources, via a Windows domain account. How do I/Can I associate the local user with a windows domain account just for the purposes of running this one process?


How to install/use sshuttle on Fedora?

How exactly can I install/use sshuttle under Fedora? It's not in the repositories


How to prepare a new MicroSDXC card for use with Android?

After buying a 64 GB MicroSDXC card and plugging it into my Android phone, it wasn't recognized. What do I need to do to use the space on this device? Many articles suggest installing closed source Windows programs for this, but I suspect it should be easy on Linux.


Are .bz2 files inside /var/lib/pengine safe to delete?

My problem is that my `/var` partition is over 80% (total size: 4.9G). I was reviewing the files into this partition and I saw a file which has 3.4G. (`/var/lib/pengine`) I dig into that /pengine file and I saw it is full of `.bz2` extension files. I want to move these files but I would like to know if is risky or not.


Why can't I create a directory by full relative path argument? Here is what I try:               #!/bin/bash     args=("$@")     # Print the command and run it. Exit the script on failure.     run()     {             if $VERBOSE; then                     echo "$@"                     "$@"             else                     "$@" >& /dev/null             fi             result=$?             if [ $result -ne 0 ]; then                     exit $result             fi     }                     if [ ! -d ${args[0]} ]; then                             run mkdir -p ${args[0]}                     fi                          run cd ./release/                     run cp -rf ./html/ ${args[0]}      but I get:               mkdir -p ./bla/bla/cloud/     cd ./release/     cp -rf ./html/ ./bla/bla/cloud/     cp: cannot create directory `./bla/bla/cloud/': No such file or directory      So I wonder how to make script work when called like this: `./script.sh ./bla/bla/bla/`


How much RAM can an application allocate on 64-bit x86 Linux systems?

Is it true that a single application can not allocate more than 2 GiBs even if the system has GiBs more free memory when using a 32-bit x86 PAE Linux kernel? Is this limit loosened by 64-bit x86 Linux kernels?


Set up network to share a printer connected to one particular machine on the network

How do I set up my Ubuntu machine to allow other computers to print to it? The set up is: All computers are connected to the network   1. 1 dual Ubuntu/Windows 7 netbook    2. 1 multibooting Debian/Ubuntu/Windows XP desktop   3. 1 Vista laptop    4. 1 dual Windows 7/Mac desktop Printer = Brother HL-4050 CDN connected to number (1) above A solution that involves only GUI configuration tools please. I'm a native Windows user; command-line is painful to me. * * * **Edit** : I tried to use `system-config-samba` but can't seem to get printer sharing up this way? Is there a way to do it with that tool?


Is it possible to find out the hosts in the known_hosts file?

I would like to see what hosts are in my known_hosts file but it doesn't appear to be human readable. Is it possible to read it? More specifically there is a host that I can connect to via several names and I want to find out what the fingerprint I expect for it from my known hosts file. Update: I'm using OpenSSH_5.3p1 Debian-3ubuntu7, OpenSSL 0.9.8k 25 Mar 2009 A line from my known_hosts file looks something like this,               |1|guO7PbLLb5FWIpxNZHF03ESTTKg=|r002DA8L2JUYRVykUh7jcVUHeYE= ssh-rsa AAAAB3NzaC1yc2EAAFADAQABAAABAQDWp73ulfigmbbzif051okmDMh5yZt/DlZnsx3DEOYHu3Nu/+THJnUAfkfEc1XkOFiFgbUyK/08Ty0K6ExUaffb1ERfXXyyp63rpCTHOPonSrnK7adl7YoPDd4BcIUZd1Dk7HtuShMmuk4l83X623cr9exbfm+DRaeyFNMFSEkMzztBYIkhpA2DWlDkd90OfVAvyoOrJPxztmIZR82qu/5t2z58sJ6Jm2xdp2ckySgXulq6S4k+hnnGuz2p1klviYCWGJMZfyAB+V+MTjGGD/cj0SkL5v/sa/Fie1zcv1SLs466x3H0kMllz6gAk0/FMi7eULspwnIp65g45qUAL3Oj


Should I be backing up my SSH host keys?

In my automated backups, I'm not sure if I should be doing this. If the hard drive fails or if I wipe the hard disk and start over, what will be the effect of starting with a new SSH host key to my clients? Will I have to do anything special other than remove the host's name from each client's `known_hosts` file? What is the best thing to do in this case? I'm planning on wiping my computer and starting from scratch in the next few days.


Is there a way to tell which file (script, specifically) executed a command?

I'm running Slackware 13.37, and I was wondering if there was a way to tell which script executed a command. I tracked the process and its arguments, but I would like to know where the command originated from.


How can I lock my own account from remote ssh login with password?

I don't want to disable remote login with password altogether, but I want to make it so that my account is only accessible with key pair authentication (there are other users who wants to use passwords to log in). Is it possible to change this on a per-user basis, ideally without changing system settings? And to make it clear, my account has sudo access, so I don't want to lock the password.


Need help with this script

I'm supposed to write a bash script that has as an argument a path to a directory which contains a file named _checking.txt_. It needs to return the following exit codes:   * 4, if the directory doesn't exist   * 5, if that directory is not a subdirectory of /home/user5/task05/   * 6, if _checking.txt_ doesn't exist How can I write these conditionals ?


minimal install, still want gnome!

I'm at the stage of the install of Fedora 15 where I choose what software to install. I want less so I'm going for "minimal" and "Customize now". What do I need to tick to get the machine to boot gnome at startup? Last time I chose minimal gnome did not load and I got stuck at terminal (or whatever you wizards call it).


How did the system settings directory on UNIX come to be named /etc?

> **Possible Duplicate:**   >  What does etc stand for? And why isn't it named /cnf or /syscf or /cfg? No one I have ever asked has been able to tell me, not that I have access to any of the minds that created UNIX. When I was a youngster, I saw the /etc and assumed it was for 'et cetera', namely, other files that had no place elsewhere, and I used it for that in a few of my early Linux installs (cringeworthy, I know) in the mid-90's. I continued learning and trying to do better, and I have, since. But the mystery remains, and even the FSSTND does not seem to contain this info. Anyone?


What is the meaning of /etc (as acronym)

> **Possible Duplicate:**   >  What does etc stand for? What does it mean? All I can think is _etcetera_. By my teacher told me that there is a more appropriate meaning.


Using calibre from the command line

Using calibre from the command line, in debian testing, how can I insert a tag with the syntax being                   ebook-meta ebook_file --tags rhubarb      but for a range of files, but all by the same author so just need the tag of his/her name? This is used to help in indexing and sorting out books on a Kindle.


Chakra overriding Arch?/ Is this possible?

My Arch installation didn't go well so can I install Chakra project to override the Arch installation?? By just installing Chakra in the same partition with Arch? Is it possible? How hard is the Chakra installation?


What does Conky update interval update and how to tune it?

As I understand, `conky_update` reloads the whole conky window every time. So, if I have rss fetching there and some scripts running they all rerun every few seconds. Is this right? Can I make the rss fetching part be very infrequent (say, every 10 hours), but other parts with few-seconds updating? Relevant part from my .conkyrc:               update_interval 2.0          TEXT     ${if_match ${desktop_number}==4}     ${font GE Inspira:size=12}${color White}${alignc}Recent Blog Posts${color}${font}     ${color White}${hr 1}${color}     ${execp python ~/Documents/rss.py}     ${color White}${hr 1}${color}     ${endif}       rss.py merely scans an rss feed and gets blog post titles & dates from it.


What is the difference between binary file and .exe file?

Can anyone distinguish the difference between binary file and .exe file?


Internet bandwidth mysteriously drops under Linux, but is fine under Windows

I can't seem to download files from the internet on my laptop with Mint/Ubuntu, due to strange bandwidth fluctuations. I'm able to browse the web with Firefox with no problems, `apt-get update` and `dist-upgrade` work normally, both my Firefox, Deluge and Transmission have standard settings, I haven't tweaked anything. Yet every time its the same story: a file starts downloading either via direct download or torrent; initial speed is around 1MB/s and several MBs are downloaded. Then the speed decreases gradually until it reaches 0. After some interval (5-20min) it again rises to around 800MB/s, downloads 1-2 MBs and then decreases to 0. After a while, in case of direct download almost nothing is downloaded and often I get an error window that say could not download the file. The same files are downloaded within 5-10min via my desktop with win7. Any ideas as to what may be the cause?


How to logout from su-ed root at certain time

Suppose, the user does `su`, switching to `root`               $ su     Password:      bash-4.2# crontab -l      How can I logout all such users from `root` at a certain time? ### What I tried I know, that using this command:               bash-4.2# ps -A -u root | grep bash      2303 tty1     00:00:00 bash      2548 pts/0    00:00:00 bash      3040 pts/0    00:00:00 bash      3080 pts/2    00:00:00 bash      we can get all the Bash shells, owned by `root`. But how can I select the one that was generated by `su`? When I ran `echo $$` in the su-ed shell, it gives this:               bash-4.2# echo $$     3040      Then I tried:               bash-4.2# kill 3040      But it didn't kill the `root` shell. Plus if I create a `cron job echo $$` it won't give the necessary PID. So, this won't work. Now I'm stuck.


Ubuntu / Mint brightness 0 by default on login

Every time I boot up Ubuntu or Mint, after choosing an OS from GRUB menu, before logging in, screen brightness is set to 0. What is the reason behind that? I always end up manually turning on the brightness in order to see the logo and then login screen. It does not happen in other distros like Debian. I encounter this in Ubuntu 12.04, 13.10, Mint 15 and Mint 16. computer specs: Laptop Lenovo g500; intel celeron 1005M 1.9G; RAM 4GB; integrated graphics; win8/mint16 dualboot


pure shell complex substitution in variable

However it may be impossible, I hope I'm just bad man reader =) Is there any way to substitute text in variables on several patterns at time or even using back reference? For example, I have `FILE=filename.ext` and I want to change it to `filename_sometext.ext`. But I don't know that file extension is `.ext`. All I know about it is that extension is after last dot. So I can do it in two steps:               EXT=${FILE##*.}     FILE=${FILE%.*}_sometext.$EXT      Can I do it on one step (smth like `${FILE/.\\(*\\)/_sometext.\1}` [that doesn't work])? By the way I need to do it in pure shell without `sed`/`awk`/etc. My shell is `ksh`, but if there is way to do it with bashisms I'd like to know it too.


How to enable user_xattr in Mint Cinnamon?

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.


Emacs - finding the cursor in multiple windows

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?


Internet stopped working after installing Xfce on Arch

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?


Frequent disconnections in OpenVPN

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


Can I use Synaptics' output in KVM?

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?


add-apt-repository Raises A Python Error

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.


Subprocess.call() and gunzip error

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?


Arch suspend when I close laptop lid?

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))


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

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?


What is the most advanced video editing FLOSS?

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?


Poor Man's GNU Parallel implemented in ksh?

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.


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

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 ?


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

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(); ?????              }


Inconsistent field separator behaviour of space in awk

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|     ||


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

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?


Warn users that the system is going down for a reboot

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?


How to I change GNOME 3.8 top bar font?

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


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

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.


MediaTomb fast image resize

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.


Block network access of a process?

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


Block specific application with iptables

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.


Run command when temperature exceeds threshold, without daemon

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?


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

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.


Redirect grep out to a file does not work

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


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

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


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

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.


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

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...


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

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.


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

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?


How to catch an error in a linux bash script?

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?


grep surrounding characters of a match

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!


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

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"")


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

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}


telling network manager to temporarily ignore a network device

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?


Getting error whenever trying to add a repository

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 ?


Reading encrypted partition with broken LVM2 inside?

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.


file type determine

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?


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

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


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

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?


Blacklisting Drivers

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


diff a gzipped tarball against a directory?

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.


Get load average excluding niced processes

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.


Aliases interpretation

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`?


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

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.


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

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


PS/2 Keyboard & Mouse not working AFTER boot

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.


Long gcc compile time

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?


What mount points exist on a typical Linux system?

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"?


Count the number of executable programs in a directory

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


Advanced usage/command of shell

> **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.


Is it possible in unix to search inside zip files

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?


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

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_.


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

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).


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

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`?


Is there an equivalent of addr2line on AIX system?

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 )


Calendar software for Linux

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?


Where node.js was installed?

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


How to defer variable expansion

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.


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

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?


Why doesn't /dev/sda3 created?

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 ~]#


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

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.


How to make an entry of Slackware into grub2

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.


Install older version of GLibc on RHEL

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?


I have replicated partition after I delete it using diskmgmt

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


Seagate external hard disk creating problems

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.


according root permission to www-data

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?


How not to boot from RAMDISK?

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


Launch a process with limited permissions

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?


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

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?)


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

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!


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

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.


Unreadable backup directory on a USB drive

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?


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

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.


Can Vim be made simpler?

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.


How to get the relative paths with ls?

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.)


CUPS authentication failure

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.


SELlinux security domains

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?


single bind mounted file gets out of sync in linux

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!


FIrefox/Thunderbird storage locations

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.


Multiline PS1 prompt

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     >> _


Gnome shell Alt+Tab

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?


Turn off autohide feature of GNOME shell bottom panel

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.