title: How to see the amount of pending data on a unix domain socket?

text: When I'm logged to a `tmux` session from two different computers, I'd like to be able to trace the amount of pending data on the sockets of both `tmux` session. To test this I logged to computer `A` and to computer `B`, then from computer `B` I used ssh to login to computer `A`. From each console I attached to the same `tmux` session and started running a script which prints the iteration number from 1 to 100M. Indeed, I see that the numbers of the iterations printed in the local (`A`) console are larger than the numbers printed in the remote console (`B`) since it takes time for the messages to travel to the remote computer               [user@server00 ~]$ lsof | grep tmux | grep unix     tmux      1073     user    4u     unix 0xf6dc2ac0       0t0   18681 socket     tmux      1073     user    5u     unix 0xf6dc3840       0t0   18682 socket     tmux      1073     user    6u     unix 0xf137ed00       0t0   19768 socket     tmux      1073     user    7u     unix 0xf6dc2880       0t0   18683 /tmp/tmux-1000/default     tmux      1073     user    8u     unix 0xf6cbcd80       0t0   22647 /tmp/tmux-1000/default     tmux      1073     user   14u     unix 0xf137ef40       0t0   12146 /tmp/tmux-1000/default     tmux      1092     user    4u     unix 0xf6cbd200       0t0   24848 socket     tmux      1092     user    5u     unix 0xf6cbef40       0t0   24849 socket     tmux      1092     user    6u     unix 0xf6cbed00       0t0   24850 socket     tmux      1177     user    4u     unix 0xf137fcc0       0t0   19947 socket     tmux      1177     user    5u     unix 0xf137fa80       0t0   19948 socket     tmux      1177     user    6u     unix 0xf137c240       0t0   19949 socket     [user@server00 ~]$ netstat -a | grep tmux     unix  2      [ ACC ]     STREAM     LISTENING     18683    /tmp/tmux-1000/default     unix  3      [ ]         STREAM     CONNECTED     12146    /tmp/tmux-1000/default     unix  3      [ ]         STREAM     CONNECTED     22647    /tmp/tmux-1000/default      Since I see only the path of `/tmp/tmux-1000/default` I was hoping to see its size increasing but its size is always 0               [user@server00 ~]$ ls -l /tmp/tmux-1000/default     srwxrwx---. 1 user user 0 Feb  9 10:45 /tmp/tmux-1000/default      How can I see the data pending on the socket, and how do I know if the socket becomes congested?


title: Evaluating the return value of a command line

text: How do I evaluate or calculate the return value of a command line? For exemple, I count the number of lines with a grep and I want to know if that value is above X. If so, I want to print the number to a file. Or I want to substract the value of a grep count to another grep count... How can I manipulate return values that way ?


title: How to programmatically retrieve the GID of a running process

text: I need to write some C code to check the effective GID of a running process whose PID I know. I've not found any direct way to do this. There are a number of heavyweight kludges I could use, such as invoking `popen("/bin/ps ARGS", "r")` and parsing its output, or `fopen("/proc/PID/status", "r")` and parsing _that_ output, but I'm looking for a cleaner, more direct approach. If only `getegid()` took a PID argument...


title: Where are displays other than ":0"?

text: X Power Tools -book has a sentence about ":0": > Display 0 on the local computer, connected by a local connection scheme I tried to open a clock by "xclock -display :2", but I got an error: > Can't open display: :2 How am I supposed to program if I cannot get displays working? Can you really do everything on it? How can you run programs, such as Vim and gcc, on displays 3 and 999? Where are they?


title: need to install mercurial

text: > **Possible Duplicate:**   >  How do I upgrade python on openSUSE? Hi If you look at my previous question you will find this one as same as that but as I couldn't solve my problem yet I want to ask again, I did tried all your good suggestions but there were no mercurial package in opensuse 10.2(my linux) please give me another sollution which doesn't need packages I'm completely confused and I just installed opensuse 11.1 but it had the same problems(also I'm not familiar with this version and even couldn't find yum) :(   please give me some suggestions for a begginer in Linux, any help to make my program work. Any help would be appreciated.   Bests


title: Is there a standard Unix command to check English verb conjugation?

text: Having recently come across wordlist and wordnet, two great discoveries on their own, I'm now looking for a similar tool, if simpler, that will take the bare infinitive of a verb and return the simple past and past participle. Example:               $ verbteacher throw          Simple past: threw     Past participle: thrown      Does anybody know where to find `verbteacher(1)`?


title: bash execute read command from file

text: After some manipulations, I got the file with commands that I would be glad to be able to execute. Input file (name of file is inp2.txt):               "02 - Beautiful Emptiness.mp3"     "02 - Come. mp3"     "02 - Go For It.mp3"      Code:               #!/bin/bash     exec 4<inp2.txt           # opening  file via descriptor     while read LINE <&4; do         printf "%s\n" "$LINE"  # just to watch that command is proper         $LINE                # execute command     done      **EDIT:** sorry, I omitted important part of code that I thought is not important for understanding. Full code:               #!/bin/bash     IFS='      '     declare LINE     declare BUF     declare a     a=1           rm inp2.txt # delete previous version of file     exec 3< inp.txt # open descriptor for a file()content of it is written above     while read LINE <&3; do  # read it         printf "mv ""$LINE"" %s\n" """$a"".mp3" >> inp2.txt          # form a command and output it to the file, just to make sure that I got a command that I really want         let "a++"  # increment number that will be a part of new unique name     done          exec 4<inp2.txt #open again descriptor with ready commands          while read LINE <&4; do         printf "%s\n" "$LINE"  # check again         $LINE #  here it should be executed, but I get mistakes that  is pointed down     done          exit 0      Output: ![enter image description here](http://i.stack.imgur.com/851Xq.png) It seems that command is proper, but something is wrong and I can't figure out what's wrong exactly.


title: Environment settings on setuid executables

text: I am observing a curious behavior when running a program with `setuid` bit enabled. Program `foo` is owned by user `bar` with setuid bit set. User `execbar` runs `foo` `foo` reports that one of the dynamic libraries is inaccessible. The dynamic library in question is located in a directory outside the normal `ld.so.conf` search paths so it's set via `LD_LIBRARY_PATH` for user `execbar` The question is: Is running a program with `setuid` clears the environment set by user `execbar`?


title: Verify Debian ISO integrity

text: I recently downloaded Debian 7.5.0 Wheezy and managed to use the Release.sig signature to verify the integrity of the Release checksum file using GPG4Win. Unfortunately, I couldn't find any advice on where to find the md5/SHA1/SHA256 checksum inside the Release filw to verify that the ISO is correct/hasn't been corrupted/manipulated. Couldn't find any help regarding this specific problem on the support sites either. I am using Windows 7 if this is relevant. Hope you can help me with this. Cheers Edit: The name of my ISO file is "debian-7.5.0-amd64-netinst". Other versions can be found here (ftp://cdimage.debian.org/cdimage/release/7.5.0-live/amd64/iso-hybrid/) and offer an easier way to verify the integrity because of this file: ftp://cdimage.debian.org/cdimage/release/7.5.0-live/amd64/iso- hybrid/SHA256SUMS. I need to find something like this in the Release file I verified.


title: How do I get the information I need in order to use unison and ssh to synchronise files

text: I have a desktop at home, and a laptop that I take with me to places away from home, both have Fedora 20 installed. I edit the same files on either machine, and would like to be able to synchronise these files over the Internet to keep them identical, and avoid the error prone task of trying to repeat the same edits on the other one. It seems that using `unison` and `ssh` are the way to go, (but if there is a more straightforward method, I would be happy to use that instead, not `diff` and `patch` though) but what I have failed to discover is how to find out the identification details as in this extract from a document on how to use unison:               $ unison -testServer /home/ravisaive/Desktop ssh://172.16.25.125//home/ravisaive/Desktop      The document is: Unison – An Ultimate Local/Remote File Synchronization Tool for Linux By Avishek Kumar Under: Backups On: March 21, 2014 So my question is, please: how do I obtain or define the equivalents of the `172.16.25.125` for my two machines? In other "how to do it" articles I see `plink@plonk` as the form of the identifiers, is this easier, and again how do I discover or define them? Please, I would like an answer that is suitable for my completely novice status on this topic, not the sort that only experts can understand. Please insult my intelligence. * * * A Final plea: I have asked similar questions to this on the Internet and here, and cannot get an answer to what seems to me to be a straightforward question. Here is another quotation, about OpenSSH (From Fedora Wiki, SSH) "The Default fedora setup for the ssh client works just fine for a basic ssh server setup, like the one above. The syntax is even pretty basic, command options username @ address or IP. An example follows.               ssh user@192.168.1.100 "      In my slow dim-witted way I just cannot see where the "user@192.168.1.100" comes from. Perhaps it is so obvious that I shouldn't need to ask, but I can't see it for myself. **_Please_** can someone _explain_ this for me?


title: Mount /home to USB Live Linux

text: do you think that it would be possible to somehow mount /home folder with all the settings to Linux that runs as Live CD from USB key? Imagine that you have /home partition on the disk in the laptop and you want to run Live Linux but you want to have your old settings. Think of it as an alternative to dual boot. Do you think it is possible? What do you think it will be usable? I mean if it will be slow because of USB? What about USB 3.0 - I mean not the cheap version but really fast read/write speeds. Would 8 GB stick will be large enough?


title: How do I associate the Windows key with GNOME menu in Fedora?

text: There is a similar question: How to associate the Fedora Start menu with the Windows keyboard? but it's for KDE 4. Can someone post equivalent steps for GNOME?


title: Modify prompt based on value

text: Suppose I have an environment variable defined in .bash_profile like this: `PS1='\\[\e[31;1m\\][\u@\h \T \w] \\[\e[0m\\]'` This variable makes my Linux prompt show certain information, like thes: `[jeff@node21 01:48:30 ~]` `[jeff@node22 01:48:30 ~]` `[jeff@node23 01:48:30 ~]` `[jeff@master 01:48:30 ~]` When the word "master" appears, I want to capitalize it (I am not to do any work on that node and I want it to stand out when I forget to `rsh` to other nodes). I can't use `sed` on the variable `PS1`, because that doesn't contain the word "master" in it. Ultimately, _I want the prompt to be capitalized when I'm on node "master". Is there a way to evaluate variable "PS1", manipulate the string, and then re- assign it so the prompt works?_


title: How to autofocus already joined channels in irssi with /join?

text: I've got a bunch of windows (>80) in irssi. Quite often I quickly want to switch the active window to #channelX, without knowing which window number it has. Cycling through all of them is useless too of course. I'm not sure where to find the answer, named windows? I messed with autofocus_new_items and window_auto_change but both don't cut it.


title: How to install freetds on centos 6

text: This error occurs to me when i install freetds on centos Machine. What is the problem?? This is Error appears when i installed freetds i installed unixODBC but with version 64 bit How can i Solve this problem               [root@localhost portal]# yum install freetds     Loaded plugins: fastestmirror, refresh-packagekit     Loading mirror speeds from cached hostfile      * base: mirror.crazynetwork.it      * epel: mirror01.th.ifl.net      * extras: mirror.crazynetwork.it      * rpmforge: be.mirror.eurid.eu      * updates: mirror.crazynetwork.it     Setting up Install Process     Resolving Dependencies     --> Running transaction check     ---> Package freetds.i386 0:0.91-2.el5 will be installed     --> Processing Dependency: libtermcap.so.2 for package: freetds-0.91-2.el5.i386     --> Processing Dependency: libreadline.so.5 for package: freetds-0.91-2.el5.i386     --> Processing Dependency: libodbcinst.so.1 for package: freetds-0.91-2.el5.i386     --> Processing Dependency: libodbc.so.1 for package: freetds-0.91-2.el5.i386     --> Processing Dependency: libgnutls.so.13(GNUTLS_1_3) for package: freetds-0.91-2.el5.i386     --> Processing Dependency: libgnutls.so.13 for package: freetds-0.91-2.el5.i386     --> Running transaction check     ---> Package compat-libtermcap.i686 0:2.0.8-49.el6 will be installed     ---> Package compat-readline5.i686 0:5.2-17.1.el6 will be installed     ---> Package freetds.i386 0:0.91-2.el5 will be installed     --> Processing Dependency: libodbcinst.so.1 for package: freetds-0.91-2.el5.i386     --> Processing Dependency: libodbc.so.1 for package: freetds-0.91-2.el5.i386     --> Processing Dependency: libgnutls.so.13(GNUTLS_1_3) for package: freetds-0.91-2.el5.i386     --> Processing Dependency: libgnutls.so.13 for package: freetds-0.91-2.el5.i386     --> Finished Dependency Resolution     Error: Package: freetds-0.91-2.el5.i386 (epel)                Requires: libodbc.so.1     Error: Package: freetds-0.91-2.el5.i386 (epel)                Requires: libgnutls.so.13     Error: Package: freetds-0.91-2.el5.i386 (epel)                Requires: libodbcinst.so.1     Error: Package: freetds-0.91-2.el5.i386 (epel)                Requires: libgnutls.so.13(GNUTLS_1_3)      You could try using --skip-broken to work around the problem      You could try running: rpm -Va --nofiles --nodigest


title: How to print (part of) a man page?

text: The question is: **how do you print only part of a man page?** Currently I do `zcat manpage.1.gz | vim -` and just remove everything I don't want to print. Then I pass that through groff and lpr. Are there better methods?


title: How to use cron + python to regularly adjust screen brightness?

text: I want to use cron and this script (http://askubuntu.com/questions/23593/use- webcam-to-sense-lighting-condition-and-adjust-screen-brightness):               import opencv     import opencv.highgui     import time     import commands               def get_image():         image = opencv.highgui.cvQueryFrame(camera)         return opencv.adaptors.Ipl2PIL(image)          camera = opencv.highgui.cvCreateCameraCapture(-1)          while 1:         image = get_image()         image.thumbnail((32, 24, ))         image = tuple(ord(i) for i in image.tostring())         x = int((int((max(image) / 256.0) * 10) + 1) ** 0.5 / 3 * 10)         cmd = ("sudo su -c 'echo " + str(x) +             " > /sys/devices/virtual/backlight/acpi_video0/brightness'")         status, output = commands.getstatusoutput(cmd)         assert status is 0      crontab: _/30_ *** sudo python /home/username/screen.py However, there are two issues: First, can the while-loop be terminated after 5 sec or so? Second, could anyone please try to improve the script so that lower brightness-levels can be set using the script? Maybe the way the 256 brightness-levels are mapped to the ones that can be set for the screen would need to be changed. Thanks


title: Make bash use external `time` command rather than shell built-in

text: How can I make bash use time binary (/usr/bin/time) by default instead of the shell keyword? `which time` returns `/usr/bin/time`   `type time` returns `time is a shell keyword`   Running `time` is obviously executing the shell keyword:               $ time          real    0m0.000s     user    0m0.000s     sys     0m0.000s     $ /usr/bin/time     Usage: /usr/bin/time [-apvV] [-f format] [-o file] [--append] [--verbose]        [--portability] [--format=format] [--output=file] [--version]        [--quiet] [--help] command [arg...]      `enable -n time` returns `bash: enable: time: not a shell builtin`


title: I am failing to delete a partition on a USB drive/stick

text: I got a partition that is probably created by dd, and is about 200MB on a 4GB USB stick. I am failing to delete it using GParted (the option is greyed on the right-click menu). ![enter image description here](http://i.stack.imgur.com/1h3Vt.png) ![enter image description here](http://i.stack.imgur.com/Axbqm.png)


title: How do I auto-mount internal HDD partitions to dynamic mount points?

text: I would like to auto-mount some partitions the way USB drives and external HDDs are currently mounted on my system. I understand that to auto-mount internal HDDs at startup, I need to place it in the `/etc/fstab` and map its mount point, etc. But I like how my USB drives and external HDDs are automatically mounted to `/run/media/myuser/drive-label` when I plug them in. To do this to my internal HDDs, I'd have to use `udiskctl mount --block-device /dev/sda4` and it then gets mounted to `/run/media/myuser/sda4-label`. Is there a way of doing it automatically on boot? _I'm currently using Antergos (Arch Linux)_


title: Why does `htop` show more process than `ps`

text: In `ps xf`               26395 pts/78   Ss     0:00  \_ bash     27016 pts/78   Sl+    0:04  |   \_ unicorn_rails master -c config/unicorn.rb                                                27042 pts/78   Sl+    0:00  |       \_ unicorn_rails worker[0] -c config/unicorn.rb                                              In `htop`, it shows up like: ![enter image description here](http://i.stack.imgur.com/1elU4.png) Why does htop show more process than ps?


title: Why is there a big delay after entering a wrong password?

text: I notice a weird (well, according to me) thing about passwords. For example, if I type an incorrect password during login, there will be a few seconds' delay before the system tells me so. When I try to `sudo` with a wrong password I would also have to wait before the shell says "Sorry, try again". I wonder why it takes so long to "recognize" an incorrect password? This has been seen on several distributions I use (and even OSX), so I think it's not a distribution specific thing.


title: Is it possible to remove the delay on wrong password?

text: So I type my password incorrectly from time to time. Sometimes for `sudo` sometimes for logging in to my (Ubuntu) machine. In either case, there is a two or three second delay before it gives me a second chance. I understand that this is a security feature, but I'm curious if this could be disabled for the first failed attempt.


title: why slight delay after failed login in tty

text: > **Possible Duplicate:**   >  Why a wrong password gives a big delay Whenever I mistype my password when logging in in a tty, I have noticed that I have to wait for a second before I'm able to log in again. I can't seem to find the reason for this nor what is causing it. I can only think of this being some security layer preventing from bruteforcing logins from a scripted HID attached to the machine. Is there a wayto shorten the delay? If I'm correct I see the same behavior in kdm and other screenlocks.


title: I can't adjust screen brightness of my laptop anymore

text: My laptop has keyboard buttons for adjusting screen brightness. After a Debian Squeeze re-installation, they don't work no more. [ **laptop** ] Acer TravelMate 6592; I use `Fn``<` to decrease the brightness and `Fn``>` to increase it.


title: Boot Linux from UEFI BIOS

text: I'm porting UEFI BIOS. I'd like to download an Linux image (bzImage) to system memory by TFTP in my UEFI shell, and then boot the OS directly. I know we generally need another bootloader to do that. But is it possible to boot Linux in UEFI BIOS? And how?


title: Set visible directories for SFTP access?

text: I am setting up SFTP access to one of my machines running Linux with the Dropbear SSH server. When I SFTP onto the machine remotely, I can see the entire filesystem on it, even if I might not have write access. How to I control what directories a user can see when connecting to my machine via SFTP? For example, what if I only want to make one directory, e.g. /ftp/, visible and accessible? Thanks.


title: Why doesn't rc.local run entirely

text: Here is my rc.local               #!/bin/sh -e     #     # rc.local     #     # This script is executed at the end of each multiuser runlevel.     # Make sure that the script will "exit 0" on success or any other     # value on error.     #     # In order to enable or disable this script just change the execution     # bits.     #     # By default this script does nothing.     /bin/echo 12 > /sys/class/backlight/acpi_video0/brightness     /bin/echo disable > /proc/acpi/ibm/bluetooth          # Samsung at home     /usr/bin/xrandr --newmode "1680x1050_60.00"  146.25  1680 1784 1960 2240 1050 1053 1059 1089 -hsync +vsync     /usr/bin/xrandr --addmode VGA1 1680x1050_60.00     /usr/bin/xrandr --output VGA1 --mode 1680x1050_60.00          exit 0      whose permission is `-rwxr-xr-x`. **The first command works, I can set the brightness of my laptop's monitor.** The following script is to disable bluetooth and to set resolution of my external monitor. Only the first command is correctly executed, not the others. I know that rc.local stops running when a command fails. However, I've tried to run it manually               /bin/sh /etc/rc.local      Everything seems to work correctly, the bluetooth is disabled and the resolution is set without problem. I've also tried to run the first command in terminal               /bin/echo 12 > /sys/class/backlight/acpi_video0/brightness     echo $?      It shows that the first command returns zero. So I don't understand why the system doesn't run all the commands in rc.local. I really need it, especially for the first 2 lines which need root permission.


title: Creative X-Fi alternative for Linux

text: I have a pretty slick Creative X-Fi Titanium (Elite Pro) card in my system. In Windows everything sounds amazing with this card, in Linux I just get generic sound. I can configure ALSA or Pulse to do some 2.0 -> 5.1 upmixing for me easily, but it just doesn't work as well as CMSS-3D does on Windows. I want my hardware upmixing back, X-Fi CMSS-3D Stereo Surround changes everything, And Crystalizer helps too (although some people hate it). Is there any dedicated soundcard out there worth getting over onboard sound that actually fully supports Linux and has officially provided drivers with full functionality on Linux just like on Windows? If not is there some way I can make my on-board audio match my X-Fi in sound quality? Or is my best bet to just shove this card in a Windows machine and stream my sound over ethernet with something terrible like pulseaudio to get the best of both worlds? (As in set up a dedicated sound server) I am assuming the list of modern sound cards fully compatible with Linux isn't big, so surely someone can point out my options?


title: Start the networking from scratch

text: Let us assume I have a computer that for some reasons has had all the networking information, in particular the stuff in /etc, wiped. Furthermore whatever caused the information to be wiped prevents the /etc folder to be modified. I've booted the computer, nothing regarding networking has been set up ( assume the driver for the card is loaded ). Now I need to initilialize and start the network from scratch. Can some describe the needed steps to set up the gateway, routing etc needed for networking? Or at least point me to a reference which does does.


title: How can I change the language in chromium?

text: I've installed chromium, but it deeply sucks that it uses my mother tongue (german) in its UI and for websites by default. I want the english back, like firefox did. I'm using archlinux's default packages. I looked into the settings dialogs, but I found nothing useful.


title: Writing to picture which is scanned document

text: I have a scanned contract and I need to change only a few names and dates in the contract. It's easy to scan the document but impossible to ocr the document and open in *.doc format. Is there an application that is able to reliably change the dates and names in scanned image, so I can print it with other names and dates? thank you for help


title: Inittab seems to ignore remount,rw /

text: I have an embedded system that boots off compact flash and runs with the initrd.img ramdisk mounted as root. When booting, it mounts the initrd image ok in read only mode but then when inittab runs, it seems to skip over the first mount command which is               null::sysinit:/bin/mount -o remount,rw /      I have /etc/fstab setup with the correct options as far as I know:               /dev/root    /    ext2    rw,noauto,noatime    1    1      The system then manages to get me a command prompt and I can then login as root and type the mount command which works without a problem. Furthermore, this same setup has worked on a seemingly identical piece of target hardware. The difference is that I am creating the boot image from my laptop instead of the usual server that we use. My laptop is running a newer version of grub which I use to make a bootloader for the image. Perhaps I also have a newer version of genext2fs which is used to make the image used as the ramdisk. The server is running FC10 but my laptop is using ubuntu so there must be some differences that I'm overlooking which is affecting mount or inittab. Could it be something to do with /dev/null? Why isn't the system remounting the ramdisk image and how can I fix it?


title: Can't get pop down menus to do anything in KDE/QT application GUIs in Ubuntu (Gnome session)

text: I have a brand new install of Ubuntu 10.10 x64 in an attempt to solve the following problem from my previous 10.04 x86 install, but with the exact same problem persisting. When trying to run Amarok or Skype, which I am told produce their GUI component via the KDE and QT frameworks ( I may be misusing these terms but I hope my point comes across ), both of these applications fail to produce menus when a menu producing button is clicked. This of course, makes both of these apps useless. I installed both apps through the Ubuntu software manager, so expected that any KDE runtime dependencies would have been taken care of already. I then installed kdelibs manually from the console, which didn't appear to be installed already, but this didn't seem to change anything. I installed a QT GUI settings management application to see if somehow menus were turned off or something for QT applications, but the QT settings application itself appears to suffer from the same lack of popdown menus... I don't have this problem with any of my Gnome apps. What is wrong here? How can I make these applications work?


title: Mount (or makefs or tunefs or cap or...) option to disallow symlinks?

text: (Other than mkfs.vfat, that is.) Is there a way in Linux to have a filesystem mounted but to prevent symlinks from being made on it? It's fine if this needs to happen at the time the filesystem is created rather than at mount time, and it's fine if this requires a "weird" filesystem (but it can't be vfat; I do want permissions). (An option that allows symlinks but prevents the formation of a graph rather than a tree would be fine too, but IIRC from CS101 that's NP-hard.)


title: What program constantly reads e-mails and could execute actions under certain conditions?

text: I need a program that would be running as a daemon, connecting to mail server and reading inbox of a specified e-mail address (provided with password, of course =) ). If certain conditions are met, it'd execute a script - and there could be many different conditions with many different scripts =) Conditions could include: sender address, e-mail topic&text, etc. Is there any program like I've described?


uploaded file via filezilla to proftp server(on ubuntu 14.04 lts) but reported 550 error               550 download.html: Permission denied     Error:  Critical file transfer error      I try to set the directory to chmod 777 but error is same ftp for download is OK your comment welcome


title: dd is crashing after a few hours of transfer

text: I am trying to clone a external hardrive ( 1.5T ) to a second one ( 3T ) with dd. I am working on Unix and want to create a disk image. Here is the command I am using :               dd if=/dev/disk1 of=/Volumes/FreeAgent\ GoFlex\ Drive\ DENISE/SeaGate_AC.dmg conv=noerror      I have used the following command to check the progress of my transfer:               kill -INFO 1880      At the beginning it was working correctly and here is an example of the output:               8576952+0 records in     8576952+0 records out     4391399424 bytes transferred in 658.085533 secs (6672992 bytes/sec)       But after a while, the terminal is not answering and even my Finder is crashing when I am trying to access the destination HD. I have tried with the option sync with the same result Any suggestions are welcome... Thanks Simon Here is the output of dmesg as suggested by slm:               2Request - begin     com_seagate_IOPowSec00_10_5: GetBufferDescriptor with buffer=0 dataSize=0 task=0     com_seagate_IOPowSec00_10_5-(NA0LVZ12): IssueSAT12Request - SCSITaskStatus 2     com_seagate_IOPowSec00_10_5-(NA0LVZ12): IssueSAT12Request - SendCommand non-zero status,     check condition     com_seagate_IOPowSec00_10_5-(NA0LVZ12): IssueSAT12Request - senseSize 18, respCode 0x72,    senseKey 0x1, addlSenseCode 0x0, addlSenseQual 0x1d, addlLength 0xe     com_seagate_IOPowSec00_10_5-(NA0LVZ12): IssueSAT12Request - returning main line 0     com_seagate_IOPowSecUserClient00_10_5[0x12f7ed00]::externalMethod(2, 0x1102c70, 0, 0, 0)     com_seagate_IOPowSecUserClient00_10_5[0x12f7ed00]::externalMethod(9, 0x1102c70, 0, 0, 0)     com_seagate_IOPowSec00_10_5-(NA0LVZ12)::UpdateSelfTestResults: using     IssueSmartDiagnosticStatus     com_seagate_IOPowSec00_10_5-(NA0LVZ12): IssueSAT12Request - begin     com_seagate_IOPowSec00_10_5: GetBufferDescriptor with buffer=12ee1928 dataSize=200 task=0     com_seagate_IOPowSec00_10_5-(NA0LVZ12): IssueSAT12Request - SCSITaskStatus 0     com_seagate_IOPowSec00_10_5-(NA0LVZ12): IssueSAT12Request - returning main line 1     com_seagate_IOPowSecUserClient00_10_5[0x12f7ed00]::externalMethod(2, 0x1102c70, 0, 0, 0)     com_seagate_IOPowSecUserClient00_10_5[0x12f7ed00]::externalMethod(10, 0x1102c70, 0, 0, 0)     com_seagate_IOPowSecUserClient00_10_5[0x12f7ed00]::externalMethod(1, 0x1102c70, 0, 0, 0)     com_seagate_IOPowSecUserClient00_10_5[0x9ffc000]::externalMethod(0, 0x1102c70, 0, 0, 0)     com_seagate_IOPowSecUserClient00_10_5[0x9ffc000]::externalMethod(23, 0x1102c70, 0, 0, 0)     com_seagate_IOPowSecUserClient00_10_5[0x9ffc000]::externalMethod(1, 0x1102c70, 0, 0, 0)     com_seagate_IOPowSecUserClient00_10_5[0x9ffc000]::externalMethod(0, 0x1152c70, 0, 0, 0)     com_seagate_IOPowSecUserClient00_10_5[0x9ffc000]::externalMethod(24, 0x1442c70, 0, 0, 0)     com_seagate_IOPowSecUserClient00_10_5[0x9ffc000]::externalMethod(1, 0x1442c70, 0, 0, 0)     com_seagate_IOPowSecUserClient00_10_5[0xa014600]::externalMethod(0, 0x112ac70, 0, 0, 0)     com_seagate_IOPowSecUserClient00_10_5[0xa014600]::externalMethod(2, 0x112ac70, 0, 0, 0)     com_seagate_IOPowSecUserClient00_10_5[0xa014600]::externalMethod(12, 0x112ac70, 0, 0, 0)     com_seagate_IOPowSec00_10_5-(NA0LVZ12)::IssueSmartRequest: using IssueSmartReturnStatus     com_seagate_IOPowSec00_10_5-(NA0LVZ12): IssueSAT12Request - begin     com_seagate_IOPowSec00_10_5: GetBufferDescriptor with buffer=0 dataSize=0 task=0     com_seagate_IOPowSec00_10_5-(NA0LVZ12): IssueSAT12Request - SCSITaskStatus 2     com_seagate_IOPowSec00_10_5-(NA0LVZ12): IssueSAT12Request - SendCommand non-zero status,  check condition     com_seagate_IOPowSec00_10_5-(NA0LVZ12): IssueSAT12Request - senseSize 18, respCode 0x72,     senseKey 0x1, addlSenseCode 0x0, addlSenseQual 0x1d, addlLength 0xe     com_seagate_IOPowSec00_10_5-(NA0LVZ12): IssueSAT12Request - returning main line 0     com_seagate_IOPowSecUserClient00_10_5[0xa014600]::externalMethod(2, 0x112ac70, 0, 0, 0)     com_seagate_IOPowSecUserClient00_10_5[0xa014600]::externalMethod(9, 0x112ac70, 0, 0, 0)     com_seagate_IOPowSec00_10_5-(NA0LVZ12)::UpdateSelfTestResults: using IssueSmartDiagnosticStatus     com_seagate_IOPowSec00_10_5-(NA0LVZ12): IssueSAT12Request - begin     com_seagate_IOPowSec00_10_5: GetBufferDescriptor with buffer=12ee1928 dataSize=200 task=0     com_seagate_IOPowSec00_10_5-(NA0LVZ12): IssueSAT12Request - SCSITaskStatus 0     com_seagate_IOPowSec00_10_5-(NA0LVZ12): IssueSAT12Request - returning main line 1     com_seagate_IOPowSecUserClient00_10_5[0xa014600]::externalMethod(2, 0x112ac70, 0, 0, 0)     com_seagate_IOPowSecUserClient00_10_5[0xa014600]::externalMethod(10, 0x112ac70, 0, 0, 0)     com_seagate_IOPowSecUserClient00_10_5[0xa014600]::externalMethod(1, 0x112ac70, 0, 0, 0)     com_seagate_IOPowSec00_10_5-(NA0LVZ12) handling stop request     com_seagate_IOPowSec00_10_5-(NA0LVZ12) IssueModeSelectTimer: shortTime = 1     com_seagate_IOPowSec00_10_5-(NA0LVZ12)::SetModeSelectTimer: using shortime     com_seagate_IOPowSec00_10_5-(NA0LVZ12) IssueModeSelectTimer: complete     com_seagate_IOPowSec00_10_5-(NA0LVZ12): IssueStopUnderDeviceControlCommand     Warning: audit space low (< 5% free)on audit log file-system      My image file is about 17G... **UPDATE #1** Both drives are formatted as `NTFS`. The system they're mounted on is `Mac OSX 10.6.8`. The `GoFlex` software provided by Seagate is being used to access the 3TB drive. The 1.5TB HDD is failing and during boot up `Disk Utility` is failing when scanning the drive.


title: Key letters? Option letters? What are these things?

text: Some GNU and GNU-like tools seem to accept options in a combined manner, e.g. `foo -hgcf` instead of `foo -h -g -c -f`. An example is tar, as in `tar cXbf keepout 20 archive.shar *.txt` instead of `tar -c -b 20 -X keepout -f archive.tar *.txt`. I was under the impression that this "compressed" or "short" style of specifying arguments had a name. Does anyone know what it's called, how I can learn more about it, and how to find out if a tool supports it?


title: Vim :fold of python code not different to C/C++ code

text: When I enter the command `:fold` inside my python code in .py files, Vim inserts the `/*{{{*/` and `/*}}}*/` tags. They, of course, cannot be parsed by python interpreter. When I'm in python I would like something like `#{{{` Do you know how I could do that ? Of course, keeping the `/*{{{*/` for my C/C++ files.


title: Read data from a pipe for a certain amount of time (in seconds)

text: Is there an easy way to create a pipe that only lasts for a given amount of wall time? I want to be able to take a "snapshot" of what's being written STDOUT for a period of time (rather than bytes or lines). Something like `tail -f /var/log/whatever.log | pipe_for_seconds 10 > ./10_second_sample_of_log` I'm using BASH, but if this is dramatically easier in some other shell, I'd like to hear about it.


title: is upstart and supervisord used for the same thing?

text: I have a some jvm based processes that I need to make sure start whenever my server is rebooted, and also if it stops because of an unexpected error etc. I'm running Ubuntu 12.04 in case in matters. I have seen sample upstart scripts and I am sort of leaning that way, but I want to understand what the differences is going with something like upstart or supervisord. Are they used for the exact same purposes or there are differences in functionality?


title: canlock-password - hashed password (?) mysteriously in .emacs

text: In my `.emacs`, this has appeared, for unknown reasons:               (custom-set-variables       ; ...       '(canlock-password "fdd7041be5b...")      And so on, totalling 40 characters and digits. `C-h v` offers this:               canlock-password is a variable defined in `canlock.el'.     Its value is "fdd7041be5b..."          Documentation:     Password to use when signing a Cancel-Lock or a Cancel-Key header.      I use rmail and GNUS, and those use headers, other than that it doesn't remind my of anything, really, but it can of course be something unrelated that I've overlooked. I tried to delete it, but it came back.


title: Printing the line after or before a regular expression match in Bash

text: Given a string like the following:               BASH - Mplayer Playlist Shuffle     http://www.youtube.com/watch?v=IB7SCPtbJM8     metalx1000     BASH - Playing Music     http://www.youtube.com/watch?v=S_-EGoLYCXY     metalx1000     BASH - Burn ISO images with cdrecord in Linux     http://www.youtube.com/watch?v=BxAEGa9NKs8     metalx1000     BASH - replace space in file names     http://www.youtube.com/watch?v=MRlUPV1221Y     metalx1000      What would be the best way to get the titles, the URLs, and the uploaders into separate variables? My thought was to find a way to `grep`, `sed`, or `awk` www.youtube.com, and then print the line above it or below it. Then save it into a variable. I haven't had any luck finding a solution that works.


title: "Missing operating system" error on boot

text: I replaced Windows 8 with Linux Mint. After the installation had completed, I restarted only to face a black screen with `missing operating system`. I thought the problem was with Mint so I decided to try Fedora. Again I got the same problem. How can I fix this problem?


title: I can see my LVM but I can't initialize it. Missing UUID of one of the disks

text: I have had a 2 disk LVM called Data going for about 6 months, and I recently bought a third disk. I installed the disk in the machine, and wanted to format it and extend the lvm onto it, like I've done before. The system refused to format the disk, claiming it was already in use. I looked around for possible solutions, and ended up using dmsetup remove_all. This allowed me to format the new drive, but now it seems the system has problems with one of the two disks in the lvm. I don't know what the next step is. Will try to include as much info as I can. Sda is a 500gb disk for system/swap etc. Sdb and sdc are the two already existing disks, and sdd is the newest addition. Sdb, sdc and sdd are all 3TB disks. I basically just want the lvm restored, and possibly the new disk included in it. It seems like the solution is right in front of me, I just don't quite know what to do.                 root@Localhost:~$ sudo lvdisplay            Couldn't find device with uuid DLdcnb-5EzK-Vhw2-3M10-8JG8-R0X1-OjWyW2.       --- Logical volume ---       LV Path                /dev/Data/cargo       LV Name                cargo       VG Name                Data       LV UUID                avSFsQ-J49l-twOa-j9KM-Dkeg-JDBE-aG1yWC       LV Write Access        read/write       LV Creation host, time Enterprise, 2013-09-22 18:32:06 +0100       LV Status              NOT available       LV Size                5.46 TiB       Current LE             1430792       Segments               2       Allocation             inherit       Read ahead sectors     auto                    root@Localhost:~$ sudo vgdisplay            Couldn't find device with uuid DLdcnb-5EzK-Vhw2-3M10-8JG8-R0X1-OjWyW2.       --- Volume group ---       VG Name               Data       System ID                    Format                lvm2       Metadata Areas        1       Metadata Sequence No  4       VG Access             read/write       VG Status             resizable       MAX LV                0       Cur LV                1       Open LV               0       Max PV                0       Cur PV                2       Act PV                1       VG Size               5.46 TiB       PE Size               4.00 MiB       Total PE              1430792       Alloc PE / Size       1430792 / 5.46 TiB       Free  PE / Size       0 / 0          VG UUID               rR2QmV-cbjs-rOYu-fU62-uEXp-cVfJ-xVHgRp                    root@Localhost:~$ sudo vgchange -ay            Couldn't find device with uuid DLdcnb-5EzK-Vhw2-3M10-8JG8-R0X1-OjWyW2.       Refusing activation of partial LV cargo. Use --partial to override.       0 logical volume(s) in volume group "Data" now active                    root@Localhost:~$ sudo vgchange -ay --partial            Partial mode. Incomplete logical volumes will be processed.       Couldn't find device with uuid DLdcnb-5EzK-Vhw2-3M10-8JG8-R0X1-OjWyW2.       Cannot activate Data/cargo: all segments missing.       0 logical volume(s) in volume group "Data" now active                    root@Localhost:~$ sudo blkid          /dev/sda7: UUID="200fea91-eed3-4634-8303-ef777e6e60a3" TYPE="swap"      /dev/sdb: UUID="jH6LUK-hTsX-035m-mdSY-zfHp-oBaR-THVnC2" TYPE="LVM2_member"      /dev/sda1: UUID="6144b690-afdd-4bd4-a095-a35da926f6bc" TYPE="ext4"      /dev/sda5: UUID="73df5ee2-33fb-495e-ad20-ad33f82996b1" TYPE="ext4"      /dev/sda6: UUID="d7a9d483-ed4a-4220-bf57-576723c636b8" TYPE="ext4"      /dev/sda8: UUID="b5a9d030-d3af-4dfe-b72a-8180128caa11" TYPE="ext4"      /dev/sda9: UUID="a7c62a16-62ee-406d-ad97-4887c823f40f" TYPE="ext4"      /dev/sdd1: UUID="mWr3pU-WDNn-8cG2-Xt0z-fZvo-wzLe-wK7Dv3" TYPE="LVM2_member"                     root@Localhost:~$ sudo fdisk -l          Disk /dev/sda: 500 GB, 500105249280 bytes     255 heads, 63 sectors/track, 60801 cylinders     Units = cylinders of 16065 * 512 = 8225280 bytes             Device Boot      Start         End      Blocks   Id  System      /dev/sda1   *           1          43      345366   83  Linux     Warning: Partition 1 does not end on cylinder boundary.     /dev/sda2              43       60802   488046667    5  Extended     Warning: Partition 2 does not end on cylinder boundary.     /dev/sda5              43        1137     8787555   83  Linux     Warning: Partition 5 does not end on cylinder boundary.     /dev/sda6            1137        1502     2931862   83  Linux     Warning: Partition 6 does not end on cylinder boundary.     /dev/sda7            1502        2285     6289447   82  Linux swap     Warning: Partition 7 does not end on cylinder boundary.     /dev/sda8            2285        2334      393592   83  Linux     Warning: Partition 8 does not end on cylinder boundary.     /dev/sda9            2334       60802   469644210   83  Linux     Warning: Partition 9 does not end on cylinder boundary.     Error: /dev/sdb: unrecognised disk label     Error: /dev/sdc: unrecognised disk label          Disk /dev/sdd: 3000 GB, 3000590369280 bytes     255 heads, 63 sectors/track, 364801 cylinders     Units = cylinders of 16065 * 512 = 8225280 bytes             Device Boot      Start         End      Blocks   Id  System      /dev/sdd1               1      364802  2930272033   83  Linux      Warning: Partition 1 does not end on cylinder boundary.                    picard@Enterprise:~$ sudo pvdisplay -C       Couldn't find device with uuid DLdcnb-5EzK-Vhw2-3M10-8JG8-R0X1-OjWyW2.       PV             VG   Fmt  Attr PSize PFree       /dev/sdb       Data lvm2 a--  2.73t    0        /dev/sdd1           lvm2 a--  2.73t 2.73t       unknown device Data lvm2 a-m  2.73t    0


title: How do I manually install the XPM library?

text: I'm wanting to install SWI-Prolog, however my linux box (more like a tuna can; it's a RasPi) isn't connected to the internet, so I can't just do               sudo apt-get install libxpm-dev      How can I do this succesfully by hand?


title: How do I create a VM from an existing FreeBSD 8.2 PreRelease server?

text: I need to create a VM (VirtualBox) out of an existing `freebsd 8.2 pre-release i386` machine. I need to replicate the exact same environment and I can't rebuild from scratch because FreeBsd 8.2 PreRelease has been discontinued. I have never done this, and I haven't found a good lead yet. What is the classic workflow?


title: USB 2.0 device is not working in USB 3.0 ports

text: I have a Ubuntu 12.04 system. On that system I have one USB 3.0 port. In this port I am trying use my USB 2.0 device, but every time when I plug in that USB 2.0 device into the USB 3.0 port, the system gets hung and I try to shutdown but it won't allow me to. If I continue to match Port types to Device speeds (2.0 to 2.0) everything woks fine. So my question is: How can I allow a USB 3.0 port to use a USB 2.0 device or is there any way to convert a USB 3.0 port to a USB 2.0 port like drivers or something? Am I mistaking the issue I'm having for another type of problem? Here is my `lsub` command output               Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub     Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub     Bus 003 Device 002: ID 046d:0823 Logitech, Inc.      Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub     Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub     Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub     Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub     Bus 002 Device 003: ID 05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB     Bus 002 Device 009: ID 046d:0823 Logitech, Inc.      Bus 002 Device 008: ID 5555:1110 Epiphan Systems Inc. VGA2USB     Bus 002 Device 006: ID 0d8c:0008 C-Media Electronics, Inc.      Bus 002 Device 007: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)      and for `dmesg` command output you can refer this link Suggestions would be appreciated. Thanks in advance.


title: Dual boot Mint/Windows: Lost 8 GBs on Windows side

text: Many dual boot tutorials talk about freeing up space through the disk manager in Windows before attempting a dual boot with Linux -- Out of curiosity I decided to skip this step and just run the Mint installer and let it decide what to do ( Mint 12 / Win 7 ). Results? I'm missing 8 gigabytes of space on the Windows side. Not complaining here ...I deliberately took the risk to see what would happen. So what's your explanation for why this happened and how you would recover the space? This is a Toshiba laptop. Started with 3 primary partitions. There is the Toshiba recovery partition, the Win 7 recovery partition and the Win 7 OS partition. Is this due to the MBR primary partition limitation? An issue with parted? **UPDATE** `df -h` shows the following: > >     Filesystem            Size  Used Avail Use% Mounted on >     /dev/sda5             108G  3.7G   99G   4% / >     udev                  898M  4.0K  898M   1% /dev >     tmpfs                 362M  1.1M  361M   1% /run >     none                  5.0M     0  5.0M   0% /run/lock >     none                  905M  136K  905M   1% /run/shm >   Using the disk utility in Mint I see the following:   * System: 1.6 GB NTFS   * Tl1...etc: 119 GB NTFS   * Extended: 119 GB   * 117 GB ext4   * 1.9 GB swap   * HDDRECOVERY: 10 GB NTFS So the drive is 250 GB -- Windows 7 Disk Manager shows the following:   * Disk 0 Basic - 232.89 GB Divided as follows:   * 1.46 GB Active, Recovery - Simple - Basic   * 111.21 GB NTFS Boot - Simple - Basic   * 109.10 GB Primary - Simple - Basic   * 1.80 GB Primary - Simple - Basic   * 9.32 GB Primary - Simple - Basic So if we subtract the 10 GB recovery partition we get 240 GB. What happened to 7 approx. Gigabytes? **UPDATE 2**   My question has been answered -- thanks. So now I owe an explanation. I am researching this for a new Linux user who'd like a dual-boot config but is having issues with all the tutorials suggesting 'shrinking' partitions in Windows first. Why bother? It's an added step and it's way easier without. Can anyone offer an explanation as to what the advantage is -- ? Seems like a wasted and confusing step for would-be converts.


title: How to specify an ISO as the location of root filesystem for GRUB?

text: I'm trying to understand the Debian "booting from Hard Disk" installation manual. The process is as follows: I copy a `kernel image`, a `ramdisk initrd` and an `ISO` with installer to the hard drive and then configure GRUB to start the kernel and ramdisk, but also I have to tell GRUB, where is the root filesystem (it should be located at the ISO), so that the kernel could pivot root to it. But the debian-supplied grub configurations seem to specify the whole hard drive as the root filesystem, not the ISO file within it: GRUB1:               title  New Install     root   (hd0,0)     kernel /boot/newinstall/vmlinuz     initrd /boot/newinstall/initrd.gz      GRUB2:               menuentry 'New Install' {     insmod part_msdos     insmod ext2     set root='(hd0,msdos1)'     linux /boot/newinstall/vmlinuz     initrd /boot/newinstall/initrd.gz     }      Why would that work? Is GRUB so smart to mount the ISO file on the hard disk as root filesystem, not the whole hard disk? Or do I have to `dd` the contents of ISO right onto the hard disk? Debian is vague on this.


title: SSH LocalCommand on exit

text: In `~/.ssh/config` you can use the `LocalCommand` directive to execute a local command whenever you connect to a remote machine via SSH. But how do I execute a command when I _exit_ an SSH connection? It seems that *.bashrc/.bash_profile* files are not sourced when connection ends or is closed.


title: Are there ways to break into a machine if iptables drops all traffic?

text: Say I install Linux on an blank computer (no other OS, disk is formatted for installation), and I configure this in iptables:               iptables -F     iptables -P INPUT DROP     iptables -P OUTPUT DROP     iptables -P FORWARD DROP      This machine is then directly connected to the internet (internet won't be functional though as no traffic goes in and out). How secure will this machine be? Are there ways to break in to this machine? Let's define 'break in' as reading any file from this machine. If the OS matters, feel free to compare how this would behave using the latest Ubuntu Server edition vs. Arch Linux with only the basics installed.


title: Mount a dropbox directory without installing the dropbox application

text: This is most likely to be a duplicate question, but I could not find a simple answer for my problem. My situation is as follows: I have multiple accounts on different computing clusters. I want to have a common directory where I can save some files and scripts. In particular, I want a way to simply access a `Dropbox` directory with a passwordless connection. So for instance, if I am logged to one of my accounts and I want to run a `python` script to process some of my files, I will like to do something like this:               python /dropbox_path/script.py      Where `/dropbox_path/` is a web link to my `Dropbox` account.


title: Date calculation in script for notification alerts

text: I want to create account expiry alerts therefore I need to write a script which could alert me before 1 month of expiry over email. I'm working on Linux. I can get expiry information as 2015-27-03. I want if 31 days are left in 2015-27-03 by determining current date then I could get an email alert. I'm unable to write a correct if statement.


title: Tunnel traffic through another machine over ssh

text: I want to be able to route a portion of my traffic through another machine over SSH. For example, is it possible to browse the web through the ssh tunnel and also browse the web through your LAN connection without much effort? (i.e. I want a seamless transition from using tunnel to using LAN) Thus it is not a simple _how do I tunnel ALL web traffic through ssh tunnel_ , but moreso _how can I setup a tunnel that I can use at my discretion but not impeded my normal traffic flow_. (Kind of on an as-needed basis) I would like the filtered traffic to be encrypted when leaving the LAN and it could be ftp, ssh, web, mail whatever traffic. Some questions I think I need to answer/address:   * Does this require multiple nics?    * Does this require setting up a proxy?    * Can I even do this the way I want it to function?  Are there other options aside from a tunnel to achieve the result of having some traffic (user decides) encrypted through another machine (outside the LAN) and have other traffic use the normal flow through the LAN and out into the internet world? Edit: If some of the answers depend on specific traffic types I can be more specific and say that web traffic is a primary focus of this. However, other traffic such as IM/Email traffic would be desirable.


title: SSH Connection into LAN without port forwarding?

text: I'm living inside a study union for the next few month. the organisation has its own network and gateways where the students are connected to the internet. problem: I don't have access to the routers but want to install my sftp- server. is there a possibility to access from outside the LAN to my server via sftp?


title: log into a machine through another, with (de)compression at the ends only

text: I have looked all around but couldn't find the answer to a very simply question: I would like to log into machine C from machine A, passing through machine B. However, B is slow, so I would also like my connection to C to be compressed/decompressed at C, tunneled through B, and decompressed/compressed at A. What ssh command should I execute (in machine A) to get a prompt at machine C when:   1. I am physically at machine A.    2. I can use ssh to log directly... 2.1. ... into machine B from A 2.2. ... into machine C from B   3. I cannot log into machine C from A directly * * * [EDIT] This is _not a duplicate_ because:   1. I am not asking how to forward traffic in general, only an ssh connection, so there could be a different answer for the particular case of ssh forwarding through ssh   2. I am asking for compression at the ends (as even the title mentions)


title: Installing Certain PPAs

text: I'm following my own article: Making a Wireless Hotspot When I put in               sudo add-apt-repository ppa:nilarimogard/webupd      I get the message > Cannot access PPA > (https://launchpad.net/api/1.0/~nilarimogard/+archive/webupd) to get PPA > information, please check your internet connection. I use Cylon Linux, which uses the updates from Ubuntu 12.04, basically. I'm using Ethernet. After doing it and responding to an answer, I get               Address already in use                                                                              [fail]     invoke-rc.d: initscript dnsmasq, action "start" failed.


title: Run smartctl on all disks of a server

text: My question is a quite simple , I want to run the command `smartctl -i -A` on all disks that the server have. Think that I've too much server with different number of disks and RAID Controllers, then I need to scan all drivers for a diagnosis. I'm thinking of running `smartctl --scan | awk '{print $1}' >> test.log`, so if I open the test.log I'll have all the drives information in it.   After this I need to run some if or do constructions to scan with `smartctl` all drivers. I don't know if this is the best way to do this, since I need to identify the RAID Controller too. Am heading in the right direction? ## Edit: I'm used to use these commands to troubleshoot: ### Without RAID Controller               for i in {c..d}; do         echo "Disk sd$i" $SN $MD         smartctl -i -A /dev/sd$i |grep -E "^  "5"|^"197"|^"198"|"FAILING_NOW"|"SERIAL""     done      ### PERC Controller               for i in {0..12}; do         echo "$i" $SN $MD         smartctl -i -A -T permissive /dev/sda -d megaraid,$i |grep -E "^  "5"|^"197"|^"198"|"FAILING_NOW"|"SERIAL""     done     /usr/sbin/megastatus –physical     /usr/sbin/megastatus --logical      ### 3ware Controller               for i in {0..10}; do         echo "Disk $i" $SN $MD         smartctl -i -A /dev/twa0 -d 3ware,$i |grep -E "^  "5"|^"197"|^"198"|"FAILING_NOW"|"SERIAL""     done      ### SmartArray & Megaraid Controler:               smartctl –a –d cciss,0 /dev/cciss/c0d0     /opt/3ware/9500/tw_cli show     cd /tmp      ### DD (Rewrite disk block (DESTROY DATA)):               dd if=/dev/zero of=/dev/HD* bs=4M     HD*: sda, sdb…      ### Burning (Stress test (DESTROY DATA)):               /opt/systems/bin/vs-burnin --destructive --time=<hours> /tmp/burninlog.txt      ### Dmesg&kernerrors:               tail /var/log/kernerrors     dmesg |grep –i –E “”ata”|”fault”|”error”      So what I'm trying to do is automate these commands.   I want that the script verify all disks that the host have and run the appropriate `smartctl` command for the case.   Something like a menu with some options that let me choose if I want to run a `smartctl` or some destructive command, if I choose to run `smartctl`   the script will scan all disks and runs the command according to the host configuration ( with / without RAID controller),   and if I choose to run a destructive command, the script will ask me to put the disk number that I want to do this. * * * ## Edit 2: I resolved my problem with the following script:               #!/bin/bash     # Troubleshoot.sh     # A more elaborate version of Troubleshoot.sh.          SUCCESS=0     E_DB=99    # Error code for missing entry.          declare -A address     #       -A option declares associative array.                    if [ -f Troubleshoot.log ]     then         rm Troubleshoot.log     fi          if [ -f HDs.log ]     then         rm HDs.log     fi          smartctl --scan | awk '{print $1}' >> HDs.log     lspci | grep -i raid >> HDs.log          getArray ()     {         i=0         while read line # Read a line         do             array[i]=$line # Put it into the array             i=$(($i + 1))         done < $1     }          getArray "HDs.log"               for e in "${array[@]}"     do         if [[ $e =~ /dev/sd* || $e =~ /dev/hd* ]]             then                 echo "smartctl -i -A $e" >> Troubleshoot.log                 smartctl -i -A $e >> Troubleshoot.log # Run smartctl into all disks that the host have         fi     done     exit $?   # In this case, exit code = 99, since that is function return.      I don't know if this solution is the right or the best one, but works for me!   Appreciate all help!!


title: Unzipping appearing to fail

text: I run:               ~$ gzip -d Mom.img.gz     ^C     ~$      I created `Mom.img.gz` by piping a `dd` to `gzip`. Should I be seeing output? I tried it with the GUI too, and the progress bar didn't move.


title: FreeBSD: Which branch is supported for longer?

text: Can someone help explain the FreeBSD support policy? I'm looking at http://security.freebsd.org/#sup , which says:               Branch      Release         Type        Release Date        Estimated EoL     RELENG_6    n/a             n/a         n/a                 November 30, 2010     RELENG_6_4  6.4-RELEASE     Extended    November 28, 2008   November 30, 2010     RELENG_7    n/a             n/a         n/a                 last release + 2 years     RELENG_7_1  7.1-RELEASE     Extended    January 4, 2009     January 31, 2011     RELENG_7_3  7.3-RELEASE     Extended    March 23, 2010      March 31, 2012     RELENG_8    n/a             n/a         n/a                 last release + 2 years     RELENG_8_0  8.0-RELEASE     Normal      November 25, 2009   November 30, 2010     RELENG_8_1  8.1-RELEASE     Extended    July 23, 2010       July 31, 2012      We haven't decided between FreeBSD 7.x and FreeBSD 8.x yet. We want to go with a FreeBSD branch which is supported for a while. Which release will be supported for longer? RELENG_7, or RELENG_7_3 ? RELENG_7 says "last release", which is a big ambiguous.


title: ssh passwordless login not working on RHEL

text: After following this tutorial for setting up SSH pubkey auth, I cannot seem to get passwordless login to work, It always redirects me to the password authentication. As far as I am aware, I have correctly copied the public key into authorized_keys on the server onto one line and have also removed the trailing "email" address. I am running a windows machine but am ssh-ing through my git bash terminal. I have run the command `chmod 700 .ssh; chmod 640 .ssh/authorized_keys` on the server as the user bob Your help would be highly appreciated. thank you. The output of `ssh -vvv: bob@myserver` is as follows:               $ ssh -vvv bob@myserver     OpenSSH_4.6p1, OpenSSL 0.9.8e 23 Feb 2007     debug1: Reading configuration data /c/Users/bob/.ssh/config     debug2: ssh_connect: needpriv 0     debug1: Connecting to myserver [192.168.0.2] port 22.     debug1: Connection established.     debug1: identity file /c/Users/bob/.ssh/identity type -1     debug3: Not a RSA1 key file /c/Users/bob/.ssh/id_rsa.     debug2: key_type_from_name: unknown key type '-----BEGIN'     debug3: key_read: missing keytype     debug2: key_type_from_name: unknown key type 'Proc-Type:'     debug3: key_read: missing keytype     debug2: key_type_from_name: unknown key type 'DEK-Info:'     debug3: key_read: missing keytype     debug3: key_read: missing whitespace     debug3: key_read: missing whitespace     debug3: key_read: missing whitespace     debug3: key_read: missing whitespace     debug3: key_read: missing whitespace     debug3: key_read: missing whitespace     debug3: key_read: missing whitespace     debug3: key_read: missing whitespace     debug3: key_read: missing whitespace     debug3: key_read: missing whitespace     debug3: key_read: missing whitespace     debug3: key_read: missing whitespace     debug3: key_read: missing whitespace     debug3: key_read: missing whitespace     debug3: key_read: missing whitespace     debug3: key_read: missing whitespace     debug3: key_read: missing whitespace     debug3: key_read: missing whitespace     debug3: key_read: missing whitespace     debug3: key_read: missing whitespace     debug3: key_read: missing whitespace     debug3: key_read: missing whitespace     debug3: key_read: missing whitespace     debug3: key_read: missing whitespace     debug3: key_read: missing whitespace     debug2: key_type_from_name: unknown key type '-----END'     debug3: key_read: missing keytype     debug1: identity file /c/Users/bob/.ssh/id_rsa type 1     debug1: identity file /c/Users/bob/.ssh/id_dsa type -1     debug1: Remote protocol version 2.0, remote software version OpenSSH_5.3     debug1: match: OpenSSH_5.3 pat OpenSSH*     debug1: Enabling compatibility mode for protocol 2.0     debug1: Local version string SSH-2.0-OpenSSH_4.6     debug2: fd 3 setting O_NONBLOCK     debug1: SSH2_MSG_KEXINIT sent     debug1: SSH2_MSG_KEXINIT received     debug2: kex_parse_kexinit: diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1     debug2: kex_parse_kexinit: ssh-rsa,ssh-dss     debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour128,arcfour256,arcfour,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se,aes128-ctr,aes192-ctr,aes256-ctr     debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour128,arcfour256,arcfour,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se,aes128-ctr,aes192-ctr,aes256-ctr     debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96     debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96     debug2: kex_parse_kexinit: none,zlib@openssh.com,zlib     debug2: kex_parse_kexinit: none,zlib@openssh.com,zlib     debug2: kex_parse_kexinit:     debug2: kex_parse_kexinit:     debug2: kex_parse_kexinit: first_kex_follows 0     debug2: kex_parse_kexinit: reserved 0     debug2: kex_parse_kexinit: diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1     debug2: kex_parse_kexinit: ssh-rsa,ssh-dss     debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se     debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se     debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96     debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96     debug2: kex_parse_kexinit: none,zlib@openssh.com     debug2: kex_parse_kexinit: none,zlib@openssh.com     debug2: kex_parse_kexinit:     debug2: kex_parse_kexinit:     debug2: kex_parse_kexinit: first_kex_follows 0     debug2: kex_parse_kexinit: reserved 0     debug2: mac_init: found hmac-md5     debug1: kex: server->client aes128-cbc hmac-md5 none     debug2: mac_init: found hmac-md5     debug1: kex: client->server aes128-cbc hmac-md5 none     debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent     debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP     debug2: dh_gen_key: priv key bits set: 124/256     debug2: bits set: 512/1024     debug1: SSH2_MSG_KEX_DH_GEX_INIT sent     debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY     debug3: check_host_in_hostfile: filename /c/Users/bob/.ssh/known_hosts     debug3: check_host_in_hostfile: match line 9     debug3: check_host_in_hostfile: filename /c/Users/bob/.ssh/known_hosts     debug3: check_host_in_hostfile: match line 8     debug1: Host 'myserver' is known and matches the RSA host key.     debug1: Found key in /c/Users/bob/.ssh/known_hosts:9     debug2: bits set: 516/1024     debug1: ssh_rsa_verify: signature correct     debug2: kex_derive_keys     debug2: set_newkeys: mode 1     debug1: SSH2_MSG_NEWKEYS sent     debug1: expecting SSH2_MSG_NEWKEYS     debug2: set_newkeys: mode 0     debug1: SSH2_MSG_NEWKEYS received     debug1: SSH2_MSG_SERVICE_REQUEST sent     debug2: service_accept: ssh-userauth     debug1: SSH2_MSG_SERVICE_ACCEPT received     debug2: key: /c/Users/bob/.ssh/identity (0x0)     debug2: key: /c/Users/bob/.ssh/id_rsa (0xa01a478)     debug2: key: /c/Users/bob/.ssh/id_dsa (0x0)     debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password     debug3: start over, passed a different list publickey,gssapi-keyex,gssapi-with-mic,password     debug3: preferred publickey,keyboard-interactive,password     debug3: authmethod_lookup publickey     debug3: remaining preferred: keyboard-interactive,password     debug3: authmethod_is_enabled publickey     debug1: Next authentication method: publickey     debug1: Trying private key: /c/Users/bob/.ssh/identity     debug3: no such identity: /c/Users/bob/.ssh/identity     debug1: Offering public key: /c/Users/bob/.ssh/id_rsa     debug3: send_pubkey_test     debug2: we sent a publickey packet, wait for reply     debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password     debug1: Trying private key: /c/Users/bob/.ssh/id_dsa     debug3: no such identity: /c/Users/bob/.ssh/id_dsa     debug2: we did not send a packet, disable method     debug3: authmethod_lookup password     debug3: remaining preferred: ,password     debug3: authmethod_is_enabled password     debug1: Next authentication method: password         bob@myserver's password: <cursor>      **UPDATE:** I have tried to create a key using cygwin this time and it has given me the output as described in the tutorial (with the random key art at the bottom), It has not worked :(


title: Can't use SSH anymore after installing denyhosts

text: so I'm in a very tricky situation. I've installed denyhosts on my debian machine and suddenly I can't use SSH anymore. Hopefully I could still login through webmin, but with root, so I had to login with another user and then "su". I flushed the IPtables, changed the port of SSH back to 22 (I had it previously changed) and tried to remove denyhosts : aptitude remove denyhosts. It doesn't seem to work: E: Waited for /usr/bin/apt-listchanges --apt || test $? -ne 10 but it wasn't the re E: Failure running script /usr/bin/apt-listchanges --apt || test $? -ne 10 at this point I really don't know what to do, I still can't connect through SSH and I only have this text terminal in webmin that allows me to do it but very slowly. Any idea ? PS: When I do an aptitude upgrade now I get an error:               Get:1 http://security.debian.org/ squeeze/updates/main file amd64 5.04-5+squeeze 5 [50.3 kB]                                                                           Get:2 http://security.debian.org/ squeeze/updates/main libmagic1 amd64 5.04-5+sq ueeze5 [236 kB]                                                                       Fetched 286 kB in 0s (622 kB/s)                                                       dpkg-deb: unrecoverable fatal error, aborting:                                         wait for subprocess tar failed: No child processes                                   close failed in file object destructor:                                               IOError: [Errno 10] No child processes                                               Traceback (most recent call last):                                                      File "/usr/bin/apt-listchanges", line 237, in <module>                             main()                                                                              File "/usr/bin/apt-listchanges", line 102, in main                                      pkg = DebianFiles.Package(deb)                                                      File "/usr/share/apt-listchanges/DebianFiles.py", line 133, in __init__                 self.binary  = pkgdata.Package                                                    AttributeError: ControlStanza instance has no attribute 'Package'                     E: Waited for /usr/bin/apt-listchanges --apt || test $? -ne 10 but it wasn't the re                                                                                E: Failure running script /usr/bin/apt-listchanges --apt || test $? -ne 10       A package failed to install.  Trying to recover:          I get the same kind of error when I do a install or reinstall denyhosts...


title: /bin /etc /lib64 /root /sbin deleted or moved by mv folder/* /* while su

text: OS is Centos 6.5 64-bit I downloaded a tar file and wanted to untar and `mv` it. I untared, then accidentally (as root) ran `mv folder/* /*` instead of `mv folder/* .` bash said it couldn't overwrite some files, then asked permission for others. I ctrl-c'd out. I've left terminal session open, but have exited `su`. Now I've lost access to most `shell` commands, can't `ls` any directories and can't get back to `su`. The webserver and services still seem to be running. I can run very few commands, `cd` is one of them and when I try to `cd` to `/etc` or `/bin` it errors with `no directory found`. _EDIT_ Just noticed all folders missing from `/` (`bin`,`etc`,`lib64`,`root`,`sbin`) got moved to `/var` directory, I tried `/var/bin/su` & get: `-bash: /var/bin/su: /lib64/ld-linux-x86-64.so.2: bad ELF interpreter: No such file or directory`


title: How could running strace be fixing my OpenGL issue?

text: Since a recent major upgrade to my distribution (PLD Linux), I have been having trouble with a whole slew of programs. As best I can tell, anything that touches OpenGL or PulseAudio segfaults. I'm using the proprietary nvidia drivers and a 3.2.x kernel. Xorg itself runs fine and I am able to run most programs, however things like mplayer segfault and no sound is produced by any program. Once I figured out that it might be related to OpenGL, I started playing with `glxgears` as a test. Running it by itself segfaults instantly. Then I discovered that running it under `strace` runs fine. The same thing is true for `mplayer`. Running it on a test mp3 file segfaults instantly, running `strace mplayer` plays just fine (although pulse audio still dies and it reverts to a dummy output device). How could running something under `strace` keep it from segfaulting and how would I continue to debug the situation?


title: Bash split a list of files

text: I have 200 files in a folder like: `test_1_cfg.dat`, `test_2_cfg.dat`,.... and so on. I need to include in a bash script the first 40 files as input and run some process, another script to read the next 40 files and run another process. So I was thinking of a way to have a list of the names of the files and then just split that list but I'm not sure how to do it in bash. Any idea?


title: Updating FreeBSD 8.0 to 8.1 (methods and policy)

text: I have 8.0-RELEASE-p4 + few ports installed. I wonder wheather I should update to 8.1.   1. How long is 8.0 supported?   2. How to update the system? I couldn't find anything about it in handbook. **SOLUTION** (based on gvkv answer): I take the liberty of describing all steps I've done at the end:               # STEP 1: Revert to GENERIC kernel     cd /tmp      wget -r ftp://ftp.freebsd.org/pub/FreeBSD/releases/i386/8.0-RELEASE/kernels/     cd pub/FreeBSD/releases/i386/8.0-RELEASE/kernels/     sha256 generic.* install.sh | diff - CHECKSUM.SHA256     ./install.sh GENERIC     nextboot -k GENERIC     # STEP 2: Upgrade - part 1     freebsd-update upgrade -r 8.1-RELEASE # Ignore kernel warning. Fix configuration     freebsd-update install     shutdown -r now     # STEP 3: Upgrade - part 2     nextboot -k GENERIC     freebsd-update install     shutdown -r now     # STEP 4: Upgrade - part 3     rm -rfv /usr/obj     portmaster -Raf # Rebuilds all packages. If you don't use portmaster use other tool or do it manually     cd /usr/src     make buildkernel KERNCONF=CUSTOM # Rebuild kernel     make installkernel KERNCONF=CUSTOM # Install kernel     shutdown -r now


title: Force shell command to return

text: I'm running a command (not part of the standard distro) that sometimes does not return the cursor. That is, I have to press enter myself. The issue is that if I want to do it from a C++ program, the function system may not return. Is there an alternative to run the program in background, and force it to return?


title: Run emacs elisp command with next word as argument

text: How can I tell emacs to run my own script (which can be elisp too or something in Perl, BASH or whatever), and use the next word after the mouse cursor as argument, or maybe using a group of marked words? The output would be in another buffer.


title: Rescue /usr/bin on Debian Wheezy?

text: I accidentally deleted the /usr/bin directory. Using a bootable usb, is it possible to rescue my machine?


title: Share Home Directory between Arch and Ubuntu

text: Before I start asking my question, I would like you to know that I am aware of the "Different linux distros sharing the same /home folder?" question already asked on this website. It did not quite answer my question though, and as it's too broad I don't think it ever will. Is it possible to share the user directory between Ubuntu and Arch, and how to make that work? I'm talking about what's known as `~`. I already have Ubuntu installed, but I am really annoyed by outdated packages. I would like to run them next to each other so when I need to use new software I can use ArchLinux. I could just switch completely to ArchLinux, but I don't want to take any risks. (Maybe I'll hate it) Just as a sidenote, my /home is on a different partition, but my users' directories also encrypted.


title: Why is my BCM43142 chipset is not recognised and device wlan0 not found?

text: I'm trying to setup the WiFi connection on my Lenovo B590 but I get the following error : > >       ifdown: interface wlan0 not configured wpa_supplicant: >       /sbin/wpa_supplicant daemon failed to start run-parts: >       /etc/network/if-pre-up.d/wpasupplicant exited with return code 1 >       Internet Systems Consortium DHCP Client 4.2.2 Copyright 2004-2011 >       Internet Systems Consortium. All rights reserved. For info, please >       visit https://www.isc.org/software/dhcp/ >   > > **Cannot find device "wlan0" Bind socket to interface: No such device** > Failed to bring up work-network So I looked up which firmware I need so my Debian 7 Wheezy system could find wlan0. **NOTE:** the wlan chipset is a Broadcom Corp. BCM43142 and its PCI-ID is 14e4:4365 > host@user $ lspci -vnn -d 14e4: |grep Network > > 02:00.0 Network controller [0280]: Broadcom Corporation BCM43142 802.11b/g/n > [14e4:4365] (rev 01) I found this article on the Debian Wiki giving all the steps needed to get it working, I followed them and got no errors anywhere. I set up the WiFi interface with wpa_supplicant but when I run               $ ifdown wlan0     $ ifup wlan0=work-network      I still get the error **Cannot find device "wlan0" Bind socket to interface: No such device** Do you know what is missing for it to work? **EDIT:** below is the `dmesg` output               $ dmesg |grep broadcom -i                                    [    2.574645] usb 1-1.4: Manufacturer: Broadcom Corp     [    6.828086] eth1: Broadcom BCM4365 802.11 Hybrid Wireless Controller 6.20.55.19 (r300276)     [   10.343512] Broadcom 43xx driver loaded [ Features: PMNLS ]      And here is the content of `/etc/network/interfaces`               # The loopback network interface     auto lo          # iface lo inet loopback          iface work-network inet dhcp           wpa-conf /etc/wpa_supplicant/work-network.conf          # The primary network interface     auto eth0     allow-hotplug eth0


title: hostapd will not start via "service" -- but will start directly

text: I am having trouble getting `hostapd` to start as a service. It fails when I try to start it:               $ sudo service hostapd start     [FAIL] Starting advanced IEEE 802.11 management: hostapd failed!      From what I understand, this uses the configuration in `/etc/default/hostapd`:               $ cat /etc/default/hostapd      # Defaults for hostapd initscript     #     # See /usr/share/doc/hostapd/README.Debian for information about alternative     # methods of managing hostapd.     #     # Uncomment and set DAEMON_CONF to the absolute path of a hostapd configuration     # file and hostapd will be started during system boot. An example configuration     # file can be found at /usr/share/doc/hostapd/examples/hostapd.conf.gz     #     #DAEMON_CONF=""     DAEMON_CONF=”/etc/hostapd/hostapd.conf”          # Additional daemon options to be appended to hostapd command:-     #   -d   show more debug messages (-dd for even more)     #   -K   include key data in debug messages     #   -t   include timestamps in some debug messages     #     # Note that -B (daemon mode) and -P (pidfile) options are automatically     # configured by the init.d script and must not be added to DAEMON_OPTS.     #     DAEMON_OPTS="-d"      My daemon configuration file is as follows:               $ cat /etc/hostapd/hostapd.conf     interface=wlan0     bridge=br0     driver=rtl871xdrv     country_code=USA     ctrl_interface=wlan0     ctrl_interface_group=0     ssid=KITT     hw_mode=g     channel=1     wpa=3     wpa_passphrase=georgeisyourfriend     wpa_key_mgmt=WPA-PSK     wpa_pairwise=TKIP     rsn_pairwise=CCMP     beacon_int=100     auth_algs=3     macaddr_acl=0     wmm_enabled=1     eap_reauth_period=360000000      Despite the service failing to start, I am able to start it directly on my own without error:               $ sudo hostapd -d /etc/hostapd/hostapd.conf     random: Trying to read entropy from /dev/random     Configuration file: /etc/hostapd/hostapd.conf     ctrl_interface_group=0     drv->ifindex=3     Configure bridge br0 for EAPOL traffic.     BSS count 1, BSSID mask 00:00:00:00:00:00 (0 bits)     Completing interface initialization     Mode: IEEE 802.11g  Channel: 1  Frequency: 2412 MHz     RATE[0] rate=10 flags=0x1     RATE[1] rate=20 flags=0x1     RATE[2] rate=55 flags=0x1     RATE[3] rate=110 flags=0x1     RATE[4] rate=60 flags=0x0     RATE[5] rate=90 flags=0x0     RATE[6] rate=120 flags=0x0     RATE[7] rate=180 flags=0x0     RATE[8] rate=240 flags=0x0     RATE[9] rate=360 flags=0x0     RATE[10] rate=480 flags=0x0     RATE[11] rate=540 flags=0x0     Flushing old station entries     Deauthenticate all stations     +rtl871x_sta_deauth_ops, ff:ff:ff:ff:ff:ff is deauth, reason=2     rtl871x_set_key_ops     rtl871x_set_key_ops     rtl871x_set_key_ops     rtl871x_set_key_ops     Using interface wlan0 with hwaddr 80:1f:02:d3:cb:b8 and ssid 'KITT'     Deriving WPA PSK based on passphrase     SSID - hexdump_ascii(len=4):          4b 49 54 54                                       KITT     PSK (ASCII passphrase) - hexdump_ascii(len=18): [REMOVED]     PSK (from passphrase) - hexdump(len=32): [REMOVED]     rtl871x_set_wps_assoc_resp_ie     rtl871x_set_wps_beacon_ie     rtl871x_set_wps_probe_resp_ie     urandom: Got 20/20 bytes from /dev/urandom     GMK - hexdump(len=32): [REMOVED]     Key Counter - hexdump(len=32): [REMOVED]     WPA: group state machine entering state GTK_INIT (VLAN-ID 0)     GTK - hexdump(len=32): [REMOVED]     WPA: group state machine entering state SETKEYSDONE (VLAN-ID 0)     rtl871x_set_key_ops     rtl871x_set_beacon_ops     rtl871x_set_hidden_ssid ignore_broadcast_ssid:0, KITT,4     rtl871x_set_acl     wlan0: Setup of interface done.


title: How to Install Fedora Live Desktop 20 in Windows 7?

text: I downloaded the `Fedora-Live-Desktop.iso` and mounting the image produces the following directories.               /isolinux     /LiveOS         |- livecd-iso-to-disk         |- osmin.img         |- squashfs.img      Now how can I make a bootable DVD from this image ? I don't think burning this `Fedora-Live-Desktop.iso` image file will install Fedora.


title: Ubuntu / Unity attach script to Launcher

text: I recently downloaded IntelliJ IDEA and start the app by running `. idea.sh`. The app appears in the launcher while I'm running it, but for some reason when I right click on it I don't get a 'Lock to Launcher' option like I do with other apps. How do I attach it to the launcher? Is it because I'm running a script and not an executable directly that disables that option?


title: Why does `cd` command not work via SSH?

text: I was trying to backup some files via SSH but instead of `tar`'ing the ones I wanted I got my home folder. I did some further testing and it boils down to this:               ssh root@server /bin/sh -c "cd /boot && ls -l"      Which to my surprise lists files in **`/root`** not `/boot`. But if I run the entire `/bin/sh` command from a terminal it properly `cd`'s and prints the `/boot` files. What's happening here?


title: nodm not working on bootup

text: I've setup and used `nodm` in the past (it is extremly simple and easy), but now cannot get it working. My base system is Ubuntu 13.04 server, but I have tried Debian and older Ubuntu servers as well. What I get is my system launching into a TTY, and every 60 seconds my screen flickering like `nodm` is trying to startup. If I manually launc it (`sudo nodm`) it starts and works as expected.


title: Can mouse wheel scrolling work in a /usr/bin/screen session?

text: Is there any way to use the mouse wheel to scroll through the output of a `screen` session? I can use the keypad scroll through previous output in screen after pressing `ctrl+a [`. Is it possible to do this with the mouse wheel? (I'm using putty, but I don't think it's a putty issue, I believe it's a `screen` issue.)


title: Will there ever be a Solaris 12?

text: I'm not trying to be inflammatory with this question! I can't any statements though from Oracle regarding the future of Solaris, and wondered if there were any press releases or official notification of future versions. As I understand it, work has been greatly scaled back on Solaris and it's not being developed at a great rate. Is Solaris 11 the final party, with endless security updates to come but nothing else?


title: flock(2) versus fcntl(2) over a NFS

text: The Perl 5.x documentation states that its implementation of flock(..) will use one of the following native calls, starting at 1 and working toward 3 if unavailable:   1. flock(2)   2. fcntl(2)   3. lockf(3) That's fine. However, you may have noticed their disclaimer that flock(2) should not be used over a NFS. The doc suggests using a -Ud_flock flag to force Perl to use flock(2). The man page of flock(2) (on Redhat) states a similar disclaimer about NFS issues. **My question is, why!?!? I can't seem to find an in-depth article or explanation of WHY flock(2) is unsafe over a NFS.** I've written several test scripts in C and Perl, on both Redhat (where flock(2) is being used) and on Solaris (where fcntl(2) is being used). I ran strace/truss to ensure that Perl was indeed using flock(2) and fcntl(2) respectively. I could not replicate any issues where a lock was not being honored! What gives??


title: How do I tell a script to wait for a process to start accepting requests on a port?

text: I need a command that will wait for a process to start accepting requests on a specific port. Is there something in linux that does that?               while (checkAlive -host localhost -port 13000 == false)       do some waiting          ...


title: What controls turning off during overheating on Linux

text: I started experience overheating (I have a few possible troublemakers for it and the cause is separate question) but I wondered what controls handling of overheating? Sometimes my computer:   * Halts properly ("System is going down NOW")   * Is halted by controller (screen turns blank, goodbye all not written to disk cache) Hence my question - how to change behavior to hibernation and/or hybrid- hibernations (well - arbitrary command - from that point I could handle)? Is is possible to specify treshholds to increase safe limits?


title: Suggestions for a command line IRC client that supports downloads?

text: It's been awhile since I've used IRC and the last time I did was on a windows system with mIRC. I'm interested in finding a command line client that supports downloads and some degree of automation for those downloads. Any suggestions?


title: Can the Fedora installer partition the disk itself?

text: I've been using Ubuntu for a little while now, but I plan on dual-booting with Fedora just to try it. Does Fedora give you the option to partition your disk and dual boot upon installation or do I have to partition the disk before I go into installation?


title: What are the ramifications of running binaries over NFS?

text: Our small business has about 10 employee workstations and an LDAP/NFS server infrastructure. We need to deploy our proprietary application (a compiled binary) on all of the workstations. But since we may be updating our application frequently, we are looking for better options than copying a new version to each station every time an update occurs. We are considering creating an `/opt` share on the NFS server, and mounting `/opt/shared` (or similar) on all of our stations. That way, when we update our application, we can simply put a new one on the NFS server rather than doing it on 10 different stations. Is this a viable option? Are there any drawbacks in performance, security, or maintainability?


title: how to find where buffers/cache are and how to clean them up?

text: I want to create 20gb ram disk for ANSYS to work in yet on `free -g` I see: ![enter image description here](http://i.stack.imgur.com/tzbIP.png) And personally I have not created any ram drives yet. So I wonder how to maximize avaliable ram: how to locate what is using buffers/cache and how to free desired space?


title: The common practice to share file for all users on the same machine?

text: There is a powerful server with few users on it. Each user has gigabytes of data to process. Sometimes a user may want to use other's file, and therefore writes output in other's folder. What's the common practice to do it? I can think of create a /share folder and make it rwx to all. Is this the common practice? Any better location for this folder? (Kind of feel that create a folder at / (root) for this purpose isn't good :S)


title: Using sort with alphanumeric filenames

text: I'm sorting the results of a `find` command which finds all of the files in the current directory:               find . -maxdepth 1 -type f -iname "*.flac" | sort      What I'm expecting is a list like this:               ./Track 1.flac     ./Track 2.flac     ./Track 3.flac     ...     ./Track 9.flac     ./Track 10.flac     ./Track 11.flac      What I'm getting is a list like this:               ./Track 10.flac     ./Track 11.flac     ./Track 1.flac     ./Track 2.flac     ./Track 3.flac     ...     ./Track 9.flac      Is there an option to `sort` which will put them in alphanumeric ascending order so that numbers are evaluated properly?


title: Sudden burst in free memory

text: I'm experiencing some strange memory management behaviour on Squeeze with Kernel 2.6. I'm trying to get to the bottom of this with nmon. Sometimes this will freeze up the system for 30 seconds to 5 minutes. The server has 4GB of RAM. The figures from nmon are:   * +1.6GB memfree.    * cached dropped by ~350MB   * swapcached dropped by ~80MB    * swap free jumped by ~200M   * active memory dropped by ~1.3GB When this happens, the server isn't near any limits. Very soon after it happens, the active memory creeps back up, along with cached... and naturally memfree drops. This doesn't appear to be a runaway process. The OS just seems to reallocate a bunch of ram very suddenly, then it slowly reallocates it back. Swappiness shouldn't be a factor because swap is barely ever touched. Is there any way to track what is happening? Why does this free memory suddenly appear in seconds, only to be given back to the cache within 30 minutes?


title: Can't login on OpenSuse:  "No logon servers"

text: I have installed OpenSuse at work, and my admin fixed some problems with my login. The login worked at work, I also restarted PC and tried it after restart, it was fine too. But then I came home I couldn't login (both GUI and terminal doesn't work), it says **"No logon servers"**. I thought that's only a problem at home, but I tried it at work and I'm getting the same message. Login as root works, but my login not. How can I try to fix the "No logon servers" problem?


title: Porting GNOME keyboard shortcuts to URXVT

text: I recently switched from `gnome terminal` to `urxvt`. I am also a heavy `emacs` w. tabs user which uses a lot of key combinations similar to `urxvt` (tab related stuff) like `Shift-Left` and `Shift-Right`. These key- combinations are set for selecting text in `emacs`. Is there a way to map `ALT-1`, `ALT-2`, `ALT-3` for tabs `1, 2, 3 ..`? Is there an extension to do that ? Can it be achieved through the `~/.Xdefaults` file ?


title: A system-wide way to set or get $JAVA_HOME in Ubuntu?

text: I wonder whether Ubuntu itself provides a system-wide way to find the current JAVA_HOME or whether there is right place for setting JAVA_HOME. Mac OS X does well in this, for `/usr/libexec/java_home` command returns the current JAVA_HOME. But to Ubuntu, the materials I found always told me to set the $JAVA_PATH pointing to a static path like ````, which is stored in`~/.bash_profile```. I think, however, this approach has several drawbacks:   1. Once Java updates, the mini version number will change, which makes the static path no longer available.   2. After changing the JRE used in my system with `update-alternatives`, I have to modify $JAVA_HOME in .bash_profile. That extra work is annoying.   3. Some $JAVA_HOME-required programs, is not aware of `.bash_profile` at all. I have to set $JAVA_HOME in their start-up script, therefore a standard-and-easy way to get $JAVA_HOME seems critical to me. Well, any advice is welcomed. Thanks.


title: Why does MemTotal in /proc/meminfo change?

text: I monitor value from `/proc/meminfo` file, namely the `MemTotal:` number. It changes if a ram module breaks, roughly by size of the memory module - this is obvious. I know the definition for the field from kernel documentation:               MemTotal: Total usable ram (i.e. physical ram minus a few reserved               bits and the kernel binary code)      The `dmesg` also lists kernel data. What other particular actions make the `MemTotal` number change if I omit hardware failure of the memory module?


title: How can I compile DSniff on Kali Linux?

text: For some reason, Dsniff isn't found on my Kali system. So I downloaded the DSniff tar.gz file and extracted it on my desktop using:               tar zxvf dsniff-2.3.tar.gz     cd dsniff-2.3     ./configure && make && make install      I get the following error:               checking for Berkeley DB with 1.85 compatibility...configure: error: Berkeley DB with 1.85 compatibility not found.      How can I get Dsniff installed & working?


title: what does Curl's stand-alone hyphen (-) mean?

text: what's the stand-alone hyphen (between the `-C` & `-O`) stand for in this command?               curl -C - -O http://www.intersil.com/content/dam/Intersil/documents/fn67/fn6742.pdf      FWIW- I'm following a tutorial here.


title: apt-get equivalent of yum localinstall

text: When using Fedora I usually use `yum localinstall` as a way to install a rpm obtained outside the distribution repositories. I can't find an equivalent option in the `apt-get` man page. I'm running Ubuntu 11.04, if that matters. What is the `apt-get` equivalent of `yum localinstall`? Should I use `dpkg` directly in this case?


title: Execute Script automatically at shutdown on Fedora 15/16

text: With fedora 15 or 16, I don't find the directory for execute a shell script automaticaly at shutdown...


title: A secure way to confine FTP login users to a single directory

text: I needed to provide multiple users FTP logins, some able to write, some only to read, to a single FTP root directory. I very much wanted that they not see of the file system anything above that directory. After searching--it appears this is a common problem--I defined the user_local config option as the root directory and confined the users to that directory using the chroot_local_users option, or chroot jail. This basically works. My problem is that, though I do not know why, relying on chroot jail for security is frowned upon generally and most importantly by (at least one member of) the kernel development team. So, how can I confine my login users to (even) seeing nothing above the defined root directory without chroot jail?? (this is the "secure" part of the question alluded to in the title) Also, for security reasons (that I do not yet understand), modern versions of `vsftpd` do not allow the user's root directory to be writable, thus leaving two options: 1. or to disable the security feature and leave the root writeable or 2. to remove the write bits from the root and create a writable sub-directory therein. The former is playing with fire and the latter is ugly and error prone (users trying to write into the root and getting errors…) I chose the latter. So, how is FTP service done right? Meaning how can users be prevented from seeing irrelevant parts of the file system in secure way? Is FTP an inherently insecure way of distributing files? If so, is there a better way. Trying to get this right…


title: lvm: what's the purpose of a Volume Group?

text: Each Volume Group can have many resizeable Logical Volumes. each of Logical Volume can have different filesystem, encryption options etc. that means having a single Volume Groups is enough. so why LVM introduced the concept of Volume Groups? isn't it just an unnecessary abstraction layer? aren't Logical Volumes enough?


title: Replace all occurrences of a character in a variable using korn script

text: Part of the Korn script I am writing requires that I replace all occurrences of the `'` character with two occurrences (`''`). I am trying to log some SQL that I am generating in this script to a column in another table but single quotes need to be replaced with 2 instances of the single quote character. I know there must be examples of this functionality somewhere but I'm not finding a string replace example specific to variables anywhere.


title: Is it possible to simulate/force/fake an USB device unplug and replug on Linux?

text: So I've got a strange problem that I've been running onto. I've got a bitcoin usb miner, Bitfury, and I'm using CGMiner to mine. When I start the application, as root, the USB device is not detected automatically. CGMiner only detects the stick when it's re-plugged (it detects an hotplug event, and then works as intended) I'd like to set up a headless mini-server, and therefore, I'd rather not stand up and unplug and then replug the device everytime the servers restarts, as I'm too lazy for that, and it's somewhat difficult do to when I'm not physically at my home. So, is it possible to, like, turn off the USB system and restart it? Or is there a better way to do it? Currently, I'm running Fedora 20 on HP t5730 terminal, but I've encountered the problem on Raspbian on Raspberry PI, so I don't think it's something OS- side. Maybe it's the device itself, or CGMiner's fault, but I was yet unable to find anything on that topic.


title: wacom pen & touch cth-460 on debian

text: Following instructions at http://lik.noblogs.org/post/2010/05/07/wacom-debian/ Though, i downloaded and built linuxwacom-0.8.8-11               ./configure --enable-wacom --with-kernel=/usr/src/linux-headers-2.6.32-5-686      completes without any problem, then copy               sudo cp src/2.6.30/wacom.ko /lib/modules/2.6.32-5-686/kernel/drivers/input/tablet/wacom.ko      unplug and replug,               jcress@debian:~/Downloads/linuxwacom-0.8.8-11$ dmesg | grep wacom     [  878.879686] usbcore: registered new interface driver wacom     [  878.879694] wacom: v1.52:USB Wacom tablet driver     [  963.774142] usbcore: deregistering interface driver wacom     [ 1613.534147] usbcore: registered new interface driver wacom     [ 1613.534671] wacom: v1.52-pc-0.4:USB Wacom tablet driver      and dmesg | grep input doesn't list the wacom advice? Does this mean the module isn't working? EDIT: === fixed === I did dist-upgrade to testing and it 'just works'


title: Change character position with sed

text: The file contains:               dateutkfilename25012009      I want to change the position of character 16th to 17th with 18th to 19th. And then change position of character 16th to 19th with 20th to 23rd... so it will be:               dateutkfilename20090125      I've tried to change position of character 16th to 17th with 18th to 19th using below code, but I don't understand why it not works:               '/dateutkfilename/s/\(.\{16\}\)\([0-9]\{2\}\)\(.*\)/\(.\{18\}\)\([0-9]\{2\}\)\(.*\)/g'