title: Transmission-daemon service spontaneously stops

text: I've installed, configured and ran transmission-daemon on my CentOS 6 machine using               service transmission-daemon start      This works nicely, and I can see the web interface on `http://server.ip:9091` as I need to. The problem is, that several minutes later, it spontaneously stops. Never says anything, without warning or error message. This happens even when I have no torrents active at all (as in, none on the list). I have no idea what's wrong, and the error logs I thought of (which probably isn't much) show nothing. How can I diagnose the causes for this? Has anyone else experienced a similar problem? ## EDIT               After the suggestion Martin gave me, I got the log. It goes like this:     [03:07:02.182] Transmission 2.13 (11501) started (session.c:624)     [03:07:02.182] RPC Server Adding address to whitelist: 127.0.0.1 (rpc-server.c:789)     [03:07:02.182] RPC Server Serving RPC and Web requests on port 9091 (rpc-server.c:962)     [03:07:02.182] DHT Generating new id (tr-dht.c:384)     [03:07:02.182] Using settings from "/var/lib/transmission/.config/transmission-daemon" (daemon.c:483)     [03:07:02.182] Saved "/var/lib/transmission/.config/transmission-daemon/settings.json" (bencode.c:1683)     [03:07:10.182] Port Forwarding State changed from "Not forwarded" to "???" (port-forwarding.c:95)     [03:07:18.188] Searching for web interface file "/var/lib/transmission/.local/share/transmission/web/index.html" (platform.c:526)     [03:07:18.188] Searching for web interface file "/usr/share/transmission/web/index.html" (platform.c:526)     [03:07:24.189] DHT Attempting bootstrap from dht.transmissionbt.com (tr-dht.c:241)      It hangs on that last one until it dies. Now I've looked into this question, but my settings file is already owned by `transmission`, and even changing the permissions on the file to `775` didn't seem to have any effects. Any ideas?


title: Asus Eee Netbook Distribution

text: > **Possible Duplicate:**   >  What are suitable distros for the Asus EEE PC 701 4G? In our school we have Asus Eee Netbooks working with Lubuntu 11.10. The problem is that we need a new distro, because the touchpad isnt working and the newer version doesn't include the driver! Do you have suggestions for an appropriate distro?


title: Installing OpenGL in fedora 14

text: I am trying to install OpenGL on my Fedora. But first I am confused with some concepts. I am using ATI Radeon 5470 card and I downloaded the driver from the official website. Here is the link I want to ask **Q1:** is this equivalent to OpenGL? **Q2:** How to uninstall the driver I have installed. PS: I used `sh ati-driver-installer-11-11-x86.x86_64.run` in the command line. A GUI pops up and after several clicks. The driver is installed, which is quite simple. **Answer Q2 by myself:** For the second question: There is a script installed on my system               sudo sh /usr/share/ati/fglrx-uninstall.sh


title: How do I rsync only some files in some directories

text: I'm trying to sync all `*.jpg` files from `/var/www/data/models/days/` + some other directories from `/var/www/data` root. I do: ` rsync -az --delete --include='/models' --include='*.jpg' --exclude='*' $SRC::/var/www/data /var/www/data ` but it doesn't sync anything. What am I doing wrong? NOTE: I don't want to change the source or target to include /models/days as I need some other directories with the same filename matching (`*.jpg`).


title: Where is boost installed on Debian?

text: I currently don't have a lot of internet quota so I didn't want to install the latest boost libraries. Instead I installed Boost 1.49 using the Synaptic Package Manager and my Debian DVDs. Now that boost (seems to be) installed, how I can I include the headers and link to the binaries when I compile my code? Do I still have to compile boost or is it already compiled for my machine? I can run `bjam`, which produces this: > warning: No toolsets are configured. warning: Configuring default toolset > "gcc". warning: If the default is wrong, your build may not work correctly. > warning: Use the "toolset=xxxxx" option to override our guess. warning: For > more configuration options, please consult warning: http://boost.org/boost- > build2/doc/html/bbv2/advanced/configuration.html > > error: error: no Jamfile in current directory found, and no target > references specified. Not surprisingly, it doesn't find what it's looking for. The link given takes me to a configuration page that doesn't seem to contain what I'm looking for. In Windows, I would unzip the files to `C:/Program Files/Common Files` and then run `bootstrap` followed by `b2 ...` to compile boost for my PC. These instructions seem to assume that we already know **where** boost actually is...


title: set verbose prints unrelated extra lines

text: Using `set -x` causes my shell to print unrelated stuff. For example:               $ set -x     ++ printf $'%157s\r'     $ echo 'hello'     + echo hello     hello     ++ printf $'%157s\r'      The lines starting with '++' are extra. How can I remove those extra lines?


title: How to save mails in Unix?

text: I wanted to save mail in unix in some directory, as we do in outlook (files are saved with .msg extensions). Is there any workaround for doing this.


title: Cannot remove Opensolaris from dual boot Windows 7 laptop

text: I've tried repairs using the Recovery discs, then System Restore, but this problem continues. The Windows Boot Manager reports:               File:         \boot\memtest.exe          Status:        0xc000000f          Info:          The application is missing or corrupt      How can I solve this problem?


title: How do I run a windows executable in linux shell script?

text: I have an executable program (no source code, just the compiled executable) that was made in windows (.exe extension). It doesn't use any graphics... it simply reads and writes files. I want to be able to run it in a linux shell script so that I don't have to switch operating systems to get my output. Is there a way to use or convert the executable for linux operating systems?


title: terminal text editor with Windows like hotkeys

text: As a Windows user (please forgive me) interacting with GNU\Linux through SSH I am looking for a terminal-based text editor that has similar hot keys to most Windows text editors which I have grown extremely used to (the same hotkeys I use when editing this text in any browser on Windows). (Or I suppose a way to customise an existing editor).   * Cut: `Ctrl`+`X`   * Copy: `Ctrl`+`C`   * Paste: `Ctrl`+`V`   * Undo: `Ctrl`+`Z`   * Redo: `Ctrl`+`Y`   * Save: `Ctrl`+`S`   * Select all: `Ctrl`+`A`   * Jump one word right: `Ctrl`+`→`   * Jump one word left: `Ctrl`+`←`   * Select right: `Shift`+`→`   * Select left: `Shift`+`←`   * Select word right: `Ctrl`+`Shift`+`→`   * Select word left: `Ctrl`+`Shift`+`←`   * Select line up: `Shift`+`↑`   * Select line down: `Shift`+`↓`   * Jump to start of line:`Home`   * Jump to end of line: `End` And for kicker:   * Delete line: `Shift`+`Del`   * Copy and paste line: `Ctrl`+`C`+`V`


title: Is it possible to x-forward windows apps to linux if windows PC running Xming?

text: I have been digging around looking for an answer to my question but have no been able to come up with anything. I know that xming server allows you to transparently run linux applications on windows through ssh window forwarding, but can it do the opposite and connect from the linux box to the windows box and display the windows apps in linux using this protocol? I am thinking this is a one way ticket but I was hoping it was possible.


title: Can't round the corners of menus for gtk?

text: I've been searching everywhere on how to round the corner of the right-click context menus. Every other widget in GTK can have rounded corners but context menus for some reason. Why is it that this is much more difficult than any other widget? I've tried modifying the css styles for Ambience in gtk- widgets.css, but the rounding attributes do not apply. Why isn't there any rounding support for context menus? I've read that I have to enable rgba support for context menus, so how would I go about doing that?


title: find command in cygwin giving parameter format not correct

text: I am using cygwin in my windows machine. I am trying to do a find and it is giving parameter format not correct. Why is that?               $ ls     bootstrap.jar     catalina-tasks.xml     catalina.bat     catalina.sh     commons-daemon-native.tar.gz     commons-daemon.jar     cpappend.bat     digest.bat     digest.sh     setclasspath.bat     setclasspath.sh     shutdown.bat     shutdown.sh     startup.bat     startup.sh     tomcat-juli.jar     tomcat-native.tar.gz     tool-wrapper.bat     tool-wrapper.sh     version.bat     version.sh          $ find . -name "version.sh"     FIND: Parameter format not correct        * Should I install anything while installing cygwin or am I doing something wrong?


title: sudo - impersonating a user

text: I am trying to use the sudo command and sudoers file correctly so that I can run a command as another user. I have my sudoers file set up as follows:               beans ALL = (root,apache) NOPASSWD: /opt/renovations/var/script-*.sh      root, apache, and beans are part of the group beans.   Also /opt has 755 permissions, while the /opt/renovations directory and it's sub-directories are owned by the beans user and group. The command I'm trying to run as beans is:               sudo -n -u apache -i /opt/renovations/var/script-test.sh        -n: is so that I'm not prompted for a password, as this will be run by a cron   -u: is so that I can impersonate the apache user   -i: is so that I simulate a login, and my .profile is loaded. I need this so that I access the environment variables in .profile.  The problem is that when I run the sudo command, I get the following message: > sudo: sorry, a password is required to run sudo I've tried running this both on AIX and Ubuntu, but the problem is on both systems. This works if I run:               sudo -n -u apache /opt/renovations/var/script-test.sh      But without the -i, my environment does not contain all of the environment variables that I need to be there. Is there something I need to update in my sudoers file so that this is possible?


title: similar content Project access from a single file

text: I create three different project which are access different three different database. Except that all project files are same. so, I want that in a project folder all project files and in other two only database connection file. In previous I listen it's possible. How I do this?


title: Remove duplicate fields in a given column (after ID check)

text: I'd like to remove from a given column ($2 in the example) the duplicate fields (comma separated), but only if the ID column ($1 in the example) is the same. Input:               A    1,2,3,4     A    8,9,10,11     A    2,3,4,11,12     B    4,5,6,7     B    6,8,9,10      Expected output:               A    1,2,3,4     A    8,9,10,11     A    12     B    4,5,6,7     B    8,9,10


title: How do I delete a file in a read-only directory?

text: I've got a directory and a file in it, with the directory marked as read-only:               $ mkdir directoryname     $ touch directoryname/filename     $ chmod a-w directoryname      I cannot delete the file, even if pass the `-f` flag to `rm`:               $ rm -f directoryname/filename     rm: cannot remove `directoryname/filename': Permission denied      Is there a way to force `rm` to delete this file? Obviously, I could temporarily give `directoryname` write permissions, but I'm looking for a more convenient way. I believe the underlying `unlink` syscall fails in the same way. Is there a way to get around that?


title: Install grub on LV container for VM

text: I'm having difficult time installing grub in LVM LV container for a VM. This is the partition table:               # parted /dev/mgtvg/linux2os print     Model: Linux device-mapper (linear) (dm)     Disk /dev/dm-7: 129GB       Sector size (logical/physical): 512B/512B     Partition Table: msdos           Number  Start   End     Size    Type      File system  Flags      1      1049kB  6469MB  6468MB  primary   ext3         boot      2      6469MB  11.8GB  5369MB  primary   xfs      3      11.8GB  17.2GB  5369MB  primary   xfs      4      17.2GB  129GB   112GB   extended               lba      5      17.2GB  22.6GB  5369MB  logical   xfs      Partition one contains the root file system (there is no /boot). Attempting to install grub:               # grub --device-map=/dev/null                   GNU GRUB  version 0.97  (640K lower / 3072K upper memory)           [ Minimal BASH-like line editing is supported.  For the first word, TAB        lists possible command completions.  Anywhere else TAB lists the possible        completions of a device/filename.]     grub> device (hd0) /dev/mgtvg/linux2os     device (hd0) /dev/mgtvg/linux2os     grub> root (hd0,0)     root (hd0,0)      Filesystem type is ext2fs, partition type 0x83     grub> setup     setup          Error 1: Unrecognized device string     grub>       This is the `grub.conf` file from the LV containing the VM:               default=0     timeout=5     splashimage=(hd0,0)/grub/splash.xpm.gz     hiddenmenu     serial --unit=1 --speeed=19200     terminal --timeout=8 console serial     title CentOS (2.6.32-279.22.1.el6.x86_64)             root (hd0,0)                kernel /vmlinuz-2.6.32-279.22.1.el6.x86_64 ro root=/dev/sda1             initrd /initramfs-2.6.32-279.22.1.el6.x86_64.img     title CentOS (2.6.32-279.el6.x86_64)             root (hd0,0)                kernel /vmlinuz-2.6.32-279.el6.x86_64 ro root=/dev/sda1             initrd /initramfs-2.6.32-279.el6.x86_64.img      What else do I need?


title: I need to install Linux without a DVD, USB, Netboot, or Unetbootin

text: So now I'm having some annoyance on my old server. I'm pretty sure that both CD drives are messed up, as I can't boot from either one. The motherboard is WAY too old to boot from USB. Unetbootin isn't working. I selected the .iso (tried both Debian and Lubuntu), selected 'Hard Drive' instead of USB Flash, and when I booted and selected Unetbotin's option I was presented with > Windows could not start because of a computer disk hardware configuration > problem. Could not read from the selected boot disk. Check boot path and > disk hardware. Please check the Windows documentation about hardware disk > configuration and your hardware reference manuals for additional > information. I'm way too clueless to install it with netboot. Are there any ways to install some kind of Linux distro from XP, but actually overwrite Windows? I tried Puppy Linux's one, but I got an error message and couldn't boot into it. I had to seriously consider seeing if my DVD+RW was sharp enough to kill myself with. Edit: Well, I don't know the type of motherboard, but neither of the CD drives have been able to read any media -- let alone boot from it. I can't set a USB port (with a bootable flash drive inserted) in the boot order.


title: How to use diff while doing wget?

text: Let's say there is a site www.songs.com, I download songs from that site using wget -r. Then,say , 3 days later, there has been an update on the site and new songs have been added. > Is there any way I download only new songs using wget? As it stands, if I give command > wget - r It will download the whole website.


title: Convert perl script to bash

text: The following script it's about monitoring some logs, the $timestamp is at log at every line that something happens.               Example:     03:19:13.4 Begin summary update for ads.doc.inventory.InventoryItemSummary     03:19:33.9 CronServer:: DailyJob ads.tools.UpdateSummaries@17c5d6cf failed with exception ads.util.AppError: Cannot create UnitName from keys: Each     ads.util.AppError: Cannot create UnitName from keys: Each     at ads.db.DBObjectDefault.createFromKeys(DBObjectDefault.java:42)     at ads.db.DBTable.createFromKeys(DBTable.java:227)     at ads.db.DBValue.getValue(DBValue.java:621)     at ads.dbmanager.DBObjectsManager.initObjects(DBObjectsManager.java:400)     at ads.dbmanager.DBObjectsManager.reload(DBObjectsManager.java:447)     at ads.dbmanager.DBObjectsManager.loadFromStore(DBObjectsManager.java:497)     at ads.doc.inventory.InventoryItemSummary.refreshSince(InventoryItemSummary.java:173)     at ads.db.DBSummaryTable.refreshAll(DBSummaryTable.java:67)     at ads.tools.CronServer$DailyThread.run(CronServer.java:271)     [SOAPException: faultCode=SOAP-ENV:Client; msg=Error opening socket: java.net.ConnectException: Connection refused; targetException=java.lang.IllegalArgumentException: Error opening socket: java.net.ConnectException: Connection refused]     at org.apache.soap.transport.http.SOAPHTTPConnection.send(SOAPHTTPConnection.java:354)     at org.apache.soap.rpc.Call.invoke(Call.java:248)     at ads.support.SupportCall.call(SupportCall.java:56)     at ads.tools.SupportThread.run(SupportThread.java:101)     03:46:42.5 Periodic support request failed: ads.support.SupportException: Error opening socket: java.net.ConnectException: Connection refused     06:31:36.1 Upload failed: java.io.FileNotFoundException: c:/tmp/cygwin1.dll (No such file or directory)     08:01:08.0 connect from /172.22.3.28      I have this perl script               #!/usr/bin/perl          use strict;     use warnings FATAL => qw(all);          my $timestamp = qr/^\d+:\d+:\d+/;          my $block = "";     my $exception = 0;     while (<STDIN>) {          if ($block) {     # $_ is the current input line in perl.         if ($_ =~ $timestamp) {             print "\n\n***EXCEPTION***\n$block" if $exception;             $block = "";             $exception = 0;         }     # This isn't actually a second regexp, it's a substring search.     # But you could use a regexp.         $exception = 1 if (index($_,"Exception") >= 0);         $block .= $_;         next;     }     $block = $_ if ($_ =~ $timestamp);     }      and I want to convert it to bash script. Here's what I've done so far but didn't work, #!/bin/bash               timestamp=^[0-9][0-9]\:[0-9][0-9]\:[0-9][0-9]\.[0-9]          block=""          exception=false          except=.*Exception.*          while read line     do          if [[ -z $block ]] ;        then              if [[ $line =~ $timestamp ]]            then                      if [[ $exception=false ]]                    then                          echo "\n\n***EXCEPTION***\n$block"                 fi     block=""     exception=false         fi              if [[ $line =~ $except ]]            then                 exception=true         fi          block=$block$line          fi          if [[ $line =~ $timestamp ]]        then         block=$line     fi          done      Any help with that?


title: Comparing text files using Bash and AWK

text: I have two text files, and I want to compare their corresponding values according to their rows and columns. By comparing, I mean to check if the values are equal and echo if the values are the same or not. Here are the files: `file1.txt`               Name  Col1  Col2  Col3       -----------------------     row1  1     4     7             row2  2     5     8              row3  3     6     9         `file2.txt`               Name  Col1  Col2  Col3       -----------------------     row2  1     4     11             row1  2     5     12      Here are the constraints:   * compare only the rows that exist (that is, since row3 exists in file1.txt, but not in file2.txt, no comparison is needed)   * Must use AWK   * The rows may be out of order in the files   * No double arrays since my version of AWK doesn't support it I am thinking of something like this:               awk 'NR>2 {next}     {         for (i=2;i<NR;i++)              #For each row of file1.txt         {                  for(j=1;i<NF;j++)           #For each column of file1.txt             {                  // Check if row and column of file1.txt is equal to row and column of file2.txt.             }          }     }     ' file1.txt file2.txt      How do you compare values of two different text files? Let me know if more explanation is needed. All I'm asking for is a general structure using AWK. Hopefully I can figure out the rest.


title: Processes lose attachment to shell when started via bash -x

text: Normally, if I run `emacs &` and then close the shell, emacs will exit. However, if I run `bash -x foo.foo` (where `foo.foo` is a script that runs `emacs &`), then emacs will remain open even when I exit the shell. Is there a way to make all processes close when the shell exits, even when the processes were started via a call to `bash -x`?


title: vsftpd does not allow chrooted users write to directory

text: I installed vsftpd on ubuntu 12.04 and chrooted local users, in order not to let them see the other parts of system. but when a local user wants to login into ftp it gives out this error:               500 OOPS: vsftpd: refusing to run with writable root inside chroot()      Why is this happening? And what is the problem to let the chrooted users to write into the directory? Do I have to compile my vsftp with extra arguments? Why aren't the included in the main package?


title: How to remove metapackage entirely in Debian

text: Is there any way to remove meta package and all its packages? Subset of metapackage is packages which don't depend on metapackage by all means. That's why if remove one metapackage only the package's subset of metapackage is not removed. For example metapackage `apache2` consists some packages which will be installed if install `apache2`. I used the `apt-get install apache2` command in shell and `synaptic` and I installed some packages. Now if I remove metapackage `apache2` via `apt-get autoremove apache2` command or `synaptic` I remove `apache2` package only and other packages which are a subset of the metapackage are not removed. In my opinion the best way is to remove all packages within the metapackage. How to resolve the issue?


title: How to configure SSL in apache?

text: I have installed apache in RHEL 6. Everything is working fine. What all changes and configurations should be done to use https://localhost:443/. If I change the "Listen 80" to 443 it is throwing an SSL connection error "Error 107 (net::ERR_SSL_PROTOCOL_ERROR): SSL protocol error."


title: How can I go forward in a file? What is the oposite of ctrl+O

text: If I jump to a file e.g. by `gf` I know that I can do `ctrl+O` to go back.   But how do I go forward? I.e. what is the opposite of `ctrl+O` so as to go forward to the file I was earlier to which I jumbed to via `gf`?


title: What does the expression $(<"dir/file") mean in bash?

text: In a bash script I cannot post here I see the following expression:               $(<"dir/file")      From what I understand the expression `$(...)` evaluates a command inside (as when using backticks), but what is the role of the angle bracket used inside the round bracket?


title: Restoring default ip rule

text: I accidentally issued `ip rule flush`, now the default ip rule are all gone, which is,               32766:  from all lookup main      32767:  from all lookup default      Anyone know how to add them back?


title: How to install cpp in RHEL 6.3?

text: I want to install gcc in RHEL 6.3, but it has cpp dependencies.   So I go to cpp rpm download page, but it has no rpm for 6.3 version:   ![enter image description here](http://i.stack.imgur.com/I1Urm.png) Is there any other way to install cpp in RHEL 6.3?


title: Calculating CPU time of process in RHEL 5.3

text: For a process management,I would need to remove a process that exceeds a certain amount of CPU time, for example 1 hour.In PS command ,it has TIME parameter shows the total CPU time of a process .So is this the correct way to take the CPU time of a process? Also is there any other commands that could be used in calculating CPU time of process.


title: Increase %e precision with /usr/bin/time shell command

text: When I run the time command in shell `time ./myapp` I get an output like the following:               real    0m0.668s     user    0m0.112s     sys     0m0.028s      However,when I run the command `\time -f %e ./myapp` I lose precision and I get:               2.01s      If I use the `%E` command I also lose precision in the same way. How do I change it to have more precision again, but still only have the seconds being outputted? I based my research in this Linux / Unix Command: time  and on this question


title: read only access to all files in a specific sub-folder

text: I have got a specific folder located in "/home/.../reboot/". I have a series of users that require read-only access to the ever changing files within. My problem is that the same users are not authorized to view any of the parent directory files. Right now, the only thing I have in place is that their starting folder is at "/home/.../reboot/" by changing the etc/passwd file; and I need to block all access to other folders. How could I only give them access to this directory?


title: When does "apt-get install" ask me to confirm whether I want to continue or not?

text: Sometimes "apt-get install" asks me `"Do you want to continue [Y/n]?"`:               root@T43:~# apt-get install chmsee     Reading package lists... Done     Building dependency tree            Reading state information... Done     The following extra packages will be installed:       libchm1     The following NEW packages will be installed:       chmsee libchm1     0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.     Need to get 192 kB of archives.     After this operation, 848 kB of additional disk space will be used.     Do you want to continue [Y/n]?       Am I correct that this happens only if `"The following NEW packages will be installed:"` line has other packages(probably dependencies) listed than the one(s) I specified as an argument to `"apt-get install"`?


title: Autofs home folders from solaris 11

text: I'm having trouble since 2 days with autofs. I have a Solaris 11 Server. There I share the folder /export/home with the following command: share -o rw -d „Freigabe von /export/home“ /export/home My Client is a Fedora 17. On Fedora I created the folder /ahome, where all home folders should be mounted with autofs. I gave permissions 777 to /ahome. After that I configured the /etc/auto.master and added               /ahome auto.homes      Than I created the file /etc/auto.homes               read1 192.168.0.3:/export/home/read1     read2 192.168.0.3:/export/home/read2      After that I restart autofs with               systemctl restart autofs.service      Both Users (read1 and read2) exist on both systems with the same UID and GID. But when I cd to /ahome/read1 and make an ls on Fedora I get the following error.               ls: cannot open directory .: Permission denied      In /var/log/messages               Mar 30 23:43:34 fe-19 pulseaudio[1474]: [alsa-sink] alsa-sink.c: We were woken up with POLLOUT set -- however a subsequent snd_pcm_avail() returned 0 or another value < min_avail.     Mar 30 23:43:49 fe-19 dbus-daemon[582]: ** Message: No devices in use, exit     Mar 30 23:45:31 fe-19 systemd[1]: Cannot add dependency job for unit mdmonitor-takeover.service, ignoring: Unit mdmonitor-takeover.service failed to load: No such file or directory. See system logs and 'systemctl status mdmonitor-takeover.service' for details.     Mar 30 23:45:32 fe-19 automount[1100]: umount_autofs_indirect: ask umount returned busy /ahome     Mar 30 23:47:49 fe-19 dbus-daemon[582]: (packagekitd:1508): GLib-GObject-CRITICAL **: g_object_unref: assertion `G_IS_OBJECT (object)' failed     Mar 30 23:55:03 fe-19 systemd[1]: Cannot add dependency job for unit mdmonitor-takeover.service, ignoring: Unit mdmonitor-takeover.service failed to load: No such file or directory. See system logs and 'systemctl status mdmonitor-takeover.service' for details.     Mar 30 23:55:03 fe-19 automount[1933]: umount_autofs_indirect: ask umount returned busy /ahome      Please, Can anybody help me? I start hating autofs


title: Retrieve countries timezones

text: What is the best way to retrieve the current time zones of a number of countries, on a daily basis? (that would take into account DST changes, of course)   * Reliably   * If possible the Linux way (i.e. either using internal resources, or a Linux website API) _(I'm on Ubuntu 10.04)_


title: How to fetch and process mail in order to execute commands?

text: I administer a home server, and sometimes when I'm out I need to execute some simple commands on the server. 3G + SSH is not an option because it's too expensive from my phone (here in Argentina). It is easier to send an SMS to my mail account. ** I want to fetch the mails I send to my server, and process the text surrounded by ** as bash commands. What approach would you recommend?


title: Bash and Tab Auto-complete

text: I recently put Fedora Core 15 on my system, and I've had a behaviour change that I can't figure out. Using Tab-Complete in the BASH shell works fine except when I use the $HOME variable. If I type `cd $HOME/d``TAB`, it will auto-complete to the proper directory (doc), but it also inserts a preceding `\`, so the result is `cd \$HOME/doc`. This then fails, as such a path does not exist. The error is > bash: cd: $HOME/doc: No such file or directory If I don't use Tab-Complete it works, as $HOME still points to the proper directory. Where did this extra `\` come from, and how do I make it go away?


title: How to use third party notification area with gnome shell

text: I'm using gnome-shell 3.0.2 on Arch Linux and I want to use AWN's notification area plugin. However when I try to activate the plugin it complains that there's already a notification area running. This is expected, of course, except that I can't find a way to disable gnome- shell's notification area. In gnome 2 I'd just right click on the notification area and select "remove from panel" - how do I do the equivalent in gnome- shell, so I can use awn's notification area (or any other third party notification area)?


title: How to auto-restart squid on ubuntu!

text: I have a Ubuntu Home edition set-up as DHCP and Squid proxy, but whenever I reboot my system, I have to restart squid in order for others to start browsing! Is there anyway I can make squid to restart automatically on each reboot, yet it is started when the system boots but I have to restart it once! Also, I have to enter this command for eth0 to redirect traffic through squid!               sudo iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 3128


title: Extracting the contents of a zip file with overwrite all mode in centos 5

text: How can I `Unzip` a `Zip` file which contains different directories and sub directories with the overwrite mode ?   I mean i want the zipped contents to overwrites any existing files (be it old be it new). I have read about `Unzip` command , but it seems it doesnt overwrite any sub directories.


title: How do I use implicit FTP over TLS

text: using any FTP client (I'm on Ubuntu 12.04 and tried using lftp), I want to be able to make an implicit TLS connection on a FTP server, but I can't quite manage to successfully connect(All I get is : "'ls' at 0 [Delaying before reconnect 29]


title: Grsecurity: best strategy sought

text: If a server is run with Linux hardened with Grsecurity (say, Gentoo Hardened), what is the best time to enable Grsecurity RBAC? Automatically by some boot script, or manually after booting?


title: Formatting the output: Underlining

text: I wrote the following function in `ksh` that prints its first argument to the screen and underlines it with the appropriate ammount of `-` character:               print_underlined () {         word=$1          echo $word              i=${#word}         while [[ i -gt 0 ]]; do             printf "-"             (( i = $i - 1 ))         done         printf "\n"     }      example:               $ print_underlined foobar     foobar     ------     $      I wonder if there is a simpler and more elegant way to display an underlined word to the screen. For the record I am using:   * Solaris 10   * ksh88


title: How do I prevent less from clearing the screen on exit?

text: I often pipe commands to `less` in order to read through the output (e.g. compiler errors).               MyCommand | less      This is great because it makes trawling through large amounts of output easy, but when I exit `less` the output is gone. How can I make the output still visible after quitting less? This question differs from Is there a way in bash to redirect output and still have it go to stdout? because that question relates to output to a text file via `tee`, which, as far as I know, doesn't provide a facility to split output between `less` and `stdout`.


title: How to compact a directory

text: Every so often, some application runs wild and fills a directory with a huge amount of files. Once we fix the bug and clean up the files, the directory stays big (>50MB) even though there's only 20-30 files in it. Is there some command that compacts a directory without having to recreate it? Bonus points: does a huge empty directory affect access performance of that directory? I'm assuming it does, but maybe it's not worth bothering. It seems slower to do `ls` on such a directory.


title: List of installed programs without running a program in the system

text: My Linux Mint 15 broke and there seems to be no way to fix it. I cannot boot it so I haven't got access to the terminal. What I'm going to do is make a backup of `/home` with a flash disk running Mint (done that) and reinstall Mint -> restoring `/home`, but I'd like to get a list of installed programs so I can reinstall them. I know:               dpkg --get-selections      exists, but that requires running the program from within the system, which I can't do because I can't boot it. Is there any way to get the list or send the command from the Mint from the flash disk?


title: Permission issues when doing system backup using rsync

text: I'm trying to backup my linux system (arch linux on a laptop) to a remote computer on the same network using ssh (or NFS). I use rsync extensively to backup my /home directory to the remote computer over ssh and NFS with no issues whatsoever. What I want to do is run the rsync command on the laptop within a script and copy all of the contents of / (excluding some directories of course, that I already have figured out) to the remote computer. The issue I'm having is about permissions. I have disabled root login on the ssh server (openssh, running on an ubuntu server 12.04 computer) and I disabled password authentication and enable rsa key login so I can run the backup scripts automatically using cron on the laptop. Now, for me to able to copy all of the system's files under /* (on the laptop) I need to run rsync as root. Doing that introduces a problem since I'm not able to access the ssh server as root. If I try to do it over NFS i get another permision problem since the root user isn't allowed to access the NFS mount, as my regular user is. I'm writting here so I can get suggestion on how to solve this problem. I would prefer to do it over ssh since it usually works a lot faster for me, but I'm willing to use NFS or even samba (haven't tried that one) if no other thing works.


title: Let Transmission running on the server, independently of SSH session

text: This question has been reworded, previous one was a duplicate of Execute remote commands, completely detaching from the ssh connection I want to access to a computer through SSH, run both Iceweasel and Transmission, use Iceweasel to find some torrents, add the torrents to Transmission, close Icewasel, close my SSH session and let Transmission running on the server. I'm running Transmission using `nohup`, but if I close Transmission, it closes on the server. If I exit the session, it closes as well.


title: Is there a way to control the mouse wheel resolution in Debian?

text: I am using Debian 6.0.4. The mouse wheel scrolls way to much for it to be any use. Is there any way to configure how much "scrolling" is done with with one mouse wheel turn? Thanks! Update: My keyboard and mouse are wireless, connected to a USB port in a KVM which is connected by USB to the computer (and it even works :-) ). `xinput --list` output:               ⎡Virtual core pointer                       id=2    [master pointer  (3)]     ⎜↳ Virtual core XTEST pointer               id=4    [slave  pointer  (2)]     ⎜↳ Microsoft Microsoft® 2.4GHz Transceiver v8.0 id=9    [slave  pointer  (2)]     ⎜↳ Microsoft Microsoft® 2.4GHz Transceiver v8.0 id=10   [slave  pointer  (2)]     ⎜↳ Justcom Technology USB KVM Switch        id=12   [slave  pointer  (2)]     ⎣Virtual core keyboard                      id=3    [master keyboard (2)]     ↳ Virtual core XTEST keyboard               id=5    [slave  keyboard (3)]     ↳ Power Button                              id=6    [slave  keyboard (3)]     ↳ Power Button                              id=7    [slave  keyboard (3)]      ↳ Microsoft Microsoft® 2.4GHz Transceiver v8.0  id=8    [slave  keyboard (3)]     ↳ Justcom Technology USB KVM Switch         id=11   [slave  keyboard (3)]      `xinput --list-props 9` output:                 Device 'Microsoft Microsoft® 2.4GHz Transceiver v8.0':         Device Enabled (128):   1         Device Accel Profile (254): 0         Device Accel Constant Deceleration (255):   1.000000         Device Accel Adaptive Deceleration (257):   1.000000         Device Accel Velocity Scaling (258):    10.000000         Evdev Reopen Attempts (246):    10         Evdev Axis Inversion (259): 0, 0         Evdev Axes Swap (261):  0         Axis Labels (262):  "Rel X" (136), "Rel Y" (137), "Rel Misc" (263)         Button Labels (264):    "Button Left" (129), "Button Middle" (130), "Button Right" (131), "Button Wheel Up" (132), "Button Wheel Down" (133), "Button Horiz Wheel Left" (134), "Button Horiz Wheel Right" (135), "Button Side" (249), "Button Extra" (250), "Button Unknown" (247), "Button Unknown" (247), "Button Unknown" (247), "Button Unknown" (247)         Evdev Middle Button Emulation (265):    2         Evdev Middle Button Timeout (266):  50         Evdev Wheel Emulation (267):    0         Evdev Wheel Emulation Axes (268):   0, 0, 4, 5         Evdev Wheel Emulation Inertia (269):    10         Evdev Wheel Emulation Timeout (270):    200          Evdev Wheel Emulation Button (271): 4         Evdev Drag Lock Buttons (272):  0


title: Bluetooth was working but just stopped?

text: I recently upgraded to the latest FGLRX driver on my MacBook Pro and I noticed that Bluetooth was having some issues afterward. I tried reinstalling bluetooth and bluez, but it didn't seem to fix things. Before the FGLRX upgrade, it was working just fine. Unfortunately, it's a really big hassle to downgrade from FGLRX, and I don't have the time to spend in getting it back to 11.12. I do have `etckeeper` installed and I've checked out the revision before I did any changes, restarted bluetooth, and it's still giving me the same error in syslog when I try to connect my keyboard:               $ tail -f /var/log/syslog | grep "blue"     Jan 30 11:56:31 work-macbook bluetoothd[9457]: Refusing input device connect: No such file or directory (2)     Jan 30 11:56:31 work-macbook bluetoothd[9457]: Refusing input device connect: No such file or directory (2)      I have no idea what file it's looking for. Is there a way for me to either:   1. Revert all of my changes and just get Bluetooth working again.   2. Enable Bluez logging to be able to see what it's unable to find? This is super weird. Can anyone help me debug this?


title: Photoshop in Wine won't open, gives "File not found" error

text: Ever since moving to Linux Mint 14, Photoshop CS 2 in Wine has been unreliable. It ran a couple times after my first install, but now it has settled into never running, and instead, it just returns an error saying "File not found". ![file not found](http://i.stack.imgur.com/oleup.png) I tried re-installing, and also installing into a custom directory, but that hasn't helped. I tried restarting the Wine server with `wineserver -k`, and rebooting, but neither helped. I get the same error if I try to run `Photoshop.exe` from the command line, even if I'm in the directory where the file is and I can see it listed when I run an `ls` command. So I don't think this is a matter of the `Photoshop.exe` file not being found, it is some system file or Wine setting. How can I get past this error and have Photoshop running consistently?


title: Kernel logs on power failure

text: I was wondering if it was possible to have a logging program document a random power failure. Clearly it won't have any time to log when the power fails, but is there a way to recognize a power failure occurred when it reboots after the failure? I know Red Hat (and Linux in general) has some pretty good logs (`/var/log`) but I don't think it has any native logging program that could handle a power failure. If there is no logging program I was also debating changing the boot scripts. The BIOS is set for it to always be powered on; so if a power failure occurs, it automatically reboots. ### The only time the system will be off is if a power failure happens; it will never be manually shut down. Therefore, I was thinking of adding something (simple as a `mail` command) to the boot scripts because every boot after the very first boot marks a power failure. Unfortunately, I don't know which file or location or the actual syntax of such a command would be.


title: how to ping & use specific network card

text: > i have 3 network cards , 1 Lan (wired) , 1 wireless network card & 1 is > wireless usb > > how do i ping from specific network card ? > > & how do i use specific network card for specific application example               i want to ping google from wlan1      example for specific application               i want to use firefox or transmission from wan1      Lan ip 192.168.0.2 > Working Properly ![enter image description here](http://i.stack.imgur.com/td6ug.jpg) pin -I wlan1 google.com ![enter image description here](http://i.stack.imgur.com/jYW2m.jpg) > **`route -n`**               Kernel IP routing table     Destination     Gateway         Genmask         Flags Metric Ref    Use Iface     0.0.0.0         192.168.0.1     0.0.0.0         UG    0      0        0 eth0     169.254.0.0     0.0.0.0         255.255.0.0     U     1000   0        0 eth0     172.16.221.0    0.0.0.0         255.255.255.0   U     0      0        0 vmnet8     192.168.0.0     0.0.0.0         255.255.255.0   U     1      0        0 eth0     192.168.0.0     0.0.0.0         255.255.255.0   U     2      0        0 wlan1     192.168.48.0    0.0.0.0         255.255.255.0   U     0      0        0 vmnet1      > one@onezero:~$ **ip route**               default via 192.168.0.1 dev eth0  proto static      169.254.0.0/16 dev eth0  scope link  metric 1000      172.16.221.0/24 dev vmnet8  proto kernel  scope link  src 172.16.221.1      192.168.0.0/24 dev eth0  proto kernel  scope link  src 192.168.0.2  metric 1      192.168.0.0/24 dev wlan1  proto kernel  scope link  src 192.168.0.3  metric 2      192.168.48.0/24 dev vmnet1  proto kernel  scope link  src 192.168.48.1       @Khaled               one@onezero:~$ ping -S 192.168.0.2  hotmail.com     PING hotmail.com (65.55.72.135) 56(84) bytes of data.     64 bytes from origin.sn131w.snt131.mail.live.com (65.55.72.135): icmp_req=1 ttl=236 time=391 ms     64 bytes from origin.sn131w.snt131.mail.live.com (65.55.72.135): icmp_req=2 ttl=236 time=296 ms     64 bytes from origin.sn131w.snt131.mail.live.com (65.55.72.135): icmp_req=3 ttl=236 time=393 ms     64 bytes from origin.sn131w.snt131.mail.live.com (65.55.72.135): icmp_req=4 ttl=236 time=352 ms      * * *                ping -S 192.168.0.3  hotmail.com     PING hotmail.com (65.55.72.183) 56(84) bytes of data.     64 bytes from origin.sn134w.snt134.mail.live.com (65.55.72.183): icmp_req=1 ttl=236 time=312 ms     64 bytes from origin.sn134w.snt134.mail.live.com (65.55.72.183): icmp_req=2 ttl=236 time=457 ms     64 bytes from origin.sn134w.snt134.mail.live.com (65.55.72.183): icmp_req=3 ttl=236 time=298 ms     64 bytes from origin.sn134w.snt134.mail.live.com (65.55.72.183): icmp_req=5 ttl=236 time=330 ms     64 bytes from origin.sn134w.snt134.mail.live.com (65.55.72.183): icmp_req=6 ttl=236 time=300 ms      Now Lastly the application issue


title: How do services in Debian work, and how can I manage them?

text: In Windows I have the services manager, where I see all system services, that can be started through Windows itself, I set up the user it uses, the rights management is in there, and I can pass variables and some other information to the services, I can name them, and I can create duplicates services of one program and so on. So I have a main management tool in Windows. How can I do the same in Linux? How can I trigger to run "svnserve" at startup, or how can I configure services to be running in a special context. How can I view all "programmed" services?


title: Shorewall "ERROR: Ordinary users may not start the /etc/shorewall configuration" in Cygwin

text: I am using Cygwin on Windows 7 and I have installed Shorewall 4.5.21.5.   When I try to start shorewall in Cygwin, it gives me error:               $ shorewall start     ERROR: Ordinary users may not start the /etc/shorewall configuration      I tried running Cygwin using Run as Administrator but that didn't work. I have searched everywhere but haven't found a fix yet.


title: Linux Confereneces with a Focus on Power Management Issues

text: The organization where I work is looking for conferences taking place in 2014 (worldwide) revolving around Linux, with a focus on power management issues on Android. Do you have any recommendation for such a summit? I know Linux Con ,Embedded Linux and Linux Plumbers all have specific sessions related to these issues, but is there anything (can be small scale) more focused?


title: sar -P ALL command AIX 6.1

text: What is the meaning of `-` in the `cpu` column below? Is it average of all CPU cores?               bash-3.00$ sar -P ALL 2 2     AIX tinapp1 1 6 00F6F78B4C00    11/27/13     System configuration: lcpu=4  mode=Capped     19:02:54 cpu    %usr    %sys    %wio   %idle   physc     19:02:56  0       13      15       0      72    0.30               1        0       1       0      99    0.23               2        0       0       0     100    0.24               3        0       0       0     100    0.23               -        4       5       0      91    1.01     19:02:58  0       12      15       0      73    0.29               1        2       1       0      97    0.24               2        0       0       0     100    0.23               3        0       1       0      99    0.23               -        4       5       0      91    1.00     Average   0       13      15       0      72    0.30               1        1       1       0      98    0.24               2        0       0       0     100    0.24               3        0       1       0      99    0.23               -        4       5       0      91    1.01     bash-3.00$ sar -P ALL 2 3     AIX tinapp1 1 6 00F6F78B4C00    11/27/13     System configuration: lcpu=4  mode=Capped     19:03:02 cpu    %usr    %sys    %wio   %idle   physc     19:03:04  0        9      11       0      80    0.28               1        1       1       0      99    0.24               2        0       0       0     100    0.24               3        0       0       0      99    0.24               -        3       3       0      94    1.00     19:03:06  0        9      10       0      81    0.28               1        0       1       0      99    0.24               2        0       0       0     100    0.24               3        0       1       0      99    0.24               -        3       3       0      94    1.00     19:03:08  0       12      16       1      70    0.30               1        0       1       0      99    0.23               2        0       1       0      99    0.23               3        0       0       0     100    0.23               -        4       5       0      91    1.00     Average   0       10      13       0      77    0.29               1        0       1       0      99    0.24               2        0       0       0     100    0.24               3        0       0       0      99    0.24               -        3       4       0      93    1.00


title: Use git submodule foreach with function

text: My indention is to have a script that updates all git submodules according to which branch is given. If there's no such branch for a submodule, master is used. This is what I have now:               #!/bin/bash -x          if [ -z $1 ]; then         echo "Branch name required."         exit     fi          function pbranch {         exists=`git show-ref refs/heads/$branch`              if [ -z $exists ]; then             branch="master"         fi              git co $branch         git pull origin $branch     }          branch=$1          git submodule foreach pbranch      But when running this script, the error is thrown:               oleq@pc ~/project> git-fetchmodules major     + '[' -z major ']'     + branch=major     + git submodule foreach pbranch     Entering 'submodule'     /usr/lib/git-core/git-submodule: 1: eval: pbranch: not found     Stopping at 'submodule'; script returned non-zero status.      My guess is that `git submodule foreach` utilizes eval (according to the documentation), which I don't use correctly in this context. There are billions of examples of how to use this command with "inline callback" but I couldn't found a single one with the callback in form of the function. Any idea how to solve this?


title: How to find what thing make a cycle in systemd

text: when boot with systemd, my system display this message:               systemd[1]: Found ordering cycle on basic.target/start     systemd[1]: Walked on cycle path to sysinit.target/start     systemd[1]: Walked on cycle path to local-fs.target/start     systemd[1]: Walked on cycle path to udevd.service/start     systemd[1]: Walked on cycle path to basic.target/start     systemd[1]: Breaking ordering cycle by deleting job local-fs.target/start      I cannot find any solution for this Any suggestions please


title: Rename directory from within directory?

text: How would I rename a directory from within that directory? For example:               ~/tmp $ rn tmp2     ~/tmp2 $       I can do that with: cd .. && mv tmp tmp2 && cd tmp2, but not sure how to make it into one command.


title: Xinput device disable doesn't work for all mouses

text: There are 2 mouses connected to one computer and I want to disable them. I tried to do it using xinput. It works for one mouse (OM), but it doesn't for second (SIGMACHIP Usb Mouse). Second mouse is disabled only for a moment and after about minute it works again. Both mouses are on USB. I checked it on 3 different computers and it acts the same (ubuntu 12.04). Is there other way to disable mouse for lets say 2 hours and then turn it on again?               adm@l:~$ xinput     ⎡ Virtual core pointer                      id=2    [master pointer  (3)]     ⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]     ⎜   ↳ SIGMACHIP Usb Mouse                       id=10   [slave  pointer  (2)]     ⎜   ↳ OM                                        id=9    [slave  pointer  (2)]     ⎣ Virtual core keyboard                     id=3    [master keyboard (2)]         ↳ Virtual core XTEST keyboard               id=5    [slave  keyboard (3)]         ↳ Power Button                              id=6    [slave  keyboard (3)]         ↳ Power Button                              id=7    [slave  keyboard (3)]         ↳ Logitech Logitech USB Keyboard            id=8    [slave  keyboard (3)]     adm@l:~$ xinput set-prop 9 "Device Enabled" 0     adm@l:~$ xinput set-prop 10 "Device Enabled" 0


title: shebang line not working with cr-lf

text: Why are the shebang parts of the following elementary scripts not working:               $ cat hello.sh     #! /bin/sh     echo Hello     $ ./hello.sh     bash: ./hello.sh: /bin/sh^M: bad interpreter: No such file or directory          $ cat hello.py     #! /usr/bin/env python3     print("Hello")     $ ./hello.py     : No such file or directory      whereas calling the interpreter manually is working:               $ sh hello.sh     Hello     $ python3 hello.py     Hello      * * * **NOTE:** I wanted to search for this on unix.SE but I didn't find a direct answer, and solved my problem myself. I thought I'd share what I learnt Q&A-wise for others since I have seen http://stackoverflow.com/help/self- answer. But since I'm new to unix.SE, I initially did not have 15 reputation to get the "Answer your own question" option (though I have more reputation at other SE sites) and hence posted the answer along with the question. Now I have edited it and made it a separate answer. (This note should provide the context for the comments below.)


title: Arch Linux Live USB no longer booting UEFI

text: My Lenovo laptop is running Arch Linux with a UEFI GPT partition table. One day I powered up my laptop, but couldn't get passed the Lenovo boot screen. I used a USB stick to boot up and reinstall Arch. However after this I still couldn't get passed the Lenovo boot screen. I tried to reinstall it again using the same USB stick and ended up with two entries in my UEFI boot menu. I formatted the GUID partition to FAT32 using GPARTED live USB which deleted them. However I can no longer use my Arch UEFI USB stick to boot up. I get to the bootloader menu on the USB stick but after the timeout I get a blank screen.


title: Recovering data from a damaged hard-drive: the "freezer trick"

text: I'm currently in the business of recovering data from a damaged---and dying--- hard-drive (check this question for background info). The drive was dropped while the system was running; and while foolishly I was trying to run `testdisk` on it, I started hearing---what I assume is---the "click of death". Now I have read in several places about the "freezer trick" (e.g. on AskDifferent, on Unix SE, on AskUbuntu). The crux of it is as follows (but do read the full instructions!):   * Place the damaged hard drive inside of a ziploc freezer bag, so that no moisture gets in. (Use two or even three bags, and note that the bags do NOT need to be isotherm.)   * Place the wrapped hard drive in the freezer   * Leave the hard drive in the freezer for at least 12 hours    * Then connect the drive to the computer and start copying data   * At some point, the hard drive will fail again. When it does, redo the procedure until all data is copied or the drive dies. (As per Harddrive in the freezer ever work for you? on SuperUser, two alternative-medicine remedies to try before freezing are: (1) "Place the hard drive on a smooth surface. Grab the ends and physically spin the whole unit around", "just spinning the unit sharply along the axis of the blades" and (2) "In situations where the head has crashed, you can temporarily get it up and running by turning the drive upsidedown. Keep the drive upsidedown while you back up your files.") **Question** : Is **freezing** a legitimate strategy to rescue data from a dying hard-drive? Or is this simply a fancy way to definitively brick your disk? And if this is legit, should one attempt it _before_ trying `ddrescue`, _after_ trying `ddrescue`, or should I combine the "freezer trick" with `ddrescue` (and an associated log file)?


title: How to cycle clients

text: I want to be able to cycle clients within a single tag (screen). I know I can swap clients by using `awful.client.swap.byidx` but that moves focus rather than the client. Say I have three windows:               +---------+-----+     |         |     |     |         |  2  |     |         |     |     |   1     +-----|     |         |     |     |         |  3  |     |         |     |     + --------+-----+      And I want to cycle each one into the "1" spot. So "1" would go to "2", "2" would go to "3", and "3" would go to "1". Does that make sense I know I've seen something like this, but can't find it now.


title: How to randomly sample a subset of a file

text: Is there any Linux command one can use to sample subset of a file? For instance, a file contains one million lines, and we want to randomly sample only one thousand lines from that file. For random I mean that every line gets the same probability to be chosen and none of the lines chosen are repetitive. `head` and `tail` can pick a subset of the file but not randomly. I know I can always write a python script to do so but just wondering is there a command for this usage.


title: Find and Replace in wordpress postings

text: I have a wordpress blog with 93 posts on it, in which I want to replace `[bash]` with `<pre>` but how do I do it please? I need to go through all the posts changing `[bash]` to `<pre>` in each one, but the `[bash]` doesn't appear in every posting but it is in quite a few, too many to do it by hand with one post after another, I'd rather do it in batches if possible. I believe the posts are stored in a MySQL database, but I can't remember why I believe so!


title: download multiple files from sourceforge

text: Is there any way to download / mirror a folder structure with **many** files from sourceforge using wget/curl/similar tool? I've seen some examples using rsync or scp but I think that works only for SF project owners (cause it needs login, password and filesystem path).


title: How to install Empathy on CentOS 6.0?

text: I'm a very new CentOS user. I came from Ubuntu. I need to install Empathy on my CentOS PC. Can anybody explain how to do that?


title: Winscp giving error for delete, move etc

text: I can login via winscp to my server I can move around the folder but when I try to delete or even download or upload files it keep showing me this error.               General failure (server should provide error description).     Error code: 4     Error message from server: Failure     Request code: 3      I tried this command df -h               Filesystem            Size  Used Avail Use% Mounted on     /dev/mapper/VolGroup00-LogVol00                           112G   47G   60G  44% /     /dev/sda1              99M   37M   57M  40% /boot     tmpfs                 3.0G     0  3.0G   0% /dev/shm


title: pager program like less, able to repeat top N lines

text: Is there any way to make `less` program repeat first line (or first 2 lines) on every displayed page? Is there any other pager program which can do this? This would be a killer-app for database table browsing, think `mysql` or `psql` or `gqlplus`... For those of you who don't get the idea, see the screenshot in the bottom of this page. I want to repeat header line + horizontal ascii bar.


title: VIM jump from one xml tag to the closing one

text: Is there a shortcut to jump from , e.g `<XX>` to `</XX>` ? I already give it a try with '%' , but it doesn't work for this situation.


title: How to disable IPv6 on OpenBSD?

text: I'm sure that in my network I will not use IPv6 only IPv4. So according to the KISS principle I will need to disable it. How can I do it? OS is OpenBSD 5.1.


title: Is there any handy command line tool to manage Cron jobs?

text: Would someone suggest any handy command line (NOT web) tool or script which adds, enables and disables Cron jobs? I am looking, for example, for the following (or similar) behavior:               sh manageCron.sh -idJob 'job1' -addJob '* * * * * <do some job>'     sh manageCron.sh -dissableJob 'job1'       crontab -e command is good for manual editing of crontab file, but I need to automate.


title: How do I run a program only once per day, while accounting for variable uptime and possible failure of program?

text: I need to run a command once, but only once, per day, until it succeeds. Continuous uptime cannot be expected, and program success cannot be guaranteed. This program requires network access, but not every time I start my computer with network access. My program will exit with, e.g -1 unless it succeed ( which returns 0 ).


title: Is Native Language Support (NLS) kernel support still necessary?

text: Does ext4 / cifs system need kernel NLS support ? I'm not sure if it's being handled by user-space program (decoding / encoding) ?


title: What is the difference between kernel drivers and kernel modules?

text: When I do a `lspci -k` on my Kubuntu with a 3.2.0-29-generic kernel I can see something like this:               01:00.0 VGA compatible controller: NVIDIA Corporation G86 [Quadro NVS 290] (rev a1)         Subsystem: NVIDIA Corporation Device 0492         Kernel driver in use: nvidia         Kernel modules: nvidia_current, nouveau, nvidiafb      There is a kernel driver `nvidia` and kernel modules `nvidia_current`, `nouveau`, `nvidiafb`. Now I wondered what might be the difference between Kernel drivers and Kernel modules?


title: Reading two files into an IFS while loop -- Is there a way to get a zero diff result in this case?

text: I have a text file full of several hundred lines of sequences like this:                        b 29.         b 52.         c 84.         c 83.         c 94.         c 93.         c 61.         b 38.         c 81.         c 92.         c 28.         c 37.         c 27.              lara@batcuter:~/.asd/a-new-way-of-studying-go$ wc -l game7         271 game7      and the following script, which separates a text file into two files, one of which consists of odd-numbered lines and one of which consists of even- numbered lines, then reads both files into a while IFS loop, printing a line from each at a time:               #/bin/bash     #testing liquor-where-twin-twas-born          awk '{print>"line-"NR%2}' $@          while IFS= read -r lineA && IFS= read -r lineB <&3; do       echo "$lineA";       echo "$lineB"      done <line-1 3<line-0      which unfortunately gives something not quite the same as the input file, due to the fact that one file was one line longer than the other.                        lara@batcuter:~/.asd/a-new-way-of-studying-go$ testing-liquor game7 > test         lara@batcuter:~/.asd/a-new-way-of-studying-go$ diff test game7         270a271         > b 7.           Obviously, since the file is 271 lines long, splitting it in half yields two files, one of which is 136 lines, and one of which is 135 lines. I need to fix the IFS while loop to return zero differences. At first, I thought using `read ... || read ...` would help. But actually, that just bloated the output, inserting more than a single a newline between each entry, and shaving off the last line (the line that ended up in the file with the odd number of lines), as did all the other solutions I tried.


title: Is really need Internet connection after installed all pkgs?

text: I know when you want to Install any new pkg then internet connection is required .right now I am using Ubuntu 12.04 I have Internet connection. using following command I installed one pkg.(e.g vlc player)                $sudo apt-get install vlc      Installed successfully. after that I **remove/purge** pkg then internet connection disconnect and tired installing same pkg again using                $sudo apt-get install vlc        Installed successfully. so my question is when you install any pkg that time internet is required but for this scenario why not required? any concept behind that? I searched on Google but not getting specific answer.


title: Start and stop bluetooth service automatically as rfkill switch changes

text: I would like to start / stop bluetooth service automatically when I turn on / off rfswitch, is that possible ?


title: SSHD Password Feedback (Show Asterisks for Characters)

text: Is it possible to have SSHD show asterisks for the password characters much like `pwfeedback` does for sudo? I am using CentOS 6.5. For example: ![if I type something here, show *****](http://i.stack.imgur.com/IA6oi.png)


title: Create a fake read only device like file with incrond

text: I need to generate UUID with `uuidgen` (not through any function call, but external command, because processes which will read the file cannot call any APIs or external commands directly). My idea is to create an `incron` job which regenerates content of file on read (`IN_ACCESS` operation). So that whenever the file, monitored by `incrond` is read, a script overwrites its content with new UUID:               #!/bin/sh     /usr/bin/uuidgen > file_to_be_monitored_and_read      My questions:   * Is there another way to create such a device like file?   * What problems can arise if multiple processes try to read from the file in about the same time? Will `incrond` and script be able to regenerate the content quickly enough?


title: trac ldapplugin ERROR: LDAP error: Operations error

text: on version 0.10.4 on centos 32 bit using python 2.4 i am trying to install and use ldaplugin to assign permissions to users and groups in AD. i have followed this guide http://trac-hacks.org/wiki/LdapPlugin#Configuration and have the following settings apache               <LocationMatch "/trac/[^/]+/">             AuthType Basic             AuthName Trac             AuthBasicProvider ldap             Order allow,deny             Allow from all     #        AuthLDAPURL "ldap://echo.uk.domain.com akutan.usa.domain.com/ou=Sites,dc=domain,dc=com?sAMAccountName"             AuthLDAPURL "ldap://echo.uk.domain.com akutan.usa.domain.com/ou=Sites,dc=domain,dc=com?userPrincipalName"             AuthLDAPBindDN cn=Administrator,cn=Users,dc=domain,dc=com             AuthLDAPBindPassword ******             AuthzLDAPAuthoritative off             require valid-user     </LocationMatch>      trac.ini               [notification]     always_notify_owner = true     always_notify_reporter = true     always_notify_updater = true     mime_encoding = base64     smtp_always_bcc =     smtp_always_cc = sharif.uddin@domain.com     smtp_default_domain = domain.com     smtp_enabled = true     smtp_from = trac@domain.com     smtp_password =     smtp_port = 25     smtp_replyto = support@domain.com     smtp_server = hero.uk.domain.com     smtp_subject_prefix = __default__     smtp_user =     use_public_cc = false     use_short_addr = false     use_tls = false     #ignore_domains = domain.com                    [ldap]     enable = true     global_perms = true     host = echo     basedn = dc=domain,dc=com     #user_rdn = ou=sites     #group_rdn = cn=users     store_bind = true     bind_user = Administrator@domain.com     bind_passwd = ******                    [trac]     permission_store = LdapPermissionStore               [logging]     log_format = Trac[$(basename)s:$(module)s] $(levelname)s: $(message)s               [components]     webadmin.* = enabled     ldapplugin.* = enabled     ldapplugin.api.ldappermissiongroupprovider = enabled     ldapplugin.api.ldappermissionstore = disabled     ticketdelete.* = enabled     tracopt.ticket.deleter = enabled      Error I receive is               Trac[paradox:api] ERROR: LDAP error: Operations error     Trac[paradox:api] ERROR: LDAP error: Operations error


title: Replace all files except one with rsync

text: I'm currently using `rsync` as follows               rsync -az --delete ...      What option can I use with `rsync` to replace all destination files that already exist except for one specific file that should not be replaced if already exists? Sure, if the file doesn't exist at the destination, it should be put there.


title: Dropbox/Copy.com & Truecrypt

text: I have a partition that contains all my personal stuff, which is mounted at boot under `/home/myuser/foo`. I would like to synchronize it on the cloud via Dropbox or Copy.com, but I don't trust them, so I have to encrypt the data in some way. I'm a Truecrypt newbie, but, as I understood, it creates a "volume" when opened, and the data is clear only in ram, which is great. The problem is that this volume is seen as a single file by the Dropbox/Copy.com client, so when I change something, as little as a text file, it will attempt to upload again the whole encrypted "volume". There is some way to encrypt my data and upload it in security?


title: SSH through router to internal file server

text: This is a real beginner question, I know. But I really don't seem to be able to wrap my head around the terminology to get what I want working. And since I want to do this on a router that 40-50 people rely on for internet, my usual approach of breaking things until it works is also not going to work. So here's what I want to do. I have a router (a Debian box with shorewall) with a static IP `cable.example.com`. I have an internal fileserver assigned `192.168.0.3`. I can currently `ssh` into the router, and from there `ssh` into the filesever. However, I want to make the fileserver available externally for both myself and others with a typical `sftp` client. Could someone at least give me an idea of what I'm looking for? Tunneling out, tunneling in, port forwarding, iptables – they all seem to describe what I want to do, but I can't get a firm idea of how to get it to work.


title: Force a specific frequency from my wireless card

text: How can I make my wireless card emit a specific frequency (the ones that it is capable of physically)? I am aware that a kernel module can help (please correct if I am wrong) but am looking for something like a command line tool. How can I find the exact upper and lower limits? As the driver interacts with the device, hence kernel should have access to this information (although I understand this could be a soft limit. Is there a way to get the hard limit as I would like to avoid digging into the manufacturing details) [Motive: Disrupt functioning of remote control at home (I know I can just take out the cells, but I want to do this in a grand way :P)]


title: how to enable sound support in linux kernel without recompile?

text: I have recently compiled linux kernel 3.2. But at time of compiling in make menuconfig, I had disabled sound support. Now, I want to enable it without recompile it. I don't want to use stock kernel or direct kernel image, I always wanted to use compiled kernel.


title: Virtual mouse is ignored by xorg when loaded

text: I'm trying to run virtual mouse driver from book "Essential Linux Device Drivers" but when I'm load this module into kernel using insmod in /var/log/Xorg.0.log I see:               [   757.212] (II) config/udev: Adding input device  (/dev/input/event10)     [   757.212] (II) No identifier specified, ignoring this device.      How can I force Xorg to don't ignoring this device? or what I must add to kernel module code?


title: relation between unity on ubuntu and unity game engine?

text: I am just curious to know if there is any kind of relation between Unity(the latest shell interface for gnome in ubuntu) and the Unity game engine, apart from having the same name ? I'm no expert in any of these. I saw my friends developing gesture recognition based software using Unity game engine and I use Ubuntu 12.04(uses unity interface) for everything.


title: Debian Netinst - why apt is downloading Libre Office when I'm installing Gnome?

text: I have Debian. I was installing it from netinst to save disk space and network transfer (small partition, UMTS connection). I decided to install Gnome. When I typed: `apt-get install gnome` it started downloading big things like Libre Office, Gimp... I really don't like it.   1. Why Debian developers assume I need Libre Office or Gimp when I'm installing Gnome? Or I missed something?   2. How can I install Gnome and only REALLY required packages?


title: Active Directory Domain with SAMBA or Other Tool

text: Can I create a domain using SAMBA and set up Active Directory with SAMBA on it? And by this I mean no windows servers involved. I would also like to be able to log in from a Windows machine. Preferably on OpenSuSE. My objective is to have a domain with centralized authentication just like AD. I want to be able to log in using both Windows and Linux computers.   * How can I do that in SAMBA?   * What other solution you guys recommend if Samba4 is not a viable one?


title: Viewing large image on Linux

text: I need to view a large (50000x40000 px) png image on Linux. Unfortunately most tools (eog, convert etc.) either crashes or fail with note about too little memory. Is there a way to view this image (I would prefer to see both the resized image and details)?


title: Is there a way to make Screen scroll like a normal terminal?

text: I love screen, but it drives me nuts that I have to stop typing input, hit `CTRL+A [`, and then find what I need. Is there a way to make the scroll wheel function normally, rather than scrolling commands? Also, is it possible to enable Shift+PageUp/PageDn?


title: Theoretical possibilities for cpu emulation built into boot-loader or kernel?

text: Is it a crazy idea to somehow make a blend of grub and qemu in order to boot linux kernels or any kernel of any cpu type supported by qemu or the built-in cpu? I know it might be impossible to detach the bootloader if its emulating the cpu, but maybe the work around would be to make the cpu emulation built into a linux kernel so that the boot-loader can detach. But is this kind of idea crazy and would never work or just too much work for anybody to take on?


title: How to stage part of hunk with added newline at EOF?

text: Is there some way to stage _individual lines_ of a file which has just been changed to include newline at EOF? I tried `add -p`, but it wouldn't split the relevant hunk into small enough parts, and it's well known that git-gui throws a "corrupt patch" error when dealing with files without a newline at the end. The relevant hunk:                $courier:   "courier new", courier, freemono, "nimbus mono l",                   "liberation mono", monospace;     -                 -$monaco:    monaco, "lucida console", "dejavu sans mono",      -            "bitstream vera sans mono", "liberation mono",      -            monospace;     \ No newline at end of file     +     +$monaco:    monaco, "lucida console", "dejavu sans mono",     +            "bitstream vera sans mono", "liberation mono",     +            monospace;     +     +h1 {     +  font-size: 2em;     +}     [snip]      I'd like to commit everything up to `h1` as a whitespace fix, and everything after in a separate commit.


title: Is Webmin oriented toward a particular Linux distro?

text: I have used Webmin on multiple distros, both on the Red Hat-based side and the Debian-based side, and have had various issues with it on both. My issues have included things like configuration failing when restarting a service from within Webmin, or settings not sticking when I enter them via Webmin and apply changes. A couple of examples are with bind9 and samba. I tried to set up a new samba user but it failed to do so, and I can't even tell exactly where, I just know that restarting the server failed. Same with bind9, after configuring a zone and adding A and PTR records, the bind server failed to start and didn't give any helpful reason why, so I ended up merely using the configuration file editor to get it done. My frustration with it has led me to try other configuration tools. It also has brought up the question -- is there a particular distro that Webmin was developed and tested on? I know Webmin is available for a variety of distros but it doesn't seem to work really well for any of them. Maybe I just haven't used it on the right one?


title: Which linux distro is based on Arch, runs LXDE and out of the box ready to use?

text: Besides that, have full multimedia, driver, network and essential software support?


title: What is $debian_chroot in .bashrc?

text: What is the `debian_chroot` variable in my bashrc file? and what is it doing here? `PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '`


title: In Bash, why is PROMPT_COMMAND set to something invisible?

text: On RHEL6 and CentOS 6, `/etc/bashrc` sets `PROMPT_COMMAND` here:               case $TERM in     xterm*)         if [ -e /etc/sysconfig/bash-prompt-xterm ]; then             PROMPT_COMMAND=/etc/sysconfig/bash-prompt-xterm         else             PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/~}"; echo -ne "\007"'         fi         ;;     screen)         if [ -e /etc/sysconfig/bash-prompt-screen ]; then             PROMPT_COMMAND=/etc/sysconfig/bash-prompt-screen         else             PROMPT_COMMAND='echo -ne "\033_${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/~}"; echo -ne "\033\\"'         fi      All of these options, as far as I know, are printed invisibly. What is the use of this? I know that `PROMPT_COMMAND` is to be executed before display the prompt (`PS1` usually). I do not understand why echoing something that is not visible is of any use.


title: How to associate a seperate station to a Wifi AP

text: My Linux machine (A) is connected with some Wifi AP over my wireless device (`wlan0`). I want to give some other Linux machine (B), which is connected to me by ethernet (`eth0`), access to this network. I do not want to use NAT. So I create a `bridge` device and bridge `wlan0` and `eth0`. This does not work. I suspect, the main reason lies in the fact, that B’s MAC was never associated to the AP. So it would simply drop B’s packets. If B would know at this point, that his ethernet is bridged to wireless, could it associate to the AP itself? Is it necessary to know the network credentials to do this (after all, it is bridged over my already-secured connection)? If this is not possible, could I somehow associate B’s MAC for it? And are there other obstacles in this scenario?


title: How to run grep on a single column?

text: I want to grep the output of my `ls -l` command:               -rw-r--r--   1 root root       1866 Feb 14 07:47 rahmu.file     -rw-r--r--   1 rahmu user     95653 Feb 14 07:47 foo.file     -rw-r--r--   1 rahmu user   1073822 Feb 14 21:01 bar.file      I want to run `grep rahmu` on column $3 only, so the output of my `grep` command should look like this:               -rw-r--r--   1 rahmu user     95653 Feb 14 07:47 foo.file     -rw-r--r--   1 rahmu user   1073822 Feb 14 21:01 bar.file      What's the simplest way to do it? The answer must be portable across many Unices, preferably focusing on Linux and Solaris. _NB: I'm not looking for a way to find all the files belonging to a given user. This example was only given to make my question clearer._


title: Android - what's the permission difference on normal and rooted devices

text: I have two android phones, one rooted the other not. When I run following code without asking for root permission on the two phones,               system("echo \"abc\" > /data/a.txt\n");      the rooted phone returns me error-2 (512); the normal phone returns error-1 (256, permission denied). So my question is, what makes this difference.


title: SOLVED: linux vmware player installation "VMs are running" error

text: I was evaluating vmware workstation lately but as my trial period ran out i decided not to go for a license so I uninstalled the now defunct workstation 9 in order to re install the player. The removal went uneventful but when I now run the vmware player installer i get an error message saying that there are still vms running on the machine. I have checked my packages and there is no other virtualization host software present. the vmware modules are not loaded in the kernel and no other indicator exists that something the like should be happening (no unexplained network interfaces, memory usage etc). What can be the cause of this false positive? Some additional information: up-to-date arch linux, vmware workstation was the first virtualization product in this machine. Any help is gladly appreciated. Solution: delete all references to vmware and vmware workstation. Apparently the uninstaller doesn't keep a very good track of its assets so I had files existing in /etc/vmware /etc/vmware-workstation /etc/rc.d the systemd directories /usr/bin etc.


title: emacs auto indentation

text: I have Auctex and auto indentation set in my `~/.emacs` but it doesn't work correctly for `\end{enumerate}`. If I had the following, (below is what would happen if I hit tab on the `\end{enumerate}`               \begin{enumerate}       \item         text       \item         text       \end{enumerate}      So when I hit tab to auto align `\end{enumerate}` it aligns with `\item`. This doesn't happen for other begin and enter commands so it is isolated to enumerate only. How can I fix this?


title: Download files and create same file structure as the source

text: I have a config file which consists of list of URIs I want to download. For example,                 http://xyz.abc.com/Dir1/Dir3/sds.exe       http://xyz.abc.com/Dir2/Dir4/jhjs.exe       http://xyz.abc.com/Dir1/itr.exe      I want to read the config file and and copy each URL but at the same time create the same directory structure as on the host. For example, for the first line in the config file, I want to create the directory structure Dir1/Dir3 on my local machine (if it doesn't exist) and then copy sds.exe to .../Dir1/Dir3/ I found that I can download all the URLs in a file using 'wget -i' but how can I create the corresponding directory structure with that


title: Ubuntu: how do you swap eth0 and eth1? (Ubuntu 13.10 server in a VirtualBox VM)

text: I installed Ubuntu 13.10 server (64-bit) in a VirtualBox 4.3.6 VM (Windows host) with one NAT adapter assigned. The only non-default software selected during installation was OpenSSH. So far so good... I could ping the world and the address is 10.0.2.15 as would be expected (per ifconfig the NAT adapter is eth0 at this point). I want to access the VM via the host without any port-mapping. Since bridging isn't an option (I can't get a second direct IP from outside the host) I created a host-only adapter (with DHCP enabled and all), edited /etc/network/interfaces (duplicating the eth0 defaults for eth1), shut the VM down, attached the new host-only adapter (selected paravirtualized), and rebooted. At this point /etc/network/interfaces contained the following:               auto lo     iface lo inet loopback          auto eth0     iface eth0 inet dhcp          auto eth1     iface eth1 inet dhcp      And indeed it all works... but per ifconfig the NAT adapter is now eth1, while the newly-added host-only adapter is eth0. I want it the other way around - and that leads to all kinds of problems! First I tried adding the MAC addresses to the interfaces file, e.g., "hwaddress ether xx:xx:xx:xx:xx:xx" as I expect it to be for eth0 and eth1. No joy... that ends up breaking networking entirely. I commented out those lines and rebooted (I actually had to disable that host-only adapter and reboot again, then I could finally re-enable it... this may be a clue.) Reading further, I see many references to updating /etc/udev/rules.d/70-persistent-net.rules to swap the MAC addresses. Great idea! Except that _other than a README file /etc/udev/rules.d is completely empty._ I tried "sudo udevadm trigger" (and a few permutations thereof)... no change. **So question #1: what happened to 70-persistent-net.rules? Is that deprecated? /etc/udev/rules.d is empty except for a README file.** Next, I tried the following: sudo ifconfig eth0 down sudo ifconfig eth1 down sudo ifconfig eth0 hw ether xx:xx:xx:xx:xx:xx sudo ifconfig eth1 hw ether yy:yy:yy:yy:yy:yy sudo ifconfig eth0 up sudo ifconfig eth1 up Hmm. ifconfig now reports the expected mac addresses but the IP addresses are still as they were. So I reboot... And again, networking is broken (it is around this point that one learns the merit of editing /etc/init/failsafe.conf to shorten network delays during the networking debug process). The contents of /etc/network/interfaces are unchanged from how they look above. ifconfig now reports that eth0 and eth1 have the same (NAT adapter MAC) address even though I really did swap the MAC addresses above. Restore the MACs per the same procedure and reboot and we're back where we started (eth0 = host-only and eth1 = NAT). **Therefore, the main question is: how do you swap eth0 and eth1 correctly on Ubuntu 13.10?** On CentOS (given DHCP) it was as easy as swapping the MAC addresses in /etc/sysconfig/network-scripts/ifcfg-eth0 and ifcfg-eth1 and then rebooting. On Ubuntu _it's like pulling teeth_... everything that should work won't work, and I am stumped. I suspect there's something relatively new going on under the hood (thus the "missing" rules files and so on) but what could it be? Note that the network-manager isn't installed by default either (and it's definitely not present). * * * **Update:** Just for grins I created another VM with the same default server setup (including OpenSSH as before), with one network adapter (NAT). No change - networking works as it normally would for this configuration, but there's nothing in /etc/udev/rules.d except a README file (I even checked as root... nothing).


title: Troubleshooting a Kali Installation

text: I tried to install Lali Linux on VMware Workstation but got the following problem: ![enter image description here](http://i.stack.imgur.com/MWVS8.png) How can I fix it?


title: Writing a service in C: How to pass and process arguments to running service?

text: I want to write a service in C. While this service is running in background and processing some information I need to grab the results from this service from other applications or from command line. Background: I need a C application/service due to performance issues. The UI will be implemented in a higher language like Java or C#/Mono on Linux. The C application will basically process data, which will come in from another source. The UI layer should be able to grab the results in a loop every few milliseconds for example and display it to the user. Also it should be possible to pause/start/configure the service from the Java application. Thats where the question begins. How do I implement the service in C, so that it can respond to commands in runtime? Thanks, Eduard


title: SSH cannot connect from Remote computer after a while

text: I can successfully connect to Debian via SSH.   The problem is that after a while--1 or two days I think--it depends on the number of times I connect, Ii cannot connect remotely.. **only locally**. The machine must be restarted in order to reconnect. I haven't seen the error myself yet as they restart it at 4am in the morning and i am not there, but it is like "networking down" ? "connection table ...something".. Any ideas what I can do to trace/solve this problem ?   I get this also in the sshd log when it is down.. > debian exim4: gethostby*.getanswer: asked for "debian IN AAAA", got type "A"


title: What's wrong with my bash script?

text: I am trying to utilize zenity in my simple `ffmpeg-cut-mp3` script, but it hangs after the input into zenity :/ What's the matter with this?               #! /bin/bash          start=$(zenity --entry --title="CutMp3" --text="Start time ? (hh:mm:ss.ms)") &          duration=$(zenity --entry --title="CutMp3" --text="Duration in seconds ?") &          gnome-terminal -x ffmpeg -ss "$start" -t "$duration" -i "$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS" -acodec copy "$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS" &&          zenity --notification --text "File cut !"


title: Overwriting line in unix shell after printing

text: How can I modify a line after printing it in unix shell.We can delete the line and write again by using `\r` as shown below,but how can I overwrite on existing line and not delete it completely and get the output as in Expected output below. **Command:**               printf "12345";printf "\r67";      **Output:**               67      **Expected Output**               67345


title: how to look the value of thedata by lookup index?

text: I have list of data array which I want to look the values by its index (id) and store to the index id from the data array. I can do it in spreadsheet VALUE LOOKUP function, but I still have lots of data to do this and I don't think spreadsheet function will be fast for huge data sets. I want you help me to let me know the script that can do it faster. My data array, index id and proposed out put is as follows. data array               Id  Value           1    10     2    20     3    30     4    40     6    60     8    80     10   100      index               Id           1     2     3     4     5     6     7     8     9     10     11     12     13      Output will be               ID    Value     1  10     2  20     3  30     4  40     5  NULL     6  60     7  NULL     8  80     9  NULL      10 100     11  NULL     12  NULL     13  NULL      Thank you for helping again.


title: Why do I see different versions of bash history for the same user

text: I ssh into my servers using root. Sometimes when I scroll back in my history, I see a history from an earlier session, but not the last session. Why does this happen with the same user account? Is it related to the tty I am using? Bash 4


title: Postfix not responding to telnet

text: I am doing a Postfix installation on CentOS 6.5 I can't get `# telnet localhost 25` to do more than this:               Trying ::1...     Connected to localhost.     Escape character is '^]'.     EHLO                    ^]     telnet> quit     Connection closed.      I have gone through the `/etc/postfix//main.cf` and made the changes I need to I have set the `myhostname =` to the `# hostname -f` name in bash, plus all the others as per all the advice- one thing I have done is set the `mynetworks =` to `mynetworks = 127.0.0.0/8, 123.234.18.208/30` because I need external IP's `123.234.18.208` , `123.234.18.209` , `123.234.18.210` , `123.234.18.211` to all appear as local networks


title: set LC_* but not LC_ALL

text: I'd like to have a German (Austria) locale (A4 paper size, 24 hour time, yyyy- mm-dd), but an English-language user interface (I don't like poor translations). I figured that the correct way to achieve this is to set the `LC_` variables as follows in my `.bashrc` (please correct me if I'm wrong):               LC_MESSAGES=en_US.UTF-8     LC_$everythingelse=de_AT.UTF-8      Is there a more elegant way to set LC_$everythingelse rather than setting every single value? Setting LC_ALL is not an option, since it takes precedence over LC_MESSAGES:               $ export LC_ALL=de_AT.UTF_8     $ export LC_MESSAGES=en_US.UTF_8     $ echo $LC_MESSAGES     en_US.UTF_8     $ locale | grep LC_MESSAGES     LC_MESSAGES="de_AT.UTF_8"      PS: It's a shared machine and I'm not sudoer, so changing system-wide settings is not an option.


title: Debian wheezy re - installation

text: I am new to linux and I wanted to start learning it. So, I had installed debian. But while installation, I forgot to give username and password for login and also for root. Is it possible to log in to debian now without the username and password being set during installation? If that is not possible, how do I re-install debian. Shall I just do it the same way I did the last time(by inserting the DVD?)? If I re-install then during partitioning should I free both the main partition and the "Swap" partition or is it enough if I just delete the main partition.


title: Renaming a bunch of files but keeping the number part

text: I have a bunch of files like this:               pic100.png     pig102.png     box103a.png     superb103b.png     px103c.png     rotor110 - new.png     ready1323 (yellow car).png     motorhome1036x red circle.png     ...      so, you can notice that files may have 3 parts:   * a prefix that can be any string   * a number that may contain a suffix like "a", "b", etc.   * an optional ending, that is always a string and starts with a space, like " (yellow car)", " red circle", etc. What I need is this: I want in one operation to:   * change the prefix to the one I want   * keep the number and the suffix (a, b, c...) if there's one    * get rid of the ending using the first example, I may want to transform that in               object100.png     object102.png     object103a.png     object103b.png     object103c.png     object110.png     object1323.png     object1036x.png      how do I do that? As you see the only thing I am keeping is the number and the suffix "a, b, c" when there is one... To make it simple, the command must operate in all files in a given directory. Thanks in advance.


title: How do you make tmux count windows starting with 1 instead of 0?

text: I was able to make GNU Screen start counting windows with the number 1 instead of the default 0 with this code in my .screenrc:               # Get rid of screen 0     bind c screen 1     bind ^c screen 1     bind 0 select 10      When I created windows in .screenrc I used `screen 1` so that it would first try 1 and then count up if that window number was taken.


title: How does this shell command work?

text: The following command puts the content of the local `id_rsa.pub` into the `authorized_keys` file on the host. But I don't quite understand how `cat` and `|` works together to achieve this goal, can someone explain?               cat .ssh/id_rsa.pub | ssh b@B 'cat >> .ssh/authorized_keys'


title: Store a file for all users within a group

text: If user A is member of group foo, is it then possible for A to share a file for all members within foo without root permissions?               chown foo:foo file       Is not permitted without privileges. A can say               chmod o+rw file      but if A do not want to make it public for other users than those within foo, that does not work.