title: From Ubuntu 10.10, how do you connect to a Windows 7 share without a password setup?

text: I have:   1. Ubuntu 10.10   2. Windows 7 in virtual box (let's call this vbox)   3. Then another Windows 7 machine (let's call this remote) in the network When I'm on vbox and browse (\ip.of.remote) I'm able to see the shared drives. No password was setup, and none was asked. When on Ubuntu, and I go to smb://ip.of.remote it asks for username/password. How do I fix this? Thanks! UPDATE   * **Jan 30 2011** : I'm able to connect from Xubuntu to Windows (via Gigolo). It allows me to press connect even if there's no username. With Ubuntu though, if I remove the username, the connect button is grayed out. Maybe then it's just an interface problem?


title: Query DHCP server leases from Perl script

text: I have a Windows 2003 server and need to poll the DHCP lease information from it with a perl script that is running on a Ubuntu server. Then I need to analyze & store the information in a mysql database. Is there a way to query the leases from a perl script? I can figure out how to process the info after I get it. Thanks.


title: Why my Http Proxy doesn't reply [SYN,ACK] after received a [SYN] packet from the client?

text: I have a http proxy running on Linux (RHEL 5.5), intermittently it doesn't reply [SYN,ACK] packet after received a [SYN] packet from the client. This issue can be recovered by restarting the proxy. I ran the gstack against the proxy process, however the stack of each thread doesn't indicate any problems(hanging). And there were less than 100 connections staying at the "SYN_RECV" state during this issue. Any ideas? For such issue, where should i start to debug? Any suggestions would be greatly appreciated.


title: Why is it better to use a 64bit OS?

text: Speed/Security? Why should we choose to use 64 bit instead of 32 bit?


title: why cannot read /dev/console after reboot AIX

text: I use `< /dev/console` when running Micro-Focus cobol programs in background cron jobs instead of `< /dev/null` because then we don't get an warning about the input file not supporting ioctl. The warning about the input file not supporting `ioctl` means that the script is not able to differentiate between this and a real error as the program returns the same value. Usually (on many different AIX servers) I set up these jobs to run as root because other users do not have permissions to read `/dev/console`. Over several years, I've had several problems that I just don't understand, and searching the internet for many hours hasn't helped. E.g.   1. a server changed, for no apparent reason, from where only root could use `< /dev/console` to where only a non-root user could use `< /dev/console`   2. a server where a non-root user was able to use `< /dev/console` changed after reboot so that only root could use `< /dev/console` The 2nd example is my most recent case. `lscons` shows the console is assigned to `/dev/tty0` and you can login on `/dev/tty0` fine. I don't think anyone has used `swcons` or `chcons` to reassign the console before the reboot. I've tried changing permissions on `/dev/console` & `/dev/tty0` to `666` but still only root can do, without error:               echo TEST < /dev/console      Does anybody understand what is happening or know how to change it so non-root users can read `/dev/console` ? Any suggestions for another device that supports `ioctl` and could be used as a dummy stdin by non-root users? (I suspect that the cobol program only opens stdin but doesn't actually read it when in the background). Permissions now:   crw-rw-rw- 1 root system 4, 0 Aug 20 1999 /dev/console   crw-rw-rw- 1 root system 16, 0 Aug 09 13:39 /dev/tty0 Before I did: `chmod 666` :   crw--w--w- 1 root system 4, 0 Aug 20 1999 /dev/console   crw------- 1 root system 16, 0 Aug 09 13:39 /dev/tty0


title: What do the device files in /dev actually do?

text: (Not a duplicate of Understanding /dev and its subdirs and files) I was browsing around my filesystem and for the first time I took a second to analyze my `/dev` directory. I was surprised by the amount of devices files in it, and couldn't make sense of all of them:               max@linux-vwzy:/dev> ls     adsp             disk      fd0u1760  initctl  mem                 root  sg0       tty    tty21  tty35  tty49  tty62    vboxdrv     vcsa2     audio            dri       fd0u1840  input    mixer               rtc   sg1       tty0   tty22  tty36  tty5   tty63    vboxnetctl  vcsa3     autofs           dsp       fd0u1920  kmem     mixer1              rtc0  sg2       tty1   tty23  tty37  tty50  tty7     vboxusb     vcsa4     block            dvd       fd0u360   kmsg     net                 scd0  sg3       tty10  tty24  tty38  tty51  tty8     vcs         vcsa5     bootsplash       dvdrw     fd0u720   log      network_latency     sda   sg4       tty11  tty25  tty39  tty52  tty9     vcs1        vcsa6     bsg              fb0       fd0u800   loop0    network_throughput  sda1  sg5       tty12  tty26  tty4   tty53  ttyS0    vcs10       vcsa7     btrfs-control    fd        fd0u820   loop1    null                sda2  sg6       tty13  tty27  tty40  tty54  ttyS1    vcs2        vga_arbiter     bus              fd0       fd0u830   loop2    nvram               sda3  sg7       tty14  tty28  tty41  tty55  ttyS2    vcs3        xconsole     cdrom            fd0u1040  full      loop3    oldmem              sdb   shm       tty15  tty29  tty42  tty56  ttyS3    vcs4        zero     cdrw             fd0u1120  fuse      loop4    port                sdc   snapshot  tty16  tty3   tty43  tty57  ttyS4    vcs5     char             fd0u1440  fw0       loop5    ppp                 sdc1  snd       tty17  tty30  tty44  tty58  ttyS5    vcs6     console          fd0u1600  hidraw0   loop6    psaux               sdd   sr0       tty18  tty31  tty45  tty59  ttyS6    vcs7     core             fd0u1680  hidraw1   loop7    ptmx                sde   stderr    tty19  tty32  tty46  tty6   ttyS7    vcsa     cpu              fd0u1722  hidraw2   mapper   pts                 sdf   stdin     tty2   tty33  tty47  tty60  uinput   vcsa1     cpu_dma_latency  fd0u1743  hpet      mcelog   random              sdg   stdout    tty20  tty34  tty48  tty61  urandom  vcsa10      I know that the `sd*`'s are my disks and filesystems, but what are `loopx`, `fd0uxxxx`, `sgx`, `vcsxxx` and all the other single files. Most of them are device files according to `ls`. I understand that fully answering this question would require a ton of information, so unless someone can provide a link with a great rundown of the different devices files in `dev` and what they are all used for, I propose we make a CW answer.


title: Why can't sudo redirect stdout to /etc/file, but sudo 'nano' or 'cp' can?

text: Why does redirection, using `sudo` give me an error for the following commands?               $ sudo printf "foo" >/etc/file     bash: /etc/file: Permission denied          $ sudo printf "foo" ~/file; cat ~file >/etc/file      bash: /etc/file: Permission denied      ...yet I have no such problem when I use an editor, or `cp`.   I don't think I've ever tried this before, so I don't know if there is something haywire on my system, or if this is normal. It seems a bit restrictive to be normal, but(?) maybe it is intended to be restrictive... (using Ubuntu)


title: Yum: How can I view variables like $releasever, $basearch & $YUM0?

text: I am setting up a yum repository, and need to debug some of the URLs in the yum.conf file. I need to know why is Scientific Linux trying to grab this URL, when I was expecting it to grab another URL:               # yum install package      http://192.168.1.100/pub/scientific/6.1/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404"     Trying other mirror.     Error: Cannot retrieve repository metadata (repomd.xml) for repository: sl. Please verify its path and try again      The yum.conf(5) manpage gives some information about these variables: > Variables > > There are a number of variables you can use to ease maintenance of yum's > configuration files. They are available in the values of several options > including name, baseurl and commands. > > $releasever This will be replaced with the value of the version of the > package listed in distroverpkg. This defaults to the version of 'redhat- > release' package. > > $arch This will be replaced with your architecture as listed by > os.uname()[4] in Python. > > $basearch This will be replaced with your base architecture in yum. For > example, if your $arch is i686 your $basearch will be i386. > > $YUM0-$YUM9 These will be replaced with the value of the shell environment > variable of the same name. If the shell environment variable does not exist > then the configuration file variable will not be replaced. Is there a way to view these variables by using the `yum` commandline utility? I would prefer to not hunt down the version of the 'redhat-release' package, or manually get the value of os.uname()[4] in Python.


title: Use different authentication methods for OpenSSH server depending on client IP

text: I'm sure this has been answered before, but I could not locate the answer with Google, and this search. I currently only allow shared key authentication for openssh server on my box. However, I would like to be able to use password auth, when I am connecting locally, via my internal (192.168.1.x) subnet. Is it possible to use a per-host authentication method in OpenSSH? Thanks!


title: Installer not booting on Intel Atom 64bit CPU

text: I used to have Debian 6, the 64bit version working fine on this system. I'm now trying to install Arch (64bit) and the installer won't boot. Can anybody help me troubleshoot this issue? EDIT: My core: http://ark.intel.com/products/43098 Specs: http://pastebin.com/7KVgFch3


title: Hauppauge TV Tuner Card with Motorola STB and LIRC

text: I have a MythTV PV VM under Xen which I've spent about 2 weeks getting up and running. Everything seems to be working fine; PCI passthrough gives the card to the guest OS (OpenSUSE 11.4), the digital tuner works fine (I've successfully streamed Live HD TV to my PC), and I've very close to being very happy. BUT, I cannot get LIRC configured for the life of me. I've spent the past 3 nights googling and reading tutorial and how to after another. I've found the firmware (HVR-1600 card), and got it loaded with the lirc_zilog module. It's recognized, and configured (by the Kernel/LIRC). I cannot, however, get it to do the following:   1. I was able to capture IR signals from the stock Hauppauge Remote, but not the one from my DCT-700 STB (when I tried, I simply get a message that the gap length could not be determined, and no dots are shown).   2. I have not been able to get it to transmit ANYTHING. So, here's a quick example of some outputs: `dmesg` output:               ~ # dmesg | grep lirc     [   15.242456] lirc_dev: IR Remote Control driver registered, major 251      [   15.277047] lirc_zilog: module is from the staging directory, the quality is unknown, you have been warned.     [   15.277882] lirc_zilog: Zilog/Hauppauge IR driver initializing     [   15.282904] lirc_zilog: chip found with RX and TX     [   15.283556] i2c i2c-0: lirc_dev: driver lirc_zilog registered at minor = 0     [   15.338267] lirc_zilog: Zilog/Hauppauge IR blaster firmware version 2.1.0 loaded     [   15.339013] lirc_zilog: chip found with RX and TX     [   15.339638] i2c i2c-0: lirc_dev: driver lirc_zilog registered at minor = 1     [   15.369278] lirc_zilog: Zilog/Hauppauge IR blaster firmware version 2.1.0 loaded     [   15.369296] lirc_zilog: initialization complete      An `irsend` test:               ~ # irsend --device=/var/run/lirc/lircd SEND_ONCE dct700 OK     irsend: command failed: SEND_ONCE dct700 OK     irsend: transmission failed      The corresponding `/var/log/messages`               ~ # tail /var/log/messages     Jul 29 10:16:36 lal lircd-0.8.7[1090]: accepted new client on /var/run/lirc/lircd     Jul 29 10:16:36 lal lircd-0.8.7[1090]: write failed     Jul 29 10:16:36 lal lircd-0.8.7[1090]: Protocol error     Jul 29 10:16:36 lal lircd-0.8.7[1090]: error processing command: SEND_ONCE dct700 OK     Jul 29 10:16:36 lal lircd-0.8.7[1090]: transmission failed     Jul 29 10:16:36 lal kernel: [  227.063942] lirc_zilog: failed to get data for code 0, key 9050 -- check lircd.conf entries     Jul 29 10:16:36 lal lircd-0.8.7[1090]: removed client      Relevant portion of `/etc/lirc/hardware.conf`:               #Chosen IR Transmitter     TRANSMITTER="HVR 1600"     TRANSMITTER_MODULES="lirc_zilog"     TRANSMITTER_DRIVER=""     TRANSMITTER_DEVICE="/dev/lirc0"     TRANSMITTER_SOCKET=""     TRANSMITTER_LIRCD_CONF="/etc/lirc/lircd.conf"     TRANSMITTER_LIRCD_ARGS=""          #Enable lircd     START_LIRCD="true"          #Don't start lircmd even if there seems to be a good config file     #START_LIRCMD="false"          #Try to load appropriate kernel modules     LOAD_MODULES="true"      I'm quite sure the `dct700.conf` file is wrong. I copied it from a forum of someone who claimed to have this STB working, but it's for a USB MCE transmitter. Since I cannot get the receiver to record the signal from the remote, I cannot generate my own. SO, if anyone has a similar combination working, or knows someone who does, or sees something wrong and has a suggestion, I would be eternally grateful for any help.


title: What does dash "-" at the end of a command mean?

text: Given the following command:               gzip -dc /cdrom/cdrom0/file.tar.gz | tar xvf –      What does the `-` at the end of the command mean? Is it some kind of placeholder?


title: Which shell I am running on?

text: When I run `echo $SHELL` the output says `/bin/tcsh` which means that i am running tcsh. But for example when I issue the following command               alias emacs 'emacs -nw'       I get the following error:               bash: alias: emacs: not found     bash: alias: emacs -nw: not found      and when I issue `alias emacs="emacs -nw"` it runs fine! This is confusing since I am running tcsh but the commands are interpreted by bash. What could be the reason?


title: tool or technique to get a diff of two different linux installations

text: Albert Einstein quote > Insanity: doing the same thing over and over again and expecting different > results Often-times, Linux drives me mad because I'm doing the same thing over and over again and _getting_ different results from box to box. (See my previous question). For me, the biggest area of confusion is taking over a machine that someone else has installed (as is the case when signing up with a web hosting company). You just don't know what you're dealing with. **Is there some kind of clever _diff tool_ that I can run on an installation of Linux (Ubuntu) to give me a heads-up on how that machine has veered from the default installation?** i.e. Something that can show me a list of the commands that are going to behave surprisingly thus avoiding a trial and error approach.


title: To study SPARC executable structure with OpenSolaris on Intel

text: I want to study and compare executable file structure of elf, SPARC and PA- RISC. To perform the studies I want to install OpenSolaris on an Intel machine (Core2Duo). But I got a basic doubt will it work at all ? I know SPARC has its own assembly - grew in suspicion if it will work or is valid thought at all. I was aiming to write some programs disassemble them and with some help of tools study the file structures. I don't have any clue how to perform all this for HP-UX (PA-RISC); dont know any free OS for PA-RISC.


title: Detect if a (NTFS) drive is mounted or not. If not then mount it

text: I want to sync an USB drive with a folder located on a NTFS partition which is not mounted at boot time. I have found a command to do that: `rsync -axu /media/USB/folder /home/user/folder`. But I have to have the NTFS drive already mounted. How can I detect if a NTFS drive is mounted or not from a script and if is not to mount it? I use Linux (Ubuntu). This is the little script modified (the original is here) with your help!               #!/bin/bash     ## CONFIG SECTION     MOUNT_DRIVE=/dev/disk/by-id/scsi-SATA_Hitachi_HTS5416_SB3404GRGJRKBS-part5     MOUNT_POINT=/media/Windows/     # Local folder to sync with     SYNC_LOC=/media/Windows/vasia/Disertatie/     # Device folder to sync with     SYNC_DEV=Disertatie     #     ## SCRIPT SECTION     #verify if the drives are mounted     if mount | grep -q "/media/Windows/"; then     #device is mounted     echo "Windows NTFS Drive is mounted!"     else     #device is not mounted,let's mount it     mount $MOUNT_DRIVE $MOUNT_POINT     fi     # Wait for thumbdrive to settle     sleep 10     # Synchronize thumbdrive with local     rsync -axu /media/DISK_IMG/${SYNC_DEV}/ ${SYNC_LOC}/     # Synchronize local with thumbdrive     #rsync -axu ${SYNC_LOC}/ /media/disk/${SYNC_DEV}/     # Inform user that synchronization is complete.     zenity --title "Thumbdrive Sync" \            --info --text "File synchronization        complete."


title: Virtualenv creation seems to do nothing

text: I have a problem setting up a Virtualenv on my web host server (to install python modules later on) So far I tried this (over SSH):               wget http://pypi.python.org/packages/source/v/virtualenv/virtualenv-1.5.2.tar.gz     tar xzf virtualenv-1.5.2.tar.gz     ~/usr/lib/python2.4 virtualenv-1.5.2/virtualenv.py ~/data/env      and               ~/usr/lib/python2.4 setup.py install      I don't get any errors or output and cannot find the ~/data/env-directory that should be created. What is going wrong? Or what is the next step?


title: Duplicate selected words with sed and replace it

text: I have to modify a document containing xml data; one modification I couldn't set up with `sed`. I have to modify the following expressions from:               <Bild href_fmt="Bilder/Bildschirmfoto%202012-06_fmt.jpeg"      href="file:///user/folder/Desktop/Bildschirmfoto%202012-06-18%20um%2013.17.45.png"></Bild>      to:                     My problem: I couldn't duplicate the `Bildschirmfoto%202012-06_fmt.jpeg` to generate the correct new entry. The HTML tag is somewhere in the line, therefore I can't duplicate the whole line... How can I do this with `sed` or other Linux commands?


title: KDE windows maximize automatically?

text: There is a similar question on Askubuntu. One solution was Maximus, however it doesn't work on KDE, only on Gnome family DEs (Gnome Shell, Unity, Cinnamon). KDE settings are rich, but i didn't find how to setup Maximus-like behavior, which unwraps windows to take all possible and space and also hides window header (window title). There is System Settings → Window Behavior → Window Behavior → Advanced → Placement: Maximizing, but it doesn't hide window header (which is about 20 px) and incorrectly maximizes some applications (like Emacs). How to unfold every window to fullscreen automatically on launch in KDE?


title: Can I apply real time Linux kernel patch on Android kernel?

text: I would like to apply real time patch on the Android kernel (given I've found Kernel patch for corresponding Kernel version). Is it possible or should I create a patch specifically for the purpose of patching Android kernel? I know this question might sound trivial to many of you but I'm not into operating system, rather programming languages.


title: Why can I not chmod a file?

text: [nathanb@ka /x/sim/nathanb/nbsim1] ls -al ,nvram     -rw-r--r--    1 root     root      2097152 Jul  5  2011 ,nvram     [nathanb@ka /x/sim/nathanb/nbsim1] sudo chmod a+w ,nvram      chmod: changing permissions of `,nvram': Operation not permitted      The volume is mounted rw, obviously, since I can modify other stuff. But even if I su as root, I can't chmod this file.               [root@ka /x/sim/nathanb/nbsim1] chmod +w ,nvram     chmod: changing permissions of `,nvram': Operation not permitted      I did an strace on the chmod, and I see this:               stat64(",nvram", {st_mode=S_IFREG|0644, st_size=2097152, ...}) = 0     chmod(",nvram", 0666)                   = -1 EPERM (Operation not permitted)      Here's the output of stat               [root@ka /x/sim/nathanb/nbsim1] stat ,nvram     Name: ,nvram             Size: 2097152       Perms: 0644/-rw-r--r--     Type: Regular File     Blocks: 4120           User: 0/root     Inode: 205777           IOsize: 32768         Group: 0/root          Access Time: Sat Jul 23 09:27:31 2011         Links: 1     Modify Time: Tue Jul  5 18:36:35 2011     FS device: 28     Change Time: Sat Jul 23 09:30:35 2011       Maj/Min: 0/0      And just to prove that there's not weird uid stuff going on:               [root@ka /x/sim/nathanb/nbsim1] id     uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel),503(mailman),21(slocate),30(gopher),500(http),14(uucp),188(xelus),16(radadmin)      Any ideas?


title: How do I extend my desktop to my 2nd monitor rather than just cloning it?

text: I have just installed Debian Wheezy for the first time and have had mixed success getting my system up and running. Currently my main issue is that I am unable to extend my desktop to my second screen. I have an ATI radeon HD 7700 series graphics card connected to 2 displays. Running `lspci` results in this line, among others: > 04:00.0 VGA compatible controller: Advanced Micro Devices [AMD] nee ATI Cape > Verde [Radeon HD 7700 Series] Currently, both are cloned. I initially tried to follow the instructions for installing proprietary ATI drivers, which resulted in the 2nd display being detected but I was unable to extend the desktop rather than clone it (something about my virtual screen not being big enough). I gathered that support might be better for the free version so I followed these instructions for removing said drivers, followed by these instructions to install the free ones. As per the troubleshooting step in that page I ran this command: > dmesg | grep -E 'drm|radeon' | grep -iE 'firmware|microcode' which produced this output:               [    4.925773] [drm] Loading VERDE Microcode       [    4.990158] platform radeon_cp.0: firmware: agent loaded radeon/VERDE_pfp.bin into memory      [    5.152647] platform radeon_cp.0: firmware: agent loaded radeon/VERDE_me.bin into memory      [    5.236165] platform radeon_cp.0: firmware: agent loaded radeon/VERDE_ce.bin into memory [    5.260082] platform radeon_cp.0: firmware: agent loaded radeon/VERDE_rlc.bin into memory      [    5.376566] platform radeon_cp.0: firmware: agent loaded radeon/VERDE_mc.bin into memory      That's different to the outputs on that page but then they don't really give anymore information so I just assumed everything had worked. Anywho, now when I go to `System Tools` -> `Preferences` -> `System Settings` -> `Display` I just see a single display called `Unknown`, which clones across both of my monitors. running `xrandr -q` produces this output: > xrandr: Failed to get size of gamma for output default Screen 0: minimum > 1680 x 1050, current 1680 x 1050, maximum 1680 x 1050 default connected > 1680x1050+0+0 0mm x 0mm 1680x1050 0.0* FYI 1680x1050 is the native resolution of both monitors. I do not have a `/etc/X11/xorg.conf` file, and my `/etc/X11/xorg.conf.d/` directory seems to be empty. This is my first time running a linux system so I'm totally confused and would appreciate kind words and idiot-proof guidance.


title: Check SMTP server capabilities on the command line

text: I know an SMTP server's URL. I want to know about that SMTP server's capabilities: TLS, password encryption, etc. Evolution Mail knows how to report these. How can I get them from the command line? **UPD**. EHLO output               EHLO yandex.ru     250111.localdomain.ru Hello ac60.localdomain.ru [172.16.2.60] (may be forged), pleased to meet you     250-ENHANCEDSTATUSCODES     250-PIPELINING     250-8BITMIME     250-SIZE     250-DSN     250-ETRN     250-STARTTLS     250-DELIVERBY     250 HELP


title: cut command, order not preserved?

text: I have a sample file:-               [root@localhost base_filters]# cat shortlist     2233|charles harris  |g.m.     |sales     |12/12/52| 90000     9876|bill johnson    |director |production|03/12/50|130000     5678|robert dylan    |d.g.m.   |marketing |04/19/43| 85000     2365|john woodcock   |director |personnel |05/11/47|120000     5423|barry wood      |chairman |admin     |08/30/56|160000      I wanted to flip the names in the file such that there is a comma `,` after the last name i.e for example a name should appear as harris,charles. I tried the following command:-               [root@localhost base_filters]# tr -s ' ' < shortlist | cut -d\| -f2 | cut -d' ' -f2,1     charles harris     bill johnson     robert dylan     john woodcock     barry wood      I want last name to appear first so I specified field 2 and then 1 but this doesn't seem to work. Any Ideas about this?


title: Using zypper, how can I remove all packages installed from a specific repository?

text: Say I've added a repository using `zypper ar`. Then, I've gone and installed multiple packages from that repository, but now I want to remove all of them. Is there a command that allows me to remove all the packages that I've installed just from that specific repository?


title: Tray Icon Missing Rssowl Fedora 18

text: I have been an avid user of RSSOwl & now have ported mine OS to Fedora 18. Everything works fine including the transfer of .rssowl2 (backup folder) to new Fedora. However when minimised or exited to tray tray icon is missing... ![enter image description here](http://i.stack.imgur.com/im18l.png) notifications are OK I too can right-click tray icon... /* Details Added */ RssOwl can be downloaded as a zip file. it has a got a binary & an xpm file...You just execute binary (I symlinked it to /bin) & app starts so I manually created .desktop file:               [Desktop Entry]     Categories=Network;     Exec=rssowl     Icon=/home/usama/Programs/rssowl/RSSOwl.png     Name=RSSOwl     Terminal=false     Type=Application      I converted that .xpm file to .png to be used as desktop icon. Now I copied RSSOwl.png to /usr/share/pixmaps with **no success** & when copied RSSOwl.png to /usr/share/icons/gnome/24x24/apps well **success** happened but very tiny icon :(


title: Load my .profile for bash in Emacs terminal buffer? (multi-term mode)

text: I've got multi-term mode (derived from ansi-term) with bash started in Emacs 23.3, which is a terminal emulator running in Emacs. However, I noticed that it did not load my user profile, including environment variables, $PATH, etc. How do I tell multi-term to start bash with my user profile in ~/.profile? Thanks.


title: Tool for viewing top N items in stream

text: I'm looking for an existing Linux command-line tools that can accomplish the following: Consider there is an input stream `/dev/inputstream` which spews an infinite stream of data that looks like this:               A     A     B     A     C     Z     A     .     .     .      **NOTE:** (Each line is one character from the alphabet). The tool is used in the following fashion:               cat /dev/inputstream | tool      The output of the tool should be like the one from "top" command. It should be a continuously updated list of top N frequently occurring items. Eg:               A -- 10 times     B -- 8 times     Z -- 7 times     C -- 2 times     D -- 1 time      If the stream were not infinite I could have accomplished this using `sort` and `uniq`.


title: Share unchanging data from a central repository on a network

text: I have a bunch of different binary files (total size of all files is circa ~500GB) stored in a hard drive that is mounted to `machine001`. I have 200 other machines that need to access this data for **read-only** purposes. What is the best way to share this data with all other computers, so that reads are fastest? (I use Ubuntu Linux) Is there a different scheme that would be even better for fastest reads?


title: What does it mean that a distro is "based on" another distro?

text: Ubuntu is based on Debian. Mint is based on Ubuntu (except for Linux Mint Debian Edition, which is based on Debian.) When one distro is based on another, in what ways is it different from the parent distro? What has been added or taken out or changed? EDIT: After reading the answer from Chris Down I wonder if I should have approached this from a different angle, asking, What are the components of a distro other than the kernel and and applications?


title: Does linux have something like supercache?

text: I installed http://www.superspeed.com/desktop/supercache.php for windows and the result is awesome. Every program I run is faster. Basically it uses the memory to cache data. Simple idea. I also use delay write. Something like that in linux?


title: Where can I find a good tutorial for installing bcache?

text: Question is updated. Now bcache is part of the standard OS compilation. So it should be easy to install that now. I'll just order some SSD and some big HDD. Where can I found it? I found on the net and it's all too complicated. http://bcache.evilpiepirate.org/ for example seems like the official page for bache. Yet nothing is found there. How to install? How to set up? Nothing Some tutorial says that I have to make bcache, where can I download it? How do I download it? Some says that I have to recompile kernel. Some tutorial doesn't mention that. Which one is right? Nothing makes sense. Okay there is git. Then what? What to do with git?


title: If I rm -rf a symlink will the data the link points to get erased, too?

text: This is the contents of the `/home3` directory on my system:               ./   backup/    hearsttr@  lost+found/  randomvi@  sexsmovi@     ../  freemark@  investgr@  nudenude@    romanced@  wallpape@      I want to clean this up but I am worried because of the symlinks, which point to another drive. If I say `rm -rf /home3` will it delete the other drive?


title: When we do rm -rf * why we do not delete . and ..?

text: I am just curious. Is there a save guard there? . and .. is a "subdirectory" of the directory we are deleting right? I know it's not a subdirectory but linux treat it as a file with directory property.


title: How to keep track of changes in /etc/

text: I would like to keep track of changes in /etc/ Basically I'd like to know if a file was changed, by `yum update` or by a user and roll it back if I don't like the chage. I thought of using a VCS like git, LVM or btrfs snapshots or a backup program for this. What would you recommend?


title: Can grub2 detect processor architecture, and display options accordingly?

text: I have a bootable usb flash drive with grub2 handling booting of ISOs (mostly different spins of Ubuntu). I am editing the menu.cfg myself and have my own script to update grub because I don't want to waste time using external tools. I would like to hide 64-bit ISOs on a 32-bit system, so that I can't make the mistake of trying to boot an incompatible ISO. Is it possible for grub2 to detect whether the processor is x64 or i386 and display a different menu (or preferably enable/disable some menu options) accordingly? Edit: I'm aware of the grub2 CLI command `cpuid -l`, to check for long mode, but I'm not sure if or how that can be used in menu.cfg.


title: How to know <root of the kernel source tree>

text: In https://github.com/facebook/flashcache/ there is a saying > `make KERNEL_TREE=<root of the kernel source tree>` > > This builds both the flashcache.ko and 3 utilities. > > flascache-sa-guide.txt has details on how to create and load flashcache > volumes. > > Mohan Srinivasan Paul Saab What should I wrote to replace ?


title: Linux Fedora 19 - iptables failed to start

text: I've been trying to start the `iptables` firewall service, but it keeps failing. What's going wrong?               # systemctl status iptables.service     iptables.service - IPv4 firewall with iptables       Loaded: loaded (/usr/lib/systemd/system/iptables.service; enabled)       Active: failed (Result: exit-code) since Sat 2013-10-26 11:01:54 CDT; 41s ago      Process: 2114 ExecStart=/usr/libexec/iptables/iptables.init start (code=exited, status=1/FAILURE)          Oct 26 11:01:54 localhost.localdomain iptables.init[2114]: iptables: Applying firewall rules: iptables-restore: line 1 failed     Oct 26 11:01:54 localhost.localdomain systemd[1]: iptables.service: main process exited, code=exited, status=1/FAILURE     Oct 26 11:01:54 localhost.localdomain systemd[1]: Failed to start IPv4 firewall with iptables.     Oct 26 11:01:54 localhost.localdomain systemd[1]: Unit iptables.service entered failed state.


title: Initial delay in typing

text: I've noticed after I come back to my newly installed Fedora 20 system, there's a delay in typing. For example, if I have a terminal window open, and I leave it alone for a few minutes and return, when I type, it takes multiple seconds for my typing to manifest. It's fine after that, provided I don't wait too long between typing. This happens for any typing, not just the terminal. It could be the password on the lock screen, terminal sessions, web forms in FireFox, etc. My system has 32G of RAM, and it occurs with nothing active, except for a terminal or webpage, nothing significantly taxing. The keyboard is the build in laptop physical keyboard. The laptop is a Dell Inspiron 17R (17RM-16452sLV). Is there a known reason this occurs? How can I diagnose and fix the cause of the issue?


title: Comparing two directories in different servers

text: We copy our production code and data files to a testing server on a weekly basis. It can take hours, and sometimes it hasn't finished. What is the best method to confirm that the directories have been copied correctly from one server to another?   * I was hoping that `dircmp` could be used, but I don't see how it can be used between servers.   * My second option is to map (link) one of the directories to the other server, and then use `dircmp` on them.


title: Is GNU PDF Library in active development?

text: I've been hearing about The GNU PDF Library since 2007. Since then I've been looking forward to see this tool in the wild, but four years have passed and it seems to me that this is a painfully long time. I'm aware of the complexities of the project, but as I recall the GNU Foundation have marked it as a top priority project. What is going on?


title: KVM with directory rootfs

text: I'm currently working on an embedded system design and my test development machine is currently a VM running in KVM. Is it possible to have KVM mount a directory (like a chroot) and use that as the root file system for the VM? I currently have the root filesystem in a single sparse file, and I can mount it via loop to a directory, but when making and testing changes it would be much easier to have the root fs in a directory structure on my local machine.


title: setquota fails silently

text: I'm trying to set a file system quota for a bunch of users on my system with a command like:               setquota -b /mntpnt < /file/with/quotas      This seems to work for almost all users. However, when I do this:               getent passwd        | awk -F: '{ if ($3 >=1000 && $3 < 2000) print $1 }'        | xargs quota -u        | grep 'none'        | awk '{print $5}'      to print the names of those users not having a quota set for them, this pipeline reports two users whose names were included in `/file/with/quotas`. I even tried setting their quotas manually via a command like:               setquota -u user 1024 1024 0 0 /mntpnt      This reports nothing (as expected) and gives a zero exit status. However, `quota -u user` still reports that this user has no quota enabled. As far as I can see there's nothing special about the two rogue accounts that would set them apart. Can I make `setquota` more verbose? I tried `strace`ing it but this didn't produce any new information. Any suggestions on why it can be behaving like this? Kernel quota version: 6.5.1   OS: Debian Squeeze 6.0.1   FS: ext4 **Update** I have removed `/mntpnt/aquota.user` and recreated it with `quotacheck -c /mntpnt` because I had other reasons to think it was corrupt. All the symptoms described above took place with the brand new `aquota.user`.


title: Proprietary or Closed Parts of the Kernel

text: I've heard of lines of code that are distributed with the Linux Kernel that aren't open. Maybe some drivers or something like that. I'd like to know how much of that is true? Are there lines of code that are distributed with the Kernel (as when you download it from kernel.org) that aren't open at all? And how much that is of the total (if there's a way to know it, number of lines or percentage)? And where can I find more information about this? Maybe some articles to read... Thank you very much!


title: Disable USB power for USB controlled power strip

text: I have a USB controlled power strip that has a single usb port. ![enter image description here](http://i.stack.imgur.com/yNZnG.jpg) If my computer is turned on and connected via usb to the power strip, the power strip will provide electricity to all the sockets. I want to programatically disable power to the usb port on the computer which is connected to the power strip. This does not work:               $ echo suspend > /sys/bus/usb/devices/usb*/power/level     -bash: echo: write error: Invalid argument      Is there some other way to do this? I would like to be able to connect to my server from somewhere else and turn off power to all the devices connected to the power sockets.


title: Do any Linux distributions have a folder sync option (like briefcase in windows)?

text: I want to keep my local folder synchronized with a network folder. Is there any folder synchronization utility or feature in Linux?


title: How can I solve segmetation fault on ns2.35

text: I am trying to compile `make` on ns2.35 after I add patch of codel algorithm and it gives me this error make[1]: Leaving directory `/home/ashraf/Ns2/ns-allinone-2.35/ns-2.35/indep- utils/webtrace-conv/ucb' Can you please help me?


title: Bash pipe output to more

text: I am wondering about some bash environment setting here: is it possible to set stdout of bash as a pipe to /bin/more? You know, like using vi as editor for your commands it should be possible to avoid using Ctrl-PgUp or Ctrl-PgDown for looking on all the output (by default). To be more specific: I _don't_ want to pipe the output of a _single_ command to more like:               $> ls | more     a b c     ...     --more--      BUT: pipe _any_ output of my current session to more, so to get either all output printet as usual just beneath the prompt - or if it's too much, screen- wise.               # automatically piped to more:     $> ls      a b c     ...     --more--      Is there any bash-built-in to accomplish this? EDIT: I wasn't specific enough, sorry for that: I am aware of "script" and command grouping like               (cmdA; cmdB) | less      What I really would like is to automatically avoid getting a 100 page output at once but instead have a more-like behavior of bash'es stdout. As could be accomplished by adding                2>&1 | more      to all commands entered on command promt - just automatically.


title: Samba daemon hammering CPU on CentOS 5.6 VM on bootup

text: I have a problem where my Centos 5.6 VM is running _very_ slow on my Win7 machine, and looking at `top` I can see that the Samba daemon `smbd` is sitting at the top of the list hitting the CPU big time, with anywhere up to 65% usage! I have done a stop and start of the service, but for some reason it just comes back and takes all CPU again. I have a Samba share setup on my Win7 machine that points to the CentOS VM to let me access my code, so I need Samba running.               top - 09:18:01 up 21 min,  1 user,  load average: 0.83, 0.95, 0.86     Tasks:  98 total,   3 running,  95 sleeping,   0 stopped,   0 zombie     Cpu(s): 10.3%us,  8.3%sy,  0.0%ni, 29.0%id,  0.0%wa,  8.0%hi, 44.3%si,  0.0%st     Mem:    749148k total,   493376k used,   255772k free,    44448k buffers     Swap:  2064376k total,        0k used,  2064376k free,   208660k cached            PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND      2728 crmpicco  16   0  133m 3544 1936 R 65.5  0.5   0:59.99 smbd      What would cause this? I use the NetBeans IDE for web development, so could this be hitting the Samba share excessively causing the Samba daemon to behave in this way?


title: How do I use grep to find a text string in files in sub folders of a parent folder without -r switch

text: I'm using Solaris 10 and have two `grep` versions one in `/usr/bin` and one in `/usr/xpg4/bin`. I have been searching for an answer on how to search for text within files within sub folders of a parent directory using `grep`. All answers talk about `-r` or `-R` switches which I do not have available with my version of `grep`.


title: ip route match multiple fields

text: I have a Linux machine set up to forward IPv4 packets. I'm looking to do this: > if packet matches both source **and** destination, forward to GW X. How do I specify the source field? Do I need to use `iptables`?


title: Effect of compiling from source on already installed applications

text: I use Ubuntu 12.04. Say I have installed `package x` from the repository (with all its dependencies) at version 1.7 but I need some functionality that is only available in version 1.8, so I download the source tar and compile it:               ./configure       make       make install        * Does this overwrite the existing 1.7 binaries?    * If the existing binaries are overwritten, does the package manager reflect the new version (1.8) and can `package x` be updated by the package manager in the future?   * If `package y` has a dependency of `package x 1.8` - will it be satisfied? I have been trying to find a good source online that explains this. If you have any recommendations, please let me know.


title: How can I determine how directories/filesystems have been mounted?

text: I have access to a VM which on a different network at work using NIS. (Debian by the way) This VM has about 10 extra /directories in / when I log in. They do not exist on that VM alone, they are publicly hosted directories (I know where to access some of them via Windows shared drives as well). I'm trying to figure out how to create the same directory structure on my own VM where I have root access. But I've been unable to figure out how these were mounted (I'm kind of a beginner at Linux config). I searched the config and init files as best I could and didn't find anything useful, just some dead ends. Using the mount command I only see 3 mounts listed, all in deeper /sub/directories (ie. /home/myuser). Any ideas?


title: "E: Sub-process /usr/bin/dpkg returned an error code (1) " What does this mean?

text: I've seen this message several times whenever someone has a problem installing, upgrading or removing some piece of software, but I wonder, what does it mean, and more importantly, how can I solve it?


title: How to read commands from file?

text: I have som `php` scripts which I run sequential order like:               php index.php import file1 --offline &&     php index.php import file2 --deleteUnused &&     php index.php import file3      Now I have newly discovered the `paralell` command and I tried something like that:               parallel -j 3 -- "php index.php import file1 --offline" "php index.php import file2 --deleteUnused" "php index.php import file3"      And it works perfectly. Is it possible that I could have a file, where all the above commands are included and to start `parallel` with an option to read the command from the file? Something like this:               parallel -XX myFileWithCommands.txt


title: change time (date) in or from exif-data

text: On Change created date from exif data there are great scripts. But what if “Date and Time (original)” are bad in exif-data (because of wrong set time in camera). Is there a solution to change time for all files in a directory about +/- n minutes? Either correct the exif data (and then use one of the great scripts from the link above) or only correct the timestamp of the files.


title: How to fix link error under CMake for class QX11Info on Mac OS X

text: I'm trying to build kxstitch, which is designed for Linux, on OS X. I've gotten most of the way there by installing MacPorts, XCode, KDE, etc. and making minor changes to the build file, but am getting this error at the final stage of building the project:               Linking CXX executable kxstitch.app/Contents/MacOS/kxstitch     Undefined symbols for architecture x86_64:       "QX11Info::display()", referenced from:           Editor::keyPressAlphabet(QKeyEvent*) in Editor.o      The key line in the build script is: > cmake -DCMAKE_INSTALL_PREFIX=`kde4-config --prefix` .. && make -j${THREADS} Here is CMakeLists.txt. The missing symbol seems to be part of Qt. As part of installing KDE through MacPorts, many Qt-related packages were installed, including qt4-mac, qt4-mac- devel, and qt4-x11. The output of cmake includes:               -- Looking for QT_MAC_USE_COCOA     -- Looking for QT_MAC_USE_COCOA - found     -- Found Qt-Version 4.8.2     --  -> QT_QMAKE_EXECUTABLE is /opt/local/bin/qmake     --  -> QT_INCLUDE_DIR is /opt/local/include     --  -> QT_QTCORE_INCLUDE_DIR is /opt/local/include/QtCore     --  -> QT_BINARY_DIR is /opt/local/bin     --  -> QT_LIBRARY_DIR is /opt/local/lib     --  -> QT_PLUGINS_DIR is /opt/local/share/qt4/plugins     --  -> QT_MKSPECS_DIR is /opt/local/share/qt4/mkspecs      I'd be grateful for any advice on how to proceed. UPDATE: I've since read about a problem with the QtGui library on OS X, although I don't know how to translate the solution to CMAKE.


title: PPP over USB from RJ11

text: I have an adapter which on 1 side offers an RJ11 male plug, and on the other side and USB Type A female port, I also have another adapter which is similar but it offers and USB Type A male plug. I would like to connect this to my computer and connect to the internet from there, removing the need for an external modem, anyone knows about how the drivers or the routing should be configured in this case ? * * * **_EDIT 1_** here is a picture of what I have ![http://cdn.shopclues.com/images/detailed/45/3.jpg](http://i.stack.imgur.com/dtYEo.jpg) here are the other sides ![enter image description here](http://i.stack.imgur.com/S4yq5.jpg) of course this is the variant with the female USB, I have one with a Type A male plug as well.


title: How can I avoid escaped delimiter characters in a Unix command?

text: I need to take the sum of a field which is tilde (~) delimited. Problem I have is that my data is also having delimiter escaped. ### Example               1~CEO~ashok\~kumar~1000      As we see in 3rd field above we have escaped delimitter which I want to avoid. I'm running the below command which doesn't handle this.               $ cat test.out|awk -F'~' 'BEGIN {sum=0} {sum+=$4} END{print sum}'      Assume the `test.out` data as:               1~CEO~ashok\~kumar~1000     2~CFO~Ranjan~2000     3~CEO~kumar~1000      So my output should be 4000. But currently with my command I get only 3000!


title: Terminal filesystem location

text: I'm using gnome 3 on debian. I want to create a launcher on the desktop for terminal. Where is terminal in the file system? I tried "which terminal" but it doesn't output anything


title: cannot find what has used all the memory

text: The server has about 24GB memory. By running `free -g` I find the memory is used up                            total       used       free     shared    buffers     cached     Mem:            23         23          0          0          0         18     -/+ buffers/cache:          4         19     Swap:           56          2         53      Then I did some research into what has used up all these memory by `top` then `M`. But it seems the memory is quite free in the `%MEM` column. What can I do to free some memory? This is a server for calculation so it is better not to restart the computer.


title: What does ".managed" mean in a babushka package name?

text: I did a search for java with babushka, and got the following results:               Name                 | Source                                               | Runs    |  ✓ | Command     ---------------------+------------------------------------------------------+---------+------+--------------------------------------------     java.managed         | git://github.com/all4miller/babushka-deps.git        | 1 ever  | 100% | babushka all4miller:java.managed     java.managed         | git://github.com/benhoskings/babushka-deps.git       | 2 ever  | 50%  | babushka benhoskings:java.managed     java environment     | git://github.com/compactcode/babushka-deps.git       | 4 ever  | 75%  | babushka compactcode:'java environment'     java dev environment | git://github.com/compactcode/babushka-deps.git       | 21 ever | 14%  | babushka compactcode:'java dev environment'     java.environment     | git://github.com/compactcode/babushka-deps.git       | 1 ever  | 100% | babushka compactcode:java.environment     java.managed         | git://github.com/compactcode/babushka-deps.git       | 1 ever  | 0%   | babushka compactcode:java.managed     java                 | git://github.com/cheef/babushka-deps.git             | 1 ever  | 100% | babushka cheef:java     java                 | http://chris-berkhouts-macbook-pro-2.local:9292/.git | 4 ever  | 25%  | ✣     java-6-sun           | https://github.com/cheef/babushka-deps.git           | 2 ever  | 0%   | babushka cheef:java-6-sun      "java.managed" looks the most promising, because I trust benhoskings more than the others. But what does the ".managed" mean?


title: How to choose the adequate Linux distribution for a given hardware set up?

text: We all have a common issue whereby there is an old PC lying around and we want to revive it using a secure Linux distro (vs. using the un-updated native OS, likely Windows) that is both user-friendly and snappy. Use case: > I have an old Dell Latitute 131 L (specs here). I am considering dual-boot > installing Linux (it already has XP). Specifications >   * 256 DDR2 RAM >   * 50+ gig free disk space >   * AMD Turion 64 X2 (64-bit dual-core mobile CPU) 1.6 GHz > How do we know which distribution to choose? Are there any risks to picking older versions of a given distribution?


title: How to prevent "Last Login:" message from showing up when using sftp?

text: In Ubuntu GNU/Linux 12.04, I have a user `johndoe` that is part of an `sftponly` group, set up to `sftp` to a `chroot` jail using               Subsystem sftp internal-sftp          Match Group sftponly             ChrootDirectory %h             ForceCommand internal-sftp             AllowTcpForwarding no      at the end of `/etc/ssh/ssh_config`. All components of the user's `home` directory are `root`-owned directories that are not writeable by any other user or group, as explained in `man sshd_config` (under `ChrootDirectory`). Inside his `chroot` jail, there is a writeable directory `files`:               sudo groupadd sftponly         sudo mkdir -p /home/sftponly/johndoe/files     sudo useradd -d /home/sftponly/johndoe -g sftponly -s /usr/sbin/nologin johndoe     sudo chmod go-w /home/sftponly/{,johndoe}     sudo chown johndoe:sftponly /home/sftponly/johndoe/files     sudo chmod ug+rwX /home/sftponly/johndoe/files      (Setting the shell to `/bin/false` did not work with either `ssh` or `sftp`. With `nologin` as the shell `ssh` connects, shows "MOTD", and then disconnects, which is the expected behavior.) But `sftp` fails with the message `Received message too long 1416128883`. I know this failure is caused by "MOTD" (Message Of The Day), as `sftp` expects a "clean login." I have tried disabling all "MOTD" pieces on the server using the following, with ( **these results** ):   * Adding `PrintLastLog no` and `PrintMotd no` to the end of `/etc/ssh/ssh_config` and restarting `ssh` using `restart ssh`. ( **No effect**. Testing with `ssh` shows both "MOTD" and "Last Login:".)   * Commenting out `session optional pam_motd.so` in `/etc/pam.d/sshd`. ( **Prevents MOTD**. But there is no corresponding entry for "LastLog" so, testing with `ssh`, "Last Login:" still shows up and hence **`sftp` still fails**.)   * Commenting out `session optional pam_lastlog.so` and `session optional pam_motd.so` in `/etc/pam.d/login`. ( **No effect**. Testing with `ssh` shows both MOTD and "Last Login:".)   * Creating the `.hushlogin` file on the client using `touch ~/.hushlogin`. ( **No effect**.) I am out of ideas. Where else may this "Last Login:" message be coming from and how can it be disabled (ideally only for `sftp` and not for `ssh` logins, but, I imagine as `sftp` uses `ssh`, the message is going to be there either for both or none)?


title: What commands have -h human readable option, and how can I enable it by default w/env variable?

text: I'm tired of using aliases or typing `-h`. I want human readable output 24/7. Is there a way to enable it all the time for all commands that offer it?


title: How do I check man pages for what single parameter of the command does?

text: Example: I am using `tar -zxvf` command but I don't know what 'x' stands for. How can I check this single parameter without having to scroll all the way through `man tar`?


title: How to debug SSH port forwarding

text: This is an extension to ssh port forward to access my home machine from anywhere I tried things mentioned there but I am not able to `ssh` to my machine. Netgear router settings for port forwarding:               Start Port: 22     End Port: 22     Server IP Address: IP address of by FreeBSD box      `/etc/ssh/sshd_conf` of my FreeBSD box:               PasswordAuthentication yes     AllowUsers root     X11Forwarding yes     AllowTcpForwarding yes **How I am trying to connect:** I've signed up for `dyndns.com` and got a URL that maps to my external IP address. From another machine in my home network, I do: `ssh -l root my_dyndns_ip` Which is just timing out. On the other hand, I can ping `my_dyndns_url` successfully. **Debugging** : How can I fix this so that I can `ssh` from anywhere to `my_dnydns_url` ? I tried to look into logs of my Netgear router but on failed ssh attempt, no log in generated on the router. I also looked into `/var/log/messages` but could not finding anything. **Edit:0** Running ssh in verbose mode (as per @jasonwryan suggested): I am noticing a weird thing: When I do ssh to the dyndns.com provided url, its trying to connect to other IP address than what I get from whatismyip.com. Isn't that wrong? **Edit:1** Problem with dyndns is now solved. Now when I try to ssh, it times out and I get error: _Connection timed out_ **Edit:2** Does iptables or NAT has anything to do with it? **Edit:3** I started `ssh` with `-d option` to capture debug messages. When I ssh to the freebsd box from any other machine in wlan, It works fine and I can see logs. But when I ssh to external ip (which should forward that to my freebsd box), I do not even see any logs - that means, request is not even reaching freebsd box. And it times out.


title: Creating and updating the packages for many Debian systems

text: I'm using a Lenny (Debian 5) for remotely controlled PC's (around 100 PC's) which will be pinging to my apache server. I'm developing a patch twice in a week to keep updated with the latest versions of my code and running it manually in all those PC's. Since they are controlled remotely, for some or the other reasons I will not be able to login and update in few of the PC's and hence the older version will not be present. I wanted to know how can I keep updated my PC with all the patches/ packages getting updated from the server automatically. Thought of using rsync and executing the *.run file in rsync folder from cron for every 3days. But I'm looking one similar to apt-get update. How can this be achieved?


title: sudo over ssh: no tty present and no askpass program specified

text: I keep getting this error and have tried several ways discussed online to fix this and none are working for me. I have setup SSH keys so when I run `'ssh newton@host.com'` it automatically logs me in, I have also set this user in visudo to be `'newton ALL=(ALL:ALL) ALL'` I then also tried to add `'newton ALL=NOPASSWD: /var/www/script.sh'` Unfortunately everytime I run `ssh newton@host.com 'sudo /var/www/script.sh'` from cygwin I get back. I have also tried to add -t -t but then it prompts me for the password...               total size is 21209180  speedup is 314.69     sudo: no tty present and no askpass program specified     Sorry, try again.     sudo: no tty present and no askpass program specified     Sorry, try again.     sudo: no tty present and no askpass program specified     Sorry, try again.     sudo: 3 incorrect password attempts     sudo: no tty present and no askpass program specified     Sorry, try again.     sudo: no tty present and no askpass program specified     Sorry, try again.     sudo: no tty present and no askpass program specified     Sorry, try again.     sudo: 3 incorrect password attempts


title: Linux mutex spins

text: On Solaris I can use `mpstat` to see the `smtx` (i.e., spins on mutex or in other words locks not acquired on the first try) value. This value increasing indicates that swap is being hit too frequently and indicates that you need more RAM. The output of `mpstat` on Linux is not at all like Solaris. Is there any way I can see this (or an equivalent/related) value?


title: IPSec VPN Debian Squeeze Server for Mac OS X

text: I'm trying to get an IPSec VPN set up on my Debian home server, so that I can access my home network and browse without having my internet filtered by my college network, and so that I can perform maintenance on my home network from college as needed. I set up my server by following this link, and when I try to connect to it via Mac OS X 10.7.4, it will say "The L2TP-VPN server did not respond. Try reconnecting. If the problem continues, verify your settings and contact your Administrator." It prints the following to the console:               8/11/12 7:11:11.532 PM configd: SCNC: start, triggered by SystemUIServer, type L2TP, status 0     8/11/12 7:11:11.669 PM pppd: pppd 2.4.2 (Apple version 560.13) started by Jon, uid 501     8/11/12 7:11:11.687 PM pppd: L2TP connecting to server '10.0.1.100' (10.0.1.100)...     8/11/12 7:11:11.688 PM pppd: IPSec connection started     8/11/12 7:11:11.708 PM racoon: Connecting.     8/11/12 7:11:11.709 PM racoon: IPSec Phase1 started (Initiated by me).     8/11/12 7:11:11.709 PM racoon: IKE Packet: transmit success. (Initiator, Main-Mode message 1).     8/11/12 7:11:14.712 PM racoon: IKE Packet: transmit success. (Phase1 Retransmit).     8/11/12 7:11:17.716 PM racoon: IKE Packet: transmit success. (Phase1 Retransmit).     8/11/12 7:11:20.719 PM racoon: IKE Packet: transmit success. (Phase1 Retransmit).     8/11/12 7:11:21.710 PM pppd: IPSec connection failed      I turned debugging on level 3, and when I tried it again and pulled the logs from the server, and nothing prints to the logs. I'm thinking that the server for some reason isn't getting or recognizing the vpn connection attempt, as it prints the same thing to the logs when I try connecting to a server that doesn't exist. The server has the IP 10.0.1.100, which is the IP that I am trying to connect to, just in case there is something wrong with the port forwarding on the router. Here is my three configuration files, configured in accordance to the how-to guide listed above. (I replaced the secrets with asterisks) ## /etc/freeradius/clients.conf               # -*- text -*-     ##     ## clients.conf -- client configuration directives     ##     ##  $Id$          #######################################################################     #     #  Define RADIUS clients (usually a NAS, Access Point, etc.).          #     #  Defines a RADIUS client.     #     #  '127.0.0.1' is another name for 'localhost'.  It is enabled by default,     #  to allow testing of the server after an initial installation.  If you     #  are not going to be permitting RADIUS queries from localhost, we suggest     #  that you delete, or comment out, this entry.     #     #          #     #  Each client has a "short name" that is used to distinguish it from     #  other clients.     #     #  In version 1.x, the string after the word "client" was the IP     #  address of the client.  In 2.0, the IP address is configured via     #  the "ipaddr" or "ipv6addr" fields.  For compatibility, the 1.x     #  format is still accepted.     #     client localhost {         #  Allowed values are:         #   dotted quad (1.2.3.4)         #       hostname    (radius.example.com)         ipaddr = 127.0.0.1              #  OR, you can use an IPv6 address, but not both         #  at the same time.     #   ipv6addr = ::   # any.  ::1 == localhost              #         #  A note on DNS:  We STRONGLY recommend using IP addresses         #  rather than host names.  Using host names means that the         #  server will do DNS lookups when it starts, making it         #  dependent on DNS.  i.e. If anything goes wrong with DNS,         #  the server won't start!         #         #  The server also looks up the IP address from DNS once, and         #  only once, when it starts.  If the DNS record is later         #  updated, the server WILL NOT see that update.         #              #  One client definition can be applied to an entire network.         #  e.g. 127/8 should be defined with "ipaddr = 127.0.0.0" and         #  "netmask = 8"         #         #  If not specified, the default netmask is 32 (i.e. /32)         #         #  We do NOT recommend using anything other than 32.  There         #  are usually other, better ways to achieve the same goal.         #  Using netmasks of other than 32 can cause security issues.         #         #  You can specify overlapping networks (127/8 and 127.0/16)         #  In that case, the smallest possible network will be used         #  as the "best match" for the client.         #         #  Clients can also be defined dynamically at run time, based         #  on any criteria.  e.g. SQL lookups, keying off of NAS-Identifier,         #  etc.         #  See raddb/sites-available/dynamic-clients for details.         #          #   netmask = 32              #         #  The shared secret use to "encrypt" and "sign" packets between         #  the NAS and FreeRADIUS.  You MUST change this secret from the         #  default, otherwise it's not a secret any more!         #         #  The secret can be any string, up to 8k characters in length.         #         #  Control codes can be entered vi octal encoding,         #   e.g. "\101\102" == "AB"         #  Quotation marks can be entered by escaping them,         #   e.g. "foo\"bar"         #         #  A note on security:  The security of the RADIUS protocol         #  depends COMPLETELY on this secret!  We recommend using a         #  shared secret that is composed of:         #         #   upper case letters         #   lower case letters         #   numbers         #         #  And is at LEAST 8 characters long, preferably 16 characters in         #  length.  The secret MUST be random, and should not be words,         #  phrase, or anything else that is recognizable.         #         #  The default secret below is only for testing, and should         #  not be used in any real environment.         #         secret      = ********              #         #  Old-style clients do not send a Message-Authenticator         #  in an Access-Request.  RFC 5080 suggests that all clients         #  SHOULD include it in an Access-Request.  The configuration         #  item below allows the server to require it.  If a client         #  is required to include a Message-Authenticator and it does         #  not, then the packet will be silently discarded.         #         #  allowed values: yes, no         require_message_authenticator = no              #         #  The short name is used as an alias for the fully qualified         #  domain name, or the IP address.         #         #  It is accepted for compatibility with 1.x, but it is no         #  longer necessary in 2.0         #     #   shortname   = localhost              #         # the following three fields are optional, but may be used by         # checkrad.pl for simultaneous use checks         #              #         # The nastype tells 'checkrad.pl' which NAS-specific method to         #  use to query the NAS for simultaneous use.         #         #  Permitted NAS types are:         #         #   cisco         #   computone         #   livingston         #   max40xx         #   multitech         #   netserver         #   pathras         #   patton         #   portslave         #   tc         #   usrhiper         #   other       # for all other types              #         nastype     = other # localhost isn't usually a NAS...              #         #  The following two configurations are for future use.         #  The 'naspasswd' file is currently used to store the NAS         #  login name and password, which is used by checkrad.pl         #  when querying the NAS for simultaneous use.         #     #   login       = !root     #   password    = someadminpas              #         #  As of 2.0, clients can also be tied to a virtual server.         #  This is done by setting the "virtual_server" configuration         #  item, as in the example below.         #     #   virtual_server = home1              #         #  A pointer to the "home_server_pool" OR a "home_server"         #  section that contains the CoA configuration for this         #  client.  For an example of a coa home server or pool,         #  see raddb/sites-available/originate-coa     #   coa_server = coa     }          # IPv6 Client     #client ::1 {     #   secret      = testing123     #   shortname   = localhost     #}     #     # All IPv6 Site-local clients     #client fe80::/16 {     #   secret      = testing123     #   shortname   = localhost     #}          #client some.host.org {     #   secret      = testing123     #   shortname   = localhost     #}          #     #  You can now specify one secret for a network of clients.     #  When a client request comes in, the BEST match is chosen.     #  i.e. The entry from the smallest possible network.     #     #client 192.168.0.0/24 {     #   secret      = testing123-1     #   shortname   = private-network-1     #}     #     #client 192.168.0.0/16 {     #   secret      = testing123-2     #   shortname   = private-network-2     #}               #client 10.10.10.10 {     #   # secret and password are mapped through the "secrets" file.     #   secret      = testing123     #   shortname   = liv1     #       # the following three fields are optional, but may be used by     #       # checkrad.pl for simultaneous usage checks     #   nastype     = livingston     #   login       = !root     #   password    = someadminpas     #}          #######################################################################     #     #  Per-socket client lists.  The configuration entries are exactly     #  the same as above, but they are nested inside of a section.     #     #  You can have as many per-socket client lists as you have "listen"     #  sections, or you can re-use a list among multiple "listen" sections.     #     #  Un-comment this section, and edit a "listen" section to add:     #  "clients = per_socket_clients".  That IP address/port combination     #  will then accept ONLY the clients listed in this section.     #     #clients per_socket_clients {     #   client 192.168.3.4 {     #       secret = testing123     #        }     #}      ## /etc/l2tpns/startup-config               # Debugging level     set debug 2          # Log file: comment out to use stderr, use "syslog:facility" for syslog     set log_file "/var/log/l2tpns"          # Write pid to this file     set pid_file "/var/run/l2tpns.pid"          # Shared secret with LAC     set l2tp_secret ""          # MTU of interface for L2TP traffic     #set l2tp_mtu 1500          # PPP counter and timer values     #set ppp_restart_time 3     #set ppp_max_configure 10     #set ppp_max_failure 5          # Only 2 DNS server entries are allowed     set primary_dns 10.0.1.1     set secondary_dns 8.8.8.8          # Can have multiple radius server entries, but ony one radius secret     set primary_radius 127.0.0.1     #set primary_radius_port 1645     #set secondary_radius 0.0.0.0     #set secondary_radius_port 1645     set radius_secret "********"          # Acceptable authentication types (pap, chap) in order of preference     #set radius_authtypes "pap"          # Turn on or off Radius Accounting     #set radius_accounting no          # Port for DAE RADIUS requests     #set radius_dae_port 3799          # Allow multiple logins for the same username     #set allow_duplicate_users no          # Write usage accounting files into specified directory     set accounting_dir "/var/run/l2tpns/acct"          # Listen address for L2TP     set bind_address 10.0.1.100          # Send a gratiuitous ARP for bind address     set send_garp yes          # Gateway address given to clients     set peer_address 10.0.1.1          # Default throttle rate in kb/s     #set throttle_speed 0          # Number of buckets to allocate for throttling     #set throttle_buckets 3000          # If set to anything other than 0, setuid when initialised.     #set setuid 0          # If set to true, dump current speed to stderr every second     #set dump_speed no          # Number of packets to read from tun/udp/cluster fd when select     # returns readable     #set multi_read_count 10          # Set scheduling priority of process to SCHED_FIFO     #set scheduler_fifo no          # Lock pages into memory     #set lock_pages no          # Maximum number of host unreachable packets to send per second     #set icmp_rate 0          # Maximum number of downstream packets per 0.1s to handle for each     # session (0 = ulimited)     #set packet_limit 0          # Cluster multicast address, interface     #set cluster_address 239.192.13.13     set cluster_interface eth1          # Cluster multicast TTL     #set cluster_mcast_ttl 1          # Cluster timers (1/10th second)     set cluster_hb_interval 100     set cluster_hb_timeout 20          # Minimum number of slaves before master withdraws routes     #set cluster_master_min_adv 1          # Drop/kill sessions     #load plugin "sessionctl"          # Throttle/snoop based on RADIUS     #load plugin "autothrottle"     #load plugin "autosnoop"          # Control throttle/snoop with nsctl     #load plugin "throttlectl"     #load plugin "snoopctl"          # Punt RX speed if not supplied     #load plugin "setrxspeed"          # Remove domain from username     #load plugin "stripdomain"          # Walled garden     #load plugin "garden"      ## /etc/ipsec.conf               # /etc/ipsec.conf - Openswan IPsec configuration file          # This file:  /usr/share/doc/openswan/ipsec.conf-sample     #     # Manual:     ipsec.conf.5               version 2.0     # conforms to second version of ipsec.conf specification          # basic configuration     config setup             # NAT-TRAVERSAL support, see README.NAT-Traversal             nat_traversal=yes             # exclude networks used on server side by adding %v4:!a.b.c.0/24             virtual_private=%v4:10.0.0.0/8,%v4:192.168.0.0/16,%v4:172.16.0.0/12:!10.0.1.0/24             # OE is now off by default. Uncomment and change to on, to enable.             oe=off             # which IPsec stack to use. auto will try netkey, then klips then mast             protostack=netkey             #             #interfaces="ipsec0=br0"             uniqueids=no          conn road_warrior             rekey=no             authby=secret             pfs=no             keyingtries=3             dpddelay=30             dpdtimeout=120             dpdaction=clear             compress=yes             #             left=10.0.0.100             leftprotoport=17/1701             leftnexthop=10.0.1.1             #             right=%any             rightprotoport=17/%any             rightsubnet=vhost:%no,%priv             #             auto=add      ## /etc/ipsec.secrets               # /etc/ipsec.secrets     # The IPSec Secrets File          10.0.1.100: PSK "********"      Does anyone see a problem in these config files? I'm stumped...


title: How do DE's call ACPI functions?

text: Okay, first off, this is not a problem I am facing, but I would like to understand this better. If I wish to shutdown / reboot my machine from the command line I need to call:               $ sudo poweroff     $ sudo reboot      That is, I need root privileges to make these ACPI calls. However, I start my DE, (I use XFCE) without granting it root privileges: $ startxfce4 --with-ck-launch Now, I know that the `\--with-ck-launch` parameter helps allows XFCE to shutdown / reboot my system, but I do not understand how. What allows ConsoleKit to shutdown without root privileges? How can it change the runlevel without super-user privileges? And since it is possible, how can I shutdown my machine from the console without root privileges?


title: How to keep the content of the BuildRoot?

text: The good old rpm while building package in steps simply kept the content of the BuildRoot -- it was very useful for me, because if some piece of software was difficult to create, I could check BuildRoot if everything is OK. Now, with all "improved" rpm -- the content of BuildRoot is deleted automatically, so I cannot really dive into it (installing step is not that long). One hack I know of would be adding some kind of sleep at the end of install stage to rpm spec. But this is ugly. So -- **QUESTION** -- how to keep the content of BuildRoot in nice way -- in other words, how to disable auto delete once and for good?


title: Shell console clearing

text: Is there a way to clear up what is displayed on the shell console (in ubuntu linux) in just a single key or two? When I get flood of lines from `grep` and that exceeds the height of the window, I want to quickly scroll back to the position where I typed the command after the prompt. I can do so if I had opened a fresh terminal before I type the command, and just go to the initial position. But if keep using the same terminal window, I have to manually find the position. `Ctrl`+`l` is not an answer because it just scrolls, and the contents of the terminal remains. I cannot use `less` because the colored output of grep does not show up in color.


title: GPG check regarding packages on various distributions

text: It's ok that the various linux distributions use gpg to verify e.g. new packages downloaded with http. But what happens if the server that holds the packages gets hacked? OK, they need a new gpg key, but how do they guarantee that the new gpg keys are the valid gpg keys? There is no valid gpg key until the new one gets downloaded to the client, so there is a window when the packages [containing the new gpg keys] are not "validated" with gpg keys. Is there any method to give the new gpg keys to the clients in an "authoritative"/secure way?


title: Sleep key stops working after some time

text: I've got a "Sleep" key on my keyboard that I use to suspend the system when I'm away from the computer for a longer time. This works fine, at least for a while after I've turned the computer on. However, after some time, the Sleep key just stops working, and I've got to reboot the computer to make it work again. Problem is, I don't know what to check. What kinds of things can change in a system to disrupt the operation of this key? And sometimes it takes longer than other times before it stops working; sometimes I can use the key for days on end; other times it won't even work once.   I can still always use `pm-suspend` manually to suspend the system, so it's not the system itself that has become corrupted, only the keyboard. Anyone got any ideas on what to check, where to begin? I'm running Debian, by the way.


title: adding additional tracks using sox and the command line

text: I'm trying to add additional tracks using `sox` using the command line Example: I have several different stereo tracks a drum track, vocal track, effects track, etc. Can I add additional stereo tracks with `sox`? I don't want to append to the end of the tracks or mix them all together. I want to add additional stereo tracks to the audio file.               Example:     Stereo Track1-Vocals     Stereo Track2-Effects     Stereo Track3-Drums      Ps: the stereo tracks can't be split into individual mono files since I have specific sounds going into to the left and right channels and splitting them into all mono files negates that I have a total of 12 stereo tracks I would like to add is this possible? If not is there another application that will do this using the command line? I'm using Ubuntu 13.04 Linux 64bit.


title: Same ftp upload issue on any live distribution I tried

text: I have just installed Linux Mint Petra 16 after trying more live distributions. The problem I am facing right now, is that I can't upload anything on any ftp server. The upload speed doesn't exceed 0.20kb, which is practically 0, it starts at about 20KB/s and than quickly drops to 0.3-0.5KB/s. When downloading from any ftp server, everything is fine. I had this problem with any Linux distribution I tried (live instances). I tested my speed, and got about 30 Mbps for both uploading and downloading. I also have Windows 7 installed on my pc and I have no problems whatsoever there. I tried different ftp clients and the result is always the same.


title: cdrdao is installed, but Brasero doesn't think so

text: When I try to copy CD to image, Brasero tells me that cdrdao isn't installed. However I reinstalled cdrdao and Brasero, but the error is still there. [ **system** ] Ubuntu Lucid (10.04)


title: How to 'burn' a subtitle track onto an mp4 video file

text: I would like to make a subtitle file to be a part of an mp4 video file, so that I don't have to deal with two separate files. I imagine two ways:   * Make the subtitle an intrinsic part of the video. This will require video re-encoding.   * Make the subtitle a separate stream, but still embedded in the same video file. This is far more preferable, especially because I can disable it (unlike the other approach), or even play with the font type/size. How do I do things the 2nd way? It would also be kool to know how the 1st approach works.


title: Bash flush standard input before a read

text: Is there an easy way in bash to flush out the standard input? I have a script that is commonly run, and at one point in the script read is used to get input from the user. The problem is that most users run this script by copying and pasting the command line from web-based documentation. They frequently include some trailing whitespace, or worse, some of the text following the sample command. I want to adjust the script to simply get rid of the extra junk before displaying the prompt.


title: Change Korn prompt to show shorter path for working directory

text: I have changed my `.kshrc` to show my prompt as follows: `511 /export/home/students/cninja $` where `511` is the command number and `../students/cninja` is the current working directory. Is it possible to show a shortened version of the working directory, the prompt then showing something like: `511 ~/cninja $` or `511 ../students/cninja $` or what have you? This is what my line looks like in `.kshrc`:      `PS1=' ! $PWD $'; export PS1` * * * **Update:** I haven't been able to determine whether I have a ksh88 or ksh93 shell. Most of the `echo *what have you*` commands return a blank stare and a prompt from the shell, and `echo ${.sh.version}` returns `/bin/ksh: ${.sh.version}: bad substitution`.


title: What software can I use to do live screen-casting in linux?

text: I'm looking for a software to do live screen-cast of our local user group meeting. What software can I use to do that? Ideally I'd like to capture the computer screen and speaker's audio and stream it live? Edit: I'm not looking to just record my desktop and upload the video. I'm trying to live stream the desktop as it is happening.


title: Whats the sense of dbus objects?

text: Despite reading through tons of Dbus - tutorials, I still struggle to understand the whole concept. In my opinion this was one of the best explanations so far: http://telepathy.freedesktop.org/doc/book/sect.basics.dbus.html The reason to use the DBus is because I want to exchange Data between different programs. In my opinion it would suffice to provide a server or, like named in Figure 2-2 a service. This service provides several methods over an interface, which I share with the client. The client then invokes a method and gets an answer. So what am I missing? Why is there a need of additional objects? _edit:_ I guess its just to stick to the Java conventions of objects respectively classes. Each object represents an instance. Would really like someone to confirm that. _edit2:_ Basically, what is the benefit of the first system over the second?: ![Diagram](http://img5.fotos-hochladen.net/uploads/dbus34r07npwzq.jpg)


title: What is the function/point of "config.sub"

text: I'm trying to install some software from the command line. There is a file called "config.sub". Am I supposed to use this for something? I haven't been able yet to find out by searching online what this file is supposed to do. I think part of the deal is I don't know how to ask the question correctly.


title: Installing Arch on VM - DNS Issues

text: I have been following the Install Wiki and I have arrived at the part where I need to install X Server. My issue is that I cant install X because my DNS doesnt work. I can ping 8.8.8.8 just fine, google.com does not respond. Running Arch as a VM through Hyper-V               # nano /etc/resolv.conf     nameserver 8.8.8.8     nameserver 8.8.4.4          # systemctl stop dhcpcd.service     #ip link     1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noquene state UNKNOWN mode DEFAULT group default link/loopback 00:00:00:00:00:00     2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN mode DEFAULT mode DEFAULT group default qlen 1000 link/ether 00:15:5d:00:0f:03 brd ff:ff:ff:ff:ff:ff          # ip link set eth0 up          # ip addr add 10.100.0.25/24 dev eth0          # ip route add default via 10.100.0.25      Where should I start in troubleshooting this? I dont mind working out the problem I just dont know what to do.


title: How to scan for heartbleed vulnerability with nmap from Ubuntu 12.04?

text: [root@notebook ~] lsb_release -a     No LSB modules are available.     Distributor ID: Ubuntu     Description:    Ubuntu 12.04.4 LTS     Release:    12.04     Codename:   precise     [root@notebook ~] dpkg -l nmap | grep ^ii     ii  nmap                                          5.21-1.1ubuntu1                            The Network Mapper     [root@notebook ~] wget -q https://svn.nmap.org/nmap/scripts/ssl-heartbleed.nse -O /usr/share/nmap/nselib/ssl-heartbleed.nse     [root@notebook ~] wget -q https://svn.nmap.org/nmap/nselib/tls.lua -O /usr/share/nmap/nselib/tls.lua     [root@notebook ~] wget -q https://svn.nmap.org/nmap/nselib/sslcert.lua -O /usr/share/nmap/nselib/sslcert.lua     [root@notebook ~] wget -q https://svn.nmap.org/nmap/nselib/asn1.lua -O /usr/share/nmap/nselib/asn1.lua     [root@notebook ~] wget -q https://svn.nmap.org/nmap/nselib/stdnse.lua -O /usr/share/nmap/nselib/stdnse.lua     [root@notebook ~] nmap -p 443 --script ssl-heartbleed www.ssllabs.com          Starting Nmap 5.21 ( http://nmap.org ) at 2014-06-25 07:49 CEST     NSE: failed to initialize the script engine:     /usr/share/nmap/nselib/stdnse.lua:59: attempt to index field 'socket' (a nil value)     stack traceback:         /usr/share/nmap/nselib/stdnse.lua:59: in main chunk         [C]: in function 'require'         /usr/share/nmap/nse_main.lua:95: in main chunk         [C]: ?          QUITTING!     [root@notebook ~] cat /usr/share/nmap/nselib/stdnse.lua     ...       50 --- Sleeps for a given amount of time.       51 --       52 -- This causes the program to yield control and not regain it until the time       53 -- period has elapsed. The time may have a fractional part. Internally, the       54 -- timer provides millisecond resolution.       55 -- @name sleep       56 -- @class function       57 -- @param t Time to sleep, in seconds.       58 -- @usage stdnse.sleep(1.5)       59 _ENV.sleep = nmap.socket.sleep;     ...      **My question** : What is the problem? The many "wget's" before the nmap is because nmap said before it's missing modules.


title: Set file creation date to its modification date on OSX

text: I need to batch edit file creation date (some stupid audio recorder set the file creation date to UNIX epoch and the correct recording date in the modification date) to set it to the files modification date. I am aware of the `touch` command which can set a file creation like this `touch -t 201406251546.10 filename.wav` but I don't know how to retrieve each file modification date to give it as an argument to the `touch` command. I also know that the `ls -lT` command prints the modification time before each file but on my system (OS X 10.9) the output is localized which is not really handy for batch processing Any idea on how to do this?


title: How do I use colors in the MOTD?

text: I edited the default `/etc/update-motd.d/00-header`, adding some color to make it easier to read:               printf "Welcome to \e[1;34m%s\e[0m \e[2m(%s %s %s)\e[0m\n" "$DISTRIB_DESCRIPTION" "$(uname -o)" "$(uname -r)" "$(uname -m)"      I can run that line of code just fine in a terminal, but when I edit `00-header` with this information, I get the escape codes printed out in plaintext:               Welcome to \e[1;36mUbuntu 13.10\e[0m \e[2m(GNU/Linux 3.11.0-23-generic i686)\e[0m      How can I add a splash of color to the message of the day?


title: How to get text at start up of terminal

text: ![Just as the name shown in this image](http://i.stack.imgur.com/0G7G9.jpg) How to get text at start up of terminal as shown in this image.It should show whenever i open terminal.


title: starting LXDE automatically (without Display Manager)

text: I am disappointed with existing Display Managers, and so I was wondering wheteher I could live without one. I have very basic needs on my laptop. I have one user `martin` who wants to be logged into `LXDE` automatically after boot. I have made following change in `/etc/inittab`               #1:2345:respawn:/sbin/getty 38400 tty1     1:2345:once:/bin/login -f martin tty1 </dev/tty1 >/dev/tty1 2>&1      and added following line to my `/home/martin/.profile`               xinit 2>/dev/null      Now, when I boot my laptop, `LXDE` starts automatically. Thats great. When I log out of `LXDE`, I am back in `tty1`, logged in as `martin`. The problem is, when `LXDE` is running and I have screen-lock active to protect my `LXDE` session, somebody could press `CTRL+c` in `tty1`, thereby killing LXDE and he would be logged in as `martin`. Is there a way to make `LXDE` start without leaving martin logged in on `tty1`? i.e., after `LXDE` has started, I don't need `tty1` anymore and I would like to log out of it. but I cannot because `LXDE` is started from that console. Is there any way to make `LXDE` to "detach" itself from `tty1`, so that is shows the standard `login` prompt as normally? In case it is relevant, I am using Debian Wheezy


title: Replacing Evernote with Emacs and markdown - .org file list

text: I have grown tired of using evernote with wine or with any of the linux clients. I decided to change to Emacs and write all my notes in markdown so I can easily publish them in HTML and sync them with Dropbox. For organizing my notes I thought of putting them in separate folders and having a script make a .org file with a list of all my .md files. The structure I imagined was something like this:               * ~/Dropbox/Notebook1/          ** [[~/Dropbox/Notebook1/notefile1.md][notefile1]]     ** [[~/Dropbox/Notebook1/notefile2.md][notefile2]]               * ~/Dropbox/Notebook2/          ** [[~/Dropbox/Notebook2/notefile3.md][notefile3]]     ** [[~/Dropbox/Notebook2/notefile4.md][notefile4]]               * ~/Dropbox/Notebook3/          ** ~/Dropbox/Notebook3.1/     *** [[~/Dropbox/Notebook3.1/Notefile5.md][notefile5]]     *** [[~/Dropbox/Notebook3.1/Notefile6.md][notefile6]]          ** ~/Dropbox/Notebook3.2/     *** [[~/Dropbox/Notebook3.2/Notefile7.md][notefile7]]      The problem is that my scripting/programming skills are somewhere between very basic to none. I figured that I should begin with something like "find ~/Dropbox/ -name '*md' > list", but then I got lost. How can I take the output and manipulate it into the structure above?


title: Double port forwarding - SSH

text: **NOTE:** _I'm not explaining why I want to do this. But here is the requirement._ **There are 4 hosts. Host A, Host B, Host C, Host D**   1. Host A is running some application which can be accessed at port 8001   2. I forwarded port 8001 of Host A to 8002 of Host B.   3. Host B is accessible only using Host C. So, again, I forwarded port 8002 of Host B to 8003 of Host C. Now, from Host D...when I say: `https://HostC:8003` -- it should take me to the application running on Host A. But I'm not able to do that. But what I could do was, I forwarded port 22 of Host A to port 7777 of Host B. Then, from Host C, I ran:               $ ssh Host B -p 7777 -L 6666:localhost:8001      Doing this, `ssh Host B -p 7777`, took me to a command line on Host A. Hence port 8001 of Host A was directly forwarded to 6666 of Host C. Now, from Host D, `https://Host C:8001` worked! But, I want to do it using the former way.   * How can I do that?   * What am I missing here?


title: How can I find out if the ~/.XCompose file has loaded?

text: I've added a simple sequence, but it won't work. How can I find out if the OS (Ubuntu 12.10 with Unity) is actually loading the file?


title: Permissions to deny SSH users from accessing other user's folders

text: I am currently running Fedora on a network computer, acting as a host to other users who will SSH into my terminal to do their work. However I realised that they are also able to access my `/home` folder. How do I go about setting the permissions such that they are not able to access it?


title: Running user script with root permissions

text: I have a script that I've made that needs to have root permissions to enable and disable bluetooth features. I am binding this to a button so it is not feasible to log in as root to run the script. How do I properly set the file permissions for the script? I know that it's good practice to make it so that only root can edit and read the file, but how do I give it full execution permissions?               BT_RFKILL=$(rfkill list | grep tpacpi_bluetooth_sw | sed 's/\([0-9]\+\):.*/\1/')     BT_STATE=$(rfkill list $BT_RFKILL | grep "Soft blocked: yes")          if [ "x" == "x$BT_STATE" ]; then         sixad --stop         sleep 2s         rfkill block $BT_RFKILL     else         rfkill unblock $BT_RFKILL         sleep 2s         sixad --start     fi     exit 0      The script runs perfectly if I sudo it, but that's not ideal since I'd love run it through a simple key binding.


title: Send email from a shell script

text: I have written a script which runs a simple program in the background, logs the output and emails me when the job is done. It works fine except for the fact I am not recieving the email. I have tried a yahoo mail, a gmail but I never get the email. I have been told that: 1) I can try the `tee` command, but i have never used this 2) Some email services wont accept email when the sender is not specified I am using Fedora. This is the code I have for logging the results of the background program and then sending the email:               (nice -n 10 nohup ./$user_cmd >$log_stdout 2>$log_stderr </dev/null ; echo $body `date` | mutt -s "$subj" $recipient) & Can someone please help me get this working properly? Why am I not recieving the email? If this is not clear let me know and i will post the entire script. Basically the objective is to get the email sent using the `nice` and `nohup` commands.


title: How do I point certain directory to /dev/null?

text: I am running CentOS with cPanel, which creates a custom log directory and writes the logs there. The result is that the IO for the hard disk goes sky high. If I do `lsof` I got:               hostsite.com          httpd      2383    nobody 3779w   REG  253,0         0  422463 /usr/local/apache/domlogs/mygamecardotcobnao.super                  hostsite.com-bytes_log     httpd      2383    nobody 3780w   REG  253,0      5265  420994 /usr/local/apache/domlogs/myfreefreedatixuua.super                  hostsite.com     httpd      2383    nobody 3781w   REG  253,0        36  422464 /usr/local/apache/domlogs/myfreefreedatixuua.super                  hostsite.com-bytes_log     httpd      2383    nobody 3782w   REG  253,0      3101  415849 /usr/local/apache/domlogs/myfreedatingfrekeuo.supe                  rhostsite.com     httpd      2383    nobody 3783w   REG  253,0        72  422465 /usr/local/apache/domlogs/myfreedatingfrekeuo.supe                  rhostsite.com-bytes_log     httpd      2383    nobody 3784w   REG  253,0       672  419338 /usr/local/apache/domlogs/myfreedatingblogsxgo.sup                  erhostsite.com     httpd      2383    nobody 3785w   REG  253,0         0  422466 /usr/local/apache/domlogs/myfreedatingblogsxgo.sup         Disabling this domlog is impossible because there are tons of those lines automatically generated. I just want to point `/usr/local/apache/domlogs/` to `/dev/null`. Can that be done?


title: Tool to create text files from a template

text: I have to regularly create 100+ text files from templates.   I currently use an overly complicated shell script. I think there is a smarter way to handle this, but I don't know how. I have a "database" :               # outputfile      template            data1   data2    data3     first.txt         $template_main      $text1  abcd     1234     second.txt        $template_main      $text2  efgh     5678     third.txt         $template_other     $text1  ij       90      And a configuration file :               template_main=main.txt     template_other=other.txt     text1=whatever     text2=blah      The templates are text files with placeholders like %%data2%% (the placeholder form can be changed). Does someone know a tool to automate this better than with a complicated shell script ?


title: How to build a tool with specific libraries without breaking Fedora?

text: This is probably a noob question, but so far never needed to deviate from the standard Fedora 16 core development components. I am needing to build clutter- mx project, but this library requires glib-2.0.32. Along with this, glib-2 needs libffi-3.0.11. I can download the source and build these libraries, however, I am concerned that installing them will break the rest of the system. The clutter-mx project uses autotools and looks for the glib-2 version. The questions are:   1. If I build and install the new components, and something goes wrong, can you get back using yum, or something similar?   2. Is there a way of getting autotools to look in another directory for the installed headers? Thanks.


title: How to find a Fedora package providing a dependency I need?

text: I sometimes install software which isn't present in the repositories, and then I run into the problem of not satisfied dependencies. The error usually tells me which library or command is missing. Then I run a `yum search`. If there is a package name coinciding with the library/command name needed, it is easy. The problem comes when I can't find anything in yum. I start searching around on the Web, and often I find links to the library. But I don't know whether to trust these sites, where to copy the library if I download it, what it is supposed to do at all, and so on. Often it is supposed to be for another distribution, or another Fedora version, and then I don't know whether they will work with mine. I suspect that these libraries are probably present in some package already in the repository, and I would much rather have them from there than from random Googled sites. How can I find out which package a library belongs to, if I have its name? For example, now I need the library libpng12.so.0, how do I get it? And if it is not a library, but a command, how do I find the package which provides it?


title: GUI log viewer for logs produced by Apache log4j

text: I'm looking for a good graphical tool for view and analyze log files (local and remote) that works on Fedora 15.


title: Bash script to ftp only files of type gz in current directory

text: I have a bash script that cd to the right directory then uses the mput command to ftp all the files in the directory to a remote server, as below:               for from_dir in $DATE_LIST      do         cd ${FILE_LANDING_DIR}/deltas/${from_dir}         ftp_files     done          ftp_files () {         ftp -inv $HOST <<-EOF > $LOG_DIR/tempftplog         user $USER $PASS          cd ${ID_LANDING_DIR}         mput *         bye          EOF     }       I tried altering the ftp_files function to ftp only the `.gz` files in that directory by changing the line from `mput *` to `mput *.gz` but that did not work. Can someone tell me how I can do this once in the ftp command?


title: Reinstall GRUB from LiveCD

text: I have both windows and linux run on same machine. In Windows, when I set parition C to main boot, I cannot use GRUB anymore. So, I decide to reinstall GRUB. But, when I use Fedora live CD to boot. I don't see previous Linux parition. I juse see Windows partition. So, I don't know how to mount linux partition to install GRUB. Here is the output of command:               su -c "/sbin/fdisk -l /dev/sd?"          Device Boot      Start         End      Blocks   Id  System     /dev/sda1   *          63   188747684    94373811    7  HPFS/NTFS/exFAT     /dev/sda2       188747685   976768064   394010190    f  W95 Ext'd (LBA)     /dev/sda5       251674353   566259119   157292383+   7  HPFS/NTFS/exFAT     /dev/sda6       566259183   976768064   205254441    7  HPFS/NTFS/exFAT      As you see, maybe sda2 is the linux partition. So, I use this command:               mount -t ext4 /dev/sda2 /mnt      > mount: wrong fs type, bad option, bad superblock on /dev/sda2, missing > codepage or helper program, or other error In some cases useful info is > found in syslog - try dmesg | tail or so I don't know does sda2 is real linux partition or not. (it doesn't appear partition size, so I cannot know). but if this true, I'm pretty sure the partition is format in ext4. Please help me. Thanks :)