title: grep contents of files based on a list of files

text: Running CentOS 6.5, qemu-kvm. I have a script which builds a list of running VM's. I want to pull information from those .xml files of only the VM's that are running. `cat /dev/null > /<path>/runlist virsh list --all|grep running|awk -F" " '{print $2}' > /<path>/runlist.tmp` Now that I have the list of running vm's, I want to match them to their appropriate .xml files in a directory listing that includes the .xml files of all of our vm's and pull bits of information out. I know that I can:               grep <info> </path/file.xml>      But how do I get that middle bit that will parse the runlist file against the directory listing and only search for the information from the files that are pertinent to the running VM's. * * * Sample xml file:               <domain type='kvm'>       <name>"X"</name>       <uuid>"X"</uuid>       <memory unit='KiB'>"X"</memory>       <currentMemory unit='KiB'>"X"</currentMemory>       <vcpu placement='static'>1</vcpu>       <os>         <type arch='x86_64' machine='X'>hvm</type>         <boot dev='hd'/>       </os>       <features>         <acpi/>         <apic/>         <pae/>       </features>       <clock offset='utc'/>       <on_poweroff>destroy</on_poweroff>       <on_reboot>restart</on_reboot>       <on_crash>restart</on_crash>       <devices>         <emulator>/<path>/qemu-kvm</emulator>         <disk type='file' device='disk'>           <driver name='qemu' type='raw' cache='none'/>           <source file='/path/file.img'/>           <target dev='vda' bus='virtio'/>           <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>         </disk>         <controller type='usb' index='0'>           <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>         </controller>         <interface type='bridge'>           <mac address='X'/>           <source bridge='br1'/>           <model type='virtio'/>           <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>         </interface>         <serial type='pty'>           <target port='0'/>         </serial>         <console type='pty'>           <target type='serial' port='0'/>         </console>         <input type='tablet' bus='usb'/>         <memballoon model='virtio'>           <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>         </memballoon>       </devices>     </domain>


title: Stop ssh config on first match

text: I have a added a local proxy for all my hosts in my .ssh config, however I want to shell into my local vm without the proxy command. Output of my ssh attempt:               debug1: /Users/bbarbour/.ssh/config line 1: Applying options for local.dev     debug1: /Users/bbarbour/.ssh/config line 65: Applying options for *      Given the following ssh config how do I prevent the ProxyCommand from being applied to the local.dev entry?               Host local.dev         HostName dev.myserver.com         User developer     ...     Host *         ProxyCommand /usr/local/bin/corkscrew 127.0.0.1 8840 %h %p


title: How can you get the current terminal line (the one that is still editable by the user)?

text: I need a way to use the current line which the users typed into as variable for a shell function. my current code, which can be called by ctrl+r               zle -N search          bindkey "^R" search          search () {     read str;     fc -ln -30 | grep $(printf "%q\n" "$str");     }      or simply, to call it as a function               search () {     fc -ln -30 | grep $(printf "%q\n" "$1");     }      updated: target pseudo code, to call as a function called by ctrl+r that needs no further input prompt               zle -N search          bindkey "^R" search          search ()     echo ""; #for better formatting because ctrl+R is not enter so the BUFFER(current line) gets corrupted and looks messy and the current input is not correctly shown     fc -ln -30 | grep $(printf "%q\n" "$BUFFER"); #edited to be the solution where $BUFFER is the current terminal line     }


title: How can I query for obsolete/outdated installed packages (ebuilds) on Gentoo?

text: Installed packages sometimes become obsolete because the package got version bumped and the ebuild for the old version got dropped. Also it happens that packages are dropped completely from the tree (usually for a good reason). I'd like to query those packages in order to take the appropriate action (update, remove). **How to query installed packages** that   1. have no ebuild for the current installed version; and    2. have no ebuild at all anymore (e.g. because it got deleted)


title: How can I renew lease when it kept printing eth0 lease expired x seconds ago?

text: My guest VM cannot get an IP address from my host. It keeps printing:               eth0: lease expired x seconds ago      I've tried to start `dhclient -r` and `dhclient` and restart eth0 to no avail, see here for more. How can I get a new lease in my guest?


title: Untraceable stability problem of 3.6.8 kernel on ASUS P53E

text: Randomly, but not later than after 10 hours of work, the laptop freezes. Just freezes. Knowing that not all hardware errors are reported back to the user I tried the netconsole. Unfortunately the netconsole also didn't output anything at the time of freeze. The «BUSIER» combination also doesn't work when system hangs. The only correlation I've found is that usually, on next powering up (after forced powering off) the laptop consumes 10W more power. But I suspect it might by a concidence; this behaviour is not limited to the times, when system was powered on after the freeze. After 1.5 (on average) times rebooting, the power consumption is back to normal.   * The problem persists across any of kernel 3.5.x - 3.7.1.    * The problem persists with WiFi turned off.   * The laptop works just fine with Windows XP (I've never tried 7 on it)   * I never tried 32-bit Linux on this machine.   * I use both VirtualBox and VMWare. The hanging happens also when no virtual machine is powered on, but I know that both programs insert some kernel modules.   * I use btrfs, dm-crypt, Huwavei E220 modem, bluetooth and a ton of other stuff typical for a notebook.  ...   * I will paste whatever log/configuration file that you deem necessary.  **What is the next course of action for troubleshooting this freezing problem?** Knowing exactly nothing about the causes of the problem, there is almost infinite number of combinations to try. But maybe some of you are more experienced with debugging hardware and can suggest some usual suspects? UPDATE: Suspecting that the non-standard Ubuntu mainline kernel is a culprit I did reinstall the whole system, this time with Mint14 which is based on Ubuntu 12.10, which in turn is based on the 3.5.x kernel family. Unfortunately, the same problem :-( UPDATE 2: The distribution of hanging events seems to be non-Poisson (i.e. sometimes more frequently, sometimes less frequently), but so far I don't know how to correlate it with any type of event. It happens both when laptop is used interactively or not. It happens both when the memory is used (and the system page is used - zram in my case) and when the memory is only 30% used.


title: Backtrack 5 R2 Dual-Boot w/Windows 7 No Longer Loads

text: A while back, I installed Backtrack 5 R2 to Dual Boot on a Windows 7 PC. It worked fine for a while, but now when I try to load it, the screen gets all messed up (tried to get a picture with my phone, but it wasn't working too well). The last line before it freezes says:               fb: conflicting fb hw usage: nouveaufb vs VESA VGA - removing generic driver      Since it last worked, the only changes I can think of are that the computer is now connected via the ethernet cable to the router, and I upgraded the graphics card (to Nvidia). Because of the last line, I personally would put my money on the latter, but I still have no clue how to fix this. Can someone help me?


title: minimal graphic requirements linux distribution

text: Which modern distribuition of linux has minimal graphic requirements? My graphic card has only 64MB of memory.


title: Finding out the values of kernel options related to sysctl.conf and sysctl.d

text: On my Ubuntu machine, in `/etc/sysctl.conf` file, I've got reverse path filtering options commented out by default like this:               #net.ipv4.conf.default.rp_filter=1     #net.ipv4.conf.all.rp_filter=1      but in `/etc/sysctl.d/10-network-security.conf` they are (again, by default) not commented out:               net.ipv4.conf.default.rp_filter=1     net.ipv4.conf.all.rp_filter=1      So is reverse path filtering enabled or not? Which of the configuration locations takes priority? How do I check the current values of these and other kernel options?


title: How do I choose between ext 3 and 4?

text: I tried looking at the difference, the main ones seem to be 4 supports more subdirectories in a file, supports larger files, has delayed write which I don't prefer as I don't want data loss. I also see timestamps are more accurate but it also mentions there is no support in glibc so no apps would use it. Also I just need it ot be as accurate as NTFS, I don't need anything more accurate. I'm thinking I should go with ext3 because its more likely to be more stable. What should I look at when choosing between the two?


title: how to check openpgp (gpg) signature against a set of public key blocks

text: I have some content that needs to be checked against a predetermined whitelist of OpenPGP (also keyword: gpg) public keys for a valid signature by one of them. The whitelist is maintained separately. Ideally it would be a concatenation of ascii-armored public key blocks, but a directory with one public key per file would be fine. Because the whitelist is maintained separately, we don't want to use any of gpg's keyring management functionality. If the content is signed by a key in our set of keys, it passes. No different trust levels, no web of trust, etc. Ideally we would have a program with an interface like this:               some-program KEYS_FILE CONTENT SIGFILE      or, with example arguments,               some-program /etc/ourapp/ourapps_trusted_pubkeys.asc /var/lib/ourapp/newcontent.tar.gz /var/lib/ourapp/newcontent.tar.gz.asc      The quickest way to do this with gpg seems to be:   * use a temporary file as its keyring   * point gpg to this using --keyring, but also give --no-default-keyring   * iterate through the keys in ourapps_trusted_pubkeys.asc, importing them one at a time   * iterate through the keys again, setting them to trusted with gpg --import-ownertrust   * run the gpg --verify This is a huge amount of effort for what I imagine to be a common use case. What am I missing? Does a tool similar to the postulated some-program(1) exist?


title: What video card will support four monitors without Xinerama?

text: I'm running OpenSuse 12.3 and currently have two NVIDIA video cards spanning four monitors. The problem I have is performance since Xinerama can't utilize the hardware acceleration. There are lots of video cards that will support four monitors but will I be able to have a single desktop spanned across four screens without using Xinerama? The answer I'm hoping for is, "yes, I have _*_ card running 3|4 monitors with full hardware acceleration."


title: IPTables and transparent proxies

text: I have set up a local, transparent TCP proxy on `localhost`. I want to redirect ALL TCP traffic to this proxy, so it can handle it and nothing "leaks out," circumventing the proxy. I need to use IPTables to redirect the traffic. I thought about using TPROXY, but that requires application support and only the REDIRECT target is supported at the moment. I have used the following IPTables rules:               iptables -t nat -A OUTPUT -o lo -j RETURN     iptables -t nat -A OUTPUT -d 127.0.0.0/8 -j RETURN     iptables -t nat -A OUTPUT -d 192.168.0.0/16 -j RETURN     iptables -t nat -A OUTPUT -m owner --uid-owner proxy-owner -j RETURN     iptables -t nat -A OUTPUT -p tcp --syn -j REDIRECT --to-ports $PROXY_PORT          iptables -A OUTPUT -o lo -j ACCEPT     iptables -A OUTPUT -d 127.0.0.0/8 -j ACCEPT     iptables -A OUTPUT -m owner --uid-owner proxy-owner -j ACCEPT     iptables -A OUTPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT     iptables -A OUTPUT -j LOG     iptables -P OUTPUT DROP      They _seem_ to work fine, however I'm confused as to why. Here are two questions that I still don't know the answer to: 1) Regarding the last rule in the NAT table, **why do I only want to redirect SYN packets to the local proxy port (`\--syn`)?** I want to redirect ALL TCP packets. In the current configuration it seems like only the SYN packet is redirected to the local proxy, and all other packets are allowed to directly flow to the destination, leading (in theory) to a total mess (or all except SYN being blocked by the filter table). However, if I drop the `\--syn` option and redirect ALL packets to the local proxy, the proxy does not work at all. Why? 2) Regarding the 4th rule in the filter table, **why do I need to explicitly allow outgoing established connections?** The proxy is the only application that is allowed to send packets to non-localhost destinations anyway, and it already is allowed to do so (rule 3), so what do I need the 4th rule for? It seems like it allows non-proxy connections to circumvent the proxy. Thank you!


title: Unable to capture program exit

text: I started a program written using Node.js and started it using launch pipe into logfile and send it to background. Half way running the program exited w/o any error both on the console nor the log, I even checked the /var/log/message and no way I could figure out what's wrong with the program. Are there any better way to able to capture the error/messages that causes the exit? The current execution bash script is following:               ./run_all_with_logs >> logs/my.log &


title: Increasing kernel memory size

text: I have an embedded board with 512MB of RAM running Linux 2.6.29 and UBoot bootloader. But the kernel is able to utilize only 128MB of RAM. I tried changing the value of `XCODE_MEMSIZE`, which I think determines how much RAM the kernel uses. When I set it to 512, the kernel crashes while booting up. Is there any other configuration parameter that needs to be changed?


title: Kernel config for ASUS P8Z77-V mainboard series

text: I want to build a kernel (3.6 series) for a system with a ASUS P8Z77-V mainboard. Which settings fit to the built in components? (The ideal answer would contain an example .config for this board.)               # lspci           00:00.0 Host bridge: Intel Corporation Xeon E3-1200 v2/3rd Gen Core processor DRAM Controller (rev 09)     00:01.0 PCI bridge: Intel Corporation Xeon E3-1200 v2/3rd Gen Core processor PCI Express Root Port (rev 09)     00:02.0 VGA compatible controller: Intel Corporation Xeon E3-1200 v2/3rd Gen Core processor Graphics Controller (rev 09)     00:14.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB xHCI Host Controller (rev 04)     00:16.0 Communication controller: Intel Corporation 7 Series/C210 Series Chipset Family MEI Controller #1 (rev 04)     00:1a.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #2 (rev 04)     00:1b.0 Audio device: Intel Corporation 7 Series/C210 Series Chipset Family High Definition Audio Controller (rev 04)     00:1c.0 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 1 (rev c4)     00:1c.4 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 5 (rev c4)     00:1c.5 PCI bridge: Intel Corporation 82801 PCI Bridge (rev c4)     00:1c.6 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 7 (rev c4)     00:1c.7 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 8 (rev c4)     00:1d.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #1 (rev 04)     00:1f.0 ISA bridge: Intel Corporation Z77 Express Chipset LPC Controller (rev 04)     00:1f.2 SATA controller: Intel Corporation 7 Series/C210 Series Chipset Family 6-port SATA Controller [AHCI mode] (rev 04)     00:1f.3 SMBus: Intel Corporation 7 Series/C210 Series Chipset Family SMBus Controller (rev 04)     03:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168 PCI Express Gigabit Ethernet controller (rev 09)     04:00.0 PCI bridge: ASMedia Technology Inc. ASM1083/1085 PCIe to PCI Bridge (rev 03)     06:00.0 SATA controller: Marvell Technology Group Ltd. 88SE9120 SATA 6Gb/s Controller (rev 12)     07:00.0 USB controller: ASMedia Technology Inc. ASM1042 SuperSpeed USB Host Controller


title: All installed software/commands will not run unless root user in Slackware 14

text: I originally thought it was just startx, but now I've discovered ALL commands are "not found" for any user except root... I obviously haven't checked the path for every single one, but the path for 'startx' is fine. Basic commands such as ls, echo, cd, etc. all still work, just not ones I've had to install like startx, nano, google-chrome, etc. This happened after installing Vidalia, with the dependencies libevent, GeoIP, tor, and vidalia. Vidalia ran once, but did not run again, and upon reboot all was gone... was this a virus?? (all were from Slackbuilds)


title: How can we limit the impact of ssh probes?

text: My webserver is constantly attacked by various IP addresses. They try five passwords and then change the IP address. I have done various lockdowns like using ssh-keys and not permitting passwords, and not allowing remote root login. Is there something I can do to get rid of these attack attempts? Failing that, are there specific defenses I should put up?


title: Moonlight in Debian

text: What is the preferred way to install moonlight in Debian (Testing)? I searched the repositories, but there seems to nothing relevant. Also this wiki: http://wiki.debian.org/Teams/DebianMonoGroup/Moonlight just states its out of date. Any ideas?


title: "mkdir foo; svn mv * foo"

text: I often want to do some variant of this idiom:               $ mkdir 2010     $ svn mv * 2010      Of course, I get an error because the glob matches 2010 as well:               svn: Cannot copy path '2010' into its own child '2010/2010'      Is there a way to replace `"svn mv * 2010"` with a different one-liner that does the right thing?


title: Move all files to a new directory excluding that directory

text: I have the following:               ~@matrix:~/btp200/assignments> ls -la     total 40     drwxr-xr-x 3 molszewski1 users 4096 Feb  6 13:20 .     drwxr-xr-x 6 molszewski1 users 4096 Feb  6 13:14 ..     -rw-r--r-- 1 molszewski1 users 5727 Feb  6 13:20 ISBN.cpp     -rw-r--r-- 1 molszewski1 users  361 Feb  6 13:18 ISBN.h     -rw-r--r-- 1 molszewski1 users 3753 Feb  6 13:17 ISBNPrefix.cpp     -rw-r--r-- 1 molszewski1 users  422 Feb  6 13:15 ISBNPrefix.h     drwxr-xr-x 2 molszewski1 users 4096 Feb  6 13:20 a1     -rw-r--r-- 1 molszewski1 users    0 Feb  6 13:15 a1.cpp     -rw-r--r-- 1 molszewski1 users 6271 Feb  6 13:18 prefixRanges.txt     ~@matrix:~/btp200/assignments> mv * a1     mv: cannot move `a1' to a subdirectory of itself, `a1/a1'      How can I move everything into directory `a1` excluding `a1`?


title: locales: modify default time format

text: I need to change the default time format on my Debian Wheezy system. I am following this howto. I have modified the corresponding lines in `/usr/share/i18n/locales/en_US`               d_t_fmt "<U0025><U0059><U002D><U0025><U0062><U002D><U0025><U0064><U0020><U0020><U0025><U0054>"     d_fmt   "<U0025><U0059><U002D><U0025><U0062><U002D><U0025><U0064>"     t_fmt   "<U0025><U0054>"      Than, I ran the command ro compile locales `localedef -f UTF-8 -i en_US en_US.UTF-8` My locales in `/etc/default/locale` are set to en_US.UTF-8 :               LANG=en_US.UTF-8     LC_COLLATE=C     LC_TIME="en_US.UTF-8"      but i don't see any effect of my changes (even after restart). Am I missing a step ? UPDATE: when I run the command in verbose mode, I get lots of errors:               localedef -v -c -f UTF-8 -i custom custom.UTF-8          custom:34: non-symbolic character value should not be used     en_GB:50: non-symbolic character value should not be used     i18n:1756: non-symbolic character value should not be used     en_GB:59: non-symbolic character value should not be used     custom:40: non-symbolic character value should not be used     iso14651_t1:3: non-symbolic character value should not be used     iso14651_t1_common:6323: LC_COLLATE: symbol `pure-ta-zh' not known     translit_neutral:10: non-symbolic character value should not be used     translit_neutral:17: non-symbolic character value should not be used     LC_NAME: field `name_gen' not defined     LC_IDENTIFICATION: no identification for category `LC_MEASUREMENT'     LC_CTYPE: table for class "upper": 10634005407197270931 bytes     LC_CTYPE: table for class "lower": 10634005407197270931 bytes     LC_CTYPE: table for class "alpha": 10634005407197270931 bytes     LC_CTYPE: table for class "digit": 10634005407197270931 bytes     LC_CTYPE: table for class "xdigit": 10634005407197270931 bytes     LC_CTYPE: table for class "space": 10634005407197270931 bytes     LC_CTYPE: table for class "print": 10634005407197270931 bytes     LC_CTYPE: table for class "graph": 10634005407197270931 bytes     LC_CTYPE: table for class "blank": 10634005407197270931 bytes     LC_CTYPE: table for class "cntrl": 10634005407197270931 bytes     LC_CTYPE: table for class "punct": 10634005407197270931 bytes     LC_CTYPE: table for class "alnum": 10634005407197270931 bytes     LC_CTYPE: table for class "combining": 10634005407197270931 bytes     LC_CTYPE: table for class "combining_level3": 10634005407197270931 bytes     LC_CTYPE: table for map "toupper": 10634005407197270931 bytes     LC_CTYPE: table for map "tolower": 10634005407197270931 bytes     LC_CTYPE: table for map "totitle": 10634005407197270931 bytes     LC_CTYPE: table for width: 0 bytes


title: Is any part of the X.org software multithreaded?

text: None of the command-line shells that I am aware of are multithreaded. In particular, even those shells that support "job control" (Control-Z, `bg`, `fg`, etc) do so via facilities (namely, `fork`, `exec`, signals, pipes and PTYs) that predate Unix _threads_. Nor is Emacs multithreaded even though it is able to "do many things at the same time". (Again, it forks and execs external programs a lot and uses signals, pipes and PTYs to communicate with those external programs.) My question is, Does the dominant implementation of the X11 protocol (X.org) use Unix threads -- in either the server or any of the client libraries? If so, approximately when did it (or its ancestor, XFree86, or XFree86's ancestor) start doing so?


title: Distributing thousands of files over subfolders

text: I have a folder `A` with hundreds of thousands of files. I would like to move these files to **new** subfolders `S_i`, with, say, 100 files in each (the last folder may have less than 100 files) In other words, if my folder `A` has:               file1     file2     ...     file1000      I would later have:               S_1:             file_1         ...         file_100         S_2:         file_101         ...         file_200     ...      Before I write a Zsh script manually to do this task (e.g. using variables to count files), I was wondering if there are any readily available tools (like split) that would facilitate this task.


title: Can a Gnome Terminal profile use UTF-8 by default?

text: I am on an Ubuntu (I think) system. I **don't** have root, so I can't change the locale. I want to make my default terminal profile use UTF-8 by default. There should be a way to do this, either in the `.gconf/apps/gnome-terminal/` directory somewhere, or in a environment variable, or something. However, I can't seem to find it. Edit with more details: In a terminal, I have:               grid-unv55$ locale     LANG=en_US.UTF-8     LC_CTYPE="en_US.UTF-8"     LC_NUMERIC="en_US.UTF-8"     LC_TIME="en_US.UTF-8"     LC_COLLATE="en_US.UTF-8"     LC_MONETARY="en_US.UTF-8"     LC_MESSAGES="en_US.UTF-8"     LC_PAPER="en_US.UTF-8"     LC_NAME="en_US.UTF-8"     LC_ADDRESS="en_US.UTF-8"     LC_TELEPHONE="en_US.UTF-8"     LC_MEASUREMENT="en_US.UTF-8"     LC_IDENTIFICATION="en_US.UTF-8"     LC_ALL=     grid-unv55$ gnome-terminal      When try to more a UTF document in that new terminal, I get:               \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd     \noise:bgspeech \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd      Which appears on my screen as dots. (the uffds were a cut and paste. I left the "\noise:bgspeech" in there so you could see that ascii cut and pasted correctly)


title: Is it possible to install KVM On A VMWare virtual machine? If so, what are the steps?

text: I want to understand how to use KVM in CenTOS. At the moment, all I have is a VMWare ESX 5.x server to use. Is there a way to get KVM working on a system that is running on VMWare? Essentially, a nested install? This will not be used for production purposes, only testing/learning.


title: Why binutils and gcc need to install twice in LFS?

text: I followed LFS doc. I'm not quite understand why it needs 2 pass of compilation. My guess: We need target system's glibc, if we compile by host's gcc, it will not be able to separate with host anymore. So we need to build new system's binutils and gcc first to build target system's glibc let glibc connect with target's binutils and gcc. But first pass of binutils and gcc is using host's glibc, so we need second pass of compilation of target's binutils and gcc. Are those right? Is anything I'm missing or misunderstanding? Thank you~


title: How can I use my server to compile a kernel for my laptop?

text: My laptop, an HP pavilion with an nVidia card, has some issues with suspending. Namely firewire breaks on suspend and the nvidia drivers cause Xorg to hang on resume. I'd like to compile my own kernel to build firewire in instead of as a loadable module, and disable `agpart` to see if these changes fix these issues... However, my laptop isn't the fastest nor does it have a ton of RAM, and its fans are on their last legs. I'd like to configure the kernel build on the laptop buy compile the kernel on our in-house VMware server which has a lot more horsepower. Both the laptop and the server have Ubuntu on them (Ubuntu desktop on the laptop, Ubuntu... _wait for it_... Server on the Server. Bet you never would have guessed that!) How can I use one linux system to compile a kernel for the architecture of a different linux system?


title: How do I configure SELinux to allow outbound connections from a CGI script?

text: I'm migrating to a new webserver which has SELinux set up (running Centos 5.5). I've got it set up so that it can execute CGI scripts with no problem, but some of the older Perl based scripts are failing to connect to remote webservices (RSS feeds and the like). Running: `grep perl /var/log/audit/audit.log` gives:               type=SYSCALL msg=audit(1299612513.302:7650): arch=40000003 syscall=102 success=no exit=-13 a0=3 a1=bfb3eb90 a2=57c86c a3=10 items=0 ppid=22342 pid=22558 auid=0 uid=48 gid=48 euid=48 suid=48 fsuid=48 egid=48 sgid=48 fsgid=48 tty=(none) ses=235 comm="index.cgi" exe="/usr/bin/perl" subj=root:system_r:httpd_sys_script_t:s0 key=(null)      As my crash course in SELinux goes, it looks like it is actively refusing the outbound connection, but how do I configure it to allow for CGI scripts to make outbound requests?


title: Emacs X toolkit support?

text: From what I understand, Emacs uses GTK as it's default X toolkit. Does Emacs support X toolkits other than GTK? For example, can I build Emacs to use Qt4 instead of GTK?


title: Mount HTTP Server As File System

text: I have a machine on which I wish to mount multiple remote servers to access them all centrally. For remote Linux based systems I am using SSHFS which works fine. But for Windows systems, or systems without SSH, they all have some form of HTTP server installed sharing the files (so they all have directory browsing enabled). Can I mount a HTTP server as a local file system like SSHFS, so I can have all these remote servers mounted locally and presented in a uniform manner?


title: Rename files and directories with a special characters on solaris machines

text: The target of the following code ( commands ) is to rename files/directories and also support files/directories with a special characters as "@" or "." etc those commands are run fine on Linux without any problems ,                export NAME_THAT_WE_WANT_TO_CHANGE='.com'      export NEW_NAME='@google'      find /tmp -name '*.com*' -print0 | xargs -0  ./rename.pl   's/\Q$ENV{NAME_THAT_WE_WANT_TO_CHANGE}\E/$1$ENV{NEW_NAME}$2/'      for example the files               /tmp/star.com      /tmp/public.com      will replaced after running the below command to               /tmp/star@google      /tmp/public@google      so now I am tring to covert the find syntax to support Solaris machines ( Solaris 10 ) and this what I write for Solaris:                 export NAME_THAT_WE_WANT_TO_CHANGE='.com'       export NEW_NAME='@google'            find /tmp -name '*.com*' -exec ./rename.pl  {} + 's/\Q$ENV{NAME_THAT_WE_WANT_TO_CHANGE}\E/$1$ENV{NEW_NAME}$2/'      but when I run the find line ... ( I get the following errors )               find: paths must precede expression     Usage: find [-H] [-L] [-P] [path...] [expression]      please advice what I need to fix in my syntax in order to support solaris machines ?   * About the rename.pl script I took it from ( http://docstore.mik.ua/orelly/perl/cookbook/ch09_10.htm )               more /tmp/rename.pl      #!/usr/bin/perl      #      # rename script examples from lwall:      #       rename 's/\.orig$//' *.orig      #       rename 'y/A-Z/a-z/ unless /^Make/' *      #       rename '$_ .= ".bad"' *.f      #       rename 'print "$_: "; s/foo/bar/ if <stdin> =~ /^y/i' *           $op = shift;      for (@ARGV) {      $was = $_;      eval $op;      die $@ if $@;      rename($was,$_) unless $was eq $_;      }


title: Can I read and write to alternate HFS+ file forks or NTFS data streams from Linux?

text: It's possible to mount both Apple HFS+ and Microsoft NTFS filesystems under Linux. Both filesystems support multiple content streams per file, though this is not widely used.   * Apple uses the term _fork_.   * Microsoft uses the term _Alternate Data Stream_. Are there (semi) standard ways to access these filesystem features from Linux? If so are the methods uniform between the two filesystems or are only arcane ad-hoc methods available? (Perhaps something with `ioctl`s?)


title: Follow a pipe using less?

text: Can less follow (by pressing F) a piped input (similarly to a file)? For a file that is being written to, the command               less <file>      will follow the file when pressing F. But if I have a command that pipes output directly into less, like this               command | less      pressing F will do nothing. So it looks like pipes cannot be followed like files can? Or maybe it has to do with command also writing to STDERR? The effect I'm trying to achieve is always see the latest output of the command: just like keeping PageDown pressed! A related remark holds for G (go to end): when piping directly to less, it won't work.


title: Samba passwords expiring in x days - how do we fix them to not expire

text: We use OpenLDAP and Samba v3. Recently some Samba-defined users (no accounts on the shared linux server) started being listed in logwatch as having their passwords come up to "will expire"...I changed the names.                  password for user unicorn will expire in 7 days: 1 Time(s)        password for user xMacAlphbet will expire in 7 days: 1 Time(s)        password for user klbomb will expire in 4 days: 1 Time(s)      None of thee users have a linux user account. How can I fix these?


title: How can I start a cronjob 1 hour later each day?

text: I need to start a cronjob every day, but an hour later each day. What I have so far works for the most part, except for 1 day of the year:               0 0 * * * sleep $((3600 * (10#$(date +\%j) \% 24))) && /usr/local/bin/myprog      When the day of year is 365 the job will start at 5:00, but the next day (not counting a leap year) will have a day of year as 1, so the job will start at 1:00. How can I get rid of this corner case?


title: How to add header and footer to the flat file

text: I need to add a header and a footer to flat file - I just need to get values from the parameter like system date and report run date in the top line and for the footer I need to get the record count and prepend `00000` to it as shown below: Header:               "A"  "F" "2012-03-01"    "20120229" Footer:               "$M" "0000001252"    "." "0000" How can I achieve this in Unix?


title: Regular expressions help

text: what the different between these two regex expression ? AB\{4\} and (AB)\{4\} for the first expression I think that it repeat B 4 times, then for second expression it repeats AB 4 times. When I try to test the second expression using ABABABAB nothing matches.


title: Moving stuff off of SSD to HDD after installation. Using mount --bind? LiveCD?

text: I installed Ubuntu 12.10 on my SSD. /dev/sda1. No other partitions. No swap. Then I went about reading how to optimize usage, and have come to the conclusion I want my /home, /var and /tmp mounted on my hard disk drive. I don't have it mounted yet, but I have a line in my fstab that lists the UUID of my HDD and has it (/dev/sdb1) mounted in /media/hdd. Hard disk too, no partitions. Just plain disk space. I do _NOT_ want to create partitions on either my SSD or HDD. All I want however, is to _move_ my /tmp, /home and /var partitions to my HDD. What are my options to do this cleanly, preferably without using a LiveCD to login? (I am imagining I could use a LiveCD, literally do               mv /home /media/hdd/home     ln -s /media/hdd/home /home          mv /var /media/hdd/var     ln -s /media/hdd/var /var          mv /tmp /media/hdd/tmp     ln -s /media/hdd/tmp /tmp      What about permissions? Is my thinking correct? Can I somehow use a mount --bind option to achieve the same?


title: How to generate a new rootfs and add blobs

text: Before reading this question please take two seconds to read my last questions : How to add folders and file before compiling kernel To sum up I want to add a folder @ rootfs which one has to hold my own files (not belonging to the Cyanogen ROM source files). To clarify there is an example : Before editing source ROM code :               ~adb shell ls /     data     sdcard     storage     system     sys      After editing :               ~adb shell ls /     data     mynewfolder     sdcard     storage     system     sys     ~adb shell ls /mynewfolder     my1file     my2file      **CREATE A NEW FOLDER @ ROOTFS ("/")** What I did is to locate the init* and fstab file. I edited init.qcmon.rc file :               on init     (+)    mkdir /mynewfolder 771 root root       I recompiled my ROM and I saw my folder had been created. But when I try to create a file Android rise the following error :               mkdir failed for my1file : Read-only file system.      Although I knew that trick won't work because to dirty, I continue my investigation editing the fstab.qcmon held in the same folder. I add the following line :               /dev/block/platform/msm_sdcc.1/by-name/mynewfolder      /mynewfolder   ext4    rw,exec,nosuid,nodev,noatime,noauto_da_alloc,errors=panic      wait      This line is a copy/edition of the /data partition defined in the same file. As expected I changed nothing... I'm sure i'm taking the wrong way, but I have no idea how to do this... **ADD MY FILES WHEN COMPILING THE ROM** With the helpful advise of @mikeserv I read the Cyanogen porting guide, and locate the file which copies blobs to their corresponding folder.               grep -Ri "PRODUCT_COPY_FILES" device/samsung/*     device/samsung/jf-common/jf-common.mk : PRODUCT_COPY_FILES +=       I started by added a test file inside an existing folder, I edited jf- common.mk file :               (+)PRODUCT_COPY_FILES += \            device/samsung/jf-common/myfiles/testfile:system/usr      It worked as expected. But when I try to add it to mynewfolder, it still does not work... I think it's related my dirty tricks used to create a new folder @ rootfs. The line I am currently using in jf-common.mk :               (+)PRODUCT_COPY_FILES += \           device/samsung/jf-common/myfiles/testfile:mynewfolder/testfile      Thanks you.


title: How to force drop all partitions and erase disk from terminal?

text: My question is in fact related to OS X, however I'm using Linux tools to resolve my problem. I'm trying to delete all the partitions on my SSD drive and create new GUID (HFS+) partition table. Native Disk Utility is unable to eject disk to re- partition it. From the terminal, which is included in the OS X install, I've ran `diskutil` and here is the output: ![enter image description here](http://i.stack.imgur.com/YrI05.jpg) diskutil unmountDisk force /dev/disk0...12 also can't unmount disks. I've started Ubuntu 12.10 from USB, tried to delete all partitions with GParted (except the recovery partition); it seems to be ok, but the disk is still unavailable for creating partitions with Apple Disk Utility. And certainly I can't create HFS+ partitions in GParted, cause I don't have `hfsprogs` installed, and there is no way to install 'cause I don't have Internet connection (Ubuntu can't work with Mac Book Retina wifi adapters). So, the main question is what are these 12 partitions and how to delete them and create one HFS+ partitions? **upad:** ![enter image description here](http://i.stack.imgur.com/ydclT.jpg)


title: Make yaourt does not reinstall when already installed

text: Is there a way to make yaourt does not reinstall when the package (from AUR) already installed                $ yaourt -Q jruby      local/jruby 1.7.3-1      but somehow                $ yaourt --needed --noconfirm -S jruby      keep redownload (even if it has been downloaded before) and reinstall jruby


title: SSH File Transfer

text: Is it possible for me to use SSH to transfer files from my linux computer to my macbook, if so, can anyone post a brief tutorial? I kind of understand how to use SSH, but I need to know how to find out my hostname etc.


title: Understanding btrfs disc usage for single data volume

text: On my 256 GB disc:               # btrfs fi show /dev/sdd3     Total devices 1 FS bytes used 143.43GiB     devid    1 size 234.22GiB used 234.22GiB path /dev/sdd3     Btrfs v3.12      I don't understand the discrepancy between "143.43GiB" and "used 234.22GiB". I thought, perhaps I have duplication of the data on, but the way I read this:               # btrfs filesystem df /     Data, single: total=230.20GiB, used=142.32GiB     System, DUP: total=8.00MiB, used=32.00KiB     System, single: total=4.00MiB, used=0.00     Metadata, DUP: total=2.00GiB, used=1.19GiB     Metadata, single: total=8.00MiB, used=0.00      my data is stored only once, "single", and I don't understand where the remaining, roughtly 100 GiB, is used. Quote from the the btrfs wiki: > single - data usage matches the raw block group usage on a single device > (data = raw; 1GB of data requires 1GB of disk Mount info:               # mount | grep sdd3     /dev/sdd3 on / type btrfs (rw,noatime,ssd,noacl,space_cache)


title: what is wrong with my simple choice menu script?

text: This is a simple script which should let me go to to directory of my choice, but its not working as intended.               #!/bin/bash          showMenu() {         echo "1) ocaml"         echo "2) python"         echo "3) csharp"     }          while [ 1 ]     do         showMenu         read CHOICE         case $CHOICE in             "1")                 "cd ~/projects/practice/ocaml"                 ;;             "2")                 "cd ~/projects/practice/python"                 ;;             "3")                 "cd ~/projects/practice/csharp"                 ;;         esac     done      I have all the necessary folders in place:               (2) [01:19 PM] ls projects/practice/     csharp/  ocaml/   python/  scripts/ web/           Output:               (2) [01:19 PM] choice      1) ocaml     2) python     3) csharp     1     /home/nanda/bin/choice: line 15: cd ~/projects/practice/ocaml: No such file or directory     1) ocaml     2) python     3) csharp      The script can't find the directory apparently. I feel that I need to put the `cd` command, under each option, in some kind of substitution (with `${}` or `{}`), but I am not sure how it could be done. Also, do I need to add a break statement after each `cd` command? * * * I should do `. choice` to make it work as intended. Better yet, I put in an alias like this and it worked:               alias choice='. choice'      References:   http://stackoverflow.com/questions/255414/why-doesnt-cd-work-in-a-bash-shell- script   http://askubuntu.com/questions/84279/how-to-change-directory-using-script   http://stackoverflow.com/questions/874452/change-current-directory-from-a- script


title: Can asterisk set-up a three-way call on an analog (classic) line?

text: I would like to know if it is possible for _asterisk_ to establish a three-way call on an analog line. Typically, **I would like asterisk to call 2 numbers, with the same telephonic line, and connect them together**. For a human, this is already possible on the line I'm using, by following those steps:   * pick up and dial the 1st number, wait for it to answer,    * press `R` (the hook flash) and compose the 2nd number, wait for answer,    * press `R` and then `3` so everybody is now in the same conversation.  This is interesting here because the line I'm talking about can make international calls to many destinations without extra charge, so I can use it (as a relay) to call from one country (when travelling) to another without having to ruin myself. Can asterisk reproduce these steps automatically, and do you know how?


title: Compile Node.js for Raspberry fast

text: I wan't to know if there is a faster way to compile the node.js code for raspberry then letting the raspberry itself compile the code. Assuming I have cloned the nodejs source into _/home/pi/node/_ on my raspberry.   1. Is it right to run the `./configure` on the raspberry.   2. Then copy the node folder to my desktop computer and run `make`.    3. Then copy the folder back to my raspberry _/home/pi/node_ and run `make install`. Would that work and if yes, are there any downsides to this method? * * * **EDIT:** I accepted to use the precompiled Version suggested by goldilocks as it is truly the fastest way of getting the newest node asap.


title: Is it possible for grub2 to detect some specific CPU features and choose a proper kernel to boot?

text: I want to configure grub to check some CPU features on startup and choose a proper kernel to boot (e.g. multiple cores -> kernel with SMP support). Is it possible? If so, then how do I do it?


title: Echo difference between Ubuntu and Red Hat

text: I have mostly been experimenting with Ubuntu but recently was using a Red Hat Enterprise system and was surprised at a difference I found setting and displaying environment variables. In Ubuntu I might have an interaction like this:               acomber@mail:~$ export MY_VAR=i686-linux     acomber@mail:~$ echo $MY_VAR     i686-linux     acomber@mail:~$ echo "$MY_VAR"     i686-linux      But on RHEL:               acomber@mail:~$ export MY_VAR=i686-linux     acomber@mail:~$ echo $MY_VAR          acomber@mail:~$ echo "$MY_VAR"     i686-linux      Why this difference? Why do I need to enclose in quotes on RH? There are no spaces in the variable name? On Ubuntu:               acomber@mail:~$ type echo     echo is a shell builtin     acomber@mail:~$ ps aux | grep $$ | head -n 1     acomber   2847  0.0  0.0  26876  3836 pts/7    Ss   10:30   0:00 bash      I will have to wait until I am back at work to try on the RHEL machine.


title: Mencoder with same quality output

text: I like `mencoder` for converting video files because it shows me how much time is remaining to the end of the conversion (in opposite to `ffmpeg`).               mencoder file.wmv -ofps 23.976 -ovc lavc -oac copy -o file.avi      The problem is that the resulting file is not the same quality as the input file. With `ffmpeg` there is `sameq` option. Is there similar option for `mencoder` to achieve the same quality? Is this only my feeling or is mencoder faster than ffmpeg when I will achieve the same quality? thank you


title: man causes a broken pipe when using a pager other than less

text: I'm trying to write a simple script to format my man pages, but I've run into a broken pipe error. These lines both cause the error:               env MANPAGER=cat man $foo     man -P cat $foo      and this is the script I'm ultimately trying to use (converts underlines into italics)               man -P ul "$1" | sed -e $'s/\033\\[4m/\033\\[3m/g' -e $'s/\033\\[24m/\033\\[23m/g'      I get the same problem with `cat`, `ul`, and `tee`, and the only thing that seems to work is `less`.


title: How to use a value returned by a script in grep filter?

text: I'm on FreeBSD's csh. I want to form a row with domains of one user and then use this row to filter exim maillog to get only mail from/to this user's domains. I wrote a script to form a row from a list of DirectAdmin-domains:               #!/bin/sh     user="some-user"              list=$(cat /usr/local/directadmin/data/users/$user/domains.list)         domaincount=$(echo $list|wc -w)         echo $list| tr ' ' '|'      Executing this script returns rows with domains like this: `'domain.com'` or this: `'domain1.com|domain2.net'` Now I want to use this as an argument to `grep`, but               cat /var/log/exim/mainlog |egrep `/path/to/rowscript`      returns nothing, while replacing manually `/path/to/rowscript` with its result returns what I want to see. Tried to use               grep -E "`/path/to/rowscript`",      egrep '`/path/to/rowscript`'      egrep `/bin/sh /path/to/rowscript`     egrep $(/path/to/rowscript)         getting "Illegal variable name."      etc., but still no luck. BTW, `date` in backticks works well:               cat /var/log/exim/mainlog | grep `date +%Y-%m-%d`      What am I doing wrong?


title: What is sendmail referring to here?

text: When I install sendmail from the debian repos, I get the following output:               Disabling HOST statistics file(/var/lib/sendmail/host_status).     Creating /etc/mail/sendmail.cf...     Creating /etc/mail/submit.cf...     Informational: confCR_FILE file empty: /etc/mail/relay-domains     Informational: confCT_FILE file empty: /etc/mail/trusted-users     Updating /etc/mail/access...     Updating /etc/mail/aliases...     WARNING: local host name (ixtmixilix) is not qualified; see cf/README: WHO AM I?      Can someone please tell me what this means, what I need to do to qualify my hostname?


title: Log file not growing beyond a size. Why?

text: We have a java based web-app running on CentOS 6.0 64bit and it writes out many log files. Some of the files are rotated on daily basis using `logrotate` using the `daily`, `copytruncate` and other few options. One such particular log file stops growing at exactly "102400000" bytes. The process continues working fine. But nothing gets written in the log then. I did a `stat` on the file using `watch` to see if after reaching the "102400000" byte size the modified time changes, but it doesn't. Nothing happens to the file. It just stays there as it is. Other log files in the same directory continue to be written into. The things mentioned in another StackExchange question here do not apply. I checked and rechecked if any where the mentioned ulimit option was set, but there is none any. Doing `strace -f -p PID` showed the process to be trying to write but encountering the "File too large" and "File size limit exceeded" messages:               [pid  5679] write(1, "\n\n\n\n\n23-01-2013 12:00:46:921  Av"..., 128) = -1 EFBIG (File too large)     [pid  5679] --- SIGXFSZ (File size limit exceeded) @ 0 (0) ---      How do I find as to what is imposing this limit on the file size. Other log files in the same directory are quite large (greater than 1Gb in size) and have no issues as such.


title: How can I copy a git repo from a Makefile?

text: I'm writing a Makefile to sync my local dotfiles with GitHub. I recently decided to also add my .vim folder to the repo. But when trying to copy the .vim folder I keep getting a Permission denied error. The line in the Makefile that should copy the folder is:               @$(foreach file, $(FILES), echo "Copying $(BASH_DIR)$(file) to ."; cp -R $(BASH_DIR)$(file) . ; )      The permissions for the .vim folder is drwxr-xr-x, and the error message I get is:               cp: ./.vim/bundle/editorconfig-vim/.git/objects/pack/pack-bbb66dd84e2bdd3b05e19454b0800a928ecb94db.idx: Permission denied     cp: ./.vim/bundle/editorconfig-vim/.git/objects/pack/pack-bbb66dd84e2bdd3b05e19454b0800a928ecb94db.pack: Permission denied     cp: ./.vim/bundle/snipmate.vim/.git/objects/4d/e66757eebe4798eaaf02e3762a152d283eca81: Permission denied     cp: ./.vim/bundle/snipmate.vim/.git/objects/58/165f0e58211f8a5910df65414cc637651f046a: Permission denied     cp: ./.vim/bundle/snipmate.vim/.git/objects/6e/e90f3cfbd7c4956892da49896f62614448f851: Permission denied     cp: ./.vim/bundle/snipmate.vim/.git/objects/fc/161ff6515d405831c65c608d63627aa60c4066: Permission denied     cp: ./.vim/bundle/snipmate.vim/.git/objects/pack/pack-182ea16d08e5b471d5ce5f545f599f24ebe306cf.idx: Permission denied     cp: ./.vim/bundle/snipmate.vim/.git/objects/pack/pack-182ea16d08e5b471d5ce5f545f599f24ebe306cf.pack: Permission denied     cp: ./.vim/bundle/vim-jade/.git/objects/pack/pack-20254027167dcc621463c4454ed0fc539cf0b1da.idx: Permission denied     cp: ./.vim/bundle/vim-jade/.git/objects/pack/pack-20254027167dcc621463c4454ed0fc539cf0b1da.pack: Permission denied     cp: ./.vim/bundle/vim-markdown/.git/objects/pack/pack-b18aa89f38b322d622d05d969a9df41915bf9ea8.idx: Permission denied     cp: ./.vim/bundle/vim-markdown/.git/objects/pack/pack-b18aa89f38b322d622d05d969a9df41915bf9ea8.pack: Permission denied      Does anyone know how I can get this to work? Preferably without having to change permissions manually. @vonbrand I am trying to add my vim setup to my dotfiles for easy access on other terminals. I am using pathogen to handle my vim plugins. They are handled by cloning the plugins into the `.vim/bundles` directory. When I try to `cp -r` `.vim` into my dotfiles folder I get the error above. I'd like to find some solution for having these repos as a part of my dotfiles folder without having to manually change the permissions, as this would force me to repeat that process each time I decided to add or change a plugin. I don't know if the solution I'm looking for is passing some option to `cp`, or using some other tool for copying or syncing the `.vim` directory, or if `chown` is the only option I have. `ls -ld ~/.vim/bundle/vim-jade/.git` returns `drwxr-xr-x 12 $USER staff 408 Jan 21 15:26 ~/.vim/bundle/vim-jade/.git`


title: Move some files on every dir to a different dir

text: > **Possible Duplicate:**   >  How can I move files by type recursively from a directory and its sub- > directories to another directory? I'm quite new to Linux and specially to the shell and all of its commands. My goal is to move some files in every directory to another directory. To be more clear, I have this:               /DIR       - /dir1         - file1         - file2         - ...       - /dir2         - file1         - file2         - ...       - ...       - /dirn         - file1         - file2         - ...       What I need is to move all the file1 and file2 into a new dir in its own dir, so that I get something like this:               /DIR       - /dir1       - /mydir           - file1             - file2         - ...       - /dir2       - /mydir           - file1             - file2         - ...        For the sake of the question I have to say that dir names are not like "dir1", "dir2" and so on, but are arbitrary names. Files, however, are always named the same (models.py and wrappers.py). Thanks for your help.   P.S.: I'd really appreciate if you could explain me your answers, in order to learn a bit more about Linux and not just copy-pasting the code.


title: How to make a variable symlink ? (or something similar)

text: How can I make a variable symlink that would point to a different location according to the current user? Is it possible? Should I use something else instead? A mount point? How? Here is the problem in case you come across a different solution: Here at work we are a team developing on Unix with SVN. We all use the same development machine (remotely). So we have checkouts in different places (not /home but a specific dir mounted on another disk, let's say /svn/[userlogin]/). We use scripts and tools. Some special tools have a complex configuration and project file that includes the path of the source files. This is error prone and we lose a lot of time because of bad config or 'projects' that need to be recreated all the time. I would like to share this complex configuration and the project files across all developers. But for such files to be shared while working on different checkouts, I must either:   * correct on-the-fly the paths stored in config/project to adapt them to the current user   * make a "magic" fixed path that symlink/mount/point points to a different place according to the user (so same project file but pointing to different source) Before that we used clearcase, which was mounting a view of the same path for everyone (let's say /vob), each developer seeing his or her own view. That was convenient. How can I do a similar thing? Can you think of another solution? Thanks. -- Edit -- I was thinking of Eclipse IDE. I want to share some workspace settings, the project and the run/debug configurations. Eclipse (+plugin) settings consist of 50+ small files, so editing them is out of question. With clearcase it was easy thanks to the fixed "/vob" path which, for each terminal, was automatically pointing to the "view" we choose. I would like something similar. I want a _/svn/mysource_ which, for each terminal, point to the user current checkout, which is in a user-dependent path.


title: What is the difference between running a executable just by name and by appending a dot /slash before it?

text: This is the output from `ls -all` command :               -rwxr----- 1 subhrcho dba  3600 Nov 13 17:26 jdev     -rw-r----- 1 subhrcho dba  1566 Nov 13 17:26 jdev-Darwin.conf     -rw-r----- 1 subhrcho dba   347 Mar  6  2009 jdev-debug.boot     -rw-r----- 1 subhrcho dba   821 Nov 13 17:26 jdev-logging-debug.conf     -rw-r----- 1 subhrcho dba   584 Nov 13 17:26 jdev-logging.conf     -rw-r----- 1 subhrcho dba  4717 Jul 31 16:09 jdev.boot     -rw-r----- 1 subhrcho dba 12877 Nov 13 17:26 jdev.common     -rw-r----- 1 subhrcho dba  5047 Dec  6 01:43 jdev.conf     -rwxr-x--- 1 subhrcho dba 28160 Nov 13 16:28 jdev.exe     -rwxr-x--- 1 subhrcho dba 28672 Nov 13 16:28 jdev64.exe     -rwxr-x--- 1 subhrcho dba 28672 Nov 13 16:28 jdev64W.exe     -rwxr-x--- 1 subhrcho dba 28160 Nov 13 16:28 jdevW.exe      Now when I just run `jdev` it runs a different version of Oracle JDveloper than when I run it as `./jdev`..Why is it so ?


title: how to mount this disk?

text: I'm trying to mount a disc created some time ago in Amazon EC2. This is what I see (line breaks added for the sake of readability):               $ sudo file -s /dev/xvda4     /dev/xvda4: x86 boot sector; partition 1: ID=0x83, starthead 1,      startsector 63, 10474317 sectors, extended partition table (last)\011,      code offset 0x0      When I'm trying to mount it:               $ sudo mount /dev/xvda4 /mnt/foo     mount: wrong fs type, bad option, bad superblock on /dev/xvda4,        missing codepage or helper program, or other error        In some cases useful info is found in syslog - try        dmesg | tail  or so      How can I mount this disc? Maybe this information will help:               $ sudo fdisk -lu /dev/xvda4     Disk /dev/xvda4: 5368 MB, 5368709120 bytes     255 heads, 63 sectors/track, 652 cylinders, total 10485760 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: 0x0952616d       Device Boot      Start         End      Blocks   Id  System     /dev/xvda4p1              63    10474379     5237158+  83  Linux


title: Use configuration file for ftp with auto login enabled upon initial connection

text: I would like to so the same thing like in SSH where you can save the server in the config file. I would also like to save my username and password, so that it is not prompted each time I connect. I use the ftp command,


title: How to stop users from Switching to Root user

text: I have disabled the root user login from Sshd.conf file so now no one can login using root user even if they know the password SOMEHOW. Now I have 3 users in server ROOT,EMERG and ORACLE. I want to allow switching to ROOT only to EMERG user by using su - and not to ORACLE user. because normally if users know the ROOT password they can switch to root using su -. And i want this feature available only to EMERG user. How to do this Thanks in advance......


title: ncftp not looking into .netrc

text: I have sort of this in my `.netrc`:               machine ftp.mydomain.com             login mylogin              password mypassword      and while I can succesfully connect with `ftp`:               ftp ftp.mydomain.com      and passing credentials to `ncftp`:               ncftp -umylogin -pmypassword ftp.mydomain.com      I get this using only `ncftp ftp.mydomain.com`               NcFTP 3.2.4 (May 16, 2010) by Mike Gleason (http://www.NcFTP.com/contact/).     Connecting to xxx.xxx.0.140...                                                         ProFTPD 1.3.1 Server (Debian) [::ffff:xxx.xxx.0.140]     Login incorrect.                                                                     Sleeping 20 seconds...       Any advice welcome...


title: Screen status bar to display current directory for zsh/bash shell

text: I use GNU screen a lot with zsh as my shell. It would be a nice feature (I think) to be able to display the current directory name (not the full path) as the tab title. I can do that with `CTRL+A SHIFT+A` but that is manual. I would like it to change whenever I change directory. Does anyone know of a way to do this? Edit: The answer also feature the solution for bash.


title: Allow 1 hour only in day with PAM

text: How to allow user to access system only 1 hour in day using PAM? For example I wish to give access to a user only for 1hr on a workstation in 24hrs. First the 24hr time period needs to be defined, as fixed time period like 00:00:00 to 23:59:59 or the time period should be counted from the time the user first logs in. One must also consider the possibility if the user logs in for 3 minutes. logs off and logs in, after an hour. Note: I have successfully configure allow access in time ranges but not only 1 hour in day. Please give me any example of any service.


title: How to install & run collectd on Solaris 10 x86

text: I am trying to install and run `collectd` on Solaris 10 x86. I downloaded the Solaris x86 version of the installer. Installed using `pkd_add` command and chose the default folders. Now I am trying to run the daemon, but it doesn't seem to work. Here is the problem / error:               bash-3.00# sbin/collectd     bash: sbin/collectd: cannot execute binary file


title: Difference between commands in bash script and commands in terminal

text: Are there any differences between commands that you type into the terminal and commands you include in a script?


title: ALSA/ASoC: How to correctly load devices/drivers?

text: I am using Buildroot to build an embedded Linux (2.6.39.2) system for the NXP LPC3250 microcontroller. Right now, I'm trying to get ALSA/ASoC up and running, but I'm having some issues with getting the modules to work together. (I think!) ## Some important background: The board I am testing with is the Embedded Artists 3250 V2 development board. V2 is different from V1 in that it does not have an LCD screen, but _does include_ an I2S audio codec: The NXP UDA1380. Board support for EA3250 **V1** is included in the LPCLinux version of the kernel. There is also a different development board, called Phytec 3250, which contains the same UDA1380 codec chip. The LPCLinux distribution also has support for the Phytec board, along with the audio codec chip. From what I have discerned, the Phytec 3250 board has the UDA1380 codec on I2C address **0x18**. On my EA3250 V2 board, the audio codec is located at I2C address **0x1a**. _(I have verified the chip is powered up, and I can communicate to it by using the I2C-tools package. It responds to i2cdetect and I can read registers from the chip correctly using i2cget.)_ ## Modifying the source: I needed to edit the Phytec 3250 driver files to change the address of the codec chip. I edited this section of lpc3xxx-uda1380.c:                 static struct snd_soc_dai_link phy3250_uda1380_dai[] = {            {                       .name           = "uda1380",                       .stream_name    = "UDA1380 Duplex",       #if defined(CONFIG_SND_LPC32XX_USEI2S1)                       .cpu_dai_name   = "lpc3xxx-i2s1",       #else                       .cpu_dai_name   = "lpc3xxx-i2s0",       #endif                       .codec_dai_name = "uda1380-hifi",                       .init           = phy3250_uda1380_init,                       .platform_name  = "lpc3xxx-audio.0",              //EDIT// .codec_name     = "uda1380-codec.0-0018",  //EDIT//                       .codec_name     = "uda1380-codec.0-001a",                       .ops            = &phy3250_uda1380_ops,               },       };      After I made this change, I went ahead and built the system again and everything compiled OK. After booting into the system, I have the following modules (in addition to the standard core modules) in `/lib/modules/2.6.39.2/kernel/sound`:                ./soc/codecs: snd-soc-uda1380.ko          <-- ASoC codec driver     ./soc/lpc3xxx: snd-soc-lpc3xxx-i2s.ko      <-- ASoC DAI                    snd-soc-lpc3xxx-uda1380.ko  <-- ASoC machine driver                    snd-soc-lpc3xxx.ko          <-- ASoC platform driver      _**Now, how do I actually bind all this stuff together?_** Just inserting the modules with `modprobe` doesn't actually give the device to ALSA/ASoC. I am unable to detect the soundcard. Does this mean I must now make a new device called `uda1380-codec` at address **0x1a** and bind it to a driver? I have tried doing the following:   `echo uda1380-codec 0x01a > /sys/bus/i2c/devices/i2c-0/new_device`   and received:   `i2c i2c-0: new_device: Instantiated device uda1380-codec at 0x1a`   Then I try to bind a driver to the device:   `echo 0x1a > /sys/bus/i2c/drivers/uda1380-codec/bind`   and received:   `sh: write error: No such device`      I get this error for everything I try! I have a feeling I am not creating the device correctly, and then I'm not sure how to bind it to the correct driver. ## Nota Bene: I was playing with this last night and was somehow able to get ASoC to wake up and at least probe for the card. I was playing with different bindings, I guess. It was late and hard to remember my steps, but I was able to at least get the following error somehow:               uda1380-codec 0-001a: asoc: failed to probe CODEC uda1380-codec.0-001a: -22     asoc: failed to instantiate card LPC32XX: -22      I have been unable to recreate this error! ## Edit: I've confirmed my modified code is being compiled, so the driver should be talking to the correct address now. After manually loading the modules, the output of `lsmod` is:               Module                      Size  Used by    Not tainted     snd_soc_lpc3xxx_uda1380     2087  0      snd_soc_lpc3xxx             3089  0      snd_soc_lpc3xxx_i2s         4089  1      snd_soc_uda1380            10865  0      snd_soc_core               51549  4 snd_soc_lpc3xxx_uda1380,snd_soc_lpc3xxx,snd_soc_lpc3xxx_i2s,snd_soc_uda1380     snd_pcm                    52098  2 snd_soc_lpc3xxx,snd_soc_core     snd_timer                  15590  1 snd_pcm     snd_page_alloc              3021  1 snd_pcm     snd                        37286  3 snd_soc_core,snd_pcm,snd_timer      Does this look right? And my device table:               # Audio stuff     /dev/audio      c       666     0       29      14      4       -       -       -     #/dev/audio1    c       666     0       29      14      20      -       -       -     /dev/dsp        c       666     0       29      14      3       -       -       -     #/dev/dsp1      c       666     0       29      14      19      -       -       -     #/dev/sndstat   c       666     0       29      14      6       -       -       -     /dev/mixer      c       666     0       29      14      0       -       -       -     /dev/snd        d       755     0       29      -       -       -       -       -     /dev/snd/controlC0      c       666     0       29      116     0       -       -       -     /dev/snd/pcmC0D0c       c       666     0       29      116     24      -       -       -     /dev/snd/pcmC0D0p       c       666     0       29      116     16      -       -       -     /dev/snd/seq    c       666     0       29      116     1       -       -       -     /dev/snd/timer  c       666     0       29      116     33      -       -       -


title: Mouse pad error after new Linux kernel install

text: Yesterday I upgraded my debian laptop with the backports repository. Amongst the packages it installed, a new kernel was added (3.2.0). When booting on this kernel, the right-click on my mouse pad (is it called that way?) doesn't work. I tried booting on my old kernel (2.6.39) and it works like a charm. I have a bunch of live CDs for various distros lying around on my desk, so I tried launching live sessions. It confirmed my idea that it is a kernel issue. My hardware doesn't work well with recent kernels. My question is not how to solve my particular problem (I'm not even giving details about my hardware). What's the way to go when facing such a problem? Can anyone point me to good documentation?


title: Save HTML from clipboard as markdown text

text: I want to be able to highlight a section of a web page and copy it to the clipboard then save it to my local disk as markdown. I need an efficient way to do that. My current cumbersome method is:   1. highlight section and copy to clipboard   2. open Libre Office Writer   3. paste into Writer   4. save Writer doc as HTML   5. open terminal    6. `cd` to the directory where I saved the HTML   7. `pandoc -s -r html /home/me/a/b/mydoc.html -o /home/me/a/b/mydoc.md` Obviously, I need a better method! Any suggestions?


title: Recommended reading to better understand Unix/Linux internals

text: I've worked on *nix environments for the last four years as a application developer (mostly in C). Please suggest some books/blogs etc. for improving my *nix internals knowledge.


title: Re-ordering serial ports on a multiport card

text: I have a Red Hat Enterprise 6.2 machine with two on-board serial ports and a PCIe card with 8 additional serial ports (16C950 UARTs, 16C550 compliant). I've added the kernel option `8250.nr_uarts=10` so that all devices show up under `/dev`. The two on-board devices show up as ttyS0 and ttyS1, as expected, but the serial ports on the PCIe card aren't being ordered by their I/O port as I would expect them to. Otherwise the devices work fine, it's just that it's not very elegant that the tty order doesn't match the order on the breakout cable for the board. Any ideas on how to change the order? Output form `setserial`:               # setserial -g /dev/ttyS*     /dev/ttyS0, UART: 16550A, Port: 0x03f8, IRQ: 4     /dev/ttyS1, UART: 16550A, Port: 0x02f8, IRQ: 3     /dev/ttyS2, UART: 16650, Port: 0xdf30, IRQ: 30     /dev/ttyS3, UART: 16650, Port: 0xdf38, IRQ: 30     /dev/ttyS4, UART: 16650, Port: 0xdf00, IRQ: 30      <-- Why is this one not ttyS2?     /dev/ttyS5, UART: 16650, Port: 0xdf08, IRQ: 30     /dev/ttyS6, UART: 16650, Port: 0xdf10, IRQ: 30     /dev/ttyS7, UART: 16650, Port: 0xdf18, IRQ: 30     /dev/ttyS8, UART: 16650, Port: 0xdf20, IRQ: 30     /dev/ttyS9, UART: 16650, Port: 0xdf28, IRQ: 30      Looking in `dmesg`, it's finding them in the right order, but starting the lowest I/O port out at ttyS4:               # dmesg | grep ttyS     serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A     serial8250: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A     00:06: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A     00:07: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A     0000:05:00.0: ttyS4 at I/O 0xdf00 (irq = 30) is a ST16650     0000:05:00.0: ttyS5 at I/O 0xdf08 (irq = 30) is a ST16650     0000:05:00.0: ttyS6 at I/O 0xdf10 (irq = 30) is a ST16650     0000:05:00.0: ttyS7 at I/O 0xdf18 (irq = 30) is a ST16650     0000:05:00.0: ttyS8 at I/O 0xdf20 (irq = 30) is a ST16650     0000:05:00.0: ttyS9 at I/O 0xdf28 (irq = 30) is a ST16650     0000:05:00.0: ttyS2 at I/O 0xdf30 (irq = 30) is a ST16650     0000:05:00.0: ttyS3 at I/O 0xdf38 (irq = 30) is a ST16650      Trying to use `setserial` to change the port doesn't seem to work, it always reports that the device is busy (this is from a fresh reboot, nothing has accessed the device).               # setserial /dev/ttyS2 port 0xdf00     Cannot set serial info: Device or resource busy      **Edit** : Thanks to info provided by Gilles, I have it mostly working now using a udev that writes an ordered **NAME** by matching on the **KERNEL** name. The output from `udevadm` info shows that is the only parameter that can be used to uniquely identify the individual devices (ttyS[2-9] all report the same information, except for the **KERNEL** parameter).               # udevadm info -a -n /dev/ttyS2       looking at device '/devices/pci0000:00/0000:00:07.0/0000:05:00.0/tty/ttyS2':         KERNEL=="ttyS2"         SUBSYSTEM=="tty"         DRIVER==""            looking at parent device '/devices/pci0000:00/0000:00:07.0/0000:05:00.0':         KERNELS=="0000:05:00.0"         SUBSYSTEMS=="pci"         DRIVERS=="serial"         ATTRS{vendor}=="0x494f"         ATTRS{device}=="0x10a9"         ATTRS{subsystem_vendor}=="0x0000"         ATTRS{subsystem_device}=="0x0000"         ATTRS{class}=="0x070002"         ATTRS{irq}=="30"         ATTRS{local_cpus}=="0000ff"         ATTRS{local_cpulist}=="0-7"      My new udev rules:               SUBSYSTEM=="tty", DRIVERS=="serial", ATTRS{vendor}=="0x494f", KERNEL=="ttyS4", NAME="ttyS2"     # [snipped 7 more rules for each device]


title: CSV file + set CSV parameters and values in bash script

text: I have the following CSV file:               Alabama,Alaska,Arizona,Arkansas,California,Colorado,Connecticut,Delaware,Florida,Georgia,Hawaii,Idaho,Illinois,Indiana,Iowa     1000,"1 0 0 1",1002,1002,1003,1004,1005,"1 0 0 6",1007,1008,1009,1010,1011,1012,1013     100,101,102,102,103,104,105,"1 0 6 2",107,108,109,110,111,112,113     10001,10011,10021,10021,10031,10041,10051,10061,10071,10081,10091,10101,10111,10121,10131     .     .     .     .      My target is to set the CSV parameters ( all states in CSV ) with their values in my bash script for example               #!/bin/bash          Alabama=1000     .     .     .     Iowa=1013      so in my bash script I can read each parameter example                echo $Alabama      1000      First I just tried to write the following (wrong) code, in order to set the parameters with their values:               #!/bin/bash          counter=1          for CSV_COLUMN in Alabama  Alaska  Arizona Arkansas  California  Colorado  Connecticut Delaware Florida  Georgia  Hawaii  Idaho  Illinois  Indiana  Iowa      do       export $CSV_COLUMN=` echo $CSV_LINE | cut -d',' -f$counter `       counter=$counter+1     done      The test should be (from the bash script)               echo $Alabama     1000      How should I change my code in order to implement my idea?


title: Skype gtk style not working on debian squeeze 64

text: I have installed skype on my fresh squeeze 64bit system. It works fine except for the fact that the gtk theme isn't really working and the result is quite ugly: ![enter image description here](http://i.stack.imgur.com/G5Hlo.jpg) How can I fix this?


title: Isolate a hosts networking with iptables

text: I want to isolate a host on my home intranet using `iptables` on my linux router. So say for instance, I have a host that has the IP of `10.0.1.50` and I want it to be able to talk to the rest of the Internet, but I don't want the router to allow it to talk to any other host in `10.0.1.0/24`. However, I want to be able to allow hosts in `10.0.1.0/24` to connect to `10.0.1.50` on port `80` only as long as the connection isn't created on the host. I am doing this in case `10.0.1.50` is compromised, so it can't talk to the rest of my network.


title: Yarbu Execution

text: I am attempting to use a Project called Yarbu It appears to be exactly what I am looking for. However I am a noob at Linux and am having difficulty getting it to work. I successfully completed the install by following the steps seen here. After following those steps, I created a .conf file (found here) and placed it into /home/john/yarbu-1.4.8/etc/yarbu/conf/default however still nothing happens when I execute the program. I do not know how to proceed from here and I am fairly certain that its user error that is resulting from my unfamiliarity with linux. What should I try next? Why does this program require "sudo" to execute? Did I need to create the .conf file before I did "make install"? Any direction would be helpful and appreciated.


title: How to solve a file path as a failed dependancy when installing a RPM?

text: I have a RHEL 6 server without any internet access that is missing a cron installation. I am tyring to install crontabs like this but i get this error:               [root@netsrvr01 cron.d]# rpm -ivh /Downloads/crontabs-1.10-33.el6.noarch.rpm     warning: /Downloads/crontabs-1.10-33.el6.noarch.rpm: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY     error: Failed dependencies:             /etc/cron.d is needed by crontabs-1.10-33.el6.noarch     [root@netsrvr01 cron.d]# Error: 'NoneType' object has no attribute 'sendline'      What does it mean `/etc/cron.d is needed`? I do have those directories and I am logged in as root. Unfortunately i don't have a similar machine I can use yum downloader for either. **Edit: RPM contents:**               [root@netsrvr01 Downloads]# rpm -qpl /Downloads/crontabs-1.10-33.el6.noarch.rpm     warning: /Downloads/crontabs-1.10-33.el6.noarch.rpm: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY     /etc/cron.daily     /etc/cron.hourly     /etc/cron.monthly     /etc/cron.weekly     /etc/crontab     /usr/bin/run-parts     /usr/share/man/man4/crontabs.4.gz


title: Email server with automatic + sign aliases?

text: Is there currently a Linux email server that will allow me to replicate how Gmail or Outlook allow aliases. i.e. with Hotmail (which is now Outlook) or Gmail I can sign up on a site and use myname+askubuntu@outlook.com and it will come to the myname@outlook.com account without first having to set up an alias.


title: Gnome and Gdm doesn't recognize my password

text: I installed Archlinux as Virtualbox's guest on Windows. After installation, I can not log in through GDM, though it lists my user name, and the root account doesn't work either. The error info is:`Sorry, that didn't work. Please try again.` Then I try to log in through command line, and `startx` manually. This time it works, however, whenever I need to input my password in terminal, it doesn't recognize either. How do I solve this? I am using Gnome 3.


title: Debian thinks my file system is encoded as ISO-8859-1

text: This may not be the appropriate site for this question, because it's more a complaint than a question, but here goes. Today I updated my computer from Mint 15 to Debian 7.6. And after I'd done that, my computer thought that all the existing filenames were encoded as ISO-8859-1 rather than UTF-8. So, for instance, filenames containing "à" now got displayed as "Ã " and so on.   Turns out I needed to tell my system _explicitly_ that the file system uses UTF-8, by putting `export LANG=en_US.UTF-8` in my .bashrc file. And the question is, why? Why should something like that be necessary in this day and age, 2014? The default was UTF-8 for Mint, obviously; why should Debian be any different? What would cause Debian to use such an obscure and outdated default, even if I told it at install time what I wanted my locale to be, and /etc/locale.gen only contains `en_US.UTF8 UTF8` as the only (uncommented) line. And do I need to remember to edit the .bashrc file for every new user account that I create from now on to edit the export line in?


title: Arch: Is "SigLevel = Never" the only convenient way?

text: The only way I can install majority of packages without rejection from signature database is to put `SigLevel = Never` in `pacman.conf`. Its not supposed to be the right way, but I don't seem to be able to get pacman going any other options for SigLevel. Is what I'm doing right? And is it a frequent and common security threat that I should worry about, every second, day and night? Thanks.


title: aptitude: Meaning of curly brackets, i.e. package1{b} package2{a} package3{u}

text: When using **aptitude** , the list of changed packages sometimes has a single character in curly brackets behind some package names. The man-page has two examples of them but does not explain them (version 0.6.10-1). I have noticed {b}, {a} and {u} so far. The former one seems to show up when running `aptitude install` and tries to re-install packages I deleted (e.g. via debfoster, how can I disable that?), the latter two seem to have something to do with automatic dependency resolution. What do these characters mean, are there others, and what implications do they have for other operations? Is that extra information available to `dpkg` or `apt`?


title: How big should the rootfs partition should be on Arch Linux?

text: I've installed ArchLinux yesterday and set up a 10 GB partition for the root file system, 256 MB for swap, and the rest (456 GB) for my /home. However I still have 4.0 GB left on my root file system after installing some packages (GNOME, Firefox, Thunderbird etc...) and running a pacman clear cache. Does it suffice to have 10 GB for root file system, or could I end up running out of space in a couple of weeks/months?


title: 2 Factor Authentication in SSH using public key and PAM

text: I'm trying to setup 2 Factor Authentication. I want the user to login successfully if:   * The public private/public key matches (authentication method: publickey) or the password is correct   * My pam authentication method is successful. The second authentication method is a PAM file. So I place it into `/usr/lib/pam/` and added `auth required my_pam_module.so` in `/etc/pam.d/sshd`.   So far I can either log in using the (publickey method) or (a password and whatever is required by me pam module). So I added `AuthenticationMethods publickey,keyboard-interactive` in `/etc/sshd_config` and now I'm required to have the public key, password, and "whatever is required by me pam module". What lines do I need to change in order to achieve what I described above? I'm using Mac OS X Mavericks (10.9). If you aren't familiar with Mac, it could also help what you'd do on your Linux system.


title: Centos apache virtual hosts definition

text: _Please excuse me if my logic is flawed as I am really new to Centos._ I know I can define multiple virtual hosts in my **_httpd.conf_** file. But what I would like is to define virtual hosts in individual files as I am used to doing under Ubuntu. In Ubuntu, my virtual hosts are defined in files under my **/etc/apache2/sites-available** and individually enabled ... but I can't find a similar structure & system under Centos. Please help!


title: I want to upgrade to Debian Squeeze, but what are some pre-caution procedures that I should take?

text: I want to upgrade to Debian Squeeze and there are quite a few guides out there, but I want to be safe and make sure I don't break my system. Is there a way to check if my current install packages are going to work on Squeeze? If so, how? How can I backup my system to ensure it's okay to upgrade?


title: "Open file" dialog: Focus jumps to text field (LMDE / Cinnamon)

text: I have a usability problem with the "Open file" dialog. The questions would be:   * Is there any way out? E.g. can I disable the autocomplete?   Otherwise, I might post a bug report..   * Why does this happen?   Which package / component is responsible for this dialog?   (so I know where to report it) Details: I'm on LMDE (Linux Mint Debian Edition) with Cinnamon. The problem happens in the "Open file" dialog i get in GEdit, Chromium, etc.   I don't know which exact package is responsible for the Open file dialog - Cinnamon, Gnome, Nemo or something else. Maybe someone could confirm if this happens in other distros / desktops.   Thus, I also don't know if this is better suited for unix.stackexchange or for askubuntu. Steps to reproduce:   * Hit Ctrl+O in an application (browser, gedit, other) to open the "Open file" dialog.   -> The dialog contains a file browser area, and at the top, a text field for file name / path.   -> focus is on the text field.   * Click into the file browser area   -> this will set the focus on the file browser area   * Start typing   -> this will search in the list of files in the file browser area   * Hit the up/down arrow keys   -> this will move the current selection up and down in the file browser area   * When a directory is selected, hit Enter   -> this will let the dialog dive into that folder.   -> PROBLEM: Now the focus is back on the text field!   -> A dropdown with autocomplete suggestions appears.   * Start typing.   -> this will type in the text field, instead of searching in the file browser   * Hit TAB.   -> this will select an autocomplete option, instead of jumping to the file browser   * Hit the down arrow key.   -> This will go down into the autocomplete dropdown, instead of to the file browser area. This is all quite painful to me. I like to focus on the file browser area, but the dialog won't let me :(


title: How to get a response from any URL?

text: I have been asked to write a shell script _To check if a URL is UP/Working or not for my Project._ I tried to find some hints over the internet, but whatever I got is about checking whether the URL exists or not. I first tried with `wget`.               wget -S --spider https://genesis-dev.webbank.ssmb.com:21589/gop-ui/app.jsp 2>&1 | awk '/^  /'     if [ $? -ne 0 ]     then echo "Server is UP"     else     echo "Server is down"     fi      My next attempt was with `curl`.               curl -ivs  https://genesis-dev.webbank.ssmb.com:21589/opconsole-sit/opconsole.html#     if [ $? -ne 0 ]     then echo "Server is UP"     else     echo "Server is down"     fi      But, both are checking existence of the URL not the response.


title: Chromium browser does not allow setting the default paper size for "Print to File"

text: In Chromium, as in other web browsers, there is a Print function, which includes printing to physical printers, as well as a "Print to File" function. The default paper size for the physical printers appears to be set to the same default paper size as the printer settings in CUPS itself. So those are fine. However, the default paper size for the "Print to File" option is set to "US Letter", and I can't figure out how to change it. This has been asked on SuperUser two and a half years ago, at time of writing, but there were no sensible answers given. I could not find any obvious issue or bug for this. Am I missing something? My (possibly naive) expectation was that Chromium would get it from a default system setting. The obvious setting is `/etc/papersize`, which happened to be set to `letter`. I changed it to `a4` and restarted the browser, but it doesn't make any difference. The version of Chromium I am using is `35.0.1916.153-1~deb7u` on Debian 7.6 (wheezy), the current default version for that release. UPDATE: Reported this to the Chromium issue tracker as Chromium browser does not allow setting the default paper size for “Print to File”, but I'm not holding my breath for a reply. UPDATE 2: @don_crissti pointed out that Chromium got its default paper size in "Print to File" from LC_PAPER, or at any rate, it is one of the things it looks at. I verified this. I had earlier seen some stuff on the web about this, including this Mozilla bug report with a entry by our very own @derobert, but had not taken the possibility seriously enough to check it out. Here, of course, is also a Debian bug report: Use LC_PAPER. Extra points for anyone who can document how this is done in the Chromium source.


title: Does ~/.bashrc set environment for users whose shell is /sbin/nologin?

text: I have an SFTP server and have set user shells to nologin to restrict access to SFTP. I want to set a conditional umask of 0002 so that newly created files are group writable for all SFTP users. Can I put this code in their bashrc to ensure that all newly created files are group writable or is there a better method? Red Hat 5/6 Linux.   NFS3 filesystem


How do I disable the left CTRL on Ubuntu 13.10? Actually I can do it already. All I need to run is               xmodmap -e "keycode 37 = "      The problem I have is this only works if I run it from the terminal _after_ my machjine has booted. I really want this run on bootup. I've tried including the command in a few places:   * /etc/rc.local   * ~/i3/config (I use the i3 window manager) None of them work. Any help greatfully recieved :)


title: How to power off USB stick or MMC card under linux?

text: Usually I just unmount the usb stick or mmc before unplugging it but I'd prefer to turn the power off before doing so. I think Windows does this, so the hardware should allow for turning off the power to a specific port but I don't know how to do this on a recent linux kernel (I am not sure if suspending is really the same but afaik it is deprecated/removed from recent kernels anyway). If you know how to do this, please explain. :)


title: Copy files from remote server to local, ignoring existing files (rsync not available)

text: I would like to copy a directory of files from a remote server to my local machine. As it is a large number of files, the option of ignoring existing files is desirable.   Unfortunately, `rsync` is not available for some reason (the remote server is from a CDN service, and beyond my control). So I think I am stuck using `scp -r` on the folder in question. Is there anyway of doing this while ignoring existing files?


title: How to install JDK and eclips in linux mint 15?

text: I am absolute beginner Linux user, and I want to know simply how to install JDK ( java development kit ) and eclipse IDE in Linux mint 15


title: sed special character replace not working in shell script

text: I want to write a script 'test.sh' that will take a user's input and replace all special characters with a '\' + the character. My script:               #!/bin/bash     echo 'input='"$1"     arg=`echo "$1" | sed 's:[]\[\^\$\.\*\/]:\\&:g'`     echo 'modified input='"$arg"      My command works on the string 'xy', which does not have any special characters. I run this in my terminal:               test.sh xy      And I obtain:               input=xy     modified input=xy      However, when I run this:               test.sh x.y      I get:               input=x.y     modified input=x&y      I don't understand why this script is not working. I expect to get:               input=x.y     modified input=x\.y      I think the problem lies in this sed command but I'm not sure where:               sed 's:[]\[\^\$\.\*\/]:\\&:g'


title: grep for capital words

text: I have a file that has declarations in it with capital words, something like:               public final Foo BAR;      these declarations are not all uniform. Is there a way for me to grep out just the capital lettered words from the line? I know how to find lines that have capital letters in them, but thats not what I want. I want only the matching capital lettered word. Thanks!


title: stty before login

text: We've got some HP-UX Integrity VMs that are difficult to log in to at the console because the `KILL` character is set to `@`, which also happens to be a component of some passwords. Now I know we can get around this by logging in as a different user, and issuing `stty KILL '^U'`, and that's already in the `.login` for all users. I also know that using `\@` will work. The real question is what do I need to do to change the `KILL` character system-wide so that we don't either have to kludge interactive login or avoid passwords with `@`?


title: What happens to data copied after undoing fdisk?

text: Suppose I have some drive with a single partition. For some reason I decide to repartition it, using `fdisk`. I create multiple partitions, then write the partition table, then exit `fdisk`. At this point the kernel is still not aware of the new partition table : the initial partition is still mounted through NFS, it was only "lazy-unmounted" (`umount -l`) before `fdisk`, so it triggered the "device or resource busy" error. Now I change my mind, launch `fdisk` again, and merge all partitions into a single one, exactly as it was at first. Then again I write the partition table, exit `fdisk`, and the kernel still has no clue of what just happened. Finally, I `rm -rf` everything on the disk, then copy some new data on it. Question is : what happens at the next reboot, when the kernel will see the "new" (yet same as before) partition table ? Will the data will be straight readable by the system ?


title: Piping fragments of a document through various commands

text: I want to send, maybe using escape sequences such as `$$$`, fragments of an article through various commands, possibly with modifiers. The stdin would be replaced by the corresponding stdout. (Deleting the very special modifier should be simple enough with sed, if necessary.) I believe I can do it with python... but I was wondering if there is that special UNIX tool or technique that I don't know about that might do 90% of the trick elegantly. To be more concrete, consider the following document:               $$$ figlet -f script     Title     $$$          Now it's time to visualize the cosine function:          $$$ gnuplot     set terminal dumb     plot cos(x)     $$$          Finally, a simple directed graph:          $$$ graph-easy     digraph G {     A -> B;     }     $$$      After running my program I would get:                ______     _     (_) |o     | |         |  _|_ | |  _       _ ||  |  |/  |/      (_/ |_/|_/|__/|__/               Now it's time to visualize the cosine function:                   1 ++----------***--+---------------****---------------+--***----------++           +          *   * +               * +*               + *cos(x) ****** +       0.8 ++        *    *                *    *                *    *        ++           |         *     *               *     *               *    *         |       0.6 ++        *     *              *      *              *     *        ++           |        *       *             *      *             *       *        |       0.4 ++       *       *             *       *            *        *      ++           |       *        *            *        *            *        *       |       0.2 ++      *         *           *         *           *        *      ++           |       *         *          *          *          *         *       |         0 ++      *          *         *          *          *          *     ++      -0.2 ++     *           *         *          *         *           *     ++           |      *            *        *           *        *            *     |      -0.4 ++    *             *       *            *       *             *    ++           |     *             *      *              *      *             *     |      -0.6 ++    *             *      *               *     *              *   ++           |    *               *    *                *    *               *    |      -0.8 *+  *                 *   *                *   *                 *  +*           +* *             +    *  *         +        *  *    +             * *+        -1 +***-------------+-----**----------+---------**-----+-------------***+          -10              -5                 0                5                10               Finally, a simple directed graph:          +---+     | A |     +---+       |       |       v     +---+     | B |     +---+      Any thoughts will be appreciated. Thanks a lot, and cheers!


title: kill or kick all clients from a running vncserver without restarting the server

text: I encounter quite often the problem, that I want to kick all connected clients from a running vncserver. Even better would be to be able to kick / kill even certain clients. With `netstat -tupa | grep 5901` I see that several clients are connected, but I don't know how to disconnect them. I'm using the tigervnc-server.


title: Understanding Kerberized NFSv4 Authorization

text: Articles such as this one seem to point out that Kerberizing NFS(v4) mounts not only prevents machines without a Kerberos service ticket from mounting the shared directory but also uses the user's Kerberos ticket to authorize user actions on the shared files. I quote the relevant part: > Before NFSv4, security on NFS was pretty much non-existant. You could > prevent unauthorized machines from connecting to NFS exports, but had to > rely on user ID mappings being the same between systems to use the server's > permissions to adequately protect files. Using Kerberos in this manner makes > NFS much more secure than it used to be. What I'm having trouble understanding is the following scenario, which seems to contradict this statement:               # mount /share #succeeds because I have a service ticket in my keytab     $ klist     klist: No credentials cache found (ticket cache FILE:....)     $ ls /share     ls: cannot access /share: Permission Denied     $ kinit     Password for joe@MYREALM:     $ ls /share     contents of share      So far so good, but when I do this:               $ kdestroy     $ ls /share     contents of share      What's happening here? I was able to access the NFS mountpoint even though I had no Kerberos credentials. Is this behavior expected or is my mount misconfigured? **Info**   1. Running MIT Kerberos V on Debian Wheezy 7.0   2. My mount options:              $ grep nfs4 /etc/fstab     server.myrealm:/nfs_export /share nfs4 sec=krb5,user 0 0        3. My `/etc/exports` on the server:              /nfs_export *(rw,sync,no_subtree_check,sec=krb5)      The `nfs(5)` page says that the GSS API supports two additional flavors of Kerberos security: `krb5i` to check data integrity and detect any tampering and `krb5p` to further ensure that all RPC calls are encrypted for security. I don't think enabling either of these will solve my problem. **Edit** As per dawud's suggestion I tried both `krb5i` and `krb5p` and the behavior persists. My problem, again, is how to make sure the `/share` is inaccessible to anyone who currently holds no Kerberos ticket? Furthermore, can I use the user's Kerberos ticket for authorization purposes ( _i.e._ , control who can access what) as the article I referenced seems to imply?


title: Windows share suddenly empty

text: I have a laptop running Mint 15 Olivia that can access a shared folder from a Windows Vista desktop. Normally I can access and modify the files as if it were just another folder on the laptop, both through Nemo's interface and from the terminal. This morning the drive which previously contained the shared folder appeared as empty. Even if I unplug the ethernet connection and turn wired connections off for the laptop (the desktop is not connected to the internet except through the laptop), the desktop still appears in the file system, but it is empty. If I try to access the folder from the terminal, using a command that worked last night, it claims that there is no such drive or directory. This happened once before, and I fixed it by restarting the Linux laptop, so I don't think the Windows computer is the problem here. Toggling the wired connection on/off on the laptop and disconnecting and reconnecting the ethernet do not change anything. Is there a way to fix this without restarting the computer?


title: Harddrive I/O per Pid

text: is there any way to see the disk I/O per pid/process ? Monitorix shows me the following and correct me if I´m wrong, but it looks like that the harddrive is slowing down the whole system: ![enter image description here](http://i.stack.imgur.com/qy7Hv.png) ### UPDATE #1 Atop seems to give a great overview above everything.   * Might I ask you what the wait I marked red means?   * Is that the wait from the disk I/O? ![enter image description here](http://i.stack.imgur.com/5ifJi.png)


title: Allow multiple remote connections to an ssh Dynamic forwarded port

text: Let us assume I have three machines A - Server to which I am sshing to   B - Client from which I am sshing   C - Another Client in B's subnet Now, I set up dynamic port forwarding for port 1235 by executing this in Client B               ssh -D 1235 a@A      where a is the username at server A. Now, I can connect to this port 1235 only from B as it is bound to localhost. If I modify the command as               ssh -D C:1235 a@A      then only C can connect to the port 1235 of B and not B itself. There is a third option I could use, namely               ssh -D 0.0.0.0:1235 a@A      whereby both B and C can connect to the port 1235 of B, but so can all the other machines in the same subnet as B and C. What I really want is a way to bind the dynamic port to allow only B and C to connect to it and not any other machine. How can I achieve this?