title: Bash scripting rsync puzzler

text: Frustrating. The script below work for the first two targets, but not the second.               #!bin/bash     ...     backitup () {     Todaysdate=`date "+%Y-%m-%dT%H_%M_%S"`     Sourcedir=$1     Destination=$2     Username=$(echo $Sourcedir | cut -f1 -d'@')     if [ "$Username" = "root" ] ; then         RSYNCPATH="rsync"     else         RSYNCPATH="sudo rsync"     fi          cmd="sudo rsync -vazP --rsync-path='$RSYNCPATH' --log-file=/var/log/rsync.log $Sourcedir /BACKUPS/$Destination/back-$Todaysdate"                     echo $cmd >> ~/cmd.txt                     $cmd     ...     }     backitup root@HAZns01:/etc "HAZNS01/etc"     backitup root@HAZns01:/home/ftpusers "HAZNS01/ftpusers"     backitup jakadmin@HAZFAND10:/etc "HAZFAND10/etc"     backitup jakadmin@HAZFAND11:/etc "HAZFAND11/etc"      The second two calls give:               unexpected remote arg: jakadmin@HAZFAND10:/etc      If however I run then run the contents of cmd.txt manually from the commandline (bash cmd.txt) then it runs fine. How can that be? (I've got passwordless ssh all setup correctly of course) What am I missing?


title: Installing mailx on Openelec, Raspberry PI

text: Well I have searched some of the possibilities to install command line mail clients but there are no easy ways to install. Is this even possible without compiling the mail client ?


title: How can I disable the new history feature in Python 3.4?

text: Since upgrading to Python 3.4, all interactive commands are logged to `~/.python_history`. I don't want Python to create or write to this file. Creating a symlink to `/dev/null` does not work, Python removes the file and recreates it. The documentation suggests to delete the `sys.__interactivehook__`, but this also removes tab-completion. What should be done to disable writing this history file but still preserve tab- completion? Additional details:   * Distro: Arch Linux x86_64    * readline 6.3-3   * python 3.4.0-2


title: Why aren't my iptables rules appearing in the relevant list after reboot?

text: I am trying to write two persistent NAT rules, which I save via `iptables-save > /etc/iptables.ipv4.nat`, and restore upon reboot via `pre-up iptables- restore < /etc/iptables.ipv4.nat` in my `/etc/network/interfaces`. Prior to reboot, the rules display when `iptables -t nat -L` is used, but after reboot the rules seem to return to their default. Curiously, when I inspect the file to which I saved the rules, they are still present. So what's happening, and how do I fix it (if it requires fixing at all)?


title: Can slattach control a serial WiFi device?

text: I have a Wi-Fi device which is driven by AT commands over a USB-Serial connection. I am able to successfully make a serial connection to the device and set the SSID, PSK, obtain an IP address, and do other configuration. However, I would really like to be able to attach it as a 'wlan*' and be able to configure it directly via ifconfig / wpa_supplicant. slattach "works" in that it creates sl0 in ifconfig, however iwconfig just shows garbage along with the message > "Warning: Driver for device sl0 has been compiled with an ancient version of > Wireless Extension, while this program support version 11 and later. Some > things may be broken..." Is there any Wi-Fi equivalent to slattach, or any kernel modules I can add to my build that will facilitate slattach talking to this device?


title: mount root fs to /target

text: I am installing crunchbang linux (#!) to my eeePC and it is unable to start the disk partitioner. I traced the problem to partman and partman-lvm that states > No volume groups found. So I have done some snooping, and I can get around that part of the installer (that just hangs) if I can mount my future root partition to /target and then go from there. However, I'm having a lot of trouble with the `mount` command. I want to mount /dev/sda1 to /target. /dev/sda1 is ext3. When I try > mount -t ext3 /dev/sda1 /target it states: mount -t ext3 /dev/sda1 /target/ > failed: Invalid argument. To get a place (/target) I simply did mkdir /target. Perhaps this is not the proper way to do this? Gracias =)


title: Different linux distros sharing the same /home folder?

text: What is the best way to share the same `/home` directories between different linux distribution? I mean, I want to have both, say, Fedora and Arch, and I want to find my files at home no matter which linux distro I boot into. But if I mount the same partition for `/home` then I may mess up the configurations saved inside `/home` directory. So what can I do?


title: Recover Windows 8 after installing Kali Linux (GRUB)

text: I've installed Kali Linux over Windows 8, Kali is installed in a seperate ext4 partition(sda2) and Windows in sda1. Now GRUB is not finding Windows 8 on startup ! I can see Windows 8 with os-prober command. What shall I do ?


title: How long is the password for executing a command with sudo cached?

text: If I run a command which requires root privileges with `sudo`, I will be asked to enter the current user's password. After that for a while, if I execute the same sort of commands with `sudo`, I won't be asked for the password again. So my guess is that the password is cached somewhere until it expires. How long is this expiration time? Is it possible to configure it?


title: How do I force remove a package in Arch with pacman?

text: How do I force remove a package in Arch with `pacman` while other packages still depend upon it.               pacman -R perl-libwww                                                                    checking dependencies...     error: failed to prepare transaction (could not satisfy dependencies)     :: perl-app-cpanminus: requires perl-libwww>=5.828     :: perl-app-pmuninstall: requires perl-libwww     :: perl-app-sd: requires perl-libwww     :: perl-catalyst-action-rest: requires perl-libwww>=2.033      :: perl-catalyst-runtime: requires perl-libwww>=1.64     :: perl-cpan: requires perl-libwww     :: perl-cpan-mini: requires perl-libwww     :: perl-cpan-uploader: requires perl-libwww     :: perl-feed-find: requires perl-libwww     :: perl-http-body: requires perl-libwww     :: perl-http-request-ascgi: requires perl-libwww     :: perl-module-cpants-analyse: requires perl-libwww     :: perl-module-install: requires perl-libwww>=5.812     :: perl-net-trac: requires perl-libwww     :: perl-net-whois-raw: requires perl-libwww     :: perl-prophet: requires perl-libwww     :: perl-rt-client-rest: requires perl-libwww     :: perl-uri-fetch: requires perl-libwww     :: perl-www-mechanize: requires perl-libwww     :: perl-xml-atom: requires perl-libwww     :: perl-xml-feed: requires perl-libwww      basically LWP 6 split a whole bunch of packages, and I need to remove it so I can reinstall it.


title: How to make gksudo or gksu sessions last longer in Linux

text: Every time I want to open a GUI program that needs root permissions, I have to put my password. For example, I open synaptic and put my password then close it and a second later decide to reopen it it asks for the password again. Ubuntu 9.04 wasn't like that, it had a timeout of around 1 minute between sessions. I would like that again on the newer version of Linux. I know how to make `sudo` sessions last longer in Linux. All I have to do is type:               sudo visudo      then change:               Defaults        env_reset      to (3 minutes):               Defaults        env_reset,timestamp_timeout=3      Is there a similar way to change the `gksu` session's timemouts?


title: How to configure up arrow to get to the previous command in maxima?

text: If I press `Up` in a shell, then normally it brings up the previous command I entered. In `maxima` it's all different. Pressing `Up` just prints out `^[[A`. The same thing happens when I try to move the cursor backwards (`^[[D`) How can I fix this?


title: Use math.h and link objects files without -lm

text: I am currently reading Advanced Linux Programming and in the section 2.3.3 it is said that if I use some function from math.h I have to link the object files with -lm. But I am pretty sure that I already used some math function like sqrt, pow or log without having to specify the use of this shared library. Do you see where the problem is? Thank you


title: Combining different DNS servers

text: My company uses DNS servers that provide access to internal systems, for example "build.company.de" is resolved accordingly if one of the internal DNS server is queried. However, the internal servers are very slow. I'd love to use, for example, Google's DNS servers instead for non-internal queries. How can I configure to use Google's DNS servers all of the time, except when the host does not exist? Alternatively, It would be nice to specifiy that all queries for the domain "company.de" should be resolved by the internal servers instead. The current behaviour is that non-existing / internal hosts are not resolved, because my system sends to query to Google's servers. Concrete example 1:                   Who is heise.de? -> ask 8.8.8.8 (Google)         Who is build.company.de -> ask 10.1.1.1 (internal server)      Concrete example 2:                   Who is heise.de? -> ask 8.8.8.8 (Google)         Who is build.company.de -> ask 8.8.8.8 (Google) -> upon failure ask      10.1.1.1 (internal server)


title: Ubuntu 12.04 apache2 site shows index of instead of actual site on redmine

text: I have an Ubuntu 12.04 server that has a successful redmine install on it. I have been using redmine on it for a while, but when I tried to set up the SSL cert using this method, https://www.digitalocean.com/community/articles/how- to-create-a-ssl-certificate-on-apache-for-ubuntu-12-04. My https:// version of the site just shows my "index of /" instead of the actual site. If I go to the old http:// it still successfully shows the site. The only thing that I've done which isn't standard practice (to the best of my knowledge) is to change my default DocumentRoot in /etc/apache2/sites- available to /var/www/redmine, from the standard /var/www/. I have made sure that my pages default-ssl document root is also /var/www/redmine (which is where my symbolic link to the actual redmine folder is). If you need anymore information I'd be happy to post it. Thanks,


title: remote desktop connection - similar to team viewer

text: I have a few different Desktop versions of Ubuntus (13.04, 12.04, Kubuntu,..) on different computers. I would like to manage all of them on a single computer via remote connection and be able to use GUI programs on the remote computer as team viewer allows. But, team viewer provides a limited connection time for the free versions. Therefore, I am looking for a substitute that it is easy to install, use, and works fine on different versions of Ubuntu desktops, and freeware. What would be your suggestion?


title: How to get list of computers similar to what is shown under "Network" in Windows

text: In Windows 7 when I click on _Network_ I get a list of computers with the same workgroup of mine. But in Fedora when I click on _Network_ I just get a single item _Windows Network_ and I can't see the computers that are shown in Windows. How can I see them in Linux?


title: Kernel 3.14.1 compilation errors

text: I installed the kernel 3.14.1 and there seem to be no issues.               uname -r     3.14.1-031401-generic      However, when I try to go to the folder and try to do a make it fails. I see that multiple files are missing. any idea how I get them.               sudo make       HOSTLD  scripts/kconfig/conf     scripts/kconfig/conf --silentoldconfig Kconfig     make[1]: *** No rule to make target `/usr/src/linux-headers-3.14.1-031401-generic/arch/x86/syscalls/syscall_32.tbl', needed by `arch/x86/syscalls/../include/generated/uapi/asm/unistd_32.h'.  Stop.     make: *** [archheaders] Error 2      I'm not able to understand how to solve this error. I looked up online and I'm now exhausted after spending 30 odd hours. to check if the header files are available, I do `sudo apt-get install linux- headers-$(uname -r)`               Reading package lists... Done     Building dependency tree            Reading state information... Done     linux-headers-3.14.1-031401-generic is already the newest version.     0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.


title: Copy/backup all dirs containing files matching a regexp

text: I would like to do a backup where I recursively go through a dir structure and only get directories with files whose names matching a particular regexp. I would like to keep the directory structure, so that if there is a match at ~/dir1/dir2/regexpmatch.txt it creates the same dir structure in the target and the file is copied over to /media/backup/dir1/dir2/regexpmatch.txt preferably with rsync, but if that is not possible another program would do.


title: What is this file called - doing in my home directory?

text: In my home directory there is a file called -. Seeing inside it was hard, but I finally managed to do it. At the top was this: \-----BEGIN PGP PUBLIC KEY BLOCK----- followed by a bunch of characters. Then at the end was \-----END PGP PUBLIC KEY BLOCK----- I don't have pgp or gpgp installed. And another strange thing is that the date of the file is from last year, way before I installed this OS! What could be happening here!?


title: wificard goes into disabled state setting up AP in N-mode

text: I've recently set up an Access Point using the Ralink RT5390, using Linux Kernel 3.12.18. I'm using the rt2800usb module as the driver for the card, and rt2800.bin v0.29 as the firmware. The access point works perfectly well in b/g mode, with the following hostapd conf file:               driver=nl80211     logger_syslog=-1     logger_syslog_level=2      logger_stdout=-1     logger_stdout_level=2     debug=0     eapol_key_index_workaround=0     own_ip_addr=127.0.0.1     interface=wificard3     channel=1          hw_mode=g          bridge=br2     ssid=USBbox3          ap_isolate=1      However, when I try to set the access point to work in N-mode I get an error at startup saying `wificard3 entering disabled state`. Then when I log in to the terminal `ifconfig` shows that the interface is down. This is my hostapd conf file for n mode:               driver=nl80211     logger_syslog=-1     logger_syslog_level=2     logger_stdout=-1     logger_stdout_level=2     debug=0     eapol_key_index_workaround=0     own_ip_addr=127.0.0.1     interface=wificard3     channel=1          require_ht=1     hw_mode=g     ieee80211n=1     wmm_enabled=1     ht_capab=[HT40-][HT40+][SHORT-GI-40][TX-STBC][RX-STBC1][DSSS_CCK-40]          bridge=br2     ssid=USBbox3          ap_isolate=1      I'd be really grateful for any suggestions on this, as I don't have much experience setting up access points.


title: Is it normal to have a file called "shadow-" in the /etc directory?

text: I am noticing a lot of weird files appearing in my router and on my various filesystems. Files in weird places or files that have to do with security with a - sign after them. If I do `ls -l /etc/shadow*`, this is what I see.               -rw-r----- 1 root shadow 1163 Aug  9 15:48 shadow     -rw------- 1 root root   1163 Aug  8 21:11 shadow-      Does that look normal? What is the 2nd shadow file used for?


title: Music player with random song command

text: I recently migrated from Windows, where I've been using Foobar2000 for a long time. I've been looking for a music player that replaces a feature I considered basic. What I need is a player that has a play random song command (which can be sent from the command line). Note, that this is different from shuffle, which most players have. In shuffle, the order of the songs is mixed, and the playback is random. What I am looking for is something where playback is ordered, but when a certain command is issued a song is randomly picked and the playback jumps to it; playback then continues on in the normal sorted order. The closest I found was gmusicbrowser, which has a random album command. This is close, but I'd prefer an actual random song. I don't care about things like looking up lyrics or fancy library interfaces, just a simple playlist that can handle 30k+ songs. I'd prefer something with a gui, but I could do command line only if need be. Edit: To clarify what I consider a normal ordered playback. It should play back in order of band, then year, then album, then track (or something similar, this should probably be configurable somewhere anyway). The only time it should deviate from this, and jump to a random song, is when it receives the random song command.


title: Deny a machine from PPP authentication

text: In my work I have been struggling for a long time trying to simulate the behavior of a PPP server that doesn't respond to "PADI" PPP packets. One way to do that is to shutdown the PPP service, but it will take down all my colleague's PPP sessions. Is there another simpler practice to deny access for a specific machine?


title: What platform to use for programmatically editing text files?

text: I just volunteered at work for a project that involves creating a program to edit log files on a server. By edit I mean extract useful information to another location and remove lines of text that is searched for to have certain text identifiers. My problem is that I am a linux beginner and I don't know the most efficient way to do this. Is it best to use a scripting language like python? or should I create shell files? I plan to have cron run the job every night.


title: Boot into a chroot?

text: I have Linux (Debian Jessie) installed on a hard drive. Drive - `sda1`, ext4fs, and `sda2` \- swap I have a `/chroot` folder. There is installed another system, in `/chroot` folder. Question: How to tell the bootmanager, to boot _not the primary system_ (main, Debian Jessie), but system in _/chroot_? Probably, change `/menu.lst` and `/chroot/etc/fstab`? (`vmlinuz root=/dev/sda1/chroot`?) Or another variant of question: is it possible, to have linux installed not into root directory of partition, but in folder? (`/another_linux/bin`, `/another_linux/home`, `/another_linux/etc`, ...)


title: Segmentation fault when executing a command in rc.local

text: I'm trying to execute `xbindkeys -f /etc/xbindkeysrc` command on the start up. I've put this in my `rc.local` including another command :               #!/bin/bash     echo OFF > /sys/kernel/debug/vgaswitcheroo/switch     xbindkeys -f /etc/xbindkeysrc     exit 0      But then i find that `xbindkeys` command didn't get executed. I've checked `/var/log/messages` and found this line :               rc.local[1194]: /etc/rc.d/rc.local: line 4:  1203 Segmentation fault      (core dumped) xbindkeys -f /etc/xbindkeysrc      Could you tell me please, what does `segmentation fault` mean ? and how to avoid it ?


title: CentOS 6.4 Mail Server

text: I'm trying to install a mail server on my root server. I'm relative new to Linux but not a absolute beginner. There are many many how to's on the internet I tried to get my own mail server with IMAP/SMTP. Also maybe some virus/spam detection. I've got a Root Server (CentOS 6.4) and a own domain (let us say 'morekings.com'). I want to have some email adresses (admin@morekings.com, peter@morekings.com, etc). Nice would be some kind of encryption (ssl/tsl). But I have no official cert. Roughly speaking I removed sendmail, installed postfix and cyrus and configured it. Among others for example I tried this tutorial https://www.digitalocean.com/community/articles/how-to-install-postfix-on- centos-6 In main.cf of Postfix I used this:               myhostname              = mail.morekings.com      mydomain                = morekings.com Is this right? At least I got it to send mails via Thunderbird and send/receive via telnet. But I'm not so sure about that what I'm doing. Now I'm looking for some guides which will get me working this. Also some guides which get me into this topic.


title: Any implementations of unix with "flat", tag-based file systems?

text: As I understand, files in Unix are all stored in a "flat" structure in the hard drive -- the file system is merely links from directories to other directories and eventually to leaves/nodes/files. Many hard links may point to the same file (but not the same directory/branch) Has there been any approaches to this where there are essentially no folders at all -- all of the files are in one giant folder, and instead of folders you have tags? Your home directory might then not be files in folders but instead merely lists of tags/folders, where a file may be found in more than one? And also some sort of software faculty to do more complicated tag queries, like filtering.


title: Permissions corrupted?

text: A few weeks ago, I installed Linux Mint on a USB flash drive. I used it to copy the contents of my HFS+ external hard drive to my Windows drive on my desktop. Then, I formatted the external drive to install linux on it, as well as create a large HFS+ partition. I copied the contents back from the windows drive to the new HFS+ partition on the external drive. Now, half of the files' permissions are acting weird. For example, on the drive, "/Files" is `drwxrwxrwx`, and if I copy something that's `-rw-r--r--@` from my Desktop on my Mac laptop into "/Files" on my external drive, it remains `-rw-r--r--@`, but I can't rename, modify, or delete it. Why might this be? I do not have admin/root access on my mac, but I do on my Linux install. I've run "chmod -R 777" on the entire drive on my linux install, and I can modify these files there, but the permissions still act weird when it's on my Mac. Is this because there are different users and groups on my Mac?


title: conditional DirectoryIndex based on IP address, using .htaccess

text: I've got this in `httpd.conf`:               <VirtualHost xx.xxx.xx.xxx>         Options All +ExecCGI         ServerAdmin hostmaster@thehost.com         DocumentRoot /var/www/html/domain.com         ServerName  dl.domain.org         DirectoryIndex dlindex1.html     </VirtualHost>      ... which is fine (what I need as the `DirectoryIndex` for our 'dl.domain.org' subdomain), _but_ now I also need to alter that `DirectoryIndex` based on IP address, using `.htaccess`. Is this possible? StackOverflow posts are telling me that I cannot set `DirectoryIndex` conditionally.. but instead _have_ to use a `RewriteRule`. If that is true, OK, but what `RewriteCond` and `RewriteRule`? I am pretty noob in Apache, but anyway have tried many things, including (where the actual IPs are those of our 2 devs):               RewriteCond %{REMOTE_ADDR} ^111\.222\.333\.444$    [OR]     RewriteCond %{REMOTE_ADDR} ^555\.666\.777\.888$     RewriteCond %{SERVER_NAME} ^dl.domain.org     RewriteRule ^(.*)/$ $1/dlindex2.html      ..or even just (as an absolute test):               RewriteCond %{REMOTE_ADDR} ^555\.666\.777\.888$     RewriteRule (.*)/dlindex1.html$ $1/dlindex2.html      But it seems that whatever I try it just serves up the `DirectoryIndex dlindex1.html` as per `httpd.conf`, as opposed to the `dlindex2.html` I want served up as the default page in that subdomain when a devs IP is calling. Can any one point me to what I can do to get what I am after? i.e. this: ...to actually, or even just effectively, alter `DirectoryIndex` based on IP address, using `.htaccess`, on the fly?


title: Zentyal dpkg dependecy install problems because packages are not configured

text: I have done a fresh install of Zentyal 3.5, which is based on Ubuntu 14.04. To be fully operational, several modules must be installed. Many of these modules failed to install since a chain of them cannot be configured. An example error is:               dpkg: dependency problems prevent configuration of zentyal-ntp:         zentyal-ntp depends on zentyal-firewall; however:             Package zentyal-firewall is not configured yet.      I have tried removing the packages and their configurations with `sudo apt-get purge [PACKAGE]`. Re-installing them was not successful after this. How can I install these packages?


title: Samba mount with password prompt as non-root user

text: I want to mount a password-protected SMB share (served by a Windows machine). The share is protected by a user name and password, and I may not write the password in a file, I want to be prompted for the password at mount time. I need a solution that works even for when the user on the client machine does not have any administrative privileges, so whatever method is used to mount the share must not allow him to get root permissions. The initial installation can be done as root. Users must be able to specify arbitrary server names. My immediate need is with Ubuntu 12.04, but the wider applicable a solution is the better. The client is headless, so I'm looking for a command-line tool. What I tried:   * `mount.cifs`: while it can be made setuid root, its authors do not consider it secure. Running it under `sudo` has the same problem.   * `smbnetfs`, `fusesmb`: I couldn't convince either of them to prompt me for a password.   * Nautilus and gvfs: `gvfs-mount smb://servername/sharename` fails with `Error mounting location: volume doesn't implement mount`. How can I mount a Samba share from the command line, as a non-root user, with a password prompt?


title: How to configure a computer as a hotspot?

text: I use OpenSuse 13.1 (with KDE). On my phone I can turn on a hotspot just by pushing a button. I have been researching how to do this on linux, I haven't found an easy way yet. What I want to achieve: I have a wired connection. I want to share this through a wireless connection (so that my phone can access the internet). I read that I could do this with an ad-hoc network. Is this correct or is this something different still? I did try this, new network (regular and shared I tried) -> mode: ad-hoc -> I gave in a ssid "hotspot". But it is not being detected by my phones. Perhaps ad-hoc is not allowed for them? Any suggestions? \-- update I have added the steps I have tried graphically:   1. Add new network: I need to choose between wireless and shared. I have tried both. But I presume it is wireless? ![see screenshot](http://i.stack.imgur.com/2ctS5.png)   1. Set a name and as ad-hoc (or infrastructure) network. -> none of the two seems to be detected by android or iphone.  ![see screenshot](http://i.stack.imgur.com/tJkBz.png)   1. I am connected by cable, do I also need to connect to the wireless (by dubble clicking it?) Am I missing something obvious? Or a missing host service/server? Etc... because none of the ad-hoc or infrastructure networks are showing on my cell phone. I am using knetworkmanager now (kde). If I can do it command line, would also be ok. \--update I have executed the following commands error free:                  nmcli nm wifi off         rfkill unblock wlan              ip link set dev wlp1s0 up         ip address add 192.168.5.1/24 dev wlp1s0              iptables -t nat -A POSTROUTING -s 192.168.5.0/24 -o enp0s20u2 -j MASQUERADE         sysctl -w net.ipv4.ip_forward=1 1> /dev/null              systemctl start hostapd.service         systemctl start dnsmasq.service      My /etc/hostapd is:               interface=wlp1s0     driver=nl80211     # bridge=br0     channel=3     hw_mode=g     auth_algs=1     ssid=test      My phone sees the test network. But keeps saying "Obtaining IP address...." I feel that I am very close now...


title: tmux equivalent to GNU screen's :wrap mode

text: I'm a long time screen user trying to make the jump to tmux. One screen feature I use is the ability to truncate `Ctrl``a` `:set wrap` output. This is especially useful when tailing log files or following compile sessions whose lines are hundreds of characters long. I've read the `man` page and googled extensively and cannot find an equivalent command, or a viable work-around using shell commands. The closest I can come up with is piping everything to `less -S` and putting less into "follow" mode.


title: Add header to outgoing email with postfix

text: Can someone please provide _an example_ on how to add a > Precedence: bulk header to all outgoing emails using postfix. I would like to know what file(s) to create or edit and what I should put in them. And also what to do to make postfix read in the new configuration. I have read quite a bit of documentation but it seems to expect a high level of familiarity with postfix. All I have gathered so far is that it may have something to do with `/etc/postfix/main.cf` and somehow add a PREPEND statement. Note that mucking about with postfix (and email in general) is way out of my comfort zone.


title: Why does "ls" require a separate process for executing?

text: Why does `ls` require a separate process for its execution? I know the reason why commands like `cd` can't be executed by forking mechanism but is there any harm if `ls` is executed without forking?


title: Question about inode and permission command

text: Can anyone tell me if this is true or false? Does the inode of a file have the addresses of blocks containing the file's content? Also for the permission command, there was a question asking that I have the right to change permissions for existing file, where the owner (r,w) g(r) condition. So I thought it's applicable for `chmod 640 filename.txt` and `chmod u+rw g+r filename.txt`, but apparently only the 640 is correct. Anyone know why the u+rw is not part of the answer?


title: Chat client with a web interface

text: I'm trying to set up a chat client on my Ubuntu server that I'll be able to access via a browser with my other local computers. Specifically, it would need to support XMPP and IRC. My first thoughts were Pidgin and Empathy, but they don't seem to have web interfaces.


title: Passing a variable to a bash script that uses 'EOF' and considers the variable a literal

text: in this script i end up with "$1" being saved to the /test file.               #!/bin/bash     cat > /test << 'EOF'     $1     EOF      the truth is.. i need to keep               'EOF'      as 'EOF' because my argument($1) contains dollar signs. but i need that argument to be saved rather than $1


title: Where does uname get its information from?

text: Where does uname really get its information from? I figure this is something that should be straightforward. Unfortunately, I can't find any header containing just that information. Say someone wanted to change the basic output of uname/uname -s from "Linux" to something else (essentially, renaming the kernel). How would he/she go about doing that the proper way (that is, changing the source)?


title: How to Upgrade Oracle VirtualBox 4.1.12 to to 4.2.10

text: I installed Oracle VirtualBox 4.1.12 in my Ubuntu 12.04. Now I want upgrade from 4.1.12 to 4.2.10 version. How can I upgrade the Oracle VirtualBox in command line


title: IPTABLES is slow after adding '-A INPUT -j DROP' to rule list

text: I am just getting started with iptables and stumbled across something I don't really understand. FYI, I followed the instructions of Ubuntu wiki's IptablesHowTo. The nat and mangle tables are empty, I'm only working with the filter table right now. ### The problem If I add the following iptables rules:               iptables -A INPUT -p tcp --dport ssh -j ACCEPT     iptables -A INPUT -j DROP      ... then I still have access to my machine via ssh, however all iptables commands take about a minute or two to run. It's not a DNS problem, `-n` doesn't change it. ### The solution If I flush the table and add these three rules instead, everything is working fine:               sudo iptables -A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT     iptables -A INPUT -p tcp --dport ssh -j ACCEPT     iptables -A INPUT -j DROP      Can someone explain to me, why the first rule has such a great impact on iptables? I understand that it allows established sessions to receive traffic, but why do I need it if ssh is open?


title: SSH & ForwardX11 vs ForwardX11Trusted --> beyond my grasp

text: I am on Ubuntu 14.04 and trying to get my head around `ForwardX11` vs `ForwardX11Trusted`. My default ssh_config contains the following lines:               #   ForwardX11 no     #   ForwardX11Trusted yes      Further, `man ssh_config` tells me that:               1.   command-line options     2.   user's configuration file (~/.ssh/config)     3.   system-wide configuration file (/etc/ssh/ssh_config)      and that `ForwardX11.default == no` and `ForwardX11Trusted.default == yes`. Now my questions:   1. I take it that 1. takes precedence over 2. over 3. None is specified, thus the default settings should be applied, i.e. `ForwardX11Trusted == yes`. If I SSH into a remote machine without the `-Y` or `-X` option, X11 forwarding does not work.   2. If I specify `-X`, X11 forwarding works but it seems to be in trusted mode?   3. If I set               ForwardX11 no     ForwardX11Trusted no      in `/etc/ssh/ssh_config`, I can now choose the mode correctly with the `-X` and `-Y` command line options. But, while the forwarding causes roughly .5 MBit of traffic in `-Y` mode, it hogs 6-10 MBit in `-X` mode.   4. If I explicitly set               ForwardX11 yes      SSH still ignores the `ssh_config` file. I still need to specify `ssh -X [...]`.   5. Why does SSH seem to ignore both the default settings and the config file?


title: What are the different virtual TTY numbers used for?

text: It seems by default (at least on Ubuntu, but I think I saw the same on other distros) there are virtual TTYs 1-6 for text login, 7 for GUI login, and 8 upwards are unused or at least non-interactive (here they show only a blinking cursor). _Is there a standard for which virtual TTYs should be used for what?_


title: Keep the ssh session

text: I am using **Macbook** developing a client application. I want to access server logs, so I opened a shell terminal and established a ssh connection to the server and access the log file there by executing               tail -f server.log      It works, but the remote ssh session will expire after certain amount of time, which needs me to establish the ssh connection again and access the server log file again. How can I keep the remote session all the time without expiration?


title: How to measure the clock pulse of my computer manually?

text: My PC has two processors, and I know that each one runs at 1.86 GHz. I have just read about clock cycles and I only have a (very) rough understanding, so I apologize beforehand if my question is so stupid. As I said, I want to measure the clock pulse of my PC processor/s manually, and my idea is just to compute the quotient between the number of assembler lines a program have, and the time my computer spends to execute it, so then I have the number of assembly instructions per time processed by the CPU (this is what I understood a 'clock cycle' is). I thought to do it in the following way:   1. I write a C program and I convert it into assembly code.   2. I do: `$gcc -S my_program.c` , which tells to gcc compiler to do the whole compiling process except the last step: to transform my_program.c into a binary object. Thus, I have a file named my_program.s that contains the source of my C program translated into assembler code.   3. I count the lines my program have (let's call this number N). I did:    `$ nl -l my_program.s | tail -n 1` and I obtained the following:              1000015     .section    .note.GNU-stack,"",@progbits      It is to say, the program has a million of lines of code.   4. I do: `$gcc my_program.c` so that I can execute it.   5. I do: `$time ./a.out` ("a.out" is the name of the binary object of my_program.c) for obtaining the time (let's call it T) it is spent for running the program and I obtain:              real    0m0.059s     user    0m0.000s     sys     0m0.004s      It is supposed that the time T I'm searching for is the first one represented in the list: the "real", because the other ones refer on other resources that are running in my system at the same right moment I execute `./a.out`. So I have that N=1000015 lines and T=0.059 seconds. If I perform N/T division I obtain that the frequency is near to 17 MHz, which is obviously not correct. Then I thought that maybe the fact that there are other programs running on my computer and consuming hardware resources (without going any further, the operating system itself) makes that the processor "splits" its "processing power" and it does the clock pulse goes slower, but I'm not sure.   But I thought that if this is right, I should also find the percentage of CPU resources (or memory) my program consumes, because then I could really aspire to obtain a (well) approximated result about my real CPU speed.   And this leads me to the issue of how to find out that 'resource consumption value' of my program. I thought about the `$ top` command, but it's immediately discarded due to the short time my program spends to be executed (0.059 seconds); it's not possible to distinguish by simple sight any peak on the memory usage during this little time. So what do you think about this? Or what do you recommend me to do? I'm just learning and as you can see I'm very far away of being an expert about these issues. And I know there are programs that do this work I try to do, but I prefer to do it by using the raw bash because I'm interested on doing it through the most "universal way" possible (seems like more reliable).


title: Can I configure software RAID on an existing server without losing the existing partition?

text: I've got an existing server with 1 disk and Ubuntu 12.10 installed and running. I want to add a 2nd disk and configure RAID 0 across the two disks using Ubuntu's software RAID. Can I do this transparently without re-imaging the server or re-installing the OS? RAID is not currently configured on the existing disk.


title: My .xsession and .xinitrc files are not executing

text: I have installed xmobar, xmonad on ubuntu 11.04.               #!/bin/bash          trayer --edge top --align right --SetDockType true --SetPartialStrut true \        --expand true --width 10 --transparent true --tint 0x191970 --height 12 &          nm-applet --sm-disable &          sleep 3     gnome-power-manager &          xmonad      I put this in my `.xsession` file. But it does not seem to execute. I believe so because I do not see any of the applications in my processes list after the xmonad starts. Is there anything I am missing?


title: Unable to backup data on DVD

text: I'm working on Ubuntu 13.04. I want to make backup of my data on DVD but unable to do so. To test this I'm backing up file name 'tomboy' from my current directory to DVD.               ravbholua@ravbholua-Aspire-5315:~/Documents/Other$ dd if=./tomboy of=/dev/cdrom     dd: opening ‘/dev/cdrom’: Read-only file system      Then I ran the following intending to remount it as `read-write` mode.               ravbholua@ravbholua-Aspire-5315:~/Documents/Other$ sudo mount -o rw,remount /dev/cdrom ~/Downloads     mount: you must specify the filesystem type     ravbholua@ravbholua-Aspire-5315:~/Documents/Other$ sudo mount -t iso9660 -o rw,remount /dev/cdrom ~/Downloads     mount: /home/ravbholua/Downloads not mounted or bad option     ravbholua@ravbholua-Aspire-5315:~/Documents/Other$      I don't understand why it messaged above `mount: /home/ravbholua/Downloads not mounted or bad option` Is my syntax wrong? Then I tried the below:               ravbholua@ravbholua-Aspire-5315:~/Documents/Other$ sudo umount /dev/cdrom     umount: /dev/cdrom: not mounted     ravbholua@ravbholua-Aspire-5315:~/Documents/Other$ sudo mount -t iso9660  /dev/cdrom ~/Downloads     mount: block device /dev/sr0 is write-protected, mounting read-only     mount: wrong fs type, bad option, bad superblock on /dev/sr0,            missing codepage or helper program, or other error            In some cases useful info is found in syslog - try            dmesg | tail  or so          ravbholua@ravbholua-Aspire-5315:~/Documents/Other$      I tried this with 2 DVDs but the same issue with both of them. Please assist me to say how to back-up or copy data on a DVD & CD.


title: What are TTYs >12 used for?

text: Related to TTY numbers, it looks like there are 64 TTYs (`find /dev -name 'tty[0-9]*' | cut -c 9- | sort -n | tail -n 1` and documentation). tty0 is the current virtual console, `Ctrl`+`Meta`+`F1` reports that it's connected to `tty1`, and `tty` in a GNOME terminal reports that it's connected to `/dev/pts/N`. So what are `/dev/ttyN` for 12<N<64 used for?


title: Is /dev/random data a psuedo-random AES cypher, and where does the entropy come from?

text: My current understanding of an entropy pool is that it gathers truly random _bits_ of data at a slow rate. I'd like to know how Unix & Linux collect entropy, and how that entropy is used by /dev/random. I've heard (generically) of entropy collection methods such as the video card cpu's status when a "randomly" selected network packet arrives, matched against the hiss factor in the digital-analog converter, and other even more obtuse methods. I believe that the entropy "pool" is tapped as need be, and is used to seed a psuedo random generator.... I'm not after an in-depth answer, but I am interested to know if this is the general approach used by Unix/Linux ?.. and perhaps some hints about what is actually going on at the entropy-collection coal-face... and then, _what_ is the entropy fed into.. Is it an AES Rijndael cipher? The background information for my comemnts above, came from Steve Gibson's _Security Now!_ podcast: Episode #301 Going Random, Part 2 of 2... He only spoke generically (but as is his style, with enough detail and clarity so that even I could understand him. Having listened to the preceding 300 episodes helps :), ...and I'd like to know if this is how Unix/Linux does it...


title: Is 'Shut down computer when finished' during Avidemux encoding stage useful?

text: I get the option to **Shut down computer when finished** during encoding stage of Avidemux. Why would I want to do that? ![alt text](http://i.stack.imgur.com/rzSrk.png)


title: VI mode in freetalk

text: I somehow managed to get my freetalk into vi-mode. I'm just unsure how I did it (if I restart freetalk I get an emacs-mode). Anyone an idea?


title: How to re-encode a DVD into a single file?

text: A DVD file layout has a directory named " **VIDEO_TS** " which contains a variety of files. These files can include multiple video and audio channels, subtitles, and menu structure (UI). Is there a format than can contain all of these, but in a single file? Can this format do this without losing video quality? What about retaining the menu? Maybe even retaining subtitle and commentary tracks? How do I do it (command)? [ **note** ] These aren't hard requirements. I'm just looking for something that can handle more than just audio/video.


title: Does the X windowing system suffer from scalability?

text: One of my professors was telling us about scalability problems, and said that the X protocol was a prime example of a not scalable protocol. Why is that? Is it because it is very hardware dependent? I know that X is used in modern unix/linux environments, if it's not scalable than why is it used so widely?


title: What are the ways to improve system stability and prevent data loss in conditions of frequent hard reboots and/or kernel panics?

text: Suppose we are working in environment where you can't be sure that your computer won't just suddenly shut off. What measures can be taken to improve system's (unix) resist to such failures? And how to ensure that risk of data loss (on hard drive) is as low as possible?


title: Debian cannot resolve hostnames

text: I have a problem resolving host names on Debian running on vmware. It just stopped working out of the blue. Somewhere after uninstalling percona server and deleting /etc/mysql . Initially it thought it was a problem with networking when host has been to sleep while guest was running which is a known issue with vmware. But it can't be. Debian 7.4, vmware tools installed /etc/reslov.conf               # Generated by NetworkManager     nameserver 8.8.8.8     nameserver 8.8.4.4      ping, dig and nsloopup output               ivar@debian:~$ ping 8.8.8.8     PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.     64 bytes from 8.8.8.8: icmp_req=1 ttl=47 time=40.0 ms     64 bytes from 8.8.8.8: icmp_req=2 ttl=47 time=39.7 ms     ^C     --- 8.8.8.8 ping statistics ---     2 packets transmitted, 2 received, 0% packet loss, time 1002ms     rtt min/avg/max/mdev = 39.747/39.874/40.001/0.127 ms     ivar@debian:~$ dig google.com          ; <<>> DiG 9.8.4-rpz2+rl005.12-P1 <<>> google.com     ;; global options: +cmd     ;; Got answer:     ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 18895     ;; flags: qr rd ra; QUERY: 1, ANSWER: 11, AUTHORITY: 0, ADDITIONAL: 0          ;; QUESTION SECTION:     ;google.com.            IN  A          ;; ANSWER SECTION:     google.com.     299 IN  A   173.194.113.100     google.com.     299 IN  A   173.194.113.99     google.com.     299 IN  A   173.194.113.96     google.com.     299 IN  A   173.194.113.103     google.com.     299 IN  A   173.194.113.110     google.com.     299 IN  A   173.194.113.102     google.com.     299 IN  A   173.194.113.98     google.com.     299 IN  A   173.194.113.105     google.com.     299 IN  A   173.194.113.97     google.com.     299 IN  A   173.194.113.101     google.com.     299 IN  A   173.194.113.104          ;; Query time: 43 msec     ;; SERVER: 8.8.8.8#53(8.8.8.8)     ;; WHEN: Sat Mar 29 18:46:07 2014     ;; MSG SIZE  rcvd: 204          ivar@debian:~$ nslookup google.com     Server:     8.8.8.8     Address:    8.8.8.8#53          Non-authoritative answer:     Name:   google.com     Address: 173.194.113.97     Name:   google.com     Address: 173.194.113.104     Name:   google.com     Address: 173.194.113.101     Name:   google.com     Address: 173.194.113.99     Name:   google.com     Address: 173.194.113.100     Name:   google.com     Address: 173.194.113.96     Name:   google.com     Address: 173.194.113.102     Name:   google.com     Address: 173.194.113.103     Name:   google.com     Address: 173.194.113.110     Name:   google.com     Address: 173.194.113.105     Name:   google.com     Address: 173.194.113.98          ivar@debian:~$ ping google.com     ping: unknown host google.com      Any ideas how to resolve this issue? /etc/nsswitch.conf               # /etc/nsswitch.conf     #     # Example configuration of GNU Name Service Switch functionality.     # If you have the `glibc-doc-reference' and `info' packages installed, try:     # `info libc "Name Service Switch"' for information about this file.          passwd:         compat     group:          compat     shadow:         compat          hosts:          files mdns4_minimal wins [NOTFOUND=return] dns mdns4     networks:       files          protocols:      db files     services:       db files     ethers:         db files     rpc:            db files          netgroup:       nis


title: Know when a memory address is aligned or unaligned

text: Im getting kernel oops because ppp driver is trying to access to unaligned address (there is a pointer pointing to unaligned address). Im not sure about the meaning of unaligned address. It means not multiple or 4 or out of RAM scope? If my system has a bus 32-bits wide, given an address how can i know if its aligned or unaligned?


title: Good introduction to Subversion for inexperienced users?

text: Can you suggest a good introduction to Subversion for UNIX (or Mac OS X) users? It can assume familiarity with basic command-line usage, but not any advanced topics (with bash scripting counting as "advanced usage" here...) _Ideally,_ the guide should include:   * a short introduction on what a VCS is for (in general) and to the Subversion model in particular;   * quick-start usage (checkout, update/edit/commit cycle)   * installation instructions; bonus points if it mentions that it's already available for all major OSes out there and leads people to install from package and not compile from source...


title: Inner logic of chained redirections

text: When I type               cat some_file > new_file1 > new_file2      I got output from `some_file` in `new_file2` and empty `new_file1`. What is the inner logic in it? More specifically what is the `stdout` of file? Note: On Windows the middle file is skipped.


title: Manually cloning a Live USB Arch distro to a VMware virtual disk

text: I installed Arch Linux on a pen drive with yumi, based on syslinux. I would like to test the USB distro in VMware. To speed up things I would like to clone the UFD as a VMware virtual disk (vmdk). This can be simple. I attach to the virtual machine the physical UFD drive, the vmdk virtual disk and the Arch ISO. Bootstrapping from the latter, I can clone. My problem is that the UFD is very large and I would like to copy/clone only the actual UFD used sectors. I don't know if there are specific tools for cloning only used sectors. My idea is to manually format the vmdk disk and then copy the UFD files. Given the following disk mapping:               Virtual vmdk disk -> sda     Physical UFD disk -> sdb      I issued these commands:               # Format vmdk disk as FAT32     (echo o; echo n; echo p; echo 1; echo ; echo ; echo a; echo t; echo c; echo w) | fdisk /dev/sda     mkdosfs -F 32 /dev/sda1          #Copy UFD MBR to vmdk MBR     dd if=/dev/sdb of=/dev/sda bs=446 count=1     partprobe /dev/sda          #Mount vmdk      mkdir /vmdk     mount -t vfat /dev/sda1 /vmdk          #Mount UDF     mkdir /usb     mount -t vfat /dev/sdb1 /usb          #Copy files from UFD to vmdk     cp -a  /usb/* /vmdk      After them, `fdisk -l` gives: > Disk /dev/sda: 858 MB, 858783744 bytes, 1677312 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 label type: dos Disk > identifier: 0xc3072e18 > > Device Boot Start End Blocks Id System /dev/sda1 * 2048 1677311 837632 c W95 > FAT32 (LBA) > > Disk /dev/sdb: 4048 MB, 4048551936 bytes, 7907328 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 label type: dos Disk > identifier: 0xc3072e18 > > Device Boot Start End Blocks Id System /dev/sdb1 * 2976 7907327 3952176 c > W95 FAT32 (LBA) > > Disk /dev/mapper/arch_root-image: 1563 MB, 1563426816 bytes, 3053568 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 Unfortunately, when I shutdown the VM, detach the UFD and the ISO, and restart the machine, VMware says:               This is not a bootable disk...       Can you help me?


title: update curl on centos5

text: i have centos 5.9, with curl 7.15.5. i need curl 7.16.2+ . i'm a novice webmaster...if that. but would like to try. what are the commands to add a yum rpm repo so i can update the curl version, if this makes sense? is his of any use: http://mirror.city-fan.org/ftp/contrib/sysutils/Mirroring/ thanks.


title: Attaching a screen to a name

text: Okay for me to load a screen I have to do screen -r server Is there a way I can set it up so that can just be shown by the command: screen -x name


title: How to see content of dropped packages at OUTPUT chain in iptables

text: iptables is as below:               # iptables -t filter -nvL     Chain INPUT (policy DROP 0 packets, 0 bytes)      pkts bytes target     prot opt in     out     source               destination                  0     0 ACCEPT     icmp --  *      *       0.0.0.0/0            0.0.0.0/0                    1   328 ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0           state NEW,ESTABLISHED          0     0 LOGGING    all  --  *      *       0.0.0.0/0            0.0.0.0/0                     Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)      pkts bytes target     prot opt in     out     source               destination                   Chain OUTPUT (policy DROP 0 packets, 0 bytes)      pkts bytes target     prot opt in     out     source               destination                  0     0 ACCEPT     icmp --  *      *       0.0.0.0/0            0.0.0.0/0                  487 49868 LOGGING    all  --  *      *       0.0.0.0/0            0.0.0.0/0                     Chain LOGGING (2 references)      pkts bytes target     prot opt in     out     source               destination                 39  9426 LOG        all  --  *      *       0.0.0.0/0            0.0.0.0/0           limit: avg 2/min burst 5 LOG flags 0 level 4 prefix `IPTables-Dropped: '        487 49868 DROP       all  --  *      *       0.0.0.0/0            0.0.0.0/0                 The number of packets dropped are increasing from INPUT and OUTPUT chain. Is there any way to see the content of these dropped packets? I have tried to workaround tcpdump, but couldn't understand. please someone can help me either with syntax, proper command or tool to see the content of these dropped packages in human readable form. Here dropped packets are transfered to custome chain LOGGING and at system logs.                tail -f /var/log/messages


title: openvpn[]: Options error: In [CMD-LINE]:1: Error opening configuration file

text: when trying to `service openvpn start`               Oct 12 14:02:01 ccushing1 openvpn[9091]: Options error: In [CMD-LINE]:1: Error opening configuration file: devnet-client-vm.conf      running `openvpn devnet-client-vm.conf` works just fine. Why does openvpn not start? how can I fix it?


title: Xtightvnc: Ubuntu gnome-session-fallback: Fonts problem

text: I'm running a tightvnc server on Ubuntu 11.04 with a Gnome fallback session. Things seem to work fine except that when I try launching an application that needs `xfonts-100dpi`. All application menus are shown as little boxes instead of characters. It's as if the fonts are missing. The strange thing is, `xfonts-100dpi` is already installed and the same application runs fine if I log in to the box directly. Can you please help? My `~/.vnc/xstartup`               unset SESSION_MANAGER     /usr/bin/gnome-session-fallback


title: Need a different header path for compiling

text: I'm trying to update `numpy`, a python package, on my fresh install of debian. I have installed from source the latest version of python in `/usr/local` When trying to update `numpy` via `pip`, I get an error that `Python.h` is missing. Yes, I know that I can do `apt-get install python-dev`, but I know I have the `Python.h` header. To that end I've tried setting the following environment variables to where `Python.h` is:               1) LIBRARY_PATH     2) GCC_EXEC_PREFIX     3) OBJC_INCLUDE_PATH      but still no dice. Perhaps I'm setting the wrong environment variables?


title: Looking for a "undo" for file with holes (GNU)

text: Linux supports sparse files aka 'file with holes' Note following commands               alias mystat='stat -c "%n: %B*%b blocks %s bytes"'          dd if=/dev/zero bs=1024k seek=4096 count=0 of=file-with-holes          ls -l file-with-holes     -rw-r--r-- 1 root root 4294967296 Feb 25 18:33 file-with-holes          mystat file-with-holes     file-with-holes: 512*0 blocks 4294967296 bytes          cp file-with-holes other-file          mystat other-file     other-file: 512*0 blocks 4294967296 bytes          cat file-with-holes > file-without-holes          mystat file-without-holes     file-without-holes: 512*8388608 blocks 4294967296 bytes      The cat command removed all holes from the file. Is there a way to get the holes back?


title: `tar` with `find` with removing original file extension

text: I want to create `tb2` files from bunch of text files like this. `tar cfj $(basename ./2014_04_09.txt .txt).tb2 $(basename ./2014_04_09.txt)` With this command I can create a archive file `2014_04_09.tb2` that doesn't contain a directory. But when the command is applied with `-exec` option of `find` like this, `find . -name "*.txt" -exec tar cfj $(basename "{}" .txt).tb2 $(basename "{}") \;` This command create archive files with original extension (`2014_04_09.txt.tb2`) and with a directory inside the archive. How can I use `tar` command with `find` like when be applied only a single file.


title: Why is "echo" so much faster than "touch"?

text: I'm trying to update the timestamp to the current time on all of the xml files in my directory (recursively). I'm using Mac OSX 10.8.5. On about 300,000 files, the following `echo` command takes **10 seconds** :               for file in `find . -name "*.xml"`; do echo >> $file; done      However, the following `touch` command takes **10 minutes**! :               for file in `find . -name "*.xml"`; do touch $file; done      Why is echo so much faster than touch here?


title: command OR script to detect vpn connection status

text: I'm using Ubuntu Network Manager VPN client to connect to a PPTP vpn server.   I have an application that get some data from internet and must be runned from behind the VPN.   I need to suspend application process if VPN connection dropped.   How can I find out the VPN is connected/disconnected (script or command)?   Or is there a service that be able to call an script when VPN connected/disconnected? Thanks


title: What is difference between User space and Kernel space?

text: Is Kernel space used when Kernel is executing on the behalf of the user program i.e. System Call? Or is it the address space for all the Kernel threads (for example scheduler)? If it is the first one, than does it mean that normal user program cannot have more than 3GB of memory (if the division is 3GB + 1GB)? Also, in that case how can kernel use High Memory, because to what virtual memory address will the pages from high memory be mapped to, as 1GB of kernel space will be logically mapped?


title: X server with fglrx driver won't responce after exactly 49 accesses to X server

text: I have Arch linux with minimal amount of packages including xorg group and catalyst. I run `X :0` and then run in infinity cycle following monitoring script:               while [ true ]; do         DISPLAY=:0 aticonfig --odgt | grep Sensor         sleep 1     done      In normal case it yield something like this:                             Sensor 0: Temperature - 35.00 C                   Sensor 0: Temperature - 35.00 C                   Sensor 0: Temperature - 36.00 C      But after exactly **49 runs** of `aticonfig` Xserver stop working. It still in processes list, I still can kill it without trouble but X isn't response to any program that is needed it. And X stop writing to log files and to stdout. With `aticonfig` I get following error output:               aticonfig: This program must be run as root when no X server is active      It isn't necessary to run exactly `aticonfig`. Even run of any X related application decrease number of feature runs of `aticonfig`. It may be `clinfo` or any opencl application. I reproduced such behaviour on Xorg 1.14.2 and 1.13.4, on Catalyst 13.4, 13.8.beta1, 13.8.beta2. Xorg stdout output after Xserver start: http://pastie.org/8256590 `/var/log/Xorg.0.log` after Xserver start: http://pastie.org/8256594 Xorg stdout output after each run of aticonfig: http://pastie.org/8256605 `/var/log/Xorg.0.log` after each run of aticonfig: http://pastie.org/8256608 xorg.conf is basic: http://pastie.org/8262513 So is it possible to configure o run `X` with unlimited accesses?


title: How do I know if my ssh tunnel is created successfully?

text: I rely on the following script `tunnel.sh` written by others to keep a ssh tunnel alive:               #!/bin/bash     export SSH_HOST=tim@server           if [ ! -f /tmp/.tunnel ]      then     echo "Creat SSH tunnel"     ssh -f -D 9999 $SSH_HOST "if [ -f ~/.tunnel ]; then rm ~/.tunnel; fi; while [ ! -f ~/.tunnel ]; do echo > /dev/null; done" &      touch /tmp/.tunnel      else     echo "Close SSH tunnel"     ssh $SSH_HOST "touch ~/.tunnel"      rm /tmp/.tunnel      fi     exit      To create a persistent ssh tunnel, I just issue ``tunnel.sh`. The tunnel will not be closed until I issue `tunnel.sh` again. I was wondering how I can verify if the ssh tunnel is indeed created successfully? My main use of the tunnel is to print documents to some printers in the same LAN as the server, and the printers can only be accessed from within the LAN. After creating a tunnel, now printing doesn't report any problem, but since I am not physically there, I cannot check if the documents have been indeed printed. I thought since I am now in the LAN thanks to the tunnel, my external IP should be the same as the server's. But actually they are not the same (I found them out by `wget -q -O - checkip.dyndns.org|sed -e 's/.*Current IP Address: //' -e 's/<.*$//' `). I wonder why? When I connect to some website on the internet with the tunnel alive, isn't the server the midpoint between me and the internet website in the connection, due to the tunnel between me and the server? Thanks and regards!


title: How can I trim the carriage return from text that is being piped in bash?

text: I'm using this command to get my last typed command:               history | cut -c 8- | tail -n 2 | head -n 1      It works very well in bash, removing the line numbers, but there is one problem I have with it, (er, annoyance, because I want just the command) and I'm piping this to the `xsel` clipboard manager: **It also grabs the trailing new line / carriage return...** I know in some shells you can use:               echo "text \c"      I'm not sure how to incorporate that into `bash` though. Extra points for the solution that is easiest to type on the fly :)


title: I'm having trouble booting unity from Chrome OS

text: This problem appeared out of nowhere (apparently). I've been successfully booting unity from Chrome for a while now using               shell      sudo startunity      However recently it's stopped working and instead I receive               Entering /usr/local/chroots/precise...     Unknown username "dnsmasq" in message bus configuration file     Unknown username "whoopsie" in message bus configuration file               X.Org X Server 1.11.3     Release Date: 2011-12-16     X Protocol Version 11, Revision 0     Build Operating System: Linux 2.6.42-37-generic x86_64 Ubuntu     Current Operating System: Linux localhost 3.4.0 #1 SMP Wed May 14 00:11:45 PDT 2014 x86_64     Kernel command line: cros_secure  console= loglevel=7 init=/sbin/init cros_secure oops=panic panic=-1 root=/dev/dm-1 rootwait ro dm_verity.error_behavior=3 dm_verity.max_bios=-1 dm_verity.dev_wait=1 dm="2 vboot none ro 1,0 2545920 bootcache PARTUUID=3c87aabc-2166-cf41-8225-adf2ba46ce5b/PARTNROFF=1 2545920 8c94e2791f9bdea33878c80a78250f61813c88ff 512 20000 100000, vroot none ro 1,0 2506752 verity payload=254:0 hashtree=254:0 hashstart=2506752 alg=sha1 root_hexdigest=679c9dcc2e31021b7e6094c668b9e9c474651b7e salt=1c3d5ecca4424f9a4edefd8d7f3ea46ba91f8fc9c2ca35145c75811a0ceb0223" noinitrd vt.global_cursor_default=0 kern_guid=3c87aabc-2166-cf41-8225-adf2ba46ce5b add_efi_memmap boot=local noresume noswap i915.modeset=1 tpm_tis.force=1 tpm_tis.interrupts=0 nmi_watchdog=panic,lapic iTCO_vendor_support.vendorsupport=3      Build Date: 16 October 2013  04:41:23PM     xorg-server 2:1.11.4-0ubuntu10.14 (For technical support please see http://www.ubuntu.com/support)      Current version of pixman: 0.30.2             Before reporting problems, check http://wiki.x.org             to make sure that you have the latest version.     Markers: (--) probed, (**) from config file, (==) default setting,             (++) from command line, (!!) notice, (II) informational,             (WW) warning, (EE) error, (NI) not implemented, (??) unknown.     (==) Log file: "/var/log/Xorg.1.log", Time: Mon Jun 16 09:53:45 2014     (==) Using system config directory "/usr/share/X11/xorg.conf.d"     DRM_IOCTL_I915_GEM_APERTURE failed: Bad file descriptor     Assuming 131072kB available aperture size.     May lead to reduced performance or incorrect rendering.     get chip id failed: -1 [9]     param: 4, val: 0          Fatal server error:     no screens found          Please consult the The X.Org Foundation support               at http://wiki.x.org      for help.      Please also check the log file at "/var/log/Xorg.1.log" for additional information.           ddxSigGiveUp: Closing log     Server terminated with error (1). Closing log file.     /usr/bin/xinit: giving up     /usr/bin/xinit: unable to connect to X server: No such file or directory     /usr/bin/xinit: server error     Unmounting /usr/local/chroots/precise...      I have no idea what to do! Has anyone else experienced this? Does anyone have a solution?


title: Why SSH is asking for my private key password each time

text: Since yesterday, each time I try to connect to an ssh server, I got asked for my password. What should I do to make SSH not ask for my password each time.


title: Strip spaces after single capital letters with sed

text: I am writing a bash script to automatically generate some other files, and I have to format some strings a certain way. Specifically, the last problem I'm having is formatting a string that has individual capital letters and a word that starts with a capital letter. For example: `O S D Settings` needs to become `OSD Settings` I have a sed command that strips the first space, but it also deletes the "D" (i.e. `O S D Settings` -> `OS Settings`). This command is:               O S D Settings | sed 's/ \([A-Z]\)* \(A-Za-z]*\)/\1/g'      Does anyone know how to delete the spaces in between individual capital letters without losing any letters?


title: Eclipse makes laptop unusable

text: Currently I can't use my eclipse project. I'm using ArchLinux:                                  -`                       .o+`                 rkmax@satellite                      `ooo/                 OS: Arch Linux                      `+oooo:                Kernel: x86_64 Linux 3.9.9-1-ARCH                    `+oooooo:               Uptime: 1h 19m                    -+oooooo+:              Packages: 922                  `/:-:++oooo+:             Shell: bash                 `/++++/+++++++:            Resolution: 3286x1200                `/++++++++++++++:           DE: Gnome 3.8.2               `/+++ooooooooooooo/`         WM: Not Found              ./ooosssso++osssssso+`        WM Theme: Not Found             .oossssso-````/ossssss+`       GTK2 Theme: Adwaita            -osssssso.      :ssssssso.      GTK3 Theme: Adwaita           :osssssss/        osssso+++.     Icon Theme: Faenza-Darkest          /ossssssss/        +ssssooo/-     Font: Ubuntu 10        `/ossssso+/:-        -:/+osssso+-   CPU: Intel Core i3 CPU M 380 @ 2.533GHz       `+sso+:-`                 `.-/+oso:  RAM: 1049MB / 2808MB      `++:.                           `-/+/        .`                                 `/          java version "1.7.0_40"     OpenJDK Runtime Environment (IcedTea 2.4.1) (ArchLinux build 7.u40_2.4.1-1-x86_64)     OpenJDK 64-Bit Server VM (build 24.0-b50, mixed mode)          Eclipse Juno 4.2 (extra/eclipse 4.2.2-1)      The problem here is when I try to change anything in my project and eclipse goes to rebuild it. A process `systemd-coredum` eats all memory:               COMMAND                   %MEM    RSS     %CPU     systemd-coredum           54.4    1528.04 4.3     java                      9.7     272.48  69.6     chromium                  4.6     130.08  2.2     chromium                  2.1     61.12   2.9     chromium                  2.1     60.67   0.7     gnome-shell               1.7     49.16   6.4     banshee                   1.5     42.80   4.2     chromium                  1.3     37.28   0.2     chromium                  0.8     23.45   0.2     pulseaudio                0.3     10.65   2.0      I have `ulimit -c unlimited` in `.bashrc` file and a symlink in the coredump conf               $ ln -s /dev/null /etc/sysctl.d/coredump.conf     $ systemctl restart systemd-sysctl      But I can't solve this issue.


title: Moving files with find + xargs: target is not a directory?

text: When I run the following command:               > mkdir some_dir     > find /foo/bar/ -name '*.csv' -print0 | xargs -0 mv {} some_dir      I get hundreds of lines that say:               mv: target `/foo/bar/XX.csv` is not a directory      Why? I thought xargs would execute:               mv /foo/barXX.csv some_dir      for every file that `find` finds. What's going on? By the way, this is with zsh ## Update: **Update1:** I tried:               find /foo/bar/ -name '*.csv' -print0 | xargs -0 mv {} -t some_dir      but then I got a few lines like:               mv: cannot stat `{}': No such file or directory      although I think the command is moving my files correctly. **Update2:** I dont seem to need the `-t` option when using `mv` alone. For example               > touch file1.txt     > touch file2.txt     > mkdir my_dir     > mv  file1.txt  file2.txt  my_dir      works well. Why do I need `-t` when using `xargs`?


title: Library missing compiling XBMC from source

text: Somewhere between the 13 and 13.1 releases I was no longer able to compile XBMC from source. I was able to compile v13 when it was first released (from the Gotham branch). Then, 13.1 was announced and I decided not to try the betas/RCs; so I have not attempted to compile those. When the final 13.1 version was released, I tried to compile that one, with the same procedure as I've used every time with success. But this time, it didn't work... I'm failing in the "./configure" step with "could not find a required library". The command terminates with something like:               (...)     checking for TAGLIB... yes     checking for CDIO... yes     checking for LIBBLURAY... yes     checking for libbluray soname... libbluray.so.1     checking for bd_register_argb_overlay_proc in -lbluray... no     checking for library containing iconv_open... no     checking for library containing libiconv_open... no     configure: error: Could not find a required library. Please see the README for your platform.      Here's the full `config.log` file: http://pastebin.com/nGynLkX6 I'm not sure that's the problem but I manually downloaded, compiled and installed `libiconv` from http://www.gnu.org/software/libiconv/, it didn't seem to help though. In case it's relevant, I always execute the following commands (in that specific order) to compile a new XBMC version:               git clean -xfd     git reset --hard     git pull --rebase          make -C lib/taglib     sudo make -C lib/taglib install          ./bootstrap     ./configure --disable-debug --disable-pulse --disable-vaapi --enable-goom     make          sudo make install      What am I missing here? **UPDATE!** I have upgraded zlib1g and now I was able to finish the configure step. However, compiling with make, eventually gives me errors on "undefined reference" to libiconv, libiconv_open and libiconv_close. Ideas?


title: Make bluetooth device invisible / disable incoming pairing

text: I am using the bluez package for my bluetooth usb dongle on ubuntu server. I want to be able to initiate bluetooth connection from the dongle to a device, however a device itself shall not be able to find by bluetooth dongle or initiate a connection / pairing. In the /etc/bluetooth files I could only find options to set the time my bluetooth dongle will be visible to 1 second, but I want to disable the visibility at all, like it can be done in any mobile phone! Any hint on this? Thanks :-)


title: Problem after deleting a system partition on another HD

text: While installing Debian Wheezy, I decided to use my another HD as `/home/igor/Documents/`, and the system installed correctlly nothing wrong happened, but later I decided to delete that partition so I did it, so now everytime I boot system, while it's loading, an error an error stop the loading process and then ask me to enter with the "maintainer password" (root) or to press Ctrl + D to continue the loading process. The error says that there is a problem with the "file system". And a log appears on `/var/log/fsck/checkfs` and when you open it with `nano /var/log/fsck/checkfs` this message is inside:               Log of fsck -C -R -A -a     Sun Sep  9 16:37:18 2012          fsck from util-linux 2.20.1     fsck.ext4: Unable to resolve 'UUID=0f0123f4-2870-42e0-ad18-de837a6d2aed'     fsck died with exit status 8          Sun Sep  9 16:37:18 2012     ----------------      Someone know how to fix this problem? _Igor, from Brazil_


title: SSH Setup - How will the router know my computer's ip?

text: I'm very new to the networking side of the house and am trying to set up SSH on my new Ubuntu machine. I have my DD-WRT router working with DDNS now and can log in to the router page -- but I'm not sure how to go about forwarding it to my server machine. I realize I would forward port 22 over (or a unique port) -- but to forward, DD-WRT wants to know the IP I'm pointing at. But that IP will change, won't it? How do I make the router point to the machine rather than the current IP? Or am I asking the wrong question?


title: Why sudo won't remember my password?

text: I use sudo in many systems, but I have one of them that makes me type my password each time I run sudo. All the others remember it for a while. This is debian 7.4 wheezy and sudo 1.8.5 I found this : http://apple.stackexchange.com/questions/10139/how-do-i- increase-sudo-password-remember-timeout and that: http://stackoverflow.com/questions/715908/how-do-you-make-sudo-save- the-password so I checked the dir /var/lib/sudo. I removed my old user dir and restarted sudo. I made sure when I type sudo a file is created there. I also changed the timestamp in /etc/sudoers, I tried with -1, and 5, with no luck.               Defaults        timestamp_timeout=5      I also issued a tail -f /var/log/auth and /var/log/syslog to see if anything went wrong but nothing is written there when I run sudo. So I added a new file /etc/sudo.conf with this line:               Debug sudo /var/log/sudo_debug all@info      Now I see something in that file each time I run sudo but no error messages I can see. It looks like everything works fine. Any hints ? thank you very much.


title: Network connectivity problem - Debian 6 server

text: I'm having a problem with a Debian 6 server where it looses network connectivity and doesn't come back (server does not respond to pings, and can't connect to any services). The problem happens sporadically. Some times it will go a month without the problem occurring, while other times it will happen within a few days of being rebooted. When logged into the console, I confirm that the server doesn't seem to have network conectivity (can't ping 8.8.8.8 for example). All services are running though (mysql, Apache, SSH, etc). When the problem happens, the network interfaces are up (I checked ifconfig, all interfaces looked normal). I also check iptables, and verify there were no rules that would block anything. I also try running /etc/init.d/networking/restart, but that does not fix the problem. The only thing I've found that fixes the problem is rebooting. The server is a virtual machine with a wired connection in a data centre. The company I rent the server from thinks the problem is due to high RAM usage. They said that the server was frozen due to resource exhaustion and the server stopped responding to ICMP requests, referencing this:               root@vm2:~# free -m                total used free shared buffers cached     Mem:  8181  7816 365   0     364     6201     -/+ buffers/cache: 1250 6931     Swap: 8191    0  8191      Do you think that high RAM usage could have anything to do with this problem? I think it is something else, but I don't know what else to check.


title: Apache2 virtual hosts with mod_wsgi settings question

text: I'm running a VPS on DigitalOcean (Ubuntu 12.04). I'm using a single instance to run multiple (currently 2) websites. Originally I had one website (say, flaskwebsite.com) which uses `flask` and `mod_wsgi`. The config looked originally like this:               <VirtualHost *:80>                     ServerName flaskwebsite.com                     ServerAlias www.flaskwebsite.com                     ServerAdmin my-email-address                          WSGIScriptAlias / /var/www/flaskwebsite/flaskwebsite.wsgi                     <Directory /var/www/flaskwebsite/flaskwebsite/>                             Order allow,deny                             Allow from all                     </Directory>                     Alias /static /var/www/flaskwebsite/flaskwebsite/static                     <Directory /var/www/flaskwebsite/flaskwebsite/static/>                             Order allow,deny                             Allow from all                     </Directory>                     ErrorLog ${APACHE_LOG_DIR}/error.log                     LogLevel warn                     CustomLog ${APACHE_LOG_DIR}/access.log combined     </VirtualHost>      And everything was fine. I then added a second website (mystaticpage.com), which is currently just a static placeholder page. I run it using AWS Route53, and the config looks like this:               <VirtualHost *:80>                     ServerName mystaticpage.com                     ServerAlias www.mystaticpage.com                     ServerAdmin my-email-address                     DocumentRoot /var/www/mystaticpage                          ErrorLog ${APACHE_LOG_DIR}/error_sp.log                     LogLevel warn                     CustomLog ${APACHE_LOG_DIR}/access_sp.log combined     </VirtualHost>      After I got it up and running, I noticed that when I access the original flask website, it goes to the static page I created. When I disabled the static website, the flask website would work fine. Couldn't find anything on the internet concerning this. In the end, I tried adding a `DocumentRoot` setting to the flask website config file, and everything started working correctly. My question is – I thought that a `DocumentRoot` setting is not necessary for `mod_wsgi` websites? Or have I something wrong in my configs?


title: How to make ClickPad double-tap more reliable

text: Double-tapping on text so it gets highlighted is very unreliable, and seems to work at random. Single tapping is never a problem though (I set **taps** to mean **clicks** with `synclient TapButton1=1`). Here's what my configuration looks like:               $ synclient     Parameter settings:         LeftEdge                = 1765         RightEdge               = 5371         TopEdge                 = 1638         BottomEdge              = 4470         FingerLow               = 25         FingerHigh              = 30         MaxTapTime              = 180         MaxTapMove              = 234         MaxDoubleTapTime        = 180         SingleTapTimeout        = 180         ClickTime               = 100         EmulateMidButtonTime    = 0         EmulateTwoFingerMinZ    = 282         EmulateTwoFingerMinW    = 7         VertScrollDelta         = 106         HorizScrollDelta        = 106         VertEdgeScroll          = 0         HorizEdgeScroll         = 0         CornerCoasting          = 0         VertTwoFingerScroll     = 1         HorizTwoFingerScroll    = 0         MinSpeed                = 1         MaxSpeed                = 1.75         AccelFactor             = 0.0375235         TouchpadOff             = 2         LockedDrags             = 0         LockedDragTimeout       = 5000         RTCornerButton          = 0         RBCornerButton          = 0         LTCornerButton          = 0         LBCornerButton          = 0         TapButton1              = 1         TapButton2              = 2         TapButton3              = 3         ClickFinger1            = 1         ClickFinger2            = 3         ClickFinger3            = 2         CircularScrolling       = 0         CircScrollDelta         = 0.1         CircScrollTrigger       = 0         PalmDetect              = 0         PalmMinWidth            = 10         PalmMinZ                = 200         CoastingSpeed           = 20         CoastingFriction        = 50         PressureMotionMinZ      = 30         PressureMotionMaxZ      = 160         PressureMotionMinFactor = 1         PressureMotionMaxFactor = 1         GrabEventDevice         = 1         TapAndDragGesture       = 1         AreaLeftEdge            = 0         AreaRightEdge           = 0         AreaTopEdge             = 0         AreaBottomEdge          = 0         HorizHysteresis         = 26         VertHysteresis          = 26         ClickPad                = 1         RightButtonAreaLeft     = 3568         RightButtonAreaRight    = 0         RightButtonAreaTop      = 4107         RightButtonAreaBottom   = 0         MiddleButtonAreaLeft    = 0         MiddleButtonAreaRight   = 0         MiddleButtonAreaTop     = 0         MiddleButtonAreaBottom  = 0


title: Group memberships and setuid/setgid processes

text: Processes which _de-escalate_ privileges via `setuid()` and `setgid()` do not seem to inherit the group memberships of the uid/gid they set. I have a server process that must be executed as root in order to open a privileged port; after that it de-escalates to a specific non-privilleged uid/gid,1 \-- e.g., that of user `foo` (UID 73). User `foo` is a member of group `bar`:               > cat /etc/group | grep bar     bar:x:54:foo      Hence if I login as `foo`, I can read a file `/test.txt` with these characteristics:               > ls -l /test.txt     -rw-r----- 1 root bar 10 Mar  8 16:22 /test.txt      However, the following C program (compile `std=gnu99`), when run root:               #include <stdio.h>     #include <fcntl.h>     #include <unistd.h>          int main (void) {         setgid(73);         setuid(73);         int fd = open("/test.txt", O_RDONLY);         fprintf(stderr,"%d\n", fd);         return 0;     }         Always reports **Permission denied**. I imagine this has to do with it being a non-login process, but it kind of hamstrings the way permissions are supposed to work. * * * 1\. Which is often SOP for servers, and I think there must be a way around this as I found a report of someone doing it with apache -- apache has been added to the audio group and can apparently then use the sound system. Of course, this likely happens in a fork and not the original process, but in fact the case is the same in my context (it's a child process forked subsequent to the setuid call).


title: What is the best touch screen kiosk solution?

text: I'm a web developer and I'm looking for the best stripped-down linux experience that provides a full-screen experience for touch screens. I'll be looking for:   * a robust experience that stops people loading up porn or logging out   * booting from USB, CD, HDD or all three if possible   * remote admin (probably via VPN)   * complete screensaver and power-save control   * the ability to hide cursors   * an onscreen keyboard, usually web-based for the customer but a native version for admin   * the ability to autorun 3D fullscreen apps such as Blender games   * possibly multi-touch functionality in the future but this isn't a deal-breaker My favourite options at the moment are:   * SLAX   * Webconverger This kiosk project looks worth using too. Could I get some recommendations for the best configuration please? Thanks


title: How do I create a new file and edit it as root?

text: I've tried: `gksudo gedit /etc/xinetd.d/tftp` (this is the path I need). I got an error message:               couldn't find the file /etc/xinetd.d/tftp     please check that you typed the location correctly and try again      What do I need to do?


title: Tunneling SSH through multiple machines (for SOCKS)

text: I have seen questions on tunnelling SSH through multiple machines but I want to tunnel a SOCKS connection. Normally I would use something like `ssh -C2qTnN -D 8080 username@remote_machine` to make the local port 8080 a SOCKS tunnel through the remote machine. I would like to open a socks connect from my laptop on machine2, that can only be reached via SSH from machine1. So rather than tunnelling SSH connections in the normal sense, I suppose I wish to run that command on machine1 so the local port 8080 is redirected to machine2 and somehow pipe 8080 on machine1 back to a local port on laptop.


title: Samba -- Can't write to a share with "unix extensions = no" set in smb.conf

text: **/etc/samba/smb.conf :**               [global]     workgroup = w     server string = server     security = user     load printers = no     debug level = 10     log file = /var/log/samba/%m.log     max log size = 5000     dns proxy = no     printing = bsd     printcap name = /dev/null     disable spoolss = yes           unix extensions = no     # if I comment above line, I can write to /home/shareuser/writable          follow symlinks = yes     wide links = yes           [writable]     comment = test     writable = yes      valid users = shareuser     path=/home/shareuser/writable      **shareuser** has valid passwd and smbpasswd (-a) I mount the share like this: `mount -t cifs //server/writable mountpoint/ -o username=shareuser` With `unix extensions = yes`, I can write to the share. With `unix extensions = no`, I can't write to the share. **Any help greatly appreciated :)** Edit: simplified the example Edit: **/var/log/samba/log.smbd**               [2012/09/23 22:42:32,  0] smbd/server.c:1053(main)       smbd version 3.6.8 started.       Copyright Andrew Tridgell and the Samba Team 1992-2011     [2012/09/23 22:42:32,  5] ../lib/util/debug.c:330(debug_dump_status)       INFO: Current debug levels:         all: 10         tdb: 10         printdrivers: 10         lanman: 10         smb: 10         rpc_parse: 10         rpc_srv: 10         rpc_cli: 10         passdb: 10         sam: 10         auth: 10         winbind: 10         vfs: 10         idmap: 10         quota: 10         acls: 10         locking: 10         msdfs: 10         dmapi: 10         registry: 10       doing parameter log file = /var/log/samba/%m.log       doing parameter max log size = 5000       doing parameter dns proxy = no       doing parameter printing = bsd       doing parameter printcap name = /dev/null       doing parameter disable spoolss = yes       doing parameter unix extensions = no       doing parameter follow symlinks = yes       doing parameter wide links = yes     [2012/09/23 22:42:32,  4] param/loadparm.c:9608(lp_load_ex)       pm_process() returned Yes     [2012/09/23 22:42:32,  7] param/loadparm.c:9834(lp_servicenumber)       lp_servicenumber: couldn't find homes     [2012/09/23 22:42:32, 10] param/loadparm_server_role.c:101(set_server_role)       set_server_role: role = ROLE_STANDALONE     [2012/09/23 22:42:32,  5] ../lib/util/charset/codepoints.c:235(map_locale)       Substituting charset 'UTF-8' for LOCALE     [2012/09/23 22:42:32,  2] lib/tallocmsg.c:124(register_msg_pool_usage)       Registered MSG_REQ_POOL_USAGE     [2012/09/23 22:42:32,  2] lib/dmallocmsg.c:78(register_dmalloc_msgs)       Registered MSG_REQ_DMALLOC_MARK and LOG_CHANGED      Edit: **/var/log/samba/smbd.log** **/var/log/samba/smbd.log -- pastebin**


title: How to disable certain system calls for a given user?

text: I am creating a web app similar to codepad and for each run-action my app copies a directory (`/home/radeks/voidptr/private/chroot-root`) to `/tmp/voidptr/[random-id]/chroot-root`. This chroot directory has a user that compiles and runs the code entered by the web app user. The problem is that I don't want the user to shut down the machine or use sockets for example. Do I need to write a supervisor or can I simply set these permissions per user?


title: SSH automatic remote back ups

text: I have two machines, `A` and `B`. Machine `A` can ssh into `B`. `A` has a lot of free space. `B`'s data is in a sort of risky situation. **How do I back up all of`B`'s data to `A` automatically.** It does not have to be terribly frequent, but it should be hands free. Every time `A` boots up would be frequent enough. I hear sync can do this.


title: Install the roboform lite extension in Debian Wheezy Iceweezel

text: How do I install the roboform lite extension in Debian Wheezy Iceweezel browser? All I have is an XPI file.


title: centos 6.4 trouble with /dev/pts/ptmx

text: I have a problem with the server running on CentOS. CentOS has been upgraded to version 6.4 and has all updates. Updates were made according to the official repositories. On the server running the V-Server. **/etc/fstab**               # Device     Mountpoint   FStype  Options                 Dump Pass     /dev/sda1      /boot      ext3    rw,noatime                1  2     /dev/vg0/root  /          ext3    rw,noatime                1  1     /dev/vg0/swap  none       swap    sw                        0  0     /dev/vg0/usr   /usr       ext3    rw,noatime                1  2     /dev/vg0/var   /var       ext3    rw,noatime                1  2     /dev/vg0/log   /var/log   ext3    rw,noatime                1  2     /dev/vg0/tmp   /tmp       ext3    rw,noatime,nosuid,noexec  1  2     /dev/vg0/home  /home      ext3    rw,noatime                1  2     /dev/vg0/vz    /vservers  ext3    rw,noatime                1  2     tmpfs          /dev/shm   tmpfs   defaults                  0  0     devpts         /dev/pts   devpts  rw,gid=5,mode=620         0  0     sysfs          /sys       sysfs   defaults                  0  0     proc           /proc      proc    defaults                  0  0      The problem is with `/dev/pts/ptmx`:               root@Hostname #/dev/pts > ls -la     total 0     drwxr-xr-x 2 root root 0 Sep 12 12:34 .     drwxr-xr-x 18 root root 3860 Sep 12 12:34 ..     crw--w---- 1 mmichalski tty 136, 0 Sep 12 12:53 0     c--------- 1 root root 5, 2 Sep 12 12:34 ptmx      As you can see it has no rights. The same situation is running virtual. Below is the fstab file virtual fstab on virtual running on Vserver > none /proc proc defaults 0 0   >  none /tmp tmpfs size=16m,mode=1777 0 0   >  none /dev/pts devpts gid=5,mode=620 0 0   > What can cause this problem and where to look for solutions?


title: Install KDE applications under Gnome?

text: I try my best not to install KDE applications on Gnome of my Ubuntu, but sometimes I have to install some KDE applications such as Okular. Moreover, sometimes I have to install from their source of their latest release, which I often fail to do. I wonder how Gnome support KDE applications? How shall I install an KDE application properly in Gnome? For example, to install latest Okular from source in Ubuntu Gnome, I follow here:               git clone git://anongit.kde.org/okular     cd okular     mkdir build     cd build     cmake -DCMAKE_INSTALL_PREFIX=/path/to/your/kde4/install/dir ..     make     make install      Updated: When I reach the command `cmake`, I find that `CMakeLists.txt` is in `/tmp/okular/`, so I specify `../` to `cmake`:               /tmp/okular/build$ sudo cmake ../ -DCMAKE_INSTALL_PREFIX=/usr/bin      The output is here https://dl.dropboxusercontent.com/u/13029929/new. There is no executable `okular` in `/usr/bin`. I wonder how to solve this problem?


title: grab multiple lines after a matching target line

text: This question is similar to How to show lines after each grep match until other specific match? thus answers may be similar to those there. I am trying to grab and extract from a file the lines that are after the lines that are matching a TARGET value ("forms=2", in my case) and the next empty line. The segment of my file is like below:               forms=1     Code=00416T0     Code=00416T0          forms=2       #Target**     Code=06538T0  #grab this line     Code=06538T0  #grab this line     Code=11288T0  #grab this line     Code=11288T0  #grab this line          forms=1     Code=00549T0     Code=00549T0     Code=00549T0          forms=2      #Target**     Code=00553T0 #grab this line     Code=02576T0 #grab this line     Code=02576T0 #grab this line          forms=1     Code=11099T0       So I would like to find a way according to Target "forms=2" to have the following lines even if same of those grabbing lines are identical               Code=06538T0 #grab this line     Code=06538T0 #grab this line     Code=11288T0 #grab this line     Code=11288T0 #grab this line     Code=00553T0 #grab this line     Code=02576T0 #grab this line     Code=02576T0 #grab this line      Any help please?


title: What are the different CD's & DVD's for?

text: I'm planning to install Debian on my home server. It will be running some services like Teamspeak 3, gaming servers, Samba, etc... No business services like DHCP, DNS, ... needed. So as this is my first time installing Debian I found this site where you can download dvd's and cd's for installation (amd64): https://www.debian.org/CD/http-ftp/ Now I see there are a whole bunch of different CD's and DVD's. **I know that only the first DVD / CD is required for basic / core installation and that the others contain additional optional features.** **What I am searching for now is something like a list, which DVD / CD contains what.** I could not find anything on this topic in the internet.


title: Printing on serial printer via cups

text: I'm trying to set up my serial printer with cups, but I can't see any serial port in cups config page nor via `lpinfo -v`. I have serial port at `/dev/ttyAMA0`. I was trying to set proper permissions for `/dev/ttyAMA0` and `/usr/lib/cups/backend/serial`, but without success.


title: Tomoyo Linux: Have a private folder, that can't be read by default

text: Is it possible to specify folders, eg: `/home/$user/private` that can not be listed, read or written to by any application in the default profile 0, but only with programs where I specify this as rule? Example: Store SSH-Keys in such a special folder and run a program that has no policy yet normally as my user. This program should then not be able to do anything with the [files in the] special folder. When I open my ssh client, I want it to be able to read the keys. I'm using Tomoyo Linux 2.5 on Arch Linux. Just to avoid confusion: Tomoyo Linux is not a Linux distribution, it is a MAC.


title: Can't access command history in my shell (sh)

text: I'm not sure if readline is what really missing but the problem is shell (instead of bash) and when I click the up and down arrow I get the following instead of command history:               $ ^[[A^[[A^[[A^[[A^[[A^[[A^[[A      What's missing?


title: History of commands and directories we were in

text: I was wondering: If I type `history` I can see the previous commands I typed and see what happened and perhaps keep commands as reference. But I don't know in which directory I was when I typed the commands. Is there a version of `history` that displays also the directory you were in when you typed the command?


title: How are drivers for peripheral hardware installed in Linux?

text: I have acquired a new wireless keyboard, and I've tested it out on both a Windows and a Linux box. It worked on both, but with an initial difference - Windows took a minute or two, to look up the keyboard's (Logitech's) drivers on the Internet and install them. It visually notified my of doing so and displayed its progress. However, when I plugged it into my Debian computer - I did not notice such a progress. Also, I was almost immediately able to use it, and I'm not sure how it got working so fast. Is Linux using a combination of a generic Bluetooth dongle driver and a generic keyboard driver?


title: Possible to limit number of cups printers?

text: The way I have configured CUPS on my workstation is by               echo 'CUPS_SERVER=cups.example.com' >> ~/.profile     echo 'export CUPS_SERVER' >> ~/.profile      When I open the print menu in any program I see ~50 CUPS printers, where I am only interested in 2-3 of them. **Question** Is it possible to only show those 2-3 printers I am interested in?


title: How to restrict an SSH tunnel to a certain outbound IP address on an SSH server?

text: I hope I'm phrasing this question correctly. I have a SSH server that I use for testing that has 2 internet connections running on it. The LAN connection is always on, but the USB connection is on intermittently. Is it possible to restrict the tunnel so that it only ever uses the IP address of the USB connection to browse the internet? This is what I'm currently using:               ssh -v -D 3456 root@mysshserver.net;      This is great, but it doesn't tell me if the server's secondary USB connection changes. As I know the IP (for arguments sake 199.90.09.78) of the USB connection, I was hoping I could restrict the tunnel to only using the USB and breaking if the USB went down. I've been playing around with the following:               ssh -v -D *:3456 -R *:3456:199.90.09.78:80 root@mysshserver.net;      But I think I'm using -R wrong. Is there a better way to achieve this?


title: How to configure Java Security Manager on JBOSS?

text: I’m trying to configure JBoss EAP 6 with java security manager. The official guide says you should edit the standalone.conf file, but I can’t find it. Can I circumvent this issue and define the java security manager in a different way? Am I doing something wrong?


title: set umask to 0002 for sftp and scp

text: I want files sent to my server using sftp and scp to be group-writable. How can I do that? I tried using libpam-umask from http://wiki.debian.org/DebianDesktopHowTo but it didn't work. **EDIT:** Is there any way I can troubleshoot `pam`? Is there a log? Is there any common reason why `libpam-umask` would not work? Do I have to install something?


title: Execute a command once per line of piped input?

text: I want to run a java command once for every match of `ls | grep pattern -`. In this case, I think I could do `find pattern -exec java MyProg '{}' \;` but I'm curious about the general case - is there an easy way to say "run a command once for every line of standard input"? (In fish or bash.)


title: I have Debian on my server. Should I use Centos or Ubuntu version of software I need to install?

text: This is my server:               /usr/local/bin$ uname -a     Linux nn15 3.2.0-4-amd64 #1 SMP Debian 3.2.46-1 x86_64 GNU/Linux      The software I need is offered in these versions:   * centos-5.3.run   * centos-5.6.run   * centos-6.3.run   * ubuntu-8.04.run   * ubuntu-10.04.run   * ubuntu-12.04.run Which one is the closest to Debian? I'm asking because I want to know which one is the most likely to work when I download and install it.