title: Nano editor - display not updating with PuTTY

text: When I use PuTTY to connect to a specific Linux server via the SSH protocol, and I try to edit a file using the nano editor, the "enter" does not update the display. When I press enter to insert another line break, the following lines do not move down. However, if I save the file and re-open it, the new line breaks are there. I have further discovered that this only occurs on the first 3-4 lines of the file. This particular server runs CentOS 6. When I connect to a different server, I don't have the same problem. Where does the problem lie and how do I fix it? Running `infocmp $TERM` reports:               #       Reconstructed via infocmp from file: /usr/share/terminfo/l/linux     linux|linux console,         am, bce, ccc, eo, mir, msgr, xenl, xon,         colors#8, it#8, ncv#18, pairs#64,         acsc=+\020\,\021-\030.^Y0\333`\004a\261f\370g\361h\260i\316j\331k\277l\332m\300n\305o~p\304q\304r\304s_t\303u\264v\301w\302x\263y\363z\362{\343|\330}\234~\376,         bel=^G, blink=\E[5m, bold=\E[1m, civis=\E[?25l\E[?1c,         clear=\E[H\E[J, cnorm=\E[?25h\E[?0c, cr=^M,         csr=\E[%i%p1%d;%p2%dr, cub1=^H, cud1=^J, cuf1=\E[C,         cup=\E[%i%p1%d;%p2%dH, cuu1=\E[A, cvvis=\E[?25h\E[?8c,         dch=\E[%p1%dP, dch1=\E[P, dim=\E[2m, dl=\E[%p1%dM,         dl1=\E[M, ech=\E[%p1%dX, ed=\E[J, el=\E[K, el1=\E[1K,         flash=\E[?5h\E[?5l$<200/>, home=\E[H, hpa=\E[%i%p1%dG,         ht=^I, hts=\EH, ich=\E[%p1%d@, ich1=\E[@, il=\E[%p1%dL,         il1=\E[L, ind=^J,         initc=\E]P%p1%x%p2%{256}%*%{1000}%/%02x%p3%{256}%*%{1000}%/%02x%p4%{256}%*%{1000}%/%02x,         kb2=\E[G, kbs=\177, kcbt=\E[Z, kcub1=\E[D, kcud1=\E[B,         kcuf1=\E[C, kcuu1=\E[A, kdch1=\E[3~, kend=\E[4~, kf1=\E[[A,         kf10=\E[21~, kf11=\E[23~, kf12=\E[24~, kf13=\E[25~,         kf14=\E[26~, kf15=\E[28~, kf16=\E[29~, kf17=\E[31~,         kf18=\E[32~, kf19=\E[33~, kf2=\E[[B, kf20=\E[34~,         kf3=\E[[C, kf4=\E[[D, kf5=\E[[E, kf6=\E[17~, kf7=\E[18~,         kf8=\E[19~, kf9=\E[20~, khome=\E[1~, kich1=\E[2~,         kmous=\E[M, knp=\E[6~, kpp=\E[5~, kspd=^Z, nel=^M^J, oc=\E]R,         op=\E[39;49m, rc=\E8, rev=\E[7m, ri=\EM, rmacs=\E[10m,         rmam=\E[?7l, rmir=\E[4l, rmpch=\E[10m, rmso=\E[27m,         rmul=\E[24m, rs1=\Ec\E]R, sc=\E7, setab=\E[4%p1%dm,         setaf=\E[3%p1%dm,         sgr=\E[0;10%?%p1%t;7%;%?%p2%t;4%;%?%p3%t;7%;%?%p4%t;5%;%?%p5%t;2%;%?%p6%t;1%;%?%p7%t;8%;%?%p9%t;11%;m,         sgr0=\E[0;10m, smacs=\E[11m, smam=\E[?7h, smir=\E[4h,         smpch=\E[11m, smso=\E[7m, smul=\E[4m, tbc=\E[3g,         u6=\E[%i%d;%dR, u7=\E[6n, u8=\E[?6c, u9=\E[c,         vpa=\E[%i%p1%dd,


title: Dump process core without killing the process

text: Is there a way to get a core dump (or something similar) for a process without actually killing the processes? I have a multithreaded python process running on an embedded system. And I want to be able to get a snapshot of the process under normal conditions (ie with the other processes required to be running), but I don't have enough memory to connect gdb (or run it under gdb) without the python process being the only one running. I hope this question makes sense.


title: Using YUM or installing APT on CentOS

text: I am having trouble with a centOS machine I am using. I need some packages, including _john the ripper_ , but **`yum`** cannot find the packages. When I type `sudo yum install john`, I get back the _nothing to do_ message. Is there a way to improve the searched locations to install **`john`** or is it possible to install APT on CentOS machines? I know it isn't exactly supported but I am at a loss and do not have the hours necessary to install from source and rpms :(


title: Install the same 64-bit packages as a 32-bit Xubuntu installation

text: I have been using a virtual machine (Xubuntu 12.10, with VMWare on a windows host) for all my programming work, which I am trying to transition from a 32-bit install to a 64-bit install. I am hoping to be able to automatically re-install all the packages I have been using in the 32-bit VM in my new 64-bit VM. Reading these instructions, I ran `sudo dpkg --get-selections` to get a list of installed packages, but many of the packages have an `:i386` suffix. Is there an easy way to install the corresponding 64-bit packages? Am I safe to replace `:i386` with `:x86_64` or something similar in my package listing before trying to install them?


title: Run expect script from other shell

text: My target is to create the `/var/tmp/add_user.bash` script from `/var/tmp/create_script_add_user.bash` script and run the expect script (`add_user.bash`) from `create_script_add_user.bash` script. The problem is that when I run the script `add_user.bash` from `create_script_add_user.bash`, then expect gets stuck on the question:                     Proceed? n)       It looks like expect can't see the question from standard output. But when I run the script `/var/tmp/add_user.bash`, then it works fine. Why can't expect run from the other script? And how to solve this issue? ### Contents of `/var/tmp/create_script_add_user.bash`                  #!/bin/bash                  echo '#!/bin/bash                  add_user=`cat << EOF        set timeout -1        spawn /var/tmp/add_user.bash user_name=OBAMA        expect n)   { send "yes\r" }        expect eof        EOF`              /usr/local/bin/expect -c  "$add_user"              '> /var/tmp/add_user.bash              chmod +x /var/tmp/add_user.bash              #need sleep for 5 seconds         ( sleep 5 ; /var/tmp/add_user.bash ) &      ### Contents of `/var/tmp/add_user.bash`                #!/bin/bash           add_user=`cat << EOF      set timeout -1      spawn /var/tmp/add_user.bash user_name=OBAMA      expect n)   { send "yes\r" }      expect eof      EOF`           /usr/local/bin/expect -c  "$add_user"


title: Columns of Virtual Desktops in Openbox

text: I'm setting up Openbox in Arch and was trying to setup the virtual desktops like I usually like them, in one tall column. The default is to have them setup as a single row and the Openbox config utility only has the ability to add to that. Is there a way to have Openbox use virtual columns of virtual desktops?


title: Why does it take so much time to execute semodule -i mypol.pp?

text: Command `semodule -i mypol.pp` takes more than one minute to execute. Why?


title: Make many subdirectories at once

text: Suppose I have a directory `/`, and it contains many directories `/mydir`, `/hisdir`, `/herdir`, and each of those need to have a similar structure. For each directory in `/`, there needs to be a directory `doc` and within it a file `doc1.txt`. One might naively assume they could execute               mkdir */doc     touch */doc/doc1.txt      but they would be wrong, because wildcards don't work like that. Is there a way to do this without just making the structure once in an example then `cp`ing it to the others? And, if not, is there a way to do the above workaround without overwriting any existing files (suppose `mydir` already contains the structure with some data I want to keep)? EDIT: I'd also like to avoid using a script if possible.


title: Two different /etc/hosts depending upon the time

text: I am trying to make a productivity suite for myself. My first goal is to block Facebook, Gmail and Stackexchange from 0900 to 1600. As of now, I have edited my `/etc/hosts` and added 0.0.0.0 www.facebook.com and similar ones for gmail and stackexchange. But I am a little confused about how to include the blocking duration in my script. What I thought is having 2 different files (hosts_allow, hosts_block) and then `cp hosts_allow hosts` or `cp hosts_block hosts` depending upon time but then this would need to be put in an infinite loop or something which I'm not really sure is the best way of approaching the problem. Any clues?


title: ssh via multiple hosts

text: To get to my machine in my office, at the moment I am doing this:               me@home:~$ ssh unix.university.com     me@unix:~$ ssh unix.department.univeristy.com     me@unix.department:~$ ssh office-machine.department.university.com     me@office-machine:~$ echo "This is very annoying"      Is there an easy way of automating this process, perhaps a single command that I can use at my end?


title: ssh to a specific machine within a network

text: I'm frequently transferring files and operating programs via `ssh`, and often from home. The machine I usually work on is a desktop at work that I cannot `ssh` to directly unless I'm already connected to the department network. Thus if I'm at home, I must `ssh` to my department's network first and then to my desktop, ie `ssh username@departmentnetwork` and then `ssh username@desktop- departmentnetwork` This setup means that if I am to transfer files from home, I must `scp` the files to my drive on the department network, `ssh` in to the department network, then `scp` the files again to my desktop. Is there a way to use any or all of `ssh`, `scp`, and `sshfs` to connect to a 'network within a network'?


title: Tmux makes a sound when I launch it, how could I disable that?

text: When I launch tmux in the terminal, is causes my Linux Mint to play a sound in the speakers. The sound is a Linux Mint system sound. Perhaps it's the "alert" sound, but I cannot identify it by name. The same alert sound plays when I exit tmux. Any ideas on how to disable this sound when tmux is launched?


title: What is the relationship between system calls, message passing, and interrupts?

text: I am reading the Wikipedia article for process management. My focus is on Linux. I cannot figure out the relation and differences between system call, message passing and interrupt, in their concepts and purposes. Are they all for processes to make requests to kernel for resources and services? Some quotes from the article and some other:   1. > There are two possible ways for an OS to regain control of the processor during a program’s execution in order for the OS to perform de-allocation or allocation: > >     1. The process issues a system call (sometimes called a software > interrupt); for example, an I/O request occurs requesting to access a file > on hard disk. >     2. A hardware interrupt occurs; for example, a key was pressed on the > keyboard, or a timer runs out (used in pre-emptive multitasking).   2. > There are two techniques by which a program executing in user mode can request the kernel's services: >   >     >     * System call >     * Message passing >     3. > an interrupt is an asynchronous signal indicating the need for attention or a synchronous event in software indicating the need for a change in execution. > > A hardware interrupt causes the processor to save its state of execution and > begin execution of an interrupt handler. Software interrupts are usually > implemented as instructions in the instruction set, which cause a context > switch to an interrupt handler similar to a hardware interrupt.


title: What is the connection between a gedit bug and a Unix-&-Linux Q/A href?

text: While answering a _Unix-&-Linux question_, I observed that Gedit and two other editors, Leafpad and Medit (I tested 12 editors altogether) exhibit the a certain bug. As it turns out, the bug is known to Canonical's launchpad as Bug #332321 _search (and replace) takes ss as ß_. The bug's behaviour is that `find ß` will match both `ß` and `ss`... (not nice, especially if you do a replace-all). I then noticed that the StackExchange software, in order to create the question's href link, had converted the question's title from `How to bind “ß” to Meta-s?` to `how-to-bind-ss-to-meta-s`. So two completely unrelated environments are treating `ß` in a similar manner.. What is this strange attraction between `ß` and `ss`? ... and are there other such 'relationships'?


When I attempt rsync from one server to another server, I get this error:               [root@192.168.2.22 ~]# rsync -avzp -e ssh root@192.168.2.77:/system/data /system/data/          deflate on token returned 0 (88936 bytes left)     rsync error: error in rsync protocol data stream (code 12) at token.c(288)     rsync: connection unexpectedly closed (37028 bytes received so far) [receiver]     rsync error: error in rsync protocol data stream (code 12) at io.c(601) [receive r=3.0.7]     rsync: connection unexpectedly closed (37012 bytes received so far) [generator]     rsync error: error in rsync protocol data      Somewhere, I saw a suggestion to change the rsync version and install z-lib. Here's what I have installed now:               > rpm -qa rsync     rsync-3.0.7-1.el5.rfx.x86_64          > rpm -qa zlib     zlib-1.2.3-29.el6.x86_64      The error still occurs.


title: install latest gcc on rhel 6 x86_64

text: I have an RHEL 6 server with gcc version 4.4.7. I wanted to update the gcc version (I think the current one is 4.8). Yum update doesn't work. Also, SO answers for a similar question on CentOS does not work. I followed the methods in the accepted answer, the output is "Error getting repository data for testing-1.1-devtools-6, repository not found". Also I am not sure whether I should follow the methods for CentOs. Has anyone updated gcc in RHEL 6 x86_64 server?


title: Making multiple calls to a program via a bash shell script

text: Suppose that I have a program `make_ndx` that outputs via the `-o` switch. I would like to call `myprogram` from a bash shell script and output two files, `out1.ndx` and `out2.ndx`. (`myprogram` takes a string as input to the `-o` switch and automatically appends the file extension `.ndx` to that string.) So, I have written a bash shell script:               #!/bin/bash          make_ndx -o out1     make_ndx -o out2      I obtain two output files: `out1.ndx` and `out2.ndx`. But I would like to instead obtain `out1.ndx` and `out2.ndx`. It seems like the `` character in corresponds to a newline or return character (possibly `\n` or `\r`?), because when I copy and paste the file name to a text file (or to this post), `out1.ndx` appears as               out1     .ndx      (Note that, for the purpose of this post, I am using another character (``) to represent the square symbol that I see in my SSH GUI, since when I copy the actual character from the SSH GUI to here, I simply obtain a newline character.) How can I write my bash shell script so that the newline character does not appear in the filename of the first output file? The same problem occurs when I put an extra space between the calls to `make_ndx`:               #!/bin/bash          make_ndx -o out1          make_ndx -o out2      Thanks for your time.


title: Cent OS + VSFTP, 553 could not create file, how to allow uploading of files?

text: I have a ftp server running on Cent OS VM. the goal:   * public map can be seen by everyone (readonly for anonymous users, write for logged in users)   * upload map can only be seen by local users logged in and they can upload files (= write permission) I can't create files with Filezilla (also not in the public folder) if I log in with a local user account of ftp server I also set this bool value:               setsebool ftp_home_dir on      my vsftpd config:               anonymous_enable=YES     anon_root=/srv/shares/public     local_root=/srv/shares     no_anon_password=YES          local_enable=YES          write_enable=YES          local_umask=022      I get an 553 could not create file Are there any setsebool values that I forgot to set?


title: Reinstall Grub in target system

text: I'm trying to restore Grub to boot Linux Mint 13 and Windows 7. I just installed Windows 7, which rewrote the MBR, and then I was told I could simply boot Ubuntu live cd, install boot-repair, and reinstall grub over the MBR. I went through the installation, using the option to purge the old grub, but it failed, asking me to run some terminal commands to uninstall grub. After running those commands, I clicked the "Forward" button, but it said that grub was still installed. I eventually got grub installed on my MBR, and I can manually boot Windows using chainloader, but can't boot linux (it boots to initramfs and I don't know what to do from there). I see that /boot/grub/stage1 is missing, but how to I reinstall grub into my linux partition? I tried supergrubdisk (which is totally not user friendly for the record). At this point boot-repair fails, and I'm not able to uncheck the option to purge the old Grub (it's greyed out). I found this tidbit of info: > Boot-Repair's "Purge GRUB" option can't be unticked if some GRUB executables > (eg grub-install) are missing in the system you want to repair. The "Purge > GRUB" option will download the GRUB packages from Internet and reinstall > them. But it's not automatically downloading the grub packages from the internet (I do have a connection), and asking to configure my repositories for downloading grub2. Any ideas? Do I have to reformat my linux partition?


title: Tool to convert between human-readable byte sizes and bare byte counts

text: Can you recommend a Unix-style tool that converts between human-readable bytesizes (e.g., 10KiB->10240, 10240->10KiB)? By Unix-style I mean that it should do just this (i.e., be just a simple filter without any GUI or other cruft) and do it well (i.e., handle different units, behave intelligently by default while allowing optional settings, such as different interpretation of non-IT units (k==1000 OR 1024), optional custom rounding, optional conversion to units that aren't the most fitting ones, etc.).


title: How can I send attachment with ssmtp in Linux?

text: I can send email from my gmail account by ssmtp in Linux now. But how can I attach files to the email?


title: ZFS: Trying to remove top-level drive from Zpool

text: I have a zpool called storage that contains a five device raidz1 array. Today I went and bought another 3TB device and put it in my enclosure. However, instead of creating a new pool and adding that device to it, I made a mistake and added it to my existing storage pool. Now I have a top-level device that I want to remove called `sdg` (that's the new drive). Everytime I try to remove it I get:               cannot remove sdg: only inactive hot spares, cache, top-level, or log devices can be removed.      So how do I remove this device now? if this device fails, my entire pool will be unavailable. I'm thinking I should go buy another drive and at least it will be mirrored but I just can't believe there isn't a proper way to do this. This is my status dump:               pool: storage     state: ONLINE     scan: scrub canceled on Wed Jul 23 17:26:08 2014          config:           NAME                                 STATE     READ WRITE CKSUM      storage                              ONLINE       0     0     0        raidz1-0                           ONLINE       0     0     0          ata-ST3000DM001-1CH166_Z1F1PYM6  ONLINE       0     0     0          ata-ST3000DM001-1CH166_W1F24CSC  ONLINE       0     0     0          ata-ST3000DM001-1CH166_W1F2372R  ONLINE       0     0     0          ata-ST3000DM001-1CH166_W1F24BTK  ONLINE       0     0     0          ata-ST3000DM001-1CH166_Z1F2KKLW  ONLINE       0     0     0        sdg                                ONLINE       0     0     0          errors: No known data errors


title: Help needed in searching a text in all directories

text: I need to search "Ignoring request to authentication address " text in all the directories.What command need to give?Any assistance reg this will be highly appreciated.


title: Trying to setup sudo user

text: I'm trying to setup `sudo` with no password but still I get prompted for password. I'm using Ubuntu, here is the relevant line from the sudoers configuration file :               gandalf ALL=(ALL:ALL) NOPASSWD: ALL


title: Find absolute path from a script

text: In a script I get in `$0` the possible relative path to it. For converting it to absolute I've found this solution which I don't understand:               abspath=$(cd ${0%/*} && echo $PWD/${0##*/})      My problem is the magic inside of `${0%/*}` and `${0##*/}`. It looks like the former extracts the dirname and the latter extracts the filename, I just don't get how.


title: id3v2 used recursively at command line?

text: Trying to get my id3 tags cleaned up and am loving id3v2 on the command line -- but I've been using it only with a *.mp3 wildcard and want to explore if there's a way to use it recursively so I can batch all of my MP3s. There doesn't seem to be an option to use it recursively. I'm pretty sure all you awesome command line folks know of a sweet way to do this, but I am still learning my way through it... Here's the commands I have aliased to brute force it:               id3v2 --remove-frame "COMM" *.mp3     id3v2 --remove-frame "PRIV" *.mp3     id3v2 -s *.mp3      So -- is there a way to do this recursively, so I can run it a the root of my music folder? Gravy points for: including other audio file types and collapsing all three commands above into one uber command (I can do this with the `;` between commands... right?)


title: What does C-u 0 mean in Emacs

text: What does C-u 0 followed by another command mean in general in Emacs? For example, I thought C-k and C-u 0 C-k were the same, but find out that C-u 0 C-k kill the part of the current line before the cursor, while C-k kill the the part after. Thanks.


What version of Red Hat is used for the Red Hat Certified System Administrator Exam? Because I don't have over $3000 to invest in the Red Hat course that prepares you for the exam I am going to install Red Hat and practice all of the listed objectives on my own. (Exam Objectives) I'll probably do some other practice as well just for fun. As of right now I am downloading Red Hat Linux 7.1 i386. As a secondary question, would you advise either for or against taking the course? Are there other avenues the you would suggest to help me prepare for the exam? Also if I were to fail the exam would I have to pay again to retake it?


title: What factors contribute to the expense of migrating to Linux?

text: People have various reasons(... and more reasons) to use Linux:   * Freedom    * Reliability    * Stability    * Security    * Commercial support  But the question of cost is usually put aside, although Linux is essentially free, unlike Windows. Why? Does that mean that Linux cannot compete with Windows in a cost measure? The focus of the question is   * Can migration be profitable in the sense of saving money by the migration?   * How big does the cost saving need to be in order to motivate a company to migration?   * Specifically I'm interested in the usage of Linux by small business. (For large companies the Unix systems are profitable.)   * Specifically I'm interested in the usage of Linux on desktop computers (the workstations).   * Identify some model examples of profitable migration.


title: ALT + CTRL shortcuts in MATE problem

text: I've installed MATE under Arch Linux. I've a problem with the shortcuts. A lot of the shortcuts doesn't work so I tried to change them. When I'm trying to reassign the shortcut I go to Settings -> Keybord Shortcuts, clicking the row I want to change and pressing the shortcut. The problem is, when I press CTRL then ALT then L the command becomes: CTRL + L If I change the order the buttons i press down the keys to ALT + CTRL + L the result is: ALT + L So it looks like MATE only takes one of CTRL and ALT, the first one down, and not both of them as I want. Does anyone have an idea why this could be? It's not a new installation of Arch, but it is a new installation of MATE and Xorg.


title: How to restore the partition layout for GPT disk

text: parted -ms /dev/sda print > sda.parted      This actually copies the layout to a file. If I want to restore the layout, what command should I give?


title: how to check rx ring, max_backlog, and max_syn_backlog size

text: Quite often in the course of troubleshooting and tuning things I find myself thinking about the following Linux kernel settings:               net.core.netdev_max_backlog     net.ipv4.tcp_max_syn_backlog     net.core.somaxconn      Other than `fs.file-max`, `net.ipv4.ip_local_port_range`, `net.core.rmem_max`, `net.core.wmem_max`, `net.ipv4.tcp_rmem`, and `net.ipv4.tcp_wmem`, they seems to be the important knobs to mess with when you are tuning a box for high levels of concurrency. My question: How can I check to see how many items are in each of those queues ? Usually people just set them super high, but I would like to log those queue sizes to help predict future failure and catch issues before they manifest in a user noticeable way.


title: Copying a deeply nested directory structure

text: I have to copy a directory structure to a new host as part of an application migration. The directory structure is as follows: {10 - ff} / {00 - ff} / {00 - ff} (non-inclusive) / uniquefilename So there are millions of files. The third level of the tree is not fully populated, and not every third level directory has a file in it. a du takes a LONG time to complete for even a second level folder. Using tar | nc would take 10 days. I can get a 1 day outage, but not 10.


title: On Debian, how do I add a Python package in dist-packages to a virtualenv?

text: Given some python package in `/usr/share/pyshared/` or `/usr/lib/pythonX.Y/dist-packages/` (take `python-numpy` or `python-scipy` for example), how do I add that package to a virtualenv? When adding the package to the virtualenv, does it require that it uses the "normal" python installation method (`setpy.py` etc.) to install, or have it's own? Basically, I want to be able to easily add python packages, which have C extensions that are complex (`numpy`, `scipy`, `pyQt/pyside`, `pygtk` etc.), to a virtualenv.


title: How to make custom key type auto repeat in xkb

text: I have defined a custom key type in my xkb configure file to do some redirection (e.g. redirect `Ctrl`+`p` to `Up` etc.) However, I cannot get auto-repeat work for this custom type (neither the original key (e.g. `p`) or the redirect action (e.g. `Up` redirected from `Ctrl`+`p`) has auto-repeat). I have tried adding `repeat=true,` to `keysyms` configuration according to this from xfree86 mailing list but it doesn't work either.


title: Ext4 support in Grub 0.9X (legacy) and Grub 1.9X (Grub2)

text: I'm about to setup my new USB key with Grub or Grub2. In the old days I used ext2 for the boot partition. I'm wondering if I could use ext4 for Grub2? And if use Grub 0.9X, what about support of ext3?


title: wget to get list of files

text: im using `wget` in a bash script to get a list of files from a website, the files are sequential and in the format http://site.com/00001.csv etc, is there a way to terminate/end the script when I hit the last file? This is the script I have so far.               #!/bin/bash      url="site.com";      for a in {00000001..18923230} do      wget -nc -q ${url}$a.csv      done


title: jetty repositories for Debian lenny 5.0?

text: This is my current sources.list, and I wish to install libjetty-java, libjetty-extra-java, and jetty, in that order. However, the packages are not found, and I resorted to downlaoding the debs from `http://dist.codehaus.org/jetty/deb/` and fetching the dependencies viz. libslf4j-java libservlet2.5-java manually.               deb http://http.us.debian.org/debian    lenny           main contrib non-free     deb http://security.debian.org          lenny/updates   main contrib non-free          deb http://http.us.debian.org/debian    lenny       main contrib non-free     deb-src http://http.us.debian.org/debian/   lenny       main contrib non-free     deb http://security.debian.org/         lenny/updates   main contrib non-free     deb-src http://security.debian.org/     lenny/updates   main contrib non-free      My question is, is there a debian repository for jetty? If not, will the above method beproblematic in the long run? I ask, because I wont be eligible for automatic upgrades and the machine will be a production server. Thanks.


title: What's the difference between a normal user and a system user?

text: Some documentation I'm going through has a boolean switch on whether or not a user is a 'system' user or a 'normal' user defaulting to 'normal'). What is the difference between these two modes of user-ship? I'm not new to basic UNIX concepts, but I am pretty new to UNIX sysadmin.


title: Ubuntu: On a network with many clients there are two machines that can't access the web via a browser at the same time

text: Ok I'm pulling my hair out over this one. We have a wireless network with many clients all working well except two Ubuntu clients running 10.10 that can't access the internet via a browser at the same time. They can both still ping, use Skype etc but can't browse. As soon as the one that can browse exits the network browsing returns for the other and vice versa. As ping and Skype was working I assumed some kind of DNS problem but moving over to OpenDNS didn't solve it, nor did restarting networking or using wired rather than wireless. We also switched out the router, and it still persisted so I'm sure this isn't a network issue. The two clients are both laptops and work fine together on a wireless network at another office (which we don't control). I'm thinking something must be cached from the other network they both use that's causing this but have no idea what. Does anyone have any ideas? I just don't know where to go from here.


title: SSH tunnelling outgoing traffic shaping

text: I am using an OpenSSH server for a client app that uses the traffic forwarding, SSH tunnelling and some users are consuming an extraordinary amount of bandwidth. Is there a way to shape the traffic on SSH port output or SSH/TCP/IP Session and make sure that the fair amount of bandwidth gets distributed for each connected user? I have come across of this site and modified the script, but I was wondering if there is a better solution to resolve the occurred problem.               tc qdisc add dev eth0 root handle 1: htb     tc class add dev eth0 parent 1: classid 1:1 htb rate 4096kbps     tc class add dev eth0 parent 1:1 classid 1:5 htb rate 2048kbps ceil 2208kbps prio 1     tc filter add dev eth0 parent 1:0 prio 1 protocol ip handle 5 fw flowid 1:5          iptables -A OUTPUT -t mangle -p tcp --sport 22 -j MARK --set-mark 5


title: How do I get Synaptic's detailed description pane back?

text: The Synaptic package manager's main window used to look similar to this (up to at least version 0.63): ![enter image description here](http://i.stack.imgur.com/0mqyY.png) Note the three panes. However, in version 0.75, it looks like this: ![enter image description here](http://i.stack.imgur.com/GgDak.png) So where did the detailed description pane (bottom right, first picture) go? And how do I reinstate it? This is really a make or break feature for me when browsing packages quickly.


title: How do I execute a newly installed application with Sudo?

text: I have just installed an application on my Amazon EC2 instance called sshpass. I am having trouble getting it to work properly ( although, it works correctly on a non AWS instance ). I've read in some forums that I may need to run it as the root user for it to work properly. On an AWS instance, I must run applications with sudo to run them as the root user. When I try to execute sshpass with `sudo sshpass` bash outputs 'command not found.' Where & how do I configure sudo so that I can run sshpass as root using sudo?


title: How can I bind my ctrl+b so that I don't need to press it to resize my pane?

text: I managed to be able to resize panes in tmux thanks to this answer.   But now I press `CTRL-b` and then `e` each time I want to resize the pane (e.g. make larger to the left).   How could I bind the `CTRL-b` as well so I only press a single key e.g. just `e` and resize the pane (instead of pressing `CTRL-b` and then `e`)?


title: How does a debugger work in Linux?

text: How does a debugger work in Linux? How does it gets 'attached' to an already running executable or process. I understand that compiler translates code to machine language, but then how does debugger 'know' what it is being attached to?


title: mknod permanent in archlinux

text: I have a custom kernel module (on ArchLinux) that I can load manually and interact with. What I would like to do is have it loaded at boot time. So far I have managed to get the device appear in `/proc/devices` when booting. How to make a node out of it at boot time is what is haunting me. Having looked at `udev` most examples use USB drives as guides which is not the case for me. The actual device is a custom made IO card. It is a character device. Below is the script to load the device from the shell (which works):               #!/bin/sh     sudo insmod ./robsio.ko     DEV=`cat /proc/devices | grep robsio | awk '{print $1}'`     sudo mknod /dev/proc/robsio c $DEV 0


title: What is the difference between a Library call and a System call in Linux?

text: I would like to know what is the difference between a Library call and a System call in Linux. Any pointers for a good understanding of the concepts behind both will be greatly appreciated.


title: How to get this OUTPUT? perl/awk/sed? How?

text: How can I generate from this INPUT in "general" INPUT (/proc/net/ip_conntrack)               udp      17 0 src=192.168.1.128 dst=91.120.112.125 sport=29249 dport=39802 packets=3 bytes=408 [UNREPLIED] src=91.120.112.125 dst=79.132.235.112 sport=39802 dport=29249 packets=0 bytes=0 mark=0 use=2     udp      17 146 src=192.168.1.128 dst=98.196.37.3 sport=56932 dport=43645 packets=924 bytes=406167 src=98.196.37.3 dst=79.132.235.112 sport=43645 dport=56932 packets=1042 bytes=546092 [ASSURED] mark=0 use=2     tcp      6 118 SYN_SENT src=192.168.1.129 dst=89.132.51.110 sport=2518 dport=47385 packets=2 bytes=104 [UNREPLIED] src=80.132.51.190 dst=79.132.235.112 sport=47385 dport=2518 packets=0 bytes=0 mark=0 use=2     udp      17 147 src=192.168.1.128 dst=98.196.37.7 sport=56937 dport=43647 packets=924 bytes=406167 src=98.196.37.7 dst=80.132.235.117 sport=43647 dport=56937 packets=1042 bytes=546092 [ASSURED] mark=0 use=2     tcp      6 119 SYN_SENT src=192.168.1.129 dst=89.132.51.110 sport=2514 dport=47384 packets=2 bytes=104 [UNREPLIED] src=80.132.51.194 dst=80.132.235.114 sport=47384 dport=2514 packets=0 bytes=0 mark=0 use=2     udp      17 163 src=192.168.1.111 dst=192.168.1.201 sport=67 dport=68 packets=29 bytes=9512 src=192.168.1.201 dst=192.168.1.1 sport=68 dport=67 packets=27 bytes=8856 [ASSURED] mark=0 use=2     tcp      6 1 TIME_WAIT src=192.168.1.201 dst=67.201.31.15 sport=55479 dport=80 packets=7 bytes=725 src=67.201.31.35 dst=79.132.235.112 sport=80 dport=55479 packets=5 bytes=1963 [ASSURED] mark=0 use=2      to this output? OUTPUT               udp 192.168.1.128   3     tcp 192.168.1.129   2     udp 192.168.1.111   1     tcp 192.168.1.201   1      So that from the INPUT datas the OUTPUT would be 3 columns:               protocoll   src-ip-address  count-connection-numbers      So that the IP with the most number of connections would be at top.


title: Package management strategy with Pacman

text: Since I switched my favorite distro to Gentoo I have been very familiar with the following pattern for installing and removing packages:   1. Install a bunch of applications that do pretty much the same thing to try them out: `emerge <package>`. This command installs the package, and mark the package as explicitly installed.   2. Do try them out and remove those I don't like (and hopefully keep one or two that satisfy my needs): `emerge --deselect <package>`. This command removes the package from the list of explicitly installed applications, but does not uninstall the package.   3. Finally remove everything that is not required on my system: `emerge --depclean`. This command removes all packages that are (1) not a system package, (2) not installed explicitly and (3) not a dependency of those two.   4. And optionally check that all package dependencies are OK: `revdep-rebuild`. This command checks all dependencies and reinstall broken packages. Once in a while I would look at the entries in `/var/lib/portage/world` (the list of explicitly installed packages) to review the **top-level** applications that I use, and remove those that I don't use anymore using the commands in step 2, 3 and 4. Now that I'm trying to learn Arch, I wonder if I could use the same strategy with Pacman? Or another strategy that can keep my system **clean** of unused packages? Note: the Pacman Rosetta helps a lot in quickly understand things, but I could not figure out Arch's equivalent of the `/var/lib/portage/world` file. `pacman -Qe` is said to do it, but it contains things that I swear I haven't explicitly installed... Anyway please answer this question in terms of strategy (with command examples, of course :)


title: How to troubleshoot the old X applications working incorrectly on modern X servers?

text: I have an old X application provided as a part of a complicated signal processing package. The application resides on the display-less server, and clients having different X-servers connect to it. On old linux client systems, such as RHEL5, application draws fine, but on modern linux client systems, like RHEL6, Centos5, Ubuntu10 drawing is flawed - windows are blank, or not refreshing, or garbled, or have empty squares behind the previously obscured parts. Problems partially perished when X server was tuned to use the BackingStore option, but that was only the minor improvement. How can I troubleshoot the application to make it draw the windows contents properly? Any specific extensions and/or workarounds must be enabled? Any old X bugs/specifics must be "supported"? EDIT: I have uploaded a dump of `xdpyinfo` of a working client here: http://pastebin.com/W0WHQ8hx and non-working client here: http://pastebin.com/X49c6ckW. Looks like the major difference is in `PseudoColor` visuals existing on working client and absent on non-working client, but I'm not sure if that matters.


title: How to check why the cdrom cannot be open exclusively

text: Sometimes when I try to burn an ISO image, the message that "/dev/sr0" cannot be open exclusively appears. `lsof` does not shows any program that opens "/dev/sr0" (I checked for aliases too).


title: What does 'uni' mean in unistd.h

text: What does _uni_ mean in **unistd.h** Does it mean unix? or universal?   What is it?


title: Why my SSDs are in /dev/hdx instead of /dev/sdx on CentOS 5.9?

text: I have two SSDs Kingston SH103S3240G plugged on SATA ports of my Intel Server Board S3000AH. The SSDs apear like a PATA device (hdx instead of sdx) on my CentOS 5.9. I'm having problems related to high iowait. Does this have something related? On motherboard setup the `SATA mode` are `Enhanced`.


title: Is there a standard way to configure what policy iptables loads on startup under Debian?

text: I've just started playing with Debian 6.0 (Squeeze) in a VPS environment, as a way to learn more about system administration. One thing I'd like to configure is a default packet filtering policy. (Permit new and established SSH inbound, permit rate limited ICMP inbound, drop everything else inbound, permit anything outbound, etc etc) I've determined how to build a policy which roughly meets my needs, however there doesn't seem to be an existing init script which specifies where iptables should load its policy from on startup. Is there a standard way to do this on Debian? I've seen various alternatives suggested, all of which seem to involve creating a shell script somewhere somewhere and invoking it in RC scripts, initscripts, `/etc/network/interfaces`... Is there no 'blessed' way to do this in Debian? It seems like a fairly glaring oversight.


title: How to cut part from log file?

text: I have 8 Gb long log file (Rails production log), and I need to cut part between some dates (lines). Which command i have to use, to do this?


title: Read the stack of another process?

text: I'm trying to read a child process's stack but with no luck. I know it is possible using `ptrace`, but `ptrace`'s interface allows you to read only one word at a time, and I'm trying to scan a larger portions of the stack. I've also tried reading the `/proc/$pid/mem` from the boundries of the stack as extracted from the `/proc/$pid/maps` file after first using ptrace to attach to it (as suggested here) but the read keeps failing (even when running as root) although the same code succeeds when tried reading from different parts of the process (e.g. heap). What am I doing wrong? Is there any other option?


title: How do open files behave on linux systems?

text: I just renamed a log file to "foo.log.old", and assumed that the application will start writing a new logfile at "foo.log". I was surprised to discover that it tracked the logfile to its new name, and kept appending lines to "foo.log.old". In Windows, I'm not familiar with this kind of behavior - I don't know if it's even possible to implement it. How exactly is this behavior implemented in linux? Where can I learn more about it?


title: What is the meaning of $? in a shell script?

text: When going through one shell script, I saw the term "$?". What is the significance of this term?


title: How to enable remote login?

text: Currently I can only login to my remote linux via the "ubuntu" user account, without a password (via SSH authentication). I have another user configured on the machine, and if I try to login with its username + password I get > Disconnected: No supported authentication methods available How do I configure this user to accept user/pass authentication?


title: E: python-setuptools upgrade fails, apt-get broken

text: I wanted to install gnome-maps with apt-get, and then I got this error:               Preparing to unpack .../python-setuptools_3.4.1-1_all.deb ...     Unpacking python-setuptools (3.4.1-1) over (3.3-1) ...     dpkg: error processing archive /var/cache/apt/archives/python-setuptools_3.4.1-1_all.deb (--unpack):      trying to overwrite '/usr/lib/python2.7/dist-packages/build', which is also in package python-pyaudio 0.2.7-2+b1     dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)     Errors were encountered while processing:      /var/cache/apt/archives/python-setuptools_3.4.1-1_all.deb     E: Sub-process /usr/bin/dpkg returned an error code (1)      It wants to update `python-setuptools` package, but somehow fails,               apt-get -f install     apt-get clean     dpkg --configure -a      does not help. When i try to install sth now it says                sudo apt-get install sup     Reading package lists... Done     Building dependency tree            Reading state information... Done     You might want to run 'apt-get -f install' to correct these:     The following packages have unmet dependencies:      python-setuptools : Depends: python-pkg-resources (= 3.3-1) but 3.4.1-1 is to be installed     E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).      I am running Debian unstable. /var/log/dpkg.log gives:               2014-04-04 13:16:10 startup archives unpack      2014-04-04 13:16:10 upgrade python-setuptools:all 3.3-1 3.4.1-1      2014-04-04 13:16:10 status half-configured python-setuptools:all 3.3-1      2014-04-04 13:16:10 status unpacked python-setuptools:all 3.3-1      2014-04-04 13:16:10 status half-installed python-setuptools:all 3.3-1      2014-04-04 13:16:10 status unpacked python-setuptools:all 3.3-1      2014-04-04 13:16:11 status installed python-setuptools:all 3.3-1       complete: link


title: How to keep Bash running after command execution?

text: I would like to run something like this:               bash -c "some_program with its arguments"      but to have an interactive bash keep running after `some_program` ends. I'm sure `-c` is not a good way as `man bash` seys: > An interactive shell is one started without non-option arguments and without > the -c option So how to do this ? The main goal is described here **NOTE**   * I need to terminate `some_program` from time to time   * I don't want to put it to the background   * I want to stay on the `bash` then to do something else   * I want to be able to run the program again


title: AWK - every thing in one line?

text: Hello can I make several changes in a file using just on line with awk? For example, transform this:               awk < towhee_input5 -v k="$nstep" 'NR==18 {$0=k}{print}'> towhee_input6     awk < towhee_input6 -v t="$p" 'NR==22 {$0=t}{print}'> towhee_input7     awk < towhee_input7 -v t="$p" 'NR==24 {$0=t}{print}'> towhee_input8     awk < towhee_input8 'NR==82 {$0=".false."}{print}'> towhee_input9      into this:               awk < towhee_input -v "$nstep" -v t="$p"  'NR==18 {$0=k} NR==22 {$0=t} NR==24 {$0=t} NR==82 {$0=".false."}'


title: Unable to get the right exit code from a script

text: I have a script which connects to a remote server via SFTP and get some file from there. My script goes like this:               /usr/bin/sftp USER@remote.server.com <<EOF     lcd /dir1/dir2/dir3     cd /rsdir1/rsdir2/rsdir3     get file_pattern`date -d "last month" +%m%Y`.csv     EOF     rc=$?             if [[ $rc != 0 ]]                then             echo "Error occured getting file and the script abended with error code $rc" `date "+%Y-%m-%d-%H.%M.%S"`                 exit 1         else         echo "Successfully transferred the file" `date "+%Y-%m-%d-%H.%M.%S"`             fi      However, even if the script doesn't find the file with the pattern it goes to the **else** part of the script and gives me the output on the screen as               Connecting to remote.server.com...     sftp> lcd /dir1/dir2/dir3     sftp> cd /rsdir1/rsdir2/rsdir3     sftp> get file_pattern032014.csv     Couldn't stat remote file: No such file or directory     File "/rsdir1/rsdir2/rsdir3/file_pattern032014.csv" not found.     Successfully transferred the file YYYY-MM-DD-24HH.MI.SS       Any advices on what I might be doing wrong here?


title: Why is the firewall off by default with Linux Mint?

text: One of the most common recommendations that I read for users that recently installed Linux Mint is to enable their firewall, which is pretty simple to do. But why is the firewall off by default in the first place? Is there any reason for this?


title: Apache 2.4 mp4 streaming out of the box

text: I used mod_h426 to stream mp4s on Apache 2.2. I've updated Apache to 2.4, which obviously broke the mod, so I had to recompile it. But I tested my vod setup without the mod, and mp4s stream just fine. Does Apache 2.4 provide built-in streaming capability? If not, how is it possible that everything works?


title: Problem mounting GPT disk partition

text: I am trying to mount a partition on a GPT disk, but I get the following error:               $ sudo mount -t ext4 /dev/sda1 disk/     mount: special device /dev/sda1 does not exist      Looking at dmesg, I don't see any errors on /dev/sda:               $ dmesg | grep sda     [    1.367508] sd 0:0:0:0: [sda] 5860533168 512-byte logical blocks: (3.00 TB/2.72 TiB)     [    1.367514] sd 0:0:0:0: [sda] 4096-byte physical blocks     [    1.367607] sd 0:0:0:0: [sda] Write Protect is off     [    1.367611] sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00     [    1.367654] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA     [    1.367936]  sda:     [    1.392417] sd 0:0:0:0: [sda] Attached SCSI disk      fdisk reports the GPT partition:               $ sudo fdisk -l /dev/sda          Disk /dev/sda: 3000.6 GB, 3000592982016 bytes     256 heads, 63 sectors/track, 363376 cylinders     Units = cylinders of 16128 * 512 = 8257536 bytes     Sector size (logical/physical): 512 bytes / 4096 bytes     I/O size (minimum/optimal): 4096 bytes / 4096 bytes     Disk identifier: 0x00000000             Device Boot      Start         End      Blocks   Id  System     /dev/sda1               1       45423   366283322+  ee  GPT     Partition 1 does not start on physical sector boundary.      parted fails:               $ sudo parted /dev/sda print     Error: /dev/sda: unrecognised disk label      kernel seems to have support for EFI (followed this article)               $ cat /boot/config-2.6.32-5-amd64 | grep EFI     CONFIG_EFI=y     CONFIG_FB_EFI=y     CONFIG_EFI_VARS=m     CONFIG_CACHEFILES=m     # CONFIG_CACHEFILES_DEBUG is not set     # CONFIG_CACHEFILES_HISTOGRAM is not set     CONFIG_EFI_PARTITION=y      How can I mount this GPT partition? EDIT: I've just attached the same disk that is failing to another machine and I can see the contents without a hitch. Putting it back to the original box, I am having the same issue.


title: How to install red5 & Java on centos 6.4

text: There are many tutorials out there but not so many for 6.4 and it seems people are having problems with running either Java 6 or 7 and Ant. So does anyone know where to find a definitive guide? Should Java be version 6 or 7 and can I just `yum install java`? Then which version of `red5` should I be installing? On their site they have video tutorials that don't even reflect the sitemap of their site! so confused..


title: Only 5GHz networks showing, 2.4GHz networks hidden

text: I've just installed debian on my Lenovo E530 laptop and have been trying for the past couple of hours to get the 2.4GHz wireless to work. All of the wireless in my home and most of the places I go is 2.4GHz. There seems to be very little (if any) information regarding this online. If you required any output, please request and I will update this post. My network controller: `03:00.0 Network controller: Broadcom Corporation BCM43228 802.11a/b/g/n `


title: How can I find out where an RPM came from?

text: I have an RPM that is sitting on a server I inherited. On the server is an RPM that is needed for one of the applications that it runs.               xmlrpc-epi-0.54.2-1.x86_64.rpm      Rather than using this mystery rpm, I want to find the equivalent package on epel. `yum search xmlrpc` returns over a dozen results. **How can I find out where this RPM came from** , or at least verify if it is the same package that exists on one of the common repos (epel). The most information I can find is with `rpm --query`:               [root@us-devops-build02 tmp]# rpm --query --info -p xmlrpc-epi-0.54.2-1.x86_64.rpm     Name        : xmlrpc-epi                   Relocations: /     Version     : 0.54.2                            Vendor: none     Release     : 1                             Build Date: Wed 23 Oct 2013 09:08:24 PM UTC     Install Date: (not installed)               Build Host: foo.bar     Group       : default                       Source RPM: xmlrpc-epi-0.54.2-1.src.rpm     Size        : 1060096                          License: unknown     Signature   : (none)     Packager    : <autobuild@foo.bar>     URL         : http://example.com/no-uri-given     Summary     : no description given     Description :     no description given      **Edit1**   Reasoning:   The previous admin had a script that would use this RPM. I don't know why he used this special snowflake instead of using a package from epel. I'm moving the script to puppet so I'd like to use official sources as much as possible. **Edit2**   `rpm -kv` shows the following               rpm --checksig --verbose xmlrpc-epi-0.54.2-1.x86_64.rpm     xmlrpc-epi-0.54.2-1.x86_64.rpm:         Header SHA1 digest: OK (2f2f1619cd1e251cc37675b57656f1394c74024e)         MD5 digest: OK (656e5696da9f259a47725dacd38b9697)      **Edit3** Here are all the 'xmlrpc' packages on epel               sems-xmlrpc2di.x86_64 : XMLRPC interface for SEMS     xmlrpc-c-c++.i686 : C++ libraries for xmlrpc-c     xmlrpc-c-c++.x86_64 : C++ libraries for xmlrpc-c     xmlrpc-c-client.i686 : C client libraries for xmlrpc-c     xmlrpc-c-client.x86_64 : C client libraries for xmlrpc-c     xmlrpc-c-client++.i686 : C++ client libraries for xmlrpc-c     xmlrpc-c-client++.x86_64 : C++ client libraries for xmlrpc-c     xmlrpc-c-devel.i686 : Development files for xmlrpc-c based programs     xmlrpc-c-devel.x86_64 : Development files for xmlrpc-c based programs     xmlrpc3-javadoc.noarch : Javadoc for xmlrpc3     erlang-xmlrpc.x86_64 : HTTP 1.1 compliant XML-RPC library for Erlang     koji-hub.noarch : Koji XMLRPC interface     lua-xmlrpc.noarch : Lua package to access and provide XML-RPC services     php-ZendFramework2-XmlRpc.noarch : Zend Framework 2: XML-RPC Component     php-xmlrpc.x86_64 : A module for PHP applications which use the XML-RPC protocol     python-offtrac.noarch : Trac xmlrpc library     python-wordpress-xmlrpc.noarch : WordPress XML-RPC API Integration Library     trac-xmlrpc-plugin.noarch : Allows Trac plugins to export their interface via XML-RPC     xmlrpc-c.i686 : A lightweight RPC library based on XML and HTTP     xmlrpc-c.x86_64 : A lightweight RPC library based on XML and HTTP     xmlrpc-c-apps.x86_64 : Sample XML-RPC applications     xmlrpc3-client.noarch : XML-RPC client implementation     xmlrpc3-client-devel.noarch : Source for XML-RPC client implementation     xmlrpc3-common.noarch : Common classes for XML-RPC client and server implementations     xmlrpc3-common-devel.noarch : Source for common classes of XML-RPC     xmlrpc3-server.noarch : XML-RPC server implementation     xmlrpc3-server-devel.noarch : Source for XML-RPC server implementation


title: How to get numbers by using regular expression, but only last one

text: In this example I can get `00`.               expr match "00 foo 99.jpg" '[^0-9]*\([0-9]\+\).*$'      I want to know how to get last number from string, in this case `99` by using regular expression. The string may contain only a set of numbers like "foo00.jpg", or several of them like "00 foo 11 bar 22 foo.jpg". How can I write the regular expression?


title: Why does my system freeze during bootup unless I boot into recovery mode?

text: I installed some packages, and now when I try to boot into it normally it freezes at this point. ![enter image description here](http://i.stack.imgur.com/WPfKY.jpg) The only thing I can do from there is reboot the system. When I do that, this is what's displayed. ![enter image description here](http://i.stack.imgur.com/BsGmb.jpg) The only way to boot into my system is to select "recovery mode," and then when the menu comes up select "continue booting." What happened to my system? This is Ubuntu 13.10.


title: Lost control of the windows sent to monitor on HDMI, which xrandr doesn’t detect

text: I have set two monitors—one is a usual monitor, and the second one is an HDMI TV. The configuration is done in a single xorg.conf file. The problem is that the second display seem to be working, i.e. it shows my wallpaper after I start the computer, I can put windows there by specifying `DISPLAY=:0.1`, I do run mpv on the TV this way, sound over HDMI works fine as well. But I lose control of the window since it has been sent to the TV. If I open a terminal and run mpv from there, like               DISPLAY=:0.1 mpv --profile=hdmi file.mkv      it runs window on TV, passes sound to TV, but any input to the terminal is ignored—I cannot set player on pause or rewind. The keys in my window manager that must switch focus to another screen also not seem to be working, I can move mouse over the other screen, but RMB (that should set mpv on pause) doesn’t work, too. So I’ve checked `xrandr` output and… it told me that I don’t even have the HDMI connected. However, `nvidia-settings` shows my dual monitor setup properly. ![shows](http://i.stack.imgur.com/0Xzfe.png) Now about configuration:   * It’s Gentoo amd64, kernel 3.12;   * Xorg 1.14.3;    * xrandr program version 1.4.1;   * Server reports RandR version 1.4;   * nvidia-drivers 331.20;   * It is a desktop with a discrete video card GF 550Ti, not a laptop.


title: Trying to pass user generated variable to an external command

text: I have a bash script that is asking a user for input, then passes that variable to a find command. I've tried quoting/escaping the variable every way I know, but it keeps failing.               read -p "Please enter the directory # to check: " MYDIR     count=`/usr/bin/find /path/to/$MYDIR -name *.txt -mmin -60 | wc -l`     if [ $count != 0 ]         then               echo "There have been $count txt files created in $MYDIR in the last hour"         else               echo "There have been no txt files created in the last hour in $MYDIR "         fi      When running, I get this:               Please enter the directory # to check: temp_dir          /usr/bin/find: paths must precede expression     Usage: /usr/bin/find [-H] [-L] [-P] [path...] [expression]     There have been no txt files created in the last hour in temp_dir


title: Automagically upgrade Ubuntu 10.10 32bit to 12.10 64bit

text: I'm looking for a little advice, I would like to do an upgrade preferably through the update manager from my current 10.10 32bit Ubuntu Box, to 12.04 64bit, can anyone think of anyway I could do this without doing a full re- install of my linux partition? My reckoning is even if I tell the update manager to just goahead and do it, it will install 12.04 32bit any advice?


title: Allow remote MySQL to a specific IP - using CentOS 6.4

text: I've spent a day now trying to find out how to allow remote MySQL to work for my other virtual server. This is proving very difficult so I'm hoping you guys could help me out ;( I've used the command:               GRANT ALL PRIVILEGES ON *.* TO root@'VPS_IP_HERE' IDENTIFIED BY 'PASS_HERE';"      After I ran a query to select all the user and their host, which got me this: ![Image of what the query returned](http://i.stack.imgur.com/qe7Cc.png) As you can see, filtered in red is the correct IP address to my VPS, though when I try connect to the database it doesn't allow it, it shows "Connection not allowed" or so. I've tried to look through some guides, but that doesn't seem to work!


title: Samba not working

text: I'm trying to follow this guide: http://www.sitepoint.com/ubuntu-12-04-lts- precise-pangolin-file-sharing-with-samba but I'm sure there are many of them. I've had problems with Samba before. In fact in my xx years of life on Linux I have never successfully setup Samba. The steps would be:   1. Update your system   2. Install samba              $ sudo apt-get install samba samba-common winbind        3. Configure windbind              $ sudo gedit /etc/nsswitch.conf      and "wins" to the hosts line.   4. Reboot   5. "Having done this you should now be able to select ‘GO > Network’ from the desktop menu and view your entire Windows and Linux based network." But in my case I just see "Windows network" which is an empty folder and that's all. No shares from windows neither Linux PC's. Can anyone tell me what I'm missing or doing wrong?


title: Looking for small distro (to be installed automatically, with g++ and javac)

text: I'm looking for linux distro only with comand line and i need in it only g++,javac,python. I found Damn Small Linux but it dont have g++ and javac. It should have it out of the box because linux will be instaled by a script in virtual machine (qemu KVM). A easy way to get prepare my linux would by as much appreciate as linux itself. Distro should be as small as possible. Any ideas?


title: CentOS server migration

text: I have 2 dedicated servers at the moment both running CentOS 5.3 and Plesk 10, but I'm about to give up trying to transfer the data from old one to a new one, because they just wouldn't connect via Plesk. Is there any other less painful way to transfer all the data and settings? Files, databases, emails, domains, I need it all on a new server.


title: Does window minimizing free memory usage?

text: Both the undisplayed maximized window and minimized window are invisible to the end user. By undisplayed I mean an inactive maximized window covered by the active window. There is a difference however---which becomes evident in application-switching services, as with Compiz: the maximized window's appearance is "known" to the Window Manager (hence it can produce a thumbnail), while the minimized window's represented by an icon only (the appearance/content of the window is not computed). So does this mean memory is freed when a window is minimized? Is there a limit imposed by memory to the number of window a WM can have maximized? If there is such a limitation is it substantial / relevant? Imagine a WM which does not allow minimizing (but merely switches between maximized windows): would this WM be imposing considerable limitations to the end user because of memory usage? Thanks for clearing this up---I may have the wrong idea.


title: Run getty on a serial port on startup on RHEL

text: I want to put a getty on ttyS2 on a RHEL 6.1 box so I can use IPMI's serial- over-ethernet functionality to log in to a machine when SSH isn't working. In the past (on Ubuntu?), I used to add a line like this to /etc/inittab:               S1:2345:respawn:/sbin/agetty -h ttyS2 19200 vt100      But I see various files like /etc/init/start-ttys.conf, /etc/init/tty.conf, and /etc/init/serial.conf, and I suspect that the proper to do this on RHEL might be different. What's the right way to do this?


title: AES-GCM 256bit for SSL on nginx

text: Does an option exist for AES-GCM 256bit encryption for SSL connections with nginx? If so, how can I configure this as the only cipher used with my server? (I'm hardening my router, so requiring the latest browser isn't an obstacle for my implementation.)


title: How to reduce LVM size and increase one exsiting partition space

text: I want to increase 7 GB space in one of my existing partitions (`/dev/xvde1`), and reduce an LVM partition 7 GB (`/dev/mapper/vg--home-lv--home`). My total disk size is 40 GB. Detail of partitions is as follows:               # df -h     Filesystem            Size  Used Avail Use% Mounted on     /dev/xvde1            7.9G  7.5G   16M 100% /     tmpfs                 1.8G  144K  1.8G   1% /dev/shm     /dev/mapper/vg--home-lv--home                            31G   12G   19G  39% /home               # vgdisplay -C       VG      #PV #LV #SN Attr   VSize  VFree       vg-home   1   1   0 wz--n- 31.00g    0          # pvdisplay -c       /dev/xvde3:vg-home:65009705:-1:8:8:-1:4096:7935:0:7935:QjUeve-W7W1-fr44-2ENO-3CZy-mIM9-esIdpY          # /etc/fstab     UUID=4f669d3a-76c4-4847-a01d-10df9a96fd8e       /       ext4    grpquota,usrquota,rw    0       1     UUID=bbabd37e-628a-46e8-b384-66654b4c7916 swap                    swap    defaults        0 0     tmpfs                   /dev/shm                tmpfs   defaults        0 0     devpts                  /dev/pts                devpts  gid=5,mode=620  0 0     sysfs                   /sys                    sysfs   defaults        0 0     proc                    /proc                   proc    defaults        0 0     /dev/vg-home/lv-home    /home   ext4    defaults        0 0


title: `file` doesn’t show proper mime-type for .m2ts files

text: I need to define mime type of various video files and I got a problem with .m2ts files. Before I stumbled on this, I used `file` utility with `-iL` keys and parsed the output with `sed`. Today I found that `file` 5.15 defines mime type of .m2ts files as ‘application/octet-stream’. O-okay, I updated the package and now it calls them just ‘binary’. When I expected video/something. Reading about utilities doing similar job, I’ve tried `xdg-mime query filetype`. The problem with `xdg-mime` is that it looks only at the extension of the file. It defines .m2ts as ‘video/mp2t’, but shows it for any, even an empty text file with such extension. Maybe it was correct to call .m2ts files a stream because it is actually a stream, but then why in the mime database the extension is bound to ‘video/mp2t’?               $ grep m2ts /usr/share/mime/video/mp2t.xml       <glob pattern="*.m2ts"/>


title: Bash: Merge foldername from variable with filename

text: First I write a configfile with all my parameters like this               path="/home/test/"      I name it `test.conf`. Then I write a shell script with this content, name it `test`, and make it executable with `chmod +x`.               #!/bin/bash     #read the config file     . /home/test/test.conf          #cat the file /home/test/test     cat `$path`test #This line is the problem      I get this output               ./test/test: line 3: /home/test/: Is a directory     cat: test: No such file or directory      What I would like is that it shows me the content of the file `/home/test/test`. How do I write this script correctly, so that it doesn't make a new line after the file path?


title: u-boot compilation error

text: I am trying to build u-boot and getting these error               No private recovery resources for TARGET_DEVICE G0     Building U-boot     make -C u-boot ARCH=arm fio-om3xxx_config     make[1]: Entering directory `/home/mrigendra/GingerBread_2_3_4_FIO/u-boot'     Configuring for fio-om3xxx board...     rm: cannot remove `asm': Is a directory     make[1]: *** [fio-om3xxx_config] Error 1     make[1]: Leaving directory `/home/mrigendra/GingerBread_2_3_4_FIO/u-boot'     make: *** [uboot] Error 2      i don't know why it wants to remove asm directory. do anybody have idea from where i should start ..


title: How can I scp a file that my user can't read but I can sudo?

text: Can I use `scp` to copy a file from a remote server which my login user can't read, but where I have permission to sudo to root (without password even)? How?


title: KVM Guest installation

text: After ran below command               virt-install --name=vm01 --disk path=/var/lib/libvirt/images/vm01.img,size=10 --ram=512 --os-type=linux --os-variant=rhel6 --network bridge:br0 --nographics --cdrom=/home/ISO/ubuntu-12.04-server-i386.iso      I am facing below error               SeaBIOS (version seabios-0.6.1.2-26.el6)          gPXE (http://etherboot.org) - 00:03.0 C100 PCI2.10 PnP BBS PMM1FE0@10 C100          Booting from DVD/CD...     Loading bootlogo...          Initializing gfx code...     graphics initialization failed     Error setting up gfxboot     boot:     Loading bootlogo...          Initializing gfx code...     graphics initialization failed     Error setting up gfxboot     boot:      During Guest KVM installation I am facing above error but               [root@ramlo images]# virsh -c qemu:///system list      Id    Name                           State     ----------------------------------------------------      1     vm01                           running          unable to install Guest KVM


title: Can I trace a dash script without modifying its source code?

text: I would like to trace a shell script for debugging purposes without having to modify its source code (e.g. change the shebang or insert a `set -x` at the beginning). It is a dpkg postinst script, so not actually called by myself on the shell. In hope of finding an environment variable for this I searched the man page for `dash`, but could not find anything. Is there some way to do this?


title: Manually interacting with postfix mail queue

text: I need to manually be able to interact (check, remove, etc) with the postfix mail queue (through scripts and what-not). I know that this generally is a bad idea; so how can I interact with the queue without screwing things up? I believe one possible solution is to shutdown postfix, do work on the queue, and then start postfix?


title: xargs command results in sed: ;: No such file or directory

text: Trying to search and replace recursively across multiple files on a mac running OS X using the following command:               grep -rl string1 ./ | xargs sed -i ''  s/string1/string2/g \;      but it returns the following error:               sed: ;: No such file or directory


title: Question regarding linux installation (Kali Linux (Debian Based)

text: Please tell me that following steps will help me in installing Kali Linux dual boot with windows?   1. If I have 500GB and windows is taking all of it. I will create 100GB for Kali Linux by shrinking C.    2. After that a 100GB will be as unallocated space.   3. I'll boot into kali linux (through USB) and choose Graphical Install.   4. In partition disks section, I'll choose Manual and click on Continue.   5. Then it will show me 2 or 3 partitions (one will have 400GB and the other will have 100GB). I'll choose the 100GB.   6. After it will ask me that how to use this space. I will choose Automatically partition the free space instead of choosing create new partition. I hope that choose automatically partition the free space won't ask me anything to enter amount for swap etc.   7. After those steps, It will show me Yes and No options... The main question is in 6th point that is, If I choose automatically partition the free space. Then It will do everything automatically in that 100GB? like creating swap etc. It's so confusing if I do it manually that's why I am asking. I want that windows will be on 400GB partition and the linux will be on 100GB partition and it should automatically manage the partition for linux. I was reading an article regarding to Dual booting kali with windows 7. In that the author chose NO option at the GRUB Boot loader to the master boot record. But I think I should choose YES. The author after choosing NO, manually typed `/dev/sda5` in device for boot loader section. He said: By default, the installer will want to install GRUB, the boot loader, in the Master Boot Record (MBR). However, for setting up this dual-boot system, we want GRUB in the boot partition. So, select “No.” Continue. I don't think that Choosing YES will cause any problem. In that way too it will ask me to boot into the OS i want then Why I should follow the one shown in the article (of that author) and make everything confusing Please tell me that by following the above steps, I'll be able to install kali linux dual boot with windows or there will be any problem ?


title: Alternatives to Unity panel

text: Is there an alternative to Unity (top) panel that supports Mac style application menu integration? I'd like to have a Unity-like user experience on Debian.


title: How do I use the TPM to seal away data on an UEFI booted system?

text: I would like to seal away files on my system using keys stored in the TPM. Since my system uses UEFI to boot, I can no longer use TrustedGrub as a boot loader to maintain my trust chain. Are there any alternatives / ways to make use of the TPM on UEFI systems? Can Grub2 perhaps maintain the trust chain while booting UEFI?


title: systemctl to start cron-like job

text: In `/etc/systemd/system` directory I have: `rsnapshot-backup.service` file, with following content:               [Unit]     Description=rsnapshot backup automation [cron like]          [Service]     Nice=19     IOSchedulingClass=2     IOSchedulingPriority=7     ExecStart=/usr/bin/notify-send "Rsnapshot Hourly Backup In Progress"      and `rsnapshot-backup.timer` file, with following content:               [Unit]     Description=hourly rsnapshot backup          [Timer]     OnCalendar=*-*-* *:43:00     Persistent=true          [Install]     WantedBy=timers.target      But I don't see `notify-send` being triggered? What might be wrong? `systemctl list-timers` gives:               NEXT                          LEFT          LAST           PASSED                  UNIT                         ACTIVATES     Sat 2014-08-16 09:43:00 CEST  2min 37s left Sat 2014-08-16 09:31:18 CEST  9min ago rsnapshot-backup.timer       rsnapshot-backup.service      `systemctl status rsnapshot-backup.service` gives:               ● rsnapshot-backup.service - rsnapshot backup automation [cron like]         Loaded: loaded (/etc/systemd/system/rsnapshot-backup.service; static)         Active: inactive (dead) since Sat 2014-08-16 09:31:21 CEST; 11min ago         Process: 228 ExecStart=/usr/bin/notify-send Rsnapshot Hourly Backup In Progress (code=exited, status=0/SUCCESS)         Main PID: 228 (code=exited, status=0/SUCCESS)      `systemctl status rsnapshot-backup.timer` gives:               ● rsnapshot-backup.timer - hourly rsnapshot backup         Loaded: loaded (/etc/systemd/system/rsnapshot-backup.timer; enabled)         Active: active (waiting) since Sat 2014-08-16 09:31:16 CEST; 12min ago      **EDIT** Doing `journalctl -u rsnapshot-backup`, I can confirm that the service was successfuly started, however nothing seen on display (notify- send)..               -- Reboot --     Aug 16 09:43:14 ----------------- systemd[1]: Starting rsnapshot backup automation [cron like]...     Aug 16 09:43:14 ----------------- systemd[1]: Started rsnapshot backup automation [cron like].     Aug 16 10:00:06 ----------------- systemd[1]: Starting rsnapshot backup automation [cron like]...     Aug 16 10:00:07 ----------------- systemd[1]: Started rsnapshot backup automation [cron like].     Aug 16 10:19:04 ----------------- systemd[1]: Starting rsnapshot backup automation [cron like]...     Aug 16 10:19:04 ----------------- systemd[1]: Started rsnapshot backup automation [cron like].


title: Mosh doesn't reconnect

text: I installed mosh on a desktop and server yesterday (compiled latest v1.2.3 from source) and it works fine. I left the session open yesterday and have come into the office today to find my mosh session is dead, with the error along the top of the terminal window:               mosh: Last contact 14723 seconds ago. [To quit: Ctrl-^ .]       I thought mosh should auto reconnect, or do I have to manually tell it to reconnect? If so, how? Or, is it a setting I need to enabled somewhere, to auto reconnect? I left an SSH session open to the same server, this is still working just fine.


title: Use time ,timeout and ulimit commands properly

text: I'm running a command in CentOS and at the same time I want to do 2 things:   1. write the run time of the command to a file and    2. set a time limit which stops the command I implemented the first one successfully. Here's how it is:               (time ./minisat+_64-bit_static opb_clauses.txt ) 2>>../measures.txt      As you can see, I used the time command to count the time needed by the command and then I forwarded the time results to a file `measures.txt`. Here's a sample of `measures.txt`:               real    0m0.002s     user    0m0.000s     sys 0m0.000s      I'm trying to add the second thing like this:               (timeout 1s time ./minisat+_64-bit_static opb_clauses.txt ) 2>>../measures.txt      The results of this command messed up my file and returned something like this:               0.00user 0.00system 0:00.00elapsed 0%CPU (0avgtext+0avgdata 6368maxresident)k     0inputs+0outputs (0major+440minor)pagefaults 0swaps      As you can see, the results of the "real time" is somehow gone and the other results are in a different format. How can I separate the results of commands `time` and `timeout`? EDIT:A second thought is to use the ulimit command instead of timeout.I tried the same thing but with ulimit:                (ulimit -t 10 time ./minisat+_64-bit_static opb_clauses.txt ) 2>>../measures.txt      but this time i don't have any result written to measures.txt


title: support for utf-8 encoding with lpr

text: While trying to send a text file to the printer via `lpr` from `xterm`, the content was corrupted beyond recognition, the cause of which was ultimately traced to the encoding of the file. If I instead process the text with `iconv` (e.g., `iconv -f utf-8 -t ascii//TRANSLIT`), then the file is printed normally. Another suggestion I came across is setting the document format (e.g., `lpr -o document-format=text/utf8`), but this returns the error `lpr: Unsupported document-format "text/utf8"`. I could always alias the `lpr` command to include processing by `iconv`, but is there a more general way for native utf-8 support in the `CUPS`/`lpr` system? **Edit:** My OS is Debian 8 and my window manager is `openbox` (no desktop environment). I can print this file without any problem from MacOS X as well as from a Debian7/Gnome3 system. From my current system, I should point out that even after changing character encoding from UTF-8 to ASCII, the newline characters are not respected by `lpr`, so the lines are concatenated together and printed until the paper margin is reached. After recoding and transliteration with `iconv` on MacOS X, the printing still works normally (so the newline issue is also specific to my current system).


title: How to make GNU grep the default in FreeBSD?

text: I'm running FreeBSD 9.1-RELEASE. I've installed GNU grep with `portmaster textproc/gnugrep`. However the "default" grep for users is still FreeBSD grep.               # /usr/local/bin/grep -V     /usr/local/bin/grep (GNU grep) 2.12          # grep -V     grep (GNU grep) 2.5.1-FreeBSD      I want to make GNU grep the default. I understand that the problem is with the order of directories specified in my `PATH` environment variable:               # echo $PATH     /sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:/root/bin      However, I fear to move the `/usr/local/bin` entry to the beginning of my `PATH`. Is it safe? In Linux distros like Debian such tasks are usually accomplished via `dpkg- divert` and/or `update-alternatives`. What is the best way to do what I want in FreeBSD and not break system upgrades and such?


title: Why do I get "Permission Denied" errors even though I have group permission?

text: I'm trying to run a game called "Dofus", in Manjaro Linux. I've installed it with packer, that put it under `/opt/ankama` folder. This folder ownership (and for every file inside it) is root user, and games group. As said by the installing package, I've added myself (user `familia`) in the games group (by not doing so, "I would have to input my password everytime I tried to run the updater") However, when running the game, it crashes, after inputting my password (which shouldn't be required). Checking the logs, I've got some errors like those:               [29/08 20:44:07.114]{T001}INFO    c/net/NetworkAccessManager.cpp L87  : Starting request GET http://dl.ak.ankama.com/updates/uc1/projects/dofus2/updates/check.9554275D     [29/08 20:44:07.291]{T001}INFO    c/net/NetworkAccessManager.cpp L313 : Request GET http://dl.ak.ankama.com/updates/uc1/projects/dofus2/updates/check.9554275D Finished (status : 200)     [29/08 20:44:07.292]{T001}ERROR   n/src/update/UpdateProcess.cpp L852 : Can not cache script data      So, I suspect Permission Denied errors... An error message appears by a moment in![enter image description here](http://i.stack.imgur.com/YCGBq.png) That translates to "An error has happened while writing to the disk - verify if you have the sufficient rights and enough disk space". Then, after some research, I came across "auditd" that can log file accesses in a folder. After setting it up, and seeing which file accesses were unsuccessful, this is the result. All of those errors actually refer to a unique file, `/opt/ankama/transition/transition`, with a syscall to (`open`). This file's permissions are `rwxrwxr-x` (`775`). So, I've rwx permissions to it, yet it gives me an error `exit -13`, which is a `EACESS` error (Permission Denied). I've already tried to reboot the computer, to log in and log out. None of them worked. If I set the folder permissions to `familia:games`, it runs with no trouble, I don't even need to input my password. However, it doesn't seem right this way. Any ideas of why I get Permission Denied errors even though I have read/write/execute permissions? **EDIT:** Mark has said that I could need +x permissions in all directories of the path prefix. The path itself is `/opt/ankama/transition/transition`. The permissions for the path prefixes are: > /opt - drwxr-xr-x(755), ownership root:root > > /opt/ankama - drwxr-xr-x(755), ownership root:games > > /opt/ankama/transition - drwxrwxr-x(775), ownership root:games However, one thing that I've noticed is that all subfolders of `/opt/ankama` are `775`, even though the folder itself is `755`. I don't think this means anything, and changing the permissions to `775` doesn't work. Also, Giel suggested that I could have AppArmor running on my system. However, running `# cat /sys/module/apparmor/parameters/enabled` gives me `N`.


title: Re-installing Ubuntu over a dual boot laptop

text: I am trying to get ubuntu back to work on my dual boot laptop (Win8 + Ubuntu 12.10). It happens that Ubuntu 12.10 is not loading, and even after checking and repairing errors from LiveCD. Further, this repair process also messed up with Win8, and had me repair it as well. So I decided just to get it a clean fresh install of Ubuntu on top of the "old" Ubuntu. This laptop has 2 disks with 500 gb each. It is organized like this:   * /dev/sda/     1. sda1 (fat32, labeled win recovery environment);     2. sda2 (ntfs, win8 loader);     3. sda5 (ext4, linux-secure-remix 12.10, 320Gb);     4. sda6 (swap)   * /dev/sdb/ 1.sdb1 (non-labeled) 2.sdb2 (non-labeled) **So my questions are** I am guessing that I should choose format and reinstall ubuntu over sda5 right? Do you think this will mess up with Win8? Should I instead install Ubuntu over sdb (and creating a swap there as well), while reformatting sda just to have Win8?


title: Auto-load B43 wifi card module in Arch Linux

text: I am using a Dell Vostro 1500 (looking to buy a new computer) and I have installed the wifi drivers with `b43-fwcutter` or whatever the actual name of it is, but you probably know what I'm talking about. I am having a problem where I need to enable the wifi kernel module every time I boot my computer, using `sudo modprobe b43`. How can I make this automatic? To make it clear I have tried a couple of things beforehand without success:   * http://www.cyberciti.biz/faq/linux-how-to-load-a-kernel-module-automatically-at-boot-time/   * http://stackoverflow.com/questions/10730096/how-to-autoload-a-kernel-module-in-gentoo-linux I may not have tried all of these methods or may have done them incorrectly. So go ahead and advice any of these and I will try them again just to make sure. I'm pretty sure I have tried them correctly and they didn't work however. Again, not all of them.


title: How to force the change of the LUKS password in every 90 days?

text: Using an Ubuntu 12.04 or a Red Hat Enterprise Linux Desktop 6 for Desktop, how can we force the users to change their LUKS passwords at every 90 days?


title: Opening a file with program in background from shell

text: The command to launch a program, say evince, from bash shell in background is               evince &      But what if I want to open some file with evince in background? Nor `evince myfile.pdf &` neither `evince & myfile.pdf` work as expected: the first outputs something like `[2] 5356 ` but in the next line the shell returns locked; the second opens an empty istance of evince. So, what syntax can I use?


title: How to Open Visual Studio 2013 Solution in MonoDevelop

text: My Toshiba Laptop had started running slow recently and, quite frankly, I was tired of Windows 8, so I created a USB of the most recent version of Linux Mint and installed it, moving all my needed projects to GitHub. I installed MonoDevelop because I know of its tendency for WinForms, but when I try opening the .sln file it opens it in a text editor in MonoDevelop rather than as a solution. I have two major Solutions I need to develop Yahtzee and GemsCraft. How do I open these solutions in MonoDevelop? Yahtzee is in VisualBasic and GemsCraft is in C#


title: Removing Ubuntu from a dual-boot install

text: I am an Arch Linux user and I decided to try out Ubuntu just because, not really liking it. Arch Linux was installed with a 3 partition setup (`/boot` `/swap` `/`) and then I installed Ubuntu. I gave Ubuntu 50GB and Arch has 100GB. Now, Ubuntu has taken power of Grub and it's the default thing that gets run (undesirable currently). How can I take Ubuntu off the hard drive and get the original Arch Linux setup? IIRC by default Arch Linux has like a... "(fallback initframs)" or something along those lines as an entry in Grub, aside from the main Arch and the memory tester. Any help is appreciated. I have not tried anything yet because, how do you say, I think this is a one-try thing.               eduan@eduan-Vostro-1500:~$ sudo fdisk -l     [sudo] password for eduan:           Disk /dev/sda: 160.0 GB, 160041885696 bytes     255 heads, 63 sectors/track, 19457 cylinders, total 312581808 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x00022bd0             Device Boot      Start         End      Blocks   Id  System     /dev/sda1   *          63      996029      497983+  83  Linux     /dev/sda2          996030     8996399     4000185   82  Linux swap / Solaris     /dev/sda3         8996400   214846334   102924967+  83  Linux     /dev/sda4       214847486   312580095    48866305    5  Extended     /dev/sda5       214847488   312580095    48866304   83  Linux          eduan@eduan-Vostro-1500:~$ cat /etc/fstab     # /etc/fstab: static file system information.     #     # Use 'blkid' to print the universally unique identifier for a     # device; this may be used with UUID= as a more robust way to name devices     # that works even if disks are added and removed. See fstab(5).     #     # <file system> <mount point>   <type>  <options>       <dump>  <pass>     proc            /proc           proc    nodev,noexec,nosuid 0       0     # / was on /dev/sda5 during installation     UUID=45b7e030-d275-490a-9b3e-dd52012cbd24 /               ext4    errors=remount-ro 0       1     # swap was on /dev/sda2 during installation     UUID=b8d7f8f2-ecbb-4fe2-a820-96b3e23611ad none            swap    sw              0       0          eduan@eduan-Vostro-1500:~$ cat '/media/81939e82-c05b-43a3-a722-5278535b2400    /etc/fstab'      #      # /etc/fstab: static file system information     #     # <file system> <dir>   <type>  <options>   <dump>  <pass>     UUID=1c1faf65-0236-4ef2-9acd-2dac88f683ab /boot ext4 defaults 0 1     UUID=81939e82-c05b-43a3-a722-5278535b2400 / ext4 defaults 0 1     UUID=b8d7f8f2-ecbb-4fe2-a820-96b3e23611ad swap swap defaults 0 0          eduan@eduan-Vostro-1500:~$ df -h     Filesystem      Size  Used Avail Use% Mounted on     /dev/sda5        46G  4.3G   40G  10% /     udev            987M   12K  987M   1% /dev     tmpfs           399M  896K  398M   1% /run     none            5.0M     0  5.0M   0% /run/lock     none            996M  856K  995M   1% /run/shm     /dev/sda3        97G   22G   71G  24% /media/81939e82-c05b-43a3-a722-5278535b2400          $ sudo df -h     [sudo] password for eduan:      Filesystem      Size  Used Avail Use% Mounted on     /dev/sda3        97G   22G   70G  24% /     dev             996M     0  996M   0% /dev     run             999M  812K  998M   1% /run     tmpfs           999M  3.9M  995M   1% /dev/shm     tmpfs           999M     0  999M   0% /sys/fs/cgroup     tmpfs           999M  218M  782M  22% /tmp     /dev/sda1       463M   33M  403M   8% /boot     /dev/sda5        46G  4.1G   40G  10% /mnt/45b7e030-d275-490a-9b3e-dd52012cbd24


title: what is the difference between Device driver and kernel module

text: i know that driver is a software that can communicate with the hardware in order to control the device that attached to the computer.whereas kernel module is a small piece of code that can inserted into the kernel to improve the performance of the kernel. I want to ask how do the driver work together with the kernel and what is the main difference between device driver and kernel module,also how do they work?


title: How to monitor traffic when SSH tunneling?

text: If I run:               ssh -fND localhost:6000 USERNAME@IPADDRESS -p PORTNUMBER      and I set my webbrowser to use 127.0.0.1:6000 SOCKS5 proxy, is there a way for the remote SSH server to monitor my web traffic? I've seen this post that allows traffic to be monitored on a per-user basis, but what can they do if there is only 1 SSH user, and that 1 SSH user is used by many people behind 1 public IP address/NATed network? I know that if I don't set `network.proxy.socks_remote_dns` to `true` in Firefox then they can see my DNS traffic, because it's resolved in my side. So the Q: What are the methods to monitor traffic on the remote SSH server if there is only 1 ssh user with many "real" users using it?


title: SSH tunneling through a busybox router

text: I have a busybox router and I'm able to login to the console using telnet & I also have access to the web interface. My question is, how can I create an ssh tunnel from my local network through the router so that I may be able to access my computer remotely? I'm looking for a command line based solution & I'm also aware of the fact that routers have low memory and very limited set of utilities. But although it's a minimal linux system having only a small subset of tools, but they do have utilities like route, iptables, etc. so I think may be it's possible. Also my knowledge of busybox system is quite low so if I'm wrong somewhere, feel free to correct me.


title: How to convert to HTML code?

text: Are there any scripts that can convert between text (e.g. `<hi>`) and the html entities version (`<hi>`) like this website does? Or at least a PHP file?


title: Linux axel write error

text: I was downloading a 4.0 GB file using axel. When it reached 98%, it displayed "Write Error". I still have 30+ GB of free disk space. I tried to run axel again, and got "Write Error" again. Here is the actual display:               State file found: 4251724925 bytes downloaded, 62428035 to go.     Starting download          ,,,,,,,,,, ,,,,,,,,,, ,,,,,.....               Write error!          Downloaded 5.0 kilobytes in 0 seconds. (0.00 KB/s)      How can I fix this?


title: How to negate a regex inside another regex

text: That is, given a POSIX regex X, what POSIX regex is the complementary of X? (in a more detailed way: how to get regex X' that matches all strings that are not matched by X, but doesn't match any string that is matched by X) If this is not available in POSIX, is there a common extension that has it?


title: Solution to get data from memory of a process

text: If I'm using Firefox and filling out a big form (with lots of text to write), and for some reason I accidentally press `F5` and all my text in the forms is lost, I can use e.g. HxD on Windows to retrieve the text, because they're still in memory. How can I do the same under Linux? (e.g. Fedora)


title: What is a standard command for printing a date in RFC-3339 format?

text: The `date` command doesn't offer such thing, which is kind of sad since RFC-3339 is the modern, widespread, sane format used everywhere (except in email which is neither modern nor sane). My timezone offset is currently -08:00 so the simplest form of this command should print the current time as `2013-09-05T14:58:33.102-08:00`.


title: How to delete a file in Arch console?

text: pacman stopped working and asked me to delete a file if "another package manager isn't working". What is the file for deleting files?


title: Format a Date field of a .CSV file with multiple commas in a string field

text: I have a .CSV file (file.csv) whose data are all enclosed in double quotes. Sample format of the file is as below:               column1,column2,column3,column4,column5,column6, column7, Column8, Column9, Column10     "12","B000QRIGJ4","4432","string with quotes, and with a comma, and colon: in between","4432","author1, name","890","88","11-OCT-11","12"     "4432","B000QRIGJ4","890","another, string with quotes, and with more than, two commas: in between","455","author2, name","12","455","12-OCT-11","55"     "11","B000QRIGJ4","77","string with, commas and (paranthesis) and : colans, in between","12","author3, name","333","22","13-OCT-11","232"      The 9th field is the date field in the format **"DD-MMM-YY"**. I have to convert it to the format **YYYY/MM/DD**. I am trying to use the below code, but of no use.               awk -F, '      BEGIN {      split("JAN FEB MAR APR MAY JUN JUL AUG SEP OCT NOV DEC", month, " ")      for (i=1; i<=12; i++) mdigit[month[i]]=i      }      { m=substr($9,4,3)      $9 = sprintf("%02d/%02d/"20"%02d",mdigit[m],substr($9,1,2),substr($9,8,20))      print      }' OFS="," file.csv > temp_file.csv      The out put of the file temp_file.csv after executing the above code is as shown below.               column1,column2,column3,column4,column5,column6,column7,Column8,00/00/2000,Column10     "12","B000QRIGJ4","4432","string with quotes, and with a comma, and colon: in between","4432","author1,00/00/2000,"890","88","11-OCT-11","12"     "4432","B000QRIGJ4","890","another, string with quotes, and with more than, two commas: in between","455",00/00/2002, name","12","455","12-OCT-11","55"     "11","B000QRIGJ4","77","string with, commas and (paranthesis) and : colans, in between","12","author3,00/00/2000,"333","22","13-OCT-11","232"      As far as I am understand, the issue is with the commas in the double quote as my code is taking them into consideration too... Please suggest on the below questions: 1) Does the double quoting all the values in all the fields make any difference? If they make any difference, how do I get rid of them from all the values except the strings with commas in them? 2) Any modifications to my code so I could format the 9th field which in the format **"DD-MMM-YYYY"** to **YYYY/MM/DD**


title: Can root kill init process?

text: Can root kill init process (the process with pid 1)? What would be its consequences?


title: Install newer unix sort command without root permission

text: The unix server I am using has an old version of sort installed (no -V option), would it be possible to install a newer version locally (I do not have root permissions)? Where would I download it and how would I install it? I would like this new version to be the default every time I connect to the server. As a reference I am using the following version:               sort --version     sort (GNU coreutils) 5.97     Copyright (C) 2006 Free Software Foundation, Inc.          echo $BASH_VERSION     3.2.25(1)-release          ./unix_distro.sh      Linux RedHat 5.5(Final 2.6.18-194.8.1.el5 x86_64)          uname -a     Linux tin.broadinstitute.org 2.6.18-194.8.1.el5 #1 SMP Thu Jul 1 19:04:48 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux


title: Wallpaper stretching over multiple monitors on Fedora 19 (Gnome 3)

text: I'm running Fedora 19 (`gnome-shell --version` says it's `GNOME Shell 3.8.4`). I have a dual monitor setup (two 1440 x 900), and I want to be able to stretch my wallpaper over the two monitors, like I did in my Ubuntu 12.04 on the same machine. I don't want different wallpapers for each workspace, nor different wallpapers for each monitor (that would be pretty cool, but falls out of scope of the question). What I want is a 2880 x 900 (or any 3.2:1 proportional image) to be shown half on one monitor, and half on the other: ![enter image description here](http://i.stack.imgur.com/IRxwI.jpg) # How I had set it on Ubuntu If I boot with my 12.04 LiveUSB, it starts in "mirror displays" mode. I have to disable display mirroring (enable extended monitors) in order to have different images on each screen: ![enter image description here](http://i.stack.imgur.com/0ZcXa.png) Then, I open the System Settings and on the Appearance section I can choose the background, and have several options. Chosing "span" ( _see the dialog on first image rightmost side_ ) will have the background like I want it to be. # How I (don't) have it on Fedora The System Setting screen doesn't have an "Appearance" icon, just a "Background" one, with no options at all. If I choose an image, it will be applied to each monitor repeatedly, like this: ![enter image description here](http://i.stack.imgur.com/odq8T.jpg)


title: How to allow to run su instantly after I added the user to the appropriate group

text: I have the `su` executable with the following permissions:               bash-4.2# ls -la /bin/su     -rws--s--- 1 root wheel 59930 Sep 14  2012 ./su      When I am logged in as a user, not in the `wheel` group and try to run `su`, I get an error, which is correct:               bash-4.2$ su     bash: /bin/su: Permission denied      After that I add this user to `wheel` group from `root`:               bash-4.2# usermod -a -G wheel user      But for the same terminal session I still can't run `su`:               bash-4.2$ su     bash: /bin/su: Permission denied      For the new sessions I can run `su`. How to allow to run `su` instantly after I added the user to the appropriate group?


title: wireshark: Couldn't run /usr/sbin/dumpcap in child process

text: > **Possible Duplicate:**   >  How to add write permissions for a group? When I run Wireshark, It shows the following message:               Couldn't run /usr/sbin/dumpcap in child process: Permission denied     Are you a member of the 'wireshark' group? Try running     'usermod -a -G wireshark _your_username_' as root.      I ran this command: `usermod -a -G wireshark myusername` and checked my groups using `groups myusername` and I was added to the _wireshark_ group. But I still get that error message.               [nima@nma ~]$ groups nima     nima : nima wheel dialout wireshark     [nima@nma ~]$ ls -l /usr/sbin/dumpcap      -rwxr-x--- 1 root wireshark 67884 Aug 16 12:04 /usr/sbin/dumpcap     [nima@nma ~]$ /usr/sbin/dumpcap     -bash: /usr/sbin/dumpcap: Permission denied      What's the problem?


title: Not able to change default group for user with `sudo usermod -g`

text: I have looked at the questions and answer here at U&L but I still cannot get my default group to change from a user.               [red@ws-red-l ~]$ whoami     red     [red@ws-red-l ~]$ groups     yellow green     [red@ws-red-l ~]$ sudo usermod -g green red     usermod: no changes     [red@ws-red-l ~]$ sudo usermod -G green red     [red@ws-red-l ~]$ groups     yellow green     [red@ws-red-l ~]$ touch file     [red@ws-red-l ~]$ ls -l file     -rw-r--r-- 1 red yellow 0 Feb 18 13:51 file      I would prefer if `red` did not belong to group `yellow` so when I do a `touch file` the group of the file would be `green`. What am I doing wrong here?


title: Can I add to my groups in the current (shell) process?

text: If I add myself to a group, it applies only to newly launched processes. Actually it's more restricted than that; it seems to apply only to new logins. I'm not sure what the exact mechanism is, but that's not my question (though I'm curious about that too). My question is this: Is it possible to update my group membership _in the current shell process_? I suspect the answer is no. An example (this is not a direct copy-and-paste):               $ groups ; groups kst     kst oldgroup1 oldgroup2     kst : kst oldgroup1 oldgroup2     $ sudo adduser kst newgroup     [sudo] password for kst:     Adding user `kst' to group `newgroup' ...     Adding user kst to group newgroup     Done.     $ groups ; groups kst     kst oldgroup1 oldgroup2     kst : kst oldgroup1 oldgroup2 newgroup     $      After the `adduser`, my account is a member of `newgroup`, but that membership is not reflected in the current shell process. The obvious solution is to log out and log in again, but that's inconvenient.