{"id":"11542","title":"Desktop Actions and mime types for a DRM file format","text":"I want to handle a DRM file format, which adds an encryption wrapper outside of the protected content. Please see the diagram. # _**___ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ ____** # | DRM wrapper MIME | # | **___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ ____** # | | Embedded content MIME | | # | | ** ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ ___**| | # | ** ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __**| I also write some media applications for it. But every DRM-ware applications can support only a few embedded content MIME types. For example, a DRM-aware music player can only support DRM-protected or clear songs while a DRM-aware picture viewer can only support protected or clear pictures. So how can I write the .desktop entry of such DRM-aware applications? If I set MIME type to the DRM wrapper MIME type, my music player may be launched to open a DRM-protected picture and fails. And because the embedded content can be various while the wrapper MIME type is unique, I can expect many such failures. Is there any better practice to handle this issue? Is it feasible to invent new MIME types that mix the wrapper MIME type and the embedded content type? E.g. audio\/mpeg-xx- secured or image\/jpeg-xx-secured and using them in the .desktop entry of my DRM-aware applications? Great thanks! Amanda"} {"id":"89378","title":"Everything works in the auto-generated kickstart file for installing centos-linux except for selecting target drive + boot dot","text":"I discovered that if I copy the auto-generated kickstart file in CentOS Linux, I could re-install CentOS Linux without having to fill stuff, and so on.. It appears centos saves the auto-generated kickstart file to `\/root\/anaconda- ks.cfg` Let's see what it looks like: # Kickstart file automatically generated by anaconda. #version=DEVEL install harddrive --partition=UUID=94A9-D1AE --dir=\/ lang en_US.UTF-8 keyboard us network --onboot no --device eth0 --bootproto dhcp --noipv6 network --onboot no --device wlan0 --bootproto dhcp --noipv6 rootpw --iscrypted $6$wWTsHJyQ8Fe88fWk$v6u7X.WanDxPm26FJCi9gCwWXlwRg9tQze25uGk150W4BHLKcGRkcgFn4lRGowrXl1C0LlBQCOLxR9sx3Rjw20 firewall --service=ssh authconfig --enableshadow --passalgo=sha512 selinux --enforcing timezone --utc America\/New_York bootloader --location=mbr --driveorder=sda,sdb --append=\"crashkernel=auto rhgb quiet\" # The following is the partition information you requested # Note that any partitions you deleted are not expressed # here so unless you clear all partitions first, this is # not guaranteed to work #clearpart --all --drives=sda #volgroup VolGroup --pesize=4096 pv.008002 #logvol \/ --fstype=ext4 --name=lv_root --vgname=VolGroup --grow --size=1024 --maxsize=51200 #logvol swap --name=lv_swap --vgname=VolGroup --grow --size=7840 --maxsize=7840 #part \/boot --fstype=ext4 --size=500 #part pv.008002 --grow --size=1 #part None --fstype=efi --label=\"LIVE\" --onpart=sdb1 --noformat repo --name=\"CentOS\" --baseurl=hd:UUID=94A9-D1AE:\/ --cost=100 %packages --nobase @core %end To make this work better, I simply added interactive right above the `install` line on top. so that I can see what it is doing. Looks like it didn't auto fill the root-password. so let's remove the encrypted password and add a plain text password and then test again. Looks like it didn't select \"use all space\" So let's uncomment the commented lines towards the bottom portion. Looks like there are errors, I was forced to quit installation and reboot. Here is a final version that works okay. Only some lines were uncommented, and root password was changed to plain text. it is now Use All Space during the installation proces. I also added `interactive` line to it. # Kickstart file automatically generated by anaconda. #version=DEVEL interactive install harddrive --partition=UUID=94A9-D1AE --dir=\/ lang en_US.UTF-8 keyboard us network --onboot no --device eth0 --bootproto dhcp --noipv6 network --onboot no --device wlan0 --bootproto dhcp --noipv6 rootpw aaaaaa firewall --service=ssh authconfig --enableshadow --passalgo=sha512 selinux --disabled timezone --utc America\/Los_Angeles bootloader --location=mbr --driveorder=sda,sdb --append=\"crashkernel=auto rhgb quiet\" # The following is the partition information you requested # Note that any partitions you deleted are not expressed # here so unless you clear all partitions first, this is # not guaranteed to work clearpart --all --initlabel part \/boot --fstype=ext4 --size=500 part None --fstype=efi --label=\"LIVE\" --onpart=sdb1 --noformat repo --name=\"CentOS\" --baseurl=hd:UUID=94A9-D1AE:\/ --cost=100 %packages --nobase @core %end Everthing works great but it is not selecting the target hard drive, and placing a dot into the Boot thing. In other words the final step has to be done manually by hand. What should be done so that it can select the target drive and also ensure selected as the boot drive ?"} {"id":"145152","title":"Recover deleted files on Raspberry Pi?","text":"So I just rm -rf'ed a folder with a few files I need. Yes I know I should've had a backup, but it's just a Pi. It's designed to be played around with! Is there _anything_ I can do to recover that folder? Would the files be cached somewhere? Can you recommend any Linux file recovery programs? I don't want to boot into the SD again as it might write over the data :( Help! EXT4 filesystem."} {"id":"153087","title":"Recover file from previous installation?","text":"I recently wiped an old ubuntu server of mine and installed debian, but i forgot to backup a very important file. I know there is a chance that the computer has already wrote over the file, but what can I do to look for this file?"} {"id":"90186","title":"How do I simply recover the only file on an empty disk just deleted?","text":"Usually, the best way to recover a deleted file is to have backups and that, if the backup failed, you should immediately remount the drive read-only. (See this thread: How to recover a file just deleted ) But in some occasions, if the deleted file wasn't that important, it just would save some time to just \"undelete\" it. Is there a simple way I could try on bash for the case that the deleted file on an **ext4 filesystem** was **the only file on the disk** , especially, if the disk is not used otherwise?"} {"id":"18685","title":"How to recover a file just deleted","text":"I just deleted a file in Nautilus with Shift+Delete, which warned me that \"If you delete an item, it will be permanently lost.\" I wonder if there is no way to recover the file? My OS is Ubuntu 10.10. Thanks!"} {"id":"90387","title":"How to recover: Deleted accidently important files","text":"I've accidentally deleted today the `\/var\/www` with 2 Joomla-Homepages on it. Is there any possibility to recover all these files? I'm using PhotoRec right know, but the recovered files are named like: f3411984.html I have not create backups, which I should have. I there a better way to recover these files."} {"id":"127479","title":"su to another user using ssh keys?","text":"Assuming that `user_A` and `user_B` set up and exchange public ssh keys with each other, is it possible for `user_A` to `su` into `user_B` on the same machine?"} {"id":"103541","title":"Automount CIFS shares on boot?","text":"I have a script saved that mounts my CIFS share, but I have to run it manually every time I boot into Linux and I connect to the internet. Is there a way that I can set the script to run as root every time Linux boots, and have it continually run until it connects to the drives? I'm running Linux Mint. **UPDATE:** I already have the package installed. I have a working script to mount it: #!\/bin\/sh mount -t cifs \/\/xxx.xxx.xxx.xx\/usb1-1share1 \/media\/Private -o username=xx,password=xx,domain=WORKGROUP mount -t cifs \/\/xxx.xxx.xxx.xx\/Uploads \/media\/Uploads -o username=xx,password=xx,domain=WORKGROUP"} {"id":"82440","title":"Where would I find where an .htaccess file is located and being used on a Mac OS X Lion server that sets Basic Auth on an Apache server?","text":"I've installed some software, namely, a continuous integration (CI) server (Jenkins) on a Mac Mini running Lion Server. The server, by default, runs from port 8080 on local host via the url: `http:\/\/localhost:8080`. However, when I try to access the page it seems to be protected by Basic Auth and it asks me for a name and a password. Granted, I never set that Basic Auth and I've been told I can remove the authentication and use that port for the CI server. However, I'm hard pressed to find an `.htaccess` file anywhere that sets the Basic Auth? If it's not set in an `.htaccess` file then where would Basic Auth be set?"} {"id":"120120","title":"Escaping dash in `dch` call","text":"I'm using `dch` to modify the changelog for a debian package that is being built using some bash script. The messages for changelog are taken from some data source and are just passed to `dch --append`. And today I noticed that it fails to do its job if starts with dash (`-`) character: $ dch --append \"- when\" Unknown option: Unknown option: w Usage: dch [options] [changelog entry] Run dch --help for more details How would one properly escape such a string?"} {"id":"120122","title":"Bare-bones linux?","text":"I am working on a homemade OS and I was originally going to write it myself in Assembly and Python, but I decided that doing this would just be easier, faster, and more Linux-y. I have the Python part done, I just need to do the Linux part. So, I was wondering if you had any idea of a place I could get a pre-made ISO of any (preferably Debian based) Linux distro, with BASH, Aptitude, Python 2.7.6, and crontab installed, and with NO xorg or xvesa or whatever. It would also be extremely helpful if instead of posting links to places without a proper explanation and what-not, if you could just give me a download link."} {"id":"110558","title":"\"su\" with error \"X11 connection rejected because of wrong authentication.\"","text":"As root, I'm connecting to a remote host to execute a command. Only \"standarduser\" has the appropriate id-file and correct .ssh\/config, so I'm switching the user first: su standarduser -c 'ssh -x remotehost .\/remotecommand' The command works fine, but despite the fact that I used \"-x\" (disable X11-Forwarding) and having X11Forwards disabled in `\/etc\/ssh\/ssh_config`, I still get the error message: X11 connection rejected because of wrong authentication. I'm not getting the error message when I'm logged in as \"standarduser\". This is quite annoying as I would like to integrate the command in a cron job file. I understand that the error message refers to the wrong authentication of root's .XAuth file, but I'm not even trying to connect via X11. Why is \"ssh -x\" not disabling the X11 connection and throwing the error message? _UPDATE_ : The message only shows when I'm logged in within a screen, when using the command stated above on the local machine itself (without screen), I don't get an error message, so this should be fine with cron, too. I also started the same command with `-v` and surprisingly got the error message FIRST, even before the status information from SSH: root@localhost:~# su standarduser -c 'ssh -x remotehost .\/remotecommand' X11 connection rejected because of wrong authentication. OpenSSH_6.2p2 Ubuntu-6ubuntu0.1, OpenSSL 1.0.1e 11 Feb 2013 This led me to the problem itself, it is NOT the `ssh` which is throwing the error message, it's `su`: root@localhost:~# su standarduser -c 'echo Hi' X11 connection rejected because of wrong authentication. Hi Why do I only get this error within `screen`? How can I disable this error message? (Update title)"} {"id":"82990","title":"How can I grep for this or that (2 things) in a file?","text":"I have a file that has \"then\"'s and \"there\"'s. I can $ grep \"then \" x.x x and then some x and then some x and then some x and then some and I can $ grep \"there \" x.x If there is no blob none some will be created How can I search for both in one operation? I tried $ grep (then|there) x.x -bash: syntax error near unexpected token `(' and grep \"(then|there)\" x.x durrantm...\/code # (Nothing)"} {"id":"147413","title":"gpg: Bad signature","text":"I'm trying to sign a public PGP key but am encountering a 'Bad signature' error: gpg --edit-key someone@somedomain.com ... gpg> sign ... You need a passphrase to unlock the secret key for user: \"My User \" 2048-bit RSA key, ID 12345678, created 2012-01-01 I enter my passphrase then get: gpg: checking created signature failed: Bad signature gpg: signing failed: Bad signature gpg: signing failed: Bad signature I've done some searching online but can only find old, unrelated posts or ones relating to smart cards, which I'm not using. I'm running gnupg 2.0.25-1 on an Arch Linux box. Any help gratefully received!"} {"id":"19973","title":"Is a file manager in Linux a necessity or a luxury?","text":"I agree that this is a kind of a personal issue - to use a file manager or not in Linux, but I heard that it's also a bad practice to use a file manager especially for newbies because first of all they have to learn the shell and all file manipulations should be done from the shell. Is that true and do Linux users use file managers?"} {"id":"127525","title":"Data transfer between Ubuntu and CentOS","text":"How do I transfer data between Ubuntu and CentOS using LAN cable, in the same network? I tried installing Samba which did not go well in CentOS."} {"id":"80598","title":"ulimit & rlimit in Linux, are they the same thing?","text":"I see people use the terms `ulimi`t & `rlimit` interchangeably, can I say they are referring to the same thing?"} {"id":"16705","title":"Find out what processes are writing to hard drive","text":"On my Lenovo T400 and Ubuntu, the light for hard drive writing keeps flashing. I was wondering if in Linux it is possible to find out what processes are doing I\/O to the hard drive? Just like by `top`, you can find out what processes are using most CPU and memory."} {"id":"80594","title":"Trying to set keyboard layout using Xorg configuration but it's not working","text":"I'm trying to set my HP Pavilion g6 keyboard layout to English(us) and Arabic(ara). I'm using Fedora 18, but followed Arch Wiki anyways. Here's my `90-keyboard-layout.conf` file : Section \"InputClass\" Identifier \"keyboard\" MatchIsKeyboard \"on\" MatchDevicePath \"\/dev\/input\/event*\" Driver \"evdev\" Option \"XkbModel\" \"pc105\" Option \"XkbLayout\" \"us,ara(qwerty_digits)\" Option \"XkbVariant\" \"qwerty_digits,qwerty_digits\" Option \"XkbOptions\" \"grp:alt_shift_toggle\" EndSection I've entered `pc105` because I have no idea what's the corresponding `XkbModel` for my HP Pavilion g6 keyboard (looked in `\/usr\/share\/X11\/xkb\/rules\/xorg` but didn't find it). I have also this file `00-anaconda-keyboard.conf` which contains : #This file was generated by the Anaconda installer Section \"InputClass\" Identifier \"keyboard\" MatchIsKeyboard \"on\" Option \"XkbOptions\" \"terminate:ctrl_alt_bksp,\" EndSection Section \"ServerFlags\" Option \"DontZap\" \"false\" EndSection Here's my `setxkbmap -print`: xkb_keymap { xkb_keycodes { include \"evdev+aliases(qwerty)\" }; xkb_types { include \"complete\" }; xkb_compat { include \"complete\" }; xkb_symbols { include \"pc+us(qwerty_digits)+ara(qwerty_digits)(qwerty_digits):2+inet(evdev)+group(alt_shift_toggle)+terminate(ctrl_alt_bksp)\" }; xkb_geometry { include \"pc(pc104)\" }; }; What else is missing? Layout switching is not working at all so far."} {"id":"136793","title":"Copying the newest files","text":"We have a script running which picks up the report generated monthly on remote servers. I was trying to find a way to pick up the latest file from the remote servers only. Will find work in script or that's a bad practice? for host in \"${hosts[@]}\"; do scp \"$host\":\"$remote_path\" \"$local_target_dir\"\/filename.\"$host\" done File format = servername_BBC-3.0_2014-06-04_164510_.txt"} {"id":"64671","title":"SUID permissions - Which is correct?","text":"Trying to secure a Linux server and have little experience with SUID. After executing find \/ -perm +4000 many programs were discovered. I have seen conflicting advice here and hereon what should be enabled and not. SUID Enabled ` \/bin\/su \/usr\/bin\/passwd \/usr\/bin\/gpasswd \/sbin\/unix_chkpwd ` SUID Disabled ` \/usr\/bin\/crontab \/usr\/bin\/newgrp \/bin\/ping \/bin\/ping6 \/bin\/umount \/bin\/mount \/usr\/bin\/chsh \/usr\/bin\/chfn \/usr\/libexec\/pt_chown \/usr\/bin\/sudo \/usr\/bin\/sudoedit \/usr\/bin\/chage \/usr\/sbin\/userhelper \/usr\/sbin\/usernetctl \/usr\/sbin\/suexec` UNSURE `\/usr\/libexec\/openssh\/ssh-keysign \/sbin\/pam_timestamp_check ` Server will host multiple sites with few Linux \/ SFTP users. What should change? Also, how should I test?"} {"id":"119866","title":"How to search '(+1)' character substring in a string","text":"I want to search for (+1) in a string (which is a GDG dataset name to confirm if it is a GDG) and want to get a binary answer if it has (+1) as part of the string or not. Can some one please help?"} {"id":"53730","title":"Bash script for Angstrom","text":"I have written a bash script to automate cross-compiling an OpenCV program: echo \"Compiling started for: $1\" if [[ $1 == *.c ]] then gcc -ggdb `pkg-config --cflags opencv` -o `basename $1 .c` $1 `pkg-config --libs opencv`; elif [[ $1 == *.cpp ]] then g++ -ggdb `pkg-config --cflags opencv` -o `basename $1 .cpp` $1 `pkg-config --libs opencv`; else echo \"Only c or c++ files\" fi echo \"Output: ${1%.*}\" But now I noticed that there does not exist a bashrc at the Angstrom distribution. So what can I do? Regards"} {"id":"9252","title":"Determining what process is bound to a port","text":"I know that using the command: lsof -i TCP (or some variant of parameters with lsof) I can determine which process is bound to a particular port. This is useful say if I'm trying to start something that wants to bind to 8080 and some else is already using that port, but I don't know what. Is there an easy way to do this without using lsof? I spend time working on many systems and lsof is often not installed."} {"id":"53734","title":"Find both regular files and directories","text":"How can I tell ( if I can tell !) find to find files of both the directory and file type? find -type fd _It is like the heuristic dark ages up in here._"} {"id":"23179","title":"How to \"send\" variable to sub-shell?","text":"I run the following script: VAR=\"Test\" sh -c 'echo \"Hello $VAR\"' But I get : # .\/test.sh Hello How can I \"send\" the variable `VAR` of my script to the shell created with `sh -c`?"} {"id":"68181","title":"Use an USB tethered phone as network adapter","text":"I am running CentOS 6 and was able to tether my HTC phone using a proxy called proxoid . This allows me to redirect HTTP. But how do I redirect the entire TCP traffic, e.g. if I need to setup openvpn connection to my VPN server? It seems it can be done because software similar to proxoid (exactly same principles, e.g. easytether), which sets up network adapter. I couldn't find anything on internet perhaps because I don't have the right keywords - maybe this is a virtual network adapter that I am trying to setup?"} {"id":"21612","title":"How does traceroute resolve names?","text":"While writing a script, I wanted to reference a machine by the computer name that I gave it (e.g. \"selenium-rc\"). I could not ping it using \"selenium-rc\", so I tried the following commands to see if the name was recognized. > traceroute 192.168.235.41 traceroute to 192.168.235.41 (192.168.235.41), 64 hops max, 52 byte packets 1 selenium-rc (192.168.235.41) 0.545 ms 0.241 ms 0.124 ms Ok, traceroute \"found\" the name. How? Next ... > traceroute selenium-rc traceroute: unknown host selenium-rc Hmm ... the lookup mechanism here must be different because the host is unkown. I'm assuming this is using a system name resolution process whereas the first example was using a process specific to traceroute. Correct? Then when I came back a bit later ... > traceroute 192.168.235.41 traceroute to 192.168.235.41 (192.168.235.41), 64 hops max, 52 byte packets 1 minint-q4e8i52.mycorp.net (192.168.235.41) 0.509 ms 0.206 ms 0.136 ms Ok, different result. The \"selenium-rc\" name did not change on the machine itself, but the traceroute name resolution process must include some sort of priority and now gives a presumably more authoritative result assigned by another system\/service on the network. (Unfortunately, I'm assuming it's a dynamic name that I do not control, and thus it would not be useful in a script.) Can someone explain the results?"} {"id":"140359","title":"Test for a particular file format","text":"This is a followup to Normal looking text file, detected by file as ASCII Pascal program text It seems `file` can't be trusted all the time. It seems possible that a particular file may be detected as having both `encoding\/format1` and `encoding\/format2`. `file` tells me it's `encoding\/format1`, but I need to check, whether it also satisfies the constraints of `encoding\/format2`. * Is there a way to do that? * Is there a way I can ask \"Check if this file follows the rules of ASCII English Text (or _some other encoding_ )\" and the answer will be \"yes\" or \"no\"?"} {"id":"69172","title":"How to securely automate running commands as root with \"sudo su -\"?","text":"hint (on client side, how to encrypt files\/pwd's): # encrypt pwd with ssh key: openssl rsa -in ~\/.ssh\/id_rsa -outform pem > ~\/.ssh\/TEMP-id_rsa.pem 2>\/dev\/null openssl rsa -in ~\/.ssh\/id_rsa -pubout -outform pem > ~\/.ssh\/TEMP-id_rsa.pub.pem 2>\/dev\/null echo $PWDHERE > ~\/.ssh\/TEMP.pwd openssl rsautl -encrypt -pubin -inkey ~\/.ssh\/TEMP-id_rsa.pub.pem -in ~\/.ssh\/TEMP.pwd -out ~\/.ssh\/TEMP.pwd.enc 2>\/dev\/null rm ~\/.ssh\/TEMP.pwd > \/dev\/null 2>&1 # decrypt: PWDHERE=`openssl rsautl -decrypt -inkey ~\/.ssh\/TEMP-id_rsa.pem -in ~\/.ssh\/TEMP.pwd.enc` So.. it would be a very easy task to automate running commands via SSH on servers with the root user on server side (in the end we need to run a script from a desktop machine on server side with root user, but running a command automated would be enough to know, from there we could do the thing..). BUT: the **Question is** that how to securely automate running commands with root if we have to \"sudo su -\" first on the server, and give password in it? UPDATE: modifying the sudoers file is not an option. (maybe puppet can do this??) UPDATE#2: echo myPassword | sudo -S ls \/tmp isn't secure AFAIK. (because if other users 'ps -ef' they could see the pwd for a little time?) So that's not a solution either. UPDATE#3: I want to do \"Remote control a machine(s) with ad-hoc commands\""} {"id":"90312","title":"GCC compilation - where the __stack_chk_fail@GLIBC_2.4 symbol comes from?","text":"I'm using GCC 4.7.2 from devtoolset package on CentOS 5 (CentOS 5 because we need compatibility with old Linuxes, and GCC 4.7 because it optimizes better than 4.4). There is one symbols that prevents my binaries from running on RHEL4: `__stack_chk_fail@GLIBC_2.4`. It is included only in some C++ programs and the `-fno-stack-protector` flag doesn't help. Here is minimal program that reproduces the problem (but the same using `stdio.h` works): #include int main(int argc, char *argv[]) { for(int i=0; i < argc; i++) std::cout << \" \" << argv[i]; return 0; } When compiled with optimization (`-O`\/`-O2`) it references `__stack_chk_fail`. $ g++ -fno-stack-protector -O2 foo.cc $ readelf -s a.out | grep chk 15: 0000000000000000 0 FUNC GLOBAL DEFAULT UND __stack_chk_fail@GLIBC_2.4 (5) 105: 0000000000000000 0 FUNC GLOBAL DEFAULT UND __stack_chk_fail@@GLIBC_2 Any idea why this symbol gets here and how to get rid of it? Just in case, full `readelf` output and `gcc -v` is here. Edit: This problem may be specific to Red Hat Developer Toolset 1.1. With default CentOS compiler `__stack_chk_fail` is not referenced."} {"id":"134808","title":"Renaming file in scripts","text":"I want to rename `IGNORE_NAMES_20140606-2014-06-06.txt` file to `IGNORE_NAMES_20140606.txt`. I don't want to use the command below as I want to do it through a shell script. cp -p IGNORE_NAMES_20140606-2014-06-06.txt IGNORE_NAMES_20140606.txt"} {"id":"128204","title":"What does \"while test $# -gt 0\" do?","text":"I'm trying to create a function and believe I found a good working example but I don't understand all the logic behind it. More specifically, on the \"while\" line, could someone explain what test is and does? what is $# (isn't # a comment char?) and were does the -gt 0 parameter comes from? couldn't find it in the while man page. Here is the example: function my_function() { while test $# -gt 0 do $ echo \"$1\" shift done } Thank you."} {"id":"144277","title":"Where is the input method configuration file?","text":"My `ibus` input method was broken after an update. So I switched to `fcitx`. Actually, there are a handful IMs installed in my Fedora19 system, e.g. fcitx, ibus, yong, etc. However, I don't know how to configure them. My default IM for `gnome- terminal` is `yong`, `ibus` for `gmrun`. As for `firefox` or `chrome`, I guess they use `ibus` by default, because `GTK_IM_MODULE=ibus`. There are just-work solutions. I can switch IM by right-click-menu in some applications like `gnome-terminal` or `gmrun`. I can also specify IM with `GTK_IM_MODULE`. But how to do it automatically? I know the IM settings have something to do with configuration files like * `~\/.xinputrc` * `\/etc\/X11\/xinit\/xinputrc` * `\/etc\/X11\/xinit\/xinput.d\/ibus.conf` * `\/etc\/X11\/xinit\/xinput.d\/fcitx.conf` * `\/etc\/X11\/xinit\/xinitrc` * `\/etc\/alternatives\/xinputrc` The questions are * How to configure IM properly? * What configuration files really matter? In which execution order?"} {"id":"13056","title":"Finding session information about Firefox","text":"I'm currently developing a piece of software whose functionality is dependent upon knowing the state of the current Firefox session running on the user's Ubuntu computer. The information it will need to know the following: * How many Windows are open? * How many tabs are there in each window? * What is the URL currently opened in each tab? * How far down each tab has the user scrolled? Upon receiving an explicit command from the user, the application will hunt down this information from wherever it resides on the system. The problem is I have no idea where I should program the application to look for this. My first guess was that inspection of the Firefox processes in the kernel would yield the desired information, but I've used the system monitor to watch for additional processes starting up when more windows and tabs are opened, but the only Firefox process it mentions is 'firefox-bin', leading me to conclude that this assumption is incorrect. I'm prepared to do some significant reading if someone could just point me in the right direction, it's just that my time is limited and I can't afford to start poking around inside the kernel in the hope that I stumble across what I'm looking for. Does anyone know how I can find the above information **without** resorting to installing a plugin on Firefox that exports it?"} {"id":"21251","title":"Why do directories need the executable (X) permission to be opened?","text":"In my CMS, I noticed that directories need the executable bit (`+x`) set for the user to open them. Why is the execute permission required to read a directory?"} {"id":"150449","title":"What does \"execute\" permission on a folder means?","text":"I have read this topic, which gave me some info but I feel I am not fully getting it. What does the execute permission actually means on a folder? I fully understand what it means on a file, but on a folder... Sorry if that is a RTFM question. I have looked into it, I swear. This is what I found there : x : execute\/search only if the file is a directory or already has execute permission for some user (X) Any clarification is much appreciated."} {"id":"20256","title":"Is it fine to use tail -f on large log files","text":"I would like monitor a large log file (close to 1 GB) for errors. I want this to be close to real time (few seconds delay is fine). My plan is to use `tail -f | grep`. Is there any performance issues with using such a method when running it over a long time, say from zero bytes to 1 GB? Are there any standards practices used for such a monitoring. Note that I would like to do this using standard unix commands available on Solaris 10. If that is possible, my file even rolls over and I have one more problem to sort out :). using `tail -F` (`-follow=name`) is not an option for me because `-F` is not supported in the server I want to run this on. My plan is to use a script which will start this tail and poll on to find if the file is rolled over. If yes, then kill the tail and restart it. Any better approach?"} {"id":"40964","title":"emacs dedicated completion window","text":"To prevent confusion, I only run one \"window\" of emacs and so I use window in the emacs sense. I'm looking to get a window split which, let's say 70 in width, contains the completions buffer on the new split when I start emacs. I think I need to have a dedicated window. What I'm basicly trying to achieve is the following. +-----+---+ | | A | | |---| | C | B | +-----+---+ C = where I normally work. A = the completion buffer (also I would like to have messages and everything that emacs throws at me there) B = a shell. I have now the following added for this purpose in my .emacs: (split-window-horizontally) ;; want two windows at startup (other-window 1) ;; move to other window (shell) ;; start a shell (other-window 1) ;; move back to first window I would like to split the right window another time vertically and I would like to be able to specify the dimensions of each window. Also, I would like to have the dedicated property of the completions, messages, ... window (A) to be true so that emacs doesn't replace it. I've heard that a lot of people use this setup but I can't seem to find it anywhere."} {"id":"5251","title":"Can one PC be used by two users at the same time via dual-monitor?","text":"Since modern PCs can use two screens at the same time I wonder if it is possible to plug in two keyboards and mouses as well to have the two screens run two (more or less) independent X-sessions at once?"} {"id":"100671","title":"How can I set up multiseat\/separate X sessions with gnome 3?","text":"With classic Gnome, if one had two monitors, one could set up \"separate X sessions\" for each monitor. In this configuration, each monitor had a separate user login session and application windows were captive to the X session they were launched from. Is something similar possible with Gnome 3? If so, how do you go about setting it up?"} {"id":"40961","title":"Error when building bfilter","text":"I tried to build bfilter from source, but get the following error: make all-recursive make[1]: Entering directory `\/home\/myuser\/Downloads\/bfilter-1.1.4' Making all in binreloc make[2]: Entering directory `\/home\/myuser\/Downloads\/bfilter-1.1.4\/binreloc' make[2]: Nothing to be done for `all'. make[2]: Leaving directory `\/home\/myuser\/Downloads\/bfilter-1.1.4\/binreloc' Making all in foundation make[2]: Entering directory `\/home\/myuser\/Downloads\/bfilter-1.1.4\/foundation' make[2]: Nothing to be done for `all'. make[2]: Leaving directory `\/home\/myuser\/Downloads\/bfilter-1.1.4\/foundation' Making all in boost make[2]: Entering directory `\/home\/myuser\/Downloads\/bfilter-1.1.4\/boost' Making all in libs make[3]: Entering directory `\/home\/myuser\/Downloads\/bfilter-1.1.4\/boost\/libs' Making all in regex make[4]: Entering directory `\/home\/myuser\/Downloads\/bfilter-1.1.4\/boost\/libs\/regex' make[4]: Nothing to be done for `all'. make[4]: Leaving directory `\/home\/myuser\/Downloads\/bfilter-1.1.4\/boost\/libs\/regex' Making all in program_options make[4]: Entering directory `\/home\/myuser\/Downloads\/bfilter-1.1.4\/boost\/libs\/program_options' \/bin\/bash ..\/..\/..\/libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I..\/..\/.. -I..\/..\/.. -I..\/..\/..\/boost -DBOOST_MULTI_INDEX_DISABLE_SERIALIZATION -DNDEBUG -Os -Wall -Wno-unused -pthread -MT config_file.lo -MD -MP -MF .deps\/config_file.Tpo -c -o config_file.lo `test -f 'src\/config_file.cpp' || echo '.\/'`src\/config_file.cpp g++ -DHAVE_CONFIG_H -I. -I..\/..\/.. -I..\/..\/.. -I..\/..\/..\/boost -DBOOST_MULTI_INDEX_DISABLE_SERIALIZATION -DNDEBUG -Os -Wall -Wno-unused -pthread -MT config_file.lo -MD -MP -MF .deps\/config_file.Tpo -c src\/config_file.cpp -o config_file.o In file included from ..\/..\/..\/boost\/boost\/mpl\/apply.hpp:23:0, from ..\/..\/..\/boost\/boost\/iterator\/iterator_facade.hpp:34, from ..\/..\/..\/boost\/boost\/program_options\/eof_iterator.hpp:9, from ..\/..\/..\/boost\/boost\/program_options\/detail\/config_file.hpp:17, from src\/config_file.cpp:10: ..\/..\/..\/boost\/boost\/mpl\/apply_wrap.hpp:81:31: error: missing binary operator before token \"(\" ..\/..\/..\/boost\/boost\/mpl\/apply_wrap.hpp:173:31: error: missing binary operator before token \"(\" In file included from ..\/..\/..\/boost\/boost\/mpl\/bind.hpp:27:0, from ..\/..\/..\/boost\/boost\/mpl\/lambda.hpp:18, from ..\/..\/..\/boost\/boost\/mpl\/apply.hpp:25, from ..\/..\/..\/boost\/boost\/iterator\/iterator_facade.hpp:34, from ..\/..\/..\/boost\/boost\/program_options\/eof_iterator.hpp:9, from ..\/..\/..\/boost\/boost\/program_options\/detail\/config_file.hpp:17, from src\/config_file.cpp:10: ..\/..\/..\/boost\/boost\/mpl\/apply_wrap.hpp:81:31: error: missing binary operator before token \"(\" ..\/..\/..\/boost\/boost\/mpl\/apply_wrap.hpp:173:31: error: missing binary operator before token \"(\" In file included from ..\/..\/..\/boost\/boost\/mpl\/lambda.hpp:18:0, from ..\/..\/..\/boost\/boost\/mpl\/apply.hpp:25, from ..\/..\/..\/boost\/boost\/iterator\/iterator_facade.hpp:34, from ..\/..\/..\/boost\/boost\/program_options\/eof_iterator.hpp:9, from ..\/..\/..\/boost\/boost\/program_options\/detail\/config_file.hpp:17, from src\/config_file.cpp:10: ..\/..\/..\/boost\/boost\/mpl\/bind.hpp:364:31: error: missing binary operator before token \"(\" ..\/..\/..\/boost\/boost\/mpl\/bind.hpp:531:31: error: missing binary operator before token \"(\" In file included from ..\/..\/..\/boost\/boost\/mpl\/lambda.hpp:22:0, from ..\/..\/..\/boost\/boost\/mpl\/apply.hpp:25, from ..\/..\/..\/boost\/boost\/iterator\/iterator_facade.hpp:34, from ..\/..\/..\/boost\/boost\/program_options\/eof_iterator.hpp:9, from ..\/..\/..\/boost\/boost\/program_options\/detail\/config_file.hpp:17, from src\/config_file.cpp:10: ..\/..\/..\/boost\/boost\/mpl\/aux_\/full_lambda.hpp:230:31: error: missing binary operator before token \"(\" In file included from ..\/..\/..\/boost\/boost\/iterator\/iterator_facade.hpp:34:0, from ..\/..\/..\/boost\/boost\/program_options\/eof_iterator.hpp:9, from ..\/..\/..\/boost\/boost\/program_options\/detail\/config_file.hpp:17, from src\/config_file.cpp:10: ..\/..\/..\/boost\/boost\/mpl\/apply.hpp:138:31: error: missing binary operator before token \"(\" make[4]: *** [config_file.lo] Error 1 make[4]: Leaving directory `\/home\/myuser\/Downloads\/bfilter-1.1.4\/boost\/libs\/program_options' make[3]: *** [all-recursive] Error 1 make[3]: Leaving directory `\/home\/myuser\/Downloads\/bfilter-1.1.4\/boost\/libs' make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory `\/home\/myuser\/Downloads\/bfilter-1.1.4\/boost' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `\/home\/myuser\/Downloads\/bfilter-1.1.4' make: *** [all] Error 2 Any idea how to fix this?"} {"id":"27613","title":"Where should I place a downloaded tarball?","text":"I have downloaded the ChromePlus tarball and extracted it to my home directory. The extracted folder contains an executable that I can double-click to launch ChromePlus. So I assume I do not need to any extra things to install it. I'm new to Linux. Where should I place the ChromePlus directory? It's currently sitting on my home directory, and it does not look neat. After googling, I thought about `\/bin\/`, `\/usr\/bin`, `\/usr\/lib`. Where is the best place?"} {"id":"97938","title":"Oh-My-Zsh overriding my function?","text":"I use ZSH with Oh My Zsh and I am trying to define a function called `git`, as such: function git() { echo \"I'm happy because I am executed!\" } I have placed the function definition in `$ZSH\/custom\/general.zsh`. Everything else in this file works (I have a bunch of aliases there) except this function. Running `which git` outputs: git () { case $1 in (commit|blame|add|log|rebase|merge) exec_scmb_expand_args \"$_git_cmd\" \"$@\" ;; (checkout|diff|rm|reset) exec_scmb_expand_args --relative \"$_git_cmd\" \"$@\" ;; (branch) _scmb_git_branch_shortcuts \"${@:2}\" ;; (*) \"$_git_cmd\" \"$@\" ;; esac } Removing `git` from `plugins=( ... )` didn't work. Trying to find this function in Oh My Zsh yielded no results. I read the source code of `oh-my-zsh.sh`, and it seems the `custom` directory is loaded after all of OMZ's files, so it didn't make any sense to me, that when I placed my function **at the bottom of** `.zshrc` it worked. Any Ideas on how to keep the function in the `custom` folder? I would like to keep things organized."} {"id":"97931","title":"NFS Mounting Error","text":"From ServerA I shared directory `\/u001\/app\/oracle\/FolderA` and trying to mount this on SeverB under `\/media` Contents of ServerA `\/etc\/exports` file \/u001\/app\/oracle\/FolderA ServerB(rw,sync) When I try to mount it on ServerB I receive this message on ServerB mount: mount to NFS server 'ServerA' failed: timed out (retrying). mount: mount to NFS server 'ServerA' failed: timed out (retrying). mount: mount to NFS server 'ServerA' failed: timed out (retrying). mount: mount to NFS server 'ServerA' failed: timed out (retrying). mount: mount to NFS server 'ServerA' failed: timed out (giving up). `rpcinfo -P` output: program vers proto port 100000 2 tcp 111 portmapper 100000 2 udp 111 portmapper 100024 1 udp 953 status 100024 1 tcp 956 status 100011 1 udp 924 rquotad 100011 2 udp 924 rquotad 100011 1 tcp 927 rquotad 100011 2 tcp 927 rquotad 100003 2 udp 2049 nfs 100003 3 udp 2049 nfs 100003 4 udp 2049 nfs 100021 1 udp 13495 nlockmgr 100021 3 udp 13495 nlockmgr 100021 4 udp 13495 nlockmgr 100003 2 tcp 2049 nfs 100003 3 tcp 2049 nfs 100003 4 tcp 2049 nfs 100021 1 tcp 15597 nlockmgr 100021 3 tcp 15597 nlockmgr 100021 4 tcp 15597 nlockmgr 100005 1 udp 938 mountd 100005 1 tcp 941 mountd 100005 2 udp 938 mountd 100005 2 tcp 941 mountd 100005 3 udp 938 mountd 100005 3 tcp 941 mountd `\/var\/log\/messages`: Oct 28 17:16:21 kernel: nfsd: last server has exited Oct 28 17:16:21 kernel: nfsd: unexporting all filesystems Oct 28 17:16:22 kernel: NFSD: Using \/var\/lib\/nfs\/v4recovery as the NFSv4 state recovery directory Oct 28 17:16:22 kernel: NFSD: starting 90-second grace period Oct 28 17:17:28 mountd[4143]: Caught signal 15, un-registering and exiting. Oct 28 17:17:29 kernel: nfsd: last server has exited Oct 28 17:17:29 kernel: nfsd: unexporting all filesystems Oct 28 17:17:29 kernel: NFSD: Using \/var\/lib\/nfs\/v4recovery as the NFSv4 state recovery directory Oct 28 17:17:29 kernel: NFSD: starting 90-second grace period Oct 28 17:21:15 kernel: FS-Cache: Loaded Any help will be awesome......"} {"id":"59031","title":"how to add a description in footer","text":"I enjoy learning how to modify files with `awk`, `sed`, and bash. However, I know it could cause issues down the road and I would like to be prepared with a log _inside the file_. I was thinking about how I could create a log in the footer after I modify an `.html` file but I am unsure how or what the process is called. I would like to be able to do as follows: line break after the very last line of code comment tag **Example:** <\/head>
This is before script<\/div> <\/body> <\/head> <\/body> "} {"id":"11983","title":"What exactly is POSIX?","text":"I see POSIX mentioned often and everywhere, and I had assumed it to be the baseline UNIX standard.. until I noticed the following excerpt on a Wikipedia page: _The Open Group_ > The Open Group is most famous as the certifying body for the UNIX trademark, > and its publication of the _Single UNIX Specification technical standard_ , > **_which extends the POSIX standards and is the official definition of a > UNIX system_**. If the official definition of a UNIX system is an extension of POSIX, then what exactly is POSIX? ,,, It surely seems to be a touchstone of the UNIX world, but I don't know how it fits into the overall picture."} {"id":"14867","title":"What is Unix now?","text":"As I read in Wikipedia, Unix started as a revolutionary operating system written mostly in C allowing it to be ported and used on different hardware. Descendants of Unix is mentioned next, mostly BSD. Clones of Unix, Minix\/Linux are discussed as well. But what happened to the original Unix operating system? Does it exist as an operating system any more or is it nothing more than a standard like POSIX nowadays? Do note that I am aware of this answer but it has no mention of the fate of the original Unix beyond the derived works."} {"id":"56011","title":"Which Unix is considered the vanilla Unix and which Unix's are just Unix rather than Unix-like?","text":"> **Possible Duplicate:** > What exactly is POSIX? > What is Unix now? Are they only the Unix’s developed by Bell Labs or do the SCO ones count too? Are there others?"} {"id":"12834","title":"install rtorrent failed using yum install rtorrent in CentOS","text":"I want to install `rtorrent` as a client (NOT SeedBox). I tried the following command: yum install rtorrent I get following message: Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: centos.mirror.iweb.ca * extras: centos.mirror.iweb.ca * updates: centos.mirror.netelligent.ca Excluding Packages in global exclude list Finished Setting up Install Process No package rtorrent available. Nothing to do I think it's because I do not have rtorrent at my repository. What should I do to add rtorrent to my repository? I tried `yum update` without any success."} {"id":"65881","title":"mint 14 mate: window manager doesn't work after reinstall mate-panel & mate-applets","text":"After doing a sudo apt-get --purge remove mate-panel mate-applets and a sudo apt-get install mate-panel mate-applets for trying to get rid of a trayicon issue on my system, the mate window manager seems to be not working anymore. after login, I still get a gui, but only a terminal is running in there. Also no panel and menus are available. for this terminal and any other application I'll start, except chromium-browser (brings its own decoration), no window borders shown at all. when I start `mate-control-center`, following errors shown in term ** (mate-control-center:2116): WARNING **: error raised: [libslab_get_mateconf_value: error getting \/desktop\/mate\/applications\/main-menu\/lock-down\/user_modifiable_apps] ** (mate-control-center:2116): WARNING **: error raised: [load_xbel_store: couldn't load bookmark file [NULL] ** (mate-control-center:2116): WARNING **: get_actions_list() - PROBLEM - Can't load gtk-theme-selector.desktop ** (mate-control-center:2116): WARNING **: get_actions_list() - PROBLEM - Can't load mate-cups-manager.desktop temporary, a manual start of `mate-panel` & `marco` via console is my workaround to have the system used as good as normal. but I'd like to get the default windowmanager works as expected. I don't know which additional information I should provide at this point."} {"id":"66505","title":"How to print find match as well as run an -exec","text":"I was wanting to run a `find` and then execute a script on each match; however, I was wanting to print the name of the matched file above the output from each `exec`. How can I produce the following output: $ find . -name 'something' -exec sh script.sh {} \\; .\/something_1 output from script.sh something_1 .\/something_2 output from script.sh something_2 I am currently only getting the output from `script.sh`. I tried `-exec echo {} && sh script.sh {} \\;` with no success. I would prefer a solution using `-exec` or `xargs -print0`, i.e., not prone to problems with white space."} {"id":"66503","title":"How does gcc handle file permissions?","text":"The executable files that `gcc` creates have execution permissions -rwxrwxr-x which are different than the permissions that the source file has. -rw-rw-r-- How does `gcc` set these permissions ?"} {"id":"50412","title":"Change currency format to generic number using sed","text":"I am working on a large csv file with all coma separated entries. The entire document is composed of plain numbers, except for a few columns reflecting currencies that are formatted as text. For example, one such entry may look like `\"$12,345.67\"` and another one like `\"$1,234,567.89\"` (double quote symbols are also included as part of the entries). Here is an example of a full record (one single line) of data: 123,7,11,\"$343,700.14\",\"$34,928.63\",\"$377,000.00\",\"$15,421.92\",19,2 I would like to do some processing on this data file and therefore, I want to reformat such text fields to become plain numbers (i.e., getting rid of double quotes and comas). I think a regex pattern replacement with `sed` should do the job for me, but I am not sure what that regular expression looks like at all. Any idea would be much appreciated."} {"id":"101924","title":"How can I change my username?","text":"My current username is `mpatil`, how can I change that to `algo` without losing data or causing problems?"} {"id":"110496","title":"Cloned Linux system and \/etc\/udev\/rules.d\/70-persistent-net.rules","text":"I set up an Ubuntu system and configured it properly, including defining `eth0` in `\/etc\/network\/interfaces`. I then imaged that system and cloned it on a new system. When I booted up the system the first time all was good, but a few reboots later I was greeted with the network config timing out. When I logged in I found that `eth0` was not available. My initial research let me to try `ifdown -a` and `ifup -a` which I did a few times to no apparent effect. Research eventually pointed me to `\/etc\/udev\/rules.d\/70-persistent-net.rules`, where I discovered that the MAC address for the new system had created eth1. Good idea, but not what I wanted to happen. When I booted up just now, I found that `\/etc\/udev\/rules.d\/70-persistent- net.rules` now has six entries for six different HW Addresses, which I find strange as there is only one interface. My question is: did my use of `ifup -a` somehow create new MAC addresses to be created? If not, are there any thoughts on how this happened? I altered `\/etc\/udev\/rules.d\/70-persistent-net.rules` to name the current HW Address `eth0` and it seems to be working, but can I be assured that the address won't change again on a reboot?"} {"id":"26561","title":"Output the changes to a log file","text":"If I use > > tail -f *filename* > I get a real nice display of whatever is changing in a given file. However, sometimes I want to be able to search this text or otherwise look it over slowly. Is there any way I can output just the changes to a log file between now and, say, whenever I hit `Ctrl`-`C`?"} {"id":"75530","title":"Linux\/GParted can see partition table but dd bs=512 count=1 can't","text":"I have an MBR formatted sd card and when connect to a Linux machine (xubuntu 12.04) it can mount a partition and parse the file system (as can GParted). However, when I try to read the MBR from the device using dd it gives me a bunch of spurious data. Could anyone shed any light into how Linux\/GParted is able to read and make sense of the MBR when dd isn't able to read the MBR. **Do they use different methods to get at the data?** I.E not open(), read() DD command is: dd if=\/dev\/sdb of=mbr.bin bs=512 count=1 DD output is: 1+0 records in 1+0 records out 512 bytes transferred in 0.000786 secs (651345 bytes\/sec) mbr.bin dump with `hexdump -C mbr.bin` is: 00000000 04 16 41 53 4d 49 2d 53 44 03 00 00 00 00 16 f1 |..ASMI-SD.......| 00000010 00 7f 00 32 1f 5b 80 00 36 db bf bf 96 c0 00 01 |...2.[..6.......| 00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000030 6f 00 00 10 00 00 02 2e 00 00 00 00 00 00 00 00 |o...............| 00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| * 00000200"} {"id":"75537","title":"How to install manually from live CD?","text":"I got a live CD and I tried to install it manually because it doesn't support installing. So I booted from live cd and did: mkfs.ext4 \/dev\/sda5 mount \/dev\/sda5 \/mnt cd \/mnt unsqaushfs \/cdrom\/casper\/filesystem.squashfs mv squashfs-root\/* .\/ rm -r squashfs-root mount --bind \/dev \/mnt\/dev mount --bind \/sys \/mnt\/sys mount --bind \/proc \/mnt\/proc chroot \/mnt grub-install \/dev\/sda update-grub So I restarted and it said that it can't mount the filesystem. So I tried the same with ext2 because in the grub config stood `insmod=ext2` and when I tried to boot with `insmod=ext4` it said file not found. But still even with ext2 it said that it can't mount the filesystem."} {"id":"150161","title":"SSI problem with http in centos","text":"My httpd.conf is as below. - - - AddType text\/html .shtml .html Options +Includes AddOutputFilter INCLUDES .shtml .html DirectoryIndex index.shtml index.html index.php index.html.var - - - And still showing in the debug log Options +Includes wasn't set. [Thu Aug 14 01:14:26 2014] [warn] [client xxx.xxx.xxx.xxx] mod_include: Options +Includes (or IncludesNoExec) wasn't set, INCLUDES filter removed. My apache version is 2.2 & running on Centos 6. Any advice how to solve this issue."} {"id":"393","title":"How to check how many lanes are used by the PCIe card?","text":"PCI Express slots on the motherboard can be wider then the number of lanes connected. For example a motherboard can have x8 slot with only x1 lane connected. On the other hand, you can insert a card using only for ex. 4 lanes to a x16 slot on the motherboard, and they will negotiate to use only those x4 lanes. How to check from the running system how many lanes are used by the inserted PCIe cards?"} {"id":"88590","title":"how to create a data file with a column of date from day1 to dayN?","text":"I was wondering if I could generate a hourly or daily time step date in a column starting from some year in the past to some day in the near past or today. to be more clear, I want to create one column of data from 2000-10-10 100 to 2012-12-31 2400. The output file will look like Date 2000-01-01 100 2000-01-01 200 2000-01-01 300 . . . . . 2012-12-31 2400"} {"id":"92888","title":"A program that runs in a shell (e.g. pine) vs. a shell script","text":"Having a bit of trouble finding the answer to my question, perhaps because I may be asking the wrong question. I understand bash scripts. I write them all the time to do little helpful things repeatedly. However I would like to know the difference between a shell script, and a program that runs in a shell. For example, what is pine? What language is it written in? It runs in a shell, but as far as I know it's not a shell script, it's a self-contained program that you can navigate around in, and when you exit, you return to the shell exactly where you were when you launched it. If I wanted to write a program that functions similar to pine, in that it runs in the shell as a program with various functionality, where would I begin? Where can I find some examples of programs written in this way?"} {"id":"92889","title":"How to tell sudo to repeat lecture once?","text":"I'm letting one of my coding buddies have root access to my Raspberry Pi, and as I was getting everything set up, I tested sudo as him. It gave me \"the speech\": > We trust you have received the usual lecture from the local System > Administrator. It usually boils down to these three things: > > #1) Respect the privacy of others. > #2) Think before you type. > #3) With great power comes great responsibility. What I'm wondering is how to tell sudo to repeat that once. I can't find where it stores the \"warned users\" list, and I don't want to go overkill and tell it to give The Speech every time."} {"id":"114440","title":"Dual booting windows 8.1 and fedora 19","text":"I am trying to dual boot windows 8.1 and fedora 19. I am in UEFI mode and using USB. I installed windows 8.1 and left some free unpartitioned space.. Now when fedora installation is going on I am stuck at installation source. The auto detect media option detects sda1 but verification says bad image."} {"id":"134738","title":"Enabling a Display Manager in Ubuntu 13.10","text":"I was wondering if anyone knew how to enable\/set-up a display manager which prompts for username and password when the screen boots. Whenever I start Ubuntu, it goes to the desktop and then a small window pops up a few minutes later prompting me for my password. I would much prefer a separate screen for logging in, as the home screen can be accessed and interacted with before entering a password, leaving a big security hole on my computer. I run a dual-boot laptop with windows 7 and ubuntu 13.10; not sure if this is relevant, but figured I'd include it anyways."} {"id":"104276","title":"iptables: The \"script\" way or the \"*filter, rules, COMMIT\" way?","text":"I'm trying to figure out how NAT and iptables work. While I'm in the trial- and-error phase of learning about it, I found two somewhat conflicting howtos. One howto uses a script to call `iptables` rules one after another. The script seems to be named and stored such that it is executed early during system boot, and I think a problem may be that other scripts may be called after it and undo its intentions. I even think I did this once by accident when I saved and renamed the original script (00-firewall) using a backup (00-firewall- old). The example script form the howto is: #!\/bin\/sh PATH=\/usr\/sbin:\/sbin:\/bin:\/usr\/bin # # delete all existing rules. # iptables -F iptables -t nat -F iptables -t mangle -F iptables -X # Always accept loopback traffic iptables -A INPUT -i lo -j ACCEPT # Allow established connections, and those not coming from the outside iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT iptables -A INPUT -m state --state NEW -i ! eth1 -j ACCEPT iptables -A FORWARD -i eth1 -o eth0 -m state --state ESTABLISHED,RELATED -j ACCEPT # Allow outgoing connections from the LAN side. iptables -A FORWARD -i eth0 -o eth1 -j ACCEPT # Masquerade. iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE # Don't forward from the outside to the inside. iptables -A FORWARD -i eth1 -o eth1 -j REJECT # Enable routing. echo 1 > \/proc\/sys\/net\/ipv4\/ip_forward Another howto does not use a script but a file where some filter rules are defined. It looks like this: *filter # Allows all loopback (lo0) traffic and drop all traffic to 127\/8 that doesn't use lo0 -A INPUT -i lo -j ACCEPT -A INPUT ! -i lo -d 127.0.0.0\/8 -j REJECT # Accepts all established inbound connections -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT # Allows all outbound traffic # You could modify this to only allow certain traffic -A OUTPUT -j ACCEPT # Allows HTTP and HTTPS connections from anywhere (the normal ports for websites) -A INPUT -p tcp --dport 80 -j ACCEPT -A INPUT -p tcp --dport 443 -j ACCEPT # Allows SSH connections # THE -dport NUMBER IS THE SAME ONE YOU SET UP IN THE SSHD_CONFIG FILE -A INPUT -p tcp -m state --state NEW --dport 30000 -j ACCEPT # Now you should read up on iptables rules and consider whether ssh access # for everyone is really desired. Most likely you will only allow access from certain IPs. # Allow ping -A INPUT -p icmp -m icmp --icmp-type 8 -j ACCEPT # log iptables denied calls (access via 'dmesg' command) -A INPUT -m limit --limit 5\/min -j LOG --log-prefix \"iptables denied: \" --log-level 7 # Reject all other inbound - default deny unless explicitly allowed policy: -A INPUT -j REJECT -A FORWARD -j REJECT COMMIT What are the pros and cons of both ways of setting up iptables? Background info is much appreciated because I'm quite new to the whole thing. For example, I don't get who is reading the file from the latter howto, and how it is processed. My feeling tells me the second howto suggests a better solution, but why exactly?"} {"id":"104277","title":"How to detect network connection failure?","text":"I have a direct Ethernet connection between a Windows box and a Linux box. If I disable the connection on the Windows side Linux still seems to believe the link is up. Is this normal behaviour? I would like Linux to run `if down` if the link fails and `ifup` when it returns. Is that possible?"} {"id":"93131","title":"Pruning the package tree with apt-get and yum","text":"I love the Macports and Arch package managers, because I can generate a listing of all of the packages that I have manually installed, and \"prune\" the package tree every once in a while to keep my distribution lean. I would like to know how I can do this using `apt-get` and `yum`. For example, with Macports, I can type `port echo requested` and get a nice listing of all of the packages that I have explicitly installed. If I see a package I installed a few weeks ago that I no longer need, I can immediately uninstall it. To get rid of unused dependencies, I can repeatedly execute `port uninstall leaves`. Analogous commands are available using `pacman`. It is not clear to me how I can achieve similar functionality using `apt-get` and `yum` after reading the relevant man pages and doing a fair amount of Googling. One of the most important functions of a good package manager should be to let the administrator easily manage the list of explicitly installed packages. Certainly I am missing something. Thanks for your help!"} {"id":"28682","title":"`test` and `[` - different binaries, any difference?","text":"I noticed while answering another question that `test` and `[` are different binaries, but the `[` manpage pulls up `test`'s. Besides the requirement for an ending `]`, is there any difference? If not, why are they separate binaries instead of being symlinked? (They are also `bash` builtins, and `bash` doesn't show a difference either.)"} {"id":"121408","title":"why is ! character used in shell scripts","text":"I recently encountered a situation where I tried to use `!` as a record separator for my string array in shell script. When I used it in my shell script, the script got expanded automatically. An example to reproduce the situation can be as below. check_variable=\"Hello\" echo \"$check_variable\" Output: Hello ###For multiple strings, I tried to concatenate with ! as a record separator. echo \"$check_variable !\" Output: echo \"$check \" > Results.txt Then after some research, I had figured out `!` is in fact a special character and should not be used as record separators. So, exactly why is `!` used? Is there any way I can turn off the `!` character and use it in my shell script?"} {"id":"154467","title":"What does !$ mean exactly?","text":"`echo !$` outputs different strings depending on my previous command line call. For example: mrdumbdumb-redhat:~ mrdumbdumb$ ls mrdumbdumb-redhat:~ mrdumbdumb$ echo !$ echo ls ls mrdumbdumb-redhat:Documents mrdumbdumb$ cd - \/ mrdumbdumb-redhat:~ mrdumbdumb$ echo !$ echo - - `!$` seems to expand to the last argument of my last command or the command itself if the command lacked arguments. What exactly is `!$`?"} {"id":"88642","title":"What does !$ mean?","text":"I'm following through a tutorial and it mentions to run this command: sudo chmod 700 !$ I'm not familiar with `!$`. What does it mean?"} {"id":"22394","title":"Why hard links not allowed to directories in UNIX\/Linux","text":"I read in text books that UNIX\/Linux doesn't allows hard links to directories but soft links do. Is it because, when we have cycles and if we create hardlinks, and after some time we delete the original file, it will point to some garbage values? If cycles were the sole reason behind not allowing hardlinks, then why softlinks are allowed to directories?"} {"id":"132348","title":"How do I know why NetworkManager failed to initiate the VPN connection?","text":"I'm running Arch Linux, and recently updated the whole system. Now I every time I connects to VPN with `nmcli` command, if it fails, I couldn't figure out the reason: NetworkManager[15967]: VPN plugin state changed: starting (3) NetworkManager[15967]: VPN connection 'XXX' (Connect) reply received. NetworkManager[15967]: \/sys\/devices\/virtual\/net\/ppp0: couldn't determine device driver; ignoring... NetworkManager[15967]: VPN plugin failed: 1 NetworkManager[15967]: VPN plugin failed: 1 NetworkManager[15967]: VPN plugin failed: 1 NetworkManager[15967]: VPN plugin state changed: stopped (6) NetworkManager[15967]: VPN plugin state change reason: 0 NetworkManager[15967]: error disconnecting VPN: Could not process the request because no VPN connection was active. Prior to the upgrade, I can see error messages from pppd, e.g \"You're already logged in bla bla\", now every helpful message is gone. Any ideas? Why is the connection failed?"} {"id":"41394","title":"Bash script doesn't work as cronjob","text":"I'm trying to get this simple bash script to work within a cronjob. It's used to generate static nginx webserver statistic pages using GoAccess. I tried everything I know to resolve this issue, it just won't work as a cronjob. It's executed perfectly in console. It's even working as cronjob when I remove the call to goaccess (e.g. put an echo there to see if the call is built correctly). Any help on this? The script runs for every file but the resulting files only contain the \"how to use\" instructions from goaccess which appear when you call it without arguments. System is a vServer running Debian 6.0. I use GoAccess 0.5 and nginx 1.2.1 Here's the script: #!\/bin\/bash PATH=\/bin:\/sbin:\/usr\/bin:\/usr\/sbin:\/home\/ _logdir=\"\/srv\/www\/logs\" _logfiles=\"${_logdir}\/access_*.log\" for logfile in $_logfiles; do _curfilename=\"${logfile##*\/}\" # All these commands work flawless #echo \"$logfile\" >> \/home\/debug.log #echo \"$_curfilename\" >> \/home\/debug.log #echo \"goaccess -a -f $logfile > \/srv\/www\/stats\/${_curfilename}.html\" >> \/home\/debug.log; # This one fails goaccess -a -f \"${logfile}\" > \"\/srv\/www\/stats\/${_curfilename}.html\"; done Here's the crontab line for once an hour (i used * * * * * for debugging): 0 * * * * \/bin\/bash \/home\/run_webstats_update.sh Error output in cron.log: \/USR\/SBIN\/CRON[26099]: (root) CMD (\/bin\/bash \/home\/update_webstats.sh) \/USR\/SBIN\/CRON[26098]: (CRON) error (grandchild #26099 failed with exit status 1)"} {"id":"57660","title":"Any utility to find source of system load \/ load average for a certain period?","text":"By running top, htop, uptime, etc. we can see the load average as three values indicating the average load for the last 1\/5\/15 minutes (well not really, but that isn't the question here). Sometimes I'll notice that I have a fairly high load average for the last 15 minutes, but the current load is very low. Is there a utility\/program that can list the processes (even if they no longer exist) that consumed the most CPU- time for the last 1\/5\/15 minutes (or some other similar period)? I am aware that load average can also be caused by processes waiting for I\/O, but I am mostly interested in seeing the most CPU-hungry applications (though being able to see historic I\/O would also be nice). As far as I know running htop and sorting by time cannot help me here, since if the computer has been on for a while the top values will not necessarily have anything to do with the recent past."} {"id":"52100","title":"Text processing - join lines with commas","text":"I have more than 1000 lines in a file. The file starts as follows (line numbers added): 1. Station Name 2. Station Code 3. A N DEV NAGAR 4. ACND 5. ABHAIPUR 6. AHA 7. ABOHAR 8. ABS 9. ABU ROAD 10. ABR I need to convert this to a file, with comma separated entries by joining every two lines. The final data should look like Station Name,Station Code A N DEV NAGAR,ACND ABHAIPUR,AHA ABOHAR,ABS ABU ROAD,ABR ... What I was trying was - trying to write a shell script and then `echo` them with comma in between. But I guess a simpler effective one-liner would do the job here may be in `sed`\/`awk`. Any ideas?"} {"id":"102945","title":"How can I allow a user to prioritize a process to negative niceness?","text":"I want a user to run a specific process on the system with a negative nice value. I can't simply fork the process to background as this specific program is a minecraft server and I rely on the command line to control the server. My current bash script looks like this (the important part): sleep 10 && \\ sudo renice -n $NICENESS $(ps -u $(id -u) -o \"%p:%c\" | sed -n \"s\/:java$\/\/p\") & \\ java -Xmx8G -Xms2G -jar minecraft_server.jar nogui `sleep` simply delays execution of `renice`. `renice` itself uses `ps` to check for a java process using the users own ID. There might be other instances of java spawning under different users, but the minecraft server runs under its own user _minecraft_. I obviously don't want to enter a password every time I start the server. from _\/etc\/sudoers_ : minecraft ALL = NOPASSWD: \/etc\/renice Is there a more elegant way to do this? Simply using `nice` is not an option, `sudo nice bash` in combination with the _NOPASSWD:_ option would be a great security issue."} {"id":"57088","title":"How to start linpus linux on an Acer Gateway NE56R?","text":"I just purchased a laptop and the pre-installed OS is Linpus Linux. It only shows: [root@localhost \/]# What do I do? How can I tell if X is running? Do I need to install it?"} {"id":"153426","title":"What does this netcat output mean?","text":"I want to telnet into my locally running VM which has a dictd service running on port 2628, when I issue my nc -v command though I get the following: $ nc -v localhost 2628 nc: connectx to localhost port 2628 (tcp) failed: Connection refused found 0 associations found 1 connections: 1: flags=82 outif lo0 src 127.0.0.1 port 63929 dst 127.0.0.1 port 2628 rank info not available TCP aux info available Connection to localhost port 2628 [tcp\/dict] succeeded! Why is there a connection refused and then a connection succeeded later on? What does this mean and why won't it accept my connection when I just do: `telnet localhost 2628`?"} {"id":"102364","title":"why ls reports a huge file and du does not?","text":"When I run `arm-none-eabi-objcopy -O binary add.elf add.bin` everything seems to be ok. But, later when I run `ls -lh add.bin add.elf` this is the output I received: -rw-r--r-- 1 david david 2,6G nov 23 22:49 add.bin -rwxr-xr-x 1 david david 65K nov 23 22:40 add.elf this is a huge file. But when I run `du -h add.bin` the output is: 8,0K add.bin What's happening here? Edit: Output of `arm-none-eabi -A -t -x add.bin`: Warning: could not locate 'add.bin'. reason: Value too large for defined data type Output of `arm-none-eabi -A -t -x add.elf`: section size addr .text 0x2c 0x0 .data 0xc 0xa0000000 .ARM.attributes 0x14 0x0 Total 0x4c Output of `du -bh add.bin`: 2,6G add.bin This is how I fixed it: Initially when I link the program with the command `arm-none-eabi-ld -Tld_script.lds -o add.elf add.o` the ld script file `ld_script.lds` contains this: SECTIONS { . = 0x00000000; .text : { * (.text); } . = 0xA0000000; \/* RAM starting address *\/ .data :{ * (.data); } } The above code fills from 0x00000000 to 0xA0000000 with 0s. This error can be solved the following way: SECTIONS { . = 0x00000000; .text : { * (.text); } flash_sdata = .; \/* Start data in flash right after the text *\/ . = 0xA0000000; \/* RAM starting address *\/ ram_sdata = .; \/* AT specifies the load addr. of .data section *\/ .data : AT (flash_sdata) { * (.data); } ram_edata = .; \/* Address of end of data in RAM *\/ data_size = ram_edata - ram_sdata; } And then in the source I added a piece to copy the data from Flash to RAM. Something like this: @ Copy data to RAM. start: ldr r0, =flash_sdata ldr r1, =ram_sdata ldr r2, =data_size copy: ldrb r4, [r0], #1 strb r4, [r1], #1 subs r2, r2, #1 bne copy If my English is not too precise, this is the link which helps me to fix the problem. (And a good site for learning ARM embedded programming)."} {"id":"91954","title":"gtk-color-scheme = \"bg_color: red\\ results in red bg + red scroll bar bg + red scroll bar ? where is the logic?","text":"Let's edit this theme's gtkrc file: vi vi \/usr\/share\/themes\/industrial\/gtk-2.0\/gtkrc gtk-color-scheme = \"bg_color: #000000000000\\ nfg_color: #ffffff\\nbase_color: #000000000000\\ ntext_color: #ffffff\\nselected_bg_color: #ffffff\\ nselected_fg_color: #000000000000\\ ntooltip_bg_color: #000000000000\\ ntooltip_fg_color: #ffffff Let's change the bg_color to \"red\" and apply the theme to the desktop. But the problem is this, the background of every scroll bar, and the foreground of the scroll bar, both become red, this makes it impossible to see the scroll bar due to the background being same color as the scroll bar. By scroll bar I am referring to the scroll bar in firefox web browser for example that you'd use to scroll up and down. I am currently using my mouse's wheel button because the scroll bar does not look visible. Why are colors being applied this way? Why isn't there a distinction between the foreground and the background of the scroll bars?"} {"id":"107704","title":"Debian: keep custom changes in initscript","text":"I had to modify the initscript for Postfix `\/etc\/init.d\/postfix` to customize it for my special needs. Now I want to ensure, that in case of the `postfix` package being updated in the future (I am running Debian Wheezy Stable, but there could still be a security update) my modified initscript will not be overwritten. As I understand, packages ask before overwriting `config` files, but not initscripts. What is the recommended way to do it (cleanly) ?"} {"id":"80595","title":"How to follow and seek in a file being piped through a filter, in less","text":"I basically wish to seek, search and follow a growing log file _after passing it through a`sed` filter_. I figured I need to follow a file with `tail -f` pipe it to `sed` and then pipe that to `less`. For testing, I first tried combining `tail -f` and `less +F` to no avail: * `tail -f file | less +F` -- less doesn't run before one presses `Ctrl`+`C` to stop tail's following. `less` options `-B -b 1` do not help. * `less +F -f <(tail -f file)` exhibits the same behavior. If anyone knows a better\/simpler solution than what I figured out in the end, I'd appreciate it."} {"id":"37309","title":"Debian Mouse Preference?","text":"I just loaded Debian onto a live usb today for the first time. I successfully killed my laptops annoying trackpad with the synclient command, but now I can't figure out how to get Debian to stop putting my mouse to sleep everytime I stop using it for a few seconds. Does anyone know how to disable this or at the very least extend the time."} {"id":"117529","title":"How to reset user password for an RSA II card?","text":"I've got root access on a SLES 9 with a Remote Supervisor Adapter II Refresh 1 card :) The password for the user for the RSA card is incorrect. **My question:** How can I reset the RSA user's password without rebooting the machine?"} {"id":"59956","title":"Reorder folders on FAT32 drive","text":"My car can read MP3 files from a FAT32 flash drive. I have a folder for each artist on the drive, then MP3 files in those folders. However the car does not read the folders alphabetically, but by the order they were added to the drive. I can use **DriveSort** to sort the drive after I add a new artist. Could this \"sorting\" be done from the command line, perhaps using `touch`?"} {"id":"72458","title":"Unable to find an option to install CentOS 6.4 (64bit) in command line (linux text) for Asterisk","text":"I am trying to learn Asterisk, so I downloaded the latest CentOS 6.4 (64bit) to install on VMWare Workstation 9. When I started the installation it is not giving any screen to start the installation in command line mode, like it did with CentOS 5.5 (like type linux text command). The reason I want to install it in CLI is that I do not know Linux at all except a few commands and CLI gives option to uncheck GENOME, KDE, Server and more during installation. I really do not know what options to select in GUI while installing from the customization menu (like what all components to install). Is there any way to do it? I am also wondering if the MINIMAL install feature on CentOS 6.4 (64bit) is same as CentOS 5.5 (32bit), where if we start installation with \"linux text\" command and unselect every package including KDE, GENOME, SERVER and etc."} {"id":"138982","title":"backup process taking prolonged time due to rsync no space left on device error","text":"I am trying to understand why the backup process in one of the servers is taking so long and not copying the data correctly. This is the size of the external HDD partition. df -h \/dev\/sdb1 Filesystem Size Used Avail Use% Mounted on \/dev\/sdb1 985G 362G 573G 39% \/media\/backup The folder that I am trying to copy is lesser than the size of the external HDD partition. df -h \/dev\/sda4 Filesystem Size Used Avail Use% Mounted on \/dev\/sda4 3.4T 867G 2.4T 27% \/mounts Everything just seemed fine. I started the backup process almost a week back and still it has not completed. I realized it might be an issue with the USB port speed but I was wrong. I also suspected it might be a corrupted file system that might be causing the error. I wanted to run `fsck` on the `\/dev\/sda4` file system. But when I checked some of the script output, I read some error messages as, rsync: mkstemp \"\/media\/backup\/2014-06-18_09-36\/mounts\/ no space left on device (28) From here, I read that 5% of the disk space would be allocated for root file system. I do not understand if that is related to my problem. Also, from here, I read the inode size cannot be greater than 2 GB. I believe it should be something that I investigate. But am not sure if that is the problem though. I would appreciate more pointers towards the right direction. **EDIT:** The output of `df -i` command is as below. df -i \/dev\/sdb1 \/dev\/sdb1 65544192 65279823 264369 100% \/media\/backup df -i \/dev\/sda4 Filesystem Inodes IUsed IFree IUse% Mounted on \/dev\/sda4 229957632 171244050 58713582 75% \/mounts"} {"id":"136588","title":"Is there are any documentation about user-defined menu in midnight-commander?","text":"I'd like to create my own user-defined menu for mc ( **menu** file). I see some lines like + t r & ! t t or + t t What does it mean?"} {"id":"109856","title":"Is my SSD okay?:","text":"`iostat -xk 5` shows this: 1.31 10.63 3.99 14.21 0.00 69.86 Device: rrqm\/s wrqm\/s r\/s w\/s rkB\/s wkB\/s avgrq-sz avgqu-sz await svctm %util sda 2942.00 497.40 1755.00 414.60 19107.20 3695.20 21.02 86.19 41.18 0.40 86.96 sdb 62.40 519.00 137.40 73.00 2459.20 2372.00 45.92 1.04 4.95 2.03 42.72 avg-cpu: %user %nice %system %iowait %steal %idle 2.54 10.23 4.90 14.27 0.00 68.05 Device: rrqm\/s wrqm\/s r\/s w\/s rkB\/s wkB\/s avgrq-sz avgqu-sz await svctm %util sda 8936.80 395.00 2752.80 4.00 48004.80 1596.00 35.98 3.90 1.41 0.30 83.70 sdb 393.40 491.00 238.80 76.00 4984.80 2268.00 46.08 4.65 14.79 1.52 48.00 What does `await 14.79` mean? Is the unit milliseconds, seconds or something else? What does `svctime` mean? Is the unit milliseconds, seconds or something else?"} {"id":"76166","title":"What does \"INFO: task XXX blocked for more than 120 seconds\" exactly mean on Linux?","text":"I had this message in my kernel log : `INFO: task XXX blocked for more than 120 seconds`. I would like to know what it means technically: **under what conditions does the kernel display this message about a task?** For the record, my blocked task was `multipathd`, but I'm also interested in the general meaning of this error."} {"id":"96308","title":"returncode of command in a pipline","text":"The following script runs on Solaris using _\/bin\/ksh_ and on Linux using _\/bin\/sh_ cmd | tee -a cmd.log | tail exit $? The output of _cmd_ is saved in a file _cmd.log_ and the last lines are displayed on `stdout`. The purpose of `exit $?` was to exit the script with the return code of _cmd_. Of course this does not work because `$?` holds the return code of the last command in the pipeline which is `tail`. Workaround (I will omit all cleanup activities) : { cmd; echo $? > error.file; } | tee -a cmd.log | tail exit `cat error.file` But is there another way to get the returncode of _cmd_ and to avoid the creation of a file like _error.file_?"} {"id":"72391","title":"How to make my debian to work as http\/html proxy?","text":"I use debian on faculty server via putty having its public Ip adress. I have sudo. I wonder how to make it work as Http\/html proxy for access to \"web of science\" from my home windows browser. I wonder where to get instructions on how to make my debian work as http proxy (if possible sequred)?"} {"id":"144422","title":"Getting the current path in .desktop EXEC command","text":"Im trying to make a .desktop file run a .sh which is stored in the same directory as the .desktop. The whole directory needs to be portable and moved from machine to machine. my run script is `run.sh` I've tried: [Desktop Entry] Type=Application Terminal=true Name=RunMe #Exec=sh -c \"`dirname %k`\/run.sh\" #Exec=bash -c \"export PATH=$PATH:`dirname %k`; bash run.sh;\" #Exec=bash -c \"export PATH=$PATH:`dirname %k`; sh run.sh;\" Exec=bash -c \"export PATH=$PATH:`dirname %k`; run.sh;\" But nothing happens when I double click the .desktop file. If I double click 'run.sh' and choose 'run' the script runs fine. If I run the script from the command line with '`sh run.sh`' it works fine. Any ideas, even just how I could debug which path its actually trying to run from?"} {"id":"91210","title":"What is the Execute Disable bit?","text":"I read an article about the Execute Disable Bit (EDB) on x86 CPUs. This is more widely known as the NX bit; Intel also calls it XD. So Windows XP supports this hardware feature. Yay! But how do I know if my Linux distribution of choice supports it? What problems can occur, if this BIOS option is enabled? Where do I read more on how this feature is handled by Linux?"} {"id":"23263","title":"Embedded linux LCD not calibrated","text":"I have attached a new LCD to my embedded Linux device and when I run the system I found that it is shifted to the right. (the display starts from the middle of the LCD) I found 2 frame buffer drivers under Linux kernel driver and modify in following areas: #ifdef CONFIG_TOPPOLY_TD035TTEA3_320X240 hsync_len : 64, vsync_len : 6, left_margin : 125, upper_margin : 70, right_margin: 115, lower_margin : 36, sync: 0, cmap_static: 0, #endif But the problem is still there. What should I do?"} {"id":"23261","title":"How is FireFox running on a virtual machine that has no display?","text":"I am using a Red Hat virtual machine, accessible only remotely. However when I use the `top` command, one of the displayed processes taking up the most memory is firefox, located at `\/usr\/lib64\/firefox-3.0.18\/firefox`. How could such a process be launched without a display, and could it be actually used by some processes? Is there a way to check which processes are using it?"} {"id":"76189","title":"What does the tilde (~) mean at the end of a filename?","text":"What is the file with the `~` at the end of the filename for? $ ls # aliased to add flags -rwxrwxr-x 1 durrantm 2741 May 16 09:28 strip_out_rspec_prep_cmds.sh~* drwxrwxr-x 13 durrantm 4096 May 16 14:21 ..\/ -rwxrwxr-x 1 durrantm 2221 May 16 14:58 strip_out_rspec_prep_cmds.sh* This is not the same as `.swp` files which are there while editing. The two files have quite a few differences and the newer file ( **no** `~` at the end) has the most recent changes and those changes are not in the older (~) file. Looks like I can delete it?"} {"id":"6781","title":"What does *~ mean?","text":"At the end of a makefile I saw rm -f *~ *.class I understand the `*.class`, but what's `*~`?"} {"id":"126318","title":"What does ~ mean at the end of a file name (e.g. httpd.conf~)?","text":"I edited a fresh apache config file in CentOS 5 using gedit. When I looked at the directory I saw now two files: httpd.conf and httpd.conf~ What does the ~ signify?"} {"id":"87905","title":"Is running GUI apps on server a security issue?","text":"To edit system files for example `\/etc\/named\/named.conf`, I use: su - Password: gedit And then opens and edit above like files, instead of: nano \/etc\/named\/named.conf or: vi \/etc\/named\/named.conf Can this habit of using GUI tools every now and again cause a security problem, especially in **server** environment?"} {"id":"109273","title":"Gnome 3: open and resize application at startup","text":"I need to open a couple of terminal windows and watch the output of a couple of programs. Currently I open them in `~\/.profile`, then once in Gnome I click them to bring them to the front, then resize them, then select \"Always on top\", then move them to a specific spot on my screen. Can this all be done automatically? Similar question, but I am not very familiar with X, and maybe Gnome offers an easier solution."} {"id":"87906","title":"Couldn't fill logical volume maps","text":"So I have a big problem here. On our server, there is an LVM raid with one volume group called `raid`. It contained two volumes, `secured` and `unsecured` and some unallocated space. Today I tried to remove `unsecured` and recreate it with using all of the remaining free space. I ran the following commands lvremove unsecured raid lvcreate -l 100%FREE -n unsecured raid and it said logical volumes cannot contain more than 65534 extents. logical extent (0) already mapped. Couldn't fill logical volume maps. logical extent (0) already mapped. Couldn't fill logical volume maps. logical extent (0) already mapped. Couldn't fill logical volume maps. logical extent (0) already mapped. Couldn't fill logical volume maps. Volume group for uuid not found: GC3toI0uhKos5KLH0OJ6uMFppc9pSSyl00000000000000000000000000000001 Failed to activate new LV. After that, I cannot use any lvm command anymore, e.g., `lvdisplay`, `vgdisplay` etc. It always says something like this: # vgdisplay logical extent (0) already mapped. Couldn't fill logical volume maps. logical extent (0) already mapped. Couldn't fill logical volume maps. Volume group \"raid\" not found Right now, `secured` is still mounted and I can access the data. I am very worried that data may be lost when I reboot. What is going on here? What did I do wrong and can I somehow fix this?"} {"id":"14831","title":"How to change ALL the postfixes of files in a single directory, single command","text":"> **Possible Duplicate:** > How to clean up file extensions? have a directory full of files ending with .JPG I need to change them all to .jpg How?"} {"id":"11011","title":"Multiple renaming files","text":"> **Possible Duplicate:** > How to clean up file extensions? I'd like to rename files with extension .flac.mp3 to extension .mp3. I used the following command $ for i in *; do mv $i `echo $i | sed 's\/.flac\/\/g'`; done This writes for every file the following error message. mv: target `file.mp3' is not a directory Where am I doing mistake? thank you"} {"id":"46487","title":"File extension case sensitivity on CentOS","text":"> **Possible Duplicate:** > How to clean up file extensions? I'm using CentOS. There are >10M images in one of my folders, which are furthur grouped into subdirectories. The issue is that some of my images are named as abc. **jpg** and others are named as xyz. **JPG**. So, when i try to access xyz.jpg, it says \"File not found\" as the extension is case-sensitive. Is there any way to rename all `JPG` to `jpg`, or a httpd config which works around this issue."} {"id":"102647","title":"How to rename multiple files in single command or script in Unix?","text":"I have the below list of files aro_tty-mIF-45875564pmo_opt aro_tty-mIF-45875664pmo_opt aro_tty-mIF-45875964pmo_opt aro_tty-mIF-45875514pmo_opt aro_tty-mIF-45875524pmo_opt that I need to rename to aro_tty-mImpFRA-45875564pmo_opt aro_tty-mImpFRA-45875664pmo_opt aro_tty-mImpFRA-45875964pmo_opt aro_tty-mImpFRA-45875514pmo_opt aro_tty-mImpFRA-45875524pmo_opt Please help me out."} {"id":"98070","title":"Rename files in directory","text":"How to rename files in a directory such as the following file: `PMC21375.pdf.txt`, I need to be renamed to `21375.txt`. i.e, I need to remove both `PMC` and `pdf` from each file name."} {"id":"131310","title":"Add $HOME\/bin to PATH for a single user in Debian Wheezy with LXDE","text":"In Ubuntu, if $HOME\/bin exists, it will be automagically added to PATH, but this doesn't happen in Debian. How do I permanently add it to PATH for a given user, but only for him, not for all users? I want it to be valid for GUI programs also, not just for the terminal. **Edit:** To clarify, I use LXDE, and from a login manager, i.e. not `startx`. `.bashrc` does not work for programs I start outside a terminal."} {"id":"121549","title":"What does it mean exactly when a processes \"Time\" has stopped in top?","text":"I'll be looking into why we're getting critical swap alerts, and I'll find something like: PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ SWAP COMMAND 14683 user1 30 10 16.0g 772m 744 S 0.3 0.3 277:24.87 6.5g MATLAB 14576 user1 30 10 8125m 1.1g 736 S 0.3 0.4 261:16.73 4.1g MATLAB where the TIME+ column is frozen for those processes. My question is, in the above, what does this imply? As I understand it, stopped time means that it's a dormant process\/not being processed by the CPU. However the above example shows 0.3% CPU use, so despite the fact that it's very small, shouldn't the time column continue incrementing? Are these processes \"finished\"? In which case, how are they cleaned up? Does the user who started them need to acknowledge them or something for those resources to be freed up?"} {"id":"55207","title":"PCI passthrough with Xen","text":"I am trying to run Windows XP in a Xen DomU virtual machine with a PCIe device, for which there are no Linux drivers, being passed through from a Debian Squeeze Dom0. My hardware supports virtualization and it is active in the bios. If I run grep -E \"(vmx|svm)\" --color=always \/proc\/cpuinfo when I boot from the standard kernel I can see my processor supports vmx, although when I boot the Xen kernel, vmx doesn't show up. I have followed the setup in http:\/\/wiki.xen.org\/wiki\/Xen_Beginners_Guide. The guide basically creates a minimal Debain Squeeze install as Dom0, a PV Debian Squeeze DomU and a HVM Windows DomU running on an LVM volume. I have followed the guide essentially to the letter with the only differences being network bridge is different and I didn't install a Debian PV DomU. I currently have a DomU on an LVM volume that is running a fully updated version of Windows XP with the GPLPV drivers. I am now trying to pass the PCI device, but am running into problems. If I compare the output of `lspci` with and without the PCIe card that I am trying to pass I see the following two new entries: 05:00.0 PCI bridge: PLX Technology, Inc. PEX 8111 PCI Express-to-PCI Bridge (rev 21) 06:04.0 Bridge: Device 4550:9054 (rev 01) I also see that another entry has changed its address from 06:00.0 IDE interface: Marvell Technology Group Ltd. 88SE6121 SATA II Controller (rev b2) to 07:00.0 IDE interface: Marvell Technology Group Ltd. 88SE6121 SATA II Controller (rev b2) I modified `\/etc\/default\/grub` to include either GRUB_CMDLINE_XEN=\"xen-pciback.hide=(05:00.0)(06:04.0)\" or GRUB_CMDLINE_XEN=\"pciback.hide=(05:00.0)(06:04.0)\" and run `update-grub` and `update-grub2` after making the change and then fully powered down and rebooted. This doesn't appear to do anything and nothing shows up with xm pci-list-assignable-devices Looking at the Xen wiki guide http:\/\/wiki.xen.org\/wiki\/Xen_PCI_Passthrough I have tried things like echo 0000:05:00.0 > \/sys\/bus\/pci\/devices\/0000:05:00.0\/driver\/unbind echo 0000:05:00.0 > \/sys\/bus\/pci\/drivers\/pciback\/new_slot echo 0000:05:00.0 > \/sys\/bus\/pci\/drivers\/pciback\/bind and some other stuff related to pci-stub. Sometimes my random fiddling results in xm pci-list-assignable-devices listing 05:00.0 and 06:04.0. If I modify my .cfg file to include pci = ['05:00.0', '06:04.0'] I get an error about pci-stub not owning the 05:00.0 device. If I only try and pass 06:04.0 the DomU won't boot. Any ideas how to get pci passthrough working."} {"id":"141431","title":"annotate \"include\" file for grep with comments?","text":"I do a `grep` sort that includes certain strings. That is, give me the lines in a file that DO contain certain strings. As in grep -fv include file > out That command looks in `file` and sends to `out` every line that matches what is in the file `include`. No problem with that. Works fine. BUT How do I put comments in my `include` file? For example, I'd like to annotate that file with some (e.g. `#`) comments that explain what I'm including. So I'd like for `grep` to ignore any lines in the `include` file that start with `#`. How do I do that?"} {"id":"84229","title":"Change filename from lowercase to uppercase recursively","text":"I have 1,000,000 files in some folders and subfolders. I want to rename them from lowercase to uppercase using shell commands. I don't want to modify the extension. only filename part. I have found this one: rename 's\/^([^.]*)\\.(.*)$\/\\U$1\\E.$2\/' * but it is not recursive and only works on files in current folder. Then I tried this one: find . -depth -execdir rename 's\/^([^.]*)\\.(.*)$\/\\U$1\\E.$2\/' {} \\; But no files changed. How can I use it recursively?"} {"id":"4632","title":"Is it possible to find out which files are setting\/adding to environment variables, and their order of precedence?","text":"Some of my environment variables (`$PATH`, `$MANPATH` and friends) are partially set up in different source files. I find myself wishing for a command or method to quickly gather _what part_ , in a specific environment variable, came from _what file_. My $PATH, for instance, has obviously been set (added to) in `.bashrc`, `\/etc\/paths`, `\/etc\/paths.d\/X11` … and I'm still looking for that last mysterious file which superfluously created a duplicate path definition in my `$PATH`. It takes a good while to manually pinpoint the files that contribute to environment variables. There must be a useful way to bypass this unnecessary labor of tracing all the setters … or am I the only one thinking along these lines?"} {"id":"1416","title":"Redirecting stdout to a file you don't have write permission on","text":"When you attempt to modify a file without having write permissions on it, you get an error: > touch \/tmp\/foo && sudo chown root \/tmp\/foo > echo test > \/tmp\/foo zsh: permission denied: \/tmp\/foo Sudoing doesn't help, because it runs the command as root, but the shell handles redirecting stdout and opens the file as you anyway: > sudo echo test > \/tmp\/foo zsh: permission denied: \/tmp\/foo Is there an easy way to redirect stdout to a file you don't have permission to write to, besides opening a shell as root and manipulating the file that way? > sudo su # echo test > \/tmp\/foo"} {"id":"129370","title":"Write a file in \/var\/lib\/sysnews\/","text":"In that folder are stored the `news` files: they can be created by the system administrator to write some informations for the users, as suggested in this link. I tried as a normal user to add a file in `\/var\/lib\/sysnews`, but nor this command echo \"Hello world\" > \/var\/lib\/sysnews neither this command sudo echo \"Hello world\" > \/var\/lib\/sysnews worked (it gives _permission denied_ error). The folder is owned by `root` user and by the `staff` group. My normal user was already in the `sudo` group; I added the `staff` group for my user, but with no results. I can add news only by creating a file in one of my folders and then typing sudo mv myfile \/var\/lib\/sysnews but it is bothering. Is there a simpler way to add some news file to that folder without being root?"} {"id":"4335","title":"How to insert text into a root-owned file using sudo?","text":"> **Possible Duplicate:** > Redirecting stdout to a file you don't have write permission on Running a command like `sudo echo 'text' >> \/file.txt` fails with: bash: \/file.txt: Permission denied"} {"id":"16894","title":"sudo here-document \/ concatenation?","text":"> **Possible Duplicate:** > Redirecting stdout to a file you don't have write permission on I'm new i'm trying to learn shell scripting. Is there a way to force a concatenation and override the privileges doing the following one line command? `read domain; echo \"127.0.1.1 $domain \" >> \/etc\/hosts` What i'm trying to do is just create a simple script to type in the domain and then add it to my hosts file for development. Since my hosts file has restrictive permissions (even though i'm the only user with sudo powers) it won't let go. The ideal output would just do the following: `127.0.0.1 foo.l`"} {"id":"31322","title":"permission denied when redirecting sudo sed output","text":"> **Possible Duplicate:** > Redirecting stdout to a file you don't have write permission on I'm trying to install drupal according to the instructions given in this tutorial: http:\/\/how-to.linuxcareer.com\/how-to-install-drupal-7-on-ubuntu- linux and am stuck on a step: $ cd \/etc\/apache2\/sites-available $ sudo sed 's\/www\/www\\\/drupal\/g' default > drupal bash: drupal: Permission denied The permissions for `\/var\/www\/drupal` are set to 777."} {"id":"154579","title":"Emptying a file for root user does not work","text":"I use below command to empty a file > file.txt It works perfectly fine! But there are some files with `root` user permissions. So I tried sudo > different-file.txt and I got below verbose usage: sudo [-D level] -h | -K | -k | -V usage: sudo -v [-AknS] [-D level] [-g groupname|#gid] [-p prompt] [-u user name|#uid] usage: sudo -l[l] [-AknS] [-D level] [-g groupname|#gid] [-p prompt] [-U user name] [-u user name|#uid] [-g groupname|#gid] [command] usage: sudo [-AbEHknPS] [-C fd] [-D level] [-g groupname|#gid] [-p prompt] [-u user name|#uid] [-g groupname|#gid] [VAR=value] [-i|-s] [] usage: sudo -e [-AknS] [-C fd] [-D level] [-g groupname|#gid] [-p prompt] [-u user name|#uid] file ... This suggests that there is some syntax error in my command. What is wrong?"} {"id":"25747","title":"where should I put the sudo in this command?","text":"> **Possible Duplicate:** > Redirecting stdout to a file you don't have write permission on `echo \"some words\" >> \/etc\/apt\/source.list` `permission denied` `sudo echo \"some words\" >> \/etc\/apt\/source.list` also return permission denied Then I think maybe the append operator is another command, I should put the sudo before it, so I try `echo \"some words\" >> sudo \/etc\/apt\/source.list` also return permission denied how should I do this task?"} {"id":"61559","title":"Root user can't do everything?","text":"> **Possible Duplicate:** > Redirecting stdout to a file you don’t have write permission on I'm quite new to Linux and I have a permissions questions. I'm using Linux Mint. If I go to `\/opt` and do a `$ echo hi > file` it says permission denied. If I try with sudo, like this `$ sudo echo > file` it says permission denied. Isn't sudo to execute the command as superuser? How do I get permission denied as SU? If I do a `$ sudo su` and after that I do a `$ echo > file` it works. Is sudo su not the same as sudo?"} {"id":"151092","title":"Permission denied when trying to write to a file in \/sys directory","text":"I'm trying to manually set the speed of the fan on my Macbook Pro 7.1 which is running Crunchbang Linux Waldorf. I'm following the instructions in this blog article http:\/\/allanmcrae.com\/2010\/05\/simple-macbook-pro-fan-daemon\/ I need to write to a file but I'm getting permission denied when running this command sudo echo 1 > \/sys\/devices\/platform\/applesmc.768\/fan1_manual"} {"id":"78657","title":"Can't edit \/proc\/sys\/net\/core\/wmem_max","text":"Recently my wireless network has being stopping to transfer data from some irregular time intervals that vary from 30 seconds to 20 minutes, and every time I need to plug off and then on the wireless adapter. Using ping (`ping 8.8.8.8`) to see what happens, and when data transfer stops I receive this message: > ping: sendmsg: No buffer space available So I found out that a solution for this is to increase buffer size with this command: sudo echo 83886080 > \/proc\/sys\/net\/core\/wmem_max Although I can't execute this command, when I hit enter I get this: > bash: \/proc\/sys\/net\/core\/wmem_max: Permission denied Trying the command without `sudo` or with `gksu` returns the same message. Through GEdit I can open `\/proc\/sys\/net\/core\/wmem_max` file, and opening as administrator it enables me to click the 'Save' button, although after changing the value and hitting the button it returns me this message: > Could not create a temporary backup file while saving > \/proc\/sys\/net\/core\/wmem_max > > gedit could not backup the old copy of the file before saving the new one. > You can ignore this warning and save the file anyway, but if an error occurs > while saving, you could lose the old copy of the file. Save anyway? And even clicking in the 'Save anyway' button it returns the very same message."} {"id":"148592","title":"Why do I get \"Permission denied\" when redirecting the output of sudo echo \"xyz\" to a file?","text":"Why do I get -bash: test: Permission denied when I run sudo echo \"xyz\" > test The directory permissions are: drwxr-xr-x 3 root root 4096 2014-08-05 16:26 I have no problem creating a file in the directory using `sudo`. But why can't I sudo echo into it?"} {"id":"27312","title":"Why can I copy files to, but not create files in, this directory?","text":"> **Possible Duplicate:** > Redirecting stdout to a file you don't have write permission on I'm trying to create an `md5sum` for an ISO image created with the Ubuntu Customization Kit tools. The ISO is created by the tools, which have to be run with `sudo`, in ~\/tmp\/remaster-new-files\/ which has permissions: drwxr-xr-x 2 root root remaster-new-files So I `cd` to that directory and run sudo md5sum my.iso > my.iso.md5 and I get the following error: bash: my.iso.md5: Permission denied I can create the md5 sum somewhere else and use `sudo mv` to move it into place, exactly where it would be if the `sudo md5sum` command succeeded. Also, if I change user to `root` with `sudo su root`, I can run the `md5sum` command successfully. Why can't I use `sudo` to create files in this directory, given that I can use `sudo` to move files to it?"} {"id":"42801","title":"How do I append text to a write protected file","text":"> **Possible Duplicate:** > Redirecting stdout to a file you don't have write permission on I am trying to append a line of text to a write protected file. I tried to accomplish this with `sudo echo \"New line to write\" >> file.txt` but I get a permission denied error -- presumably because it is trying to sudo the string, not the act of appending it to a file. If I run `sudo vi file.txt` and authenticate I can happily write away. Any help would be greatly appreciated."} {"id":"47183","title":"Script with root permission","text":"> **Possible Duplicate:** > Redirecting stdout to a file you don't have write permission on I am creating a script to change the brightness of my laptop. I discovered that I can do this using echo 1000 > \/sys\/class\/backlight\/intel_backlight\/brightness for example. But I must to do this as root, not with `sudo` command. Well, I created the file `\/usr\/bin\/brilho` containing echo \"$1\" > \/sys\/class\/backlight\/intel_backlight\/brightness and now I can execute it with `brilho 1000`. But the problem is the permission. This does not work with `sudo brilho 1000` neither `brilho 100`. Again I have to change to root. So, I would like to know how to improve this to facilitate my job. Regards and thanks."} {"id":"4830","title":"How do I use redirection with sudo","text":"> **Possible Duplicate:** > Redirecting stdout to a file you don't have write permission on Yeah I could (and probably will) just escalate to root, but I'd like to know why this doesn't work? sudo cat .mplayer\/config >> \/home\/griff\/.mplayer\/config zsh: permission denied: \/home\/griff\/.mplayer\/config `sudo` is configured to be able to run any command, I've placed no restrictions on it."} {"id":"106663","title":"How do you process an entire command as sudo that involves redirecting or piping?","text":"I am trying to follow what I assume is best practises of using sudo instead of root account. I am running a simple concat file operation such as: sudo echo 'clock_hctosys=\"YES\"' >> \/etc\/conf.d\/hwclock This fails as to the right of the \">>\" it is running as the normal user. Adding extra sudos also fails (expected behaviour since piping to the sudo command and not to the file). Example is just that but it has been verified and tested under the root account."} {"id":"42812","title":"Can't add swap file on solaris","text":"I'm trying to add a swap file on Solaris 10. I have already created a 2GB file `swap.file`. Then, I add a swap file with the command: swap -a \/swap.file which shows an error: > \/swap.file: size is invalid What am I doing wrong?"} {"id":"85673","title":"Non-ASCII characters handled incorrectly on command line","text":"I have a problem with non-ASCII characters in the Terminal on Mac. If I write: echo ÆØÅ Then press Enter, Arrow Up, Arrow Left, so the cursor is between the Ø and the Å, then write X, then the Å is converted to ?, and if I press Enter, the following is echoed: ÆØ?X? Pressing `Ctrl`+`A` and `Ctrl`+`E` with non-ASCII characters entered also causes a mess. My settings are as follows: ~\/.profile: export LC_ALL=\"nb_NO.UTF-8\" ~\/.inputrc: set input-meta on set output-meta on set convert-meta off Terminal > Settings > Advanced > Declare terminal as: xterm Unsetting `LC_ALL` has no effect. Changing the `.inputrc` settings just seems to make things worse. I really hope someone has the answer to this."} {"id":"85674","title":"Ubuntu 13.04 on Acer x64 PC, only boots after starting recovery","text":"I have this strange problem with my Acer E1 421. First of all it's important to say that **I've upgraded this laptop's memory to 8gb RAM instead of 2**. I decided to remove Windows 7 x64, and install Ubuntu, because I just hate Windows. The problem is, the install went all fine, but when I try to boot my laptop, this happens in order: * Boot laptop * Gets past BIOS Diagnostics * I see the purple Ubuntu thing * Screen goes black and stays that way until I press the Power off button * Boot laptop again * Gets past BIOS Diagnostics * I get an Ubuntu screen where I can choose Boot Normal\/Recovery\/... * I press Recovery * I don't do anything, simply click \"Continue to Normal boot\" * It works Why do I always have to boot it up once, go through the whole recovery without actually doing anything, to get it booted? I'm using the GRUB bootloader."} {"id":"5058","title":"Guest Additions in VirtualBox","text":"I'm setting up a development server with VirtualBox. I've installed Ubuntu 10.10 Server. I want to use filesharing to setup the files that I need to develop on but it seems that the CD drive is not mounting to install the Virtualbox guest additions. How can I configure this to setup the file sharing."} {"id":"5055","title":"Execute a file in an application based on the file's extension in bash","text":"After reading this answer about a zsh feature: > If a given extension has a suffix alias, you can execute a file with that > extention directly, and ZSH will launch the given program and pass the > filename as an argument. Is there something similar to bash? That is, if a given file has an extension, how to directly execute that file, automatically launching a program just by calling the file's name? So doing > program \/path\/to\/foo.ext > > \/path\/to\/foo.ext would equivalent to the same zsh feature? Is this feature available in newer versions of bash?"} {"id":"5057","title":"What would cause \"crossover\" between two USB2 webcams when using motion?","text":"I am using the Motion package for linux to act as a security system with two Microsoft LifeCam HD-5000 webcams. In general it's working very well but I'm experiencing a weird issue. Every now and then the feed from one cam will exhibit \"crosstalk\" or \"crossover\" from the other cam, in sweeping bars, best described in this image (highlighted in red): ![WTF?](http:\/\/i.stack.imgur.com\/yBnHJ.png) As you can see, the image is a mixed mess of the inside and the outside camera feeds. I believe this article from Motion's wiki is describing the same issue, however there is no solution there besides: > If you need more than 1 USB camera add extra USB PCI cards to your computer However that is talking about USB 1.1, and these are USB 2.0 cameras. Also, I do believe this system has two UCB cards and that the cameras are connected to two different USB busses: root@chef:~# lsusb -t \/: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=ehci_hcd\/2p, 480M |__ Port 1: Dev 2, If 0, Class=hub, Driver=hub\/8p, 480M |__ Port 2: Dev 3, If 0, Class=stor., Driver=usbfs, 480M |__ Port 3: Dev 4, If 0, Class='bInterfaceClass 0x0e not yet handled', Driver=uvcvideo, 480M |__ Port 3: Dev 4, If 1, Class='bInterfaceClass 0x0e not yet handled', Driver=uvcvideo, 480M |__ Port 3: Dev 4, If 2, Class=audio, Driver=snd-usb-audio, 480M |__ Port 3: Dev 4, If 3, Class=audio, Driver=snd-usb-audio, 480M \/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci_hcd\/2p, 480M |__ Port 1: Dev 2, If 0, Class=hub, Driver=hub\/6p, 480M |__ Port 2: Dev 3, If 0, Class=HID, Driver=usbhid, 12M |__ Port 3: Dev 4, If 0, Class=HID, Driver=usbhid, 1.5M |__ Port 4: Dev 5, If 0, Class='bInterfaceClass 0x0e not yet handled', Driver=uvcvideo, 480M |__ Port 4: Dev 5, If 1, Class='bInterfaceClass 0x0e not yet handled', Driver=uvcvideo, 480M |__ Port 4: Dev 5, If 2, Class=audio, Driver=snd-usb-audio, 480M |__ Port 4: Dev 5, If 3, Class=audio, Driver=snd-usb-audio, 480M root@chef:~# lspci 00:00.0 Host bridge: Intel Corporation Core Processor DRAM Controller (rev 12) 00:02.0 VGA compatible controller: Intel Corporation Core Processor Integrated Graphics Controller (rev 12) 00:16.0 Communication controller: Intel Corporation 5 Series\/3400 Series Chipset HECI Controller (rev 06) 00:1a.0 USB Controller: Intel Corporation 5 Series\/3400 Series Chipset USB2 Enhanced Host Controller (rev 06) 00:1b.0 Audio device: Intel Corporation 5 Series\/3400 Series Chipset High Definition Audio (rev 06) 00:1c.0 PCI bridge: Intel Corporation 5 Series\/3400 Series Chipset PCI Express Root Port 1 (rev 06) 00:1c.5 PCI bridge: Intel Corporation 5 Series\/3400 Series Chipset PCI Express Root Port 6 (rev 06) 00:1d.0 USB Controller: Intel Corporation 5 Series\/3400 Series Chipset USB2 Enhanced Host Controller (rev 06) 00:1e.0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev a6) 00:1f.0 ISA bridge: Intel Corporation 5 Series Chipset LPC Interface Controller (rev 06) 00:1f.2 IDE interface: Intel Corporation 5 Series\/3400 Series Chipset 4 port SATA IDE Controller (rev 06) 00:1f.3 SMBus: Intel Corporation 5 Series\/3400 Series Chipset SMBus Controller (rev 06) 01:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111\/8168B PCI Express Gigabit Ethernet controller (rev 01) 02:00.0 Ethernet controller: Broadcom Corporation NetLink BCM57788 Gigabit Ethernet PCIe (rev 01) So my questions are: 1. Does anyone know what could cause crossover like this? 2. Any other troubleshooting suggestions? 3. I am guessing I will need to ask the developers of Motion for support, so before I do, can anyone confirm that I do have the cameras connected to two different PCI cards as they suggested?"} {"id":"5050","title":"Can someone diagnose this JACK error message?","text":"OK. I start JACK without starting the JACK server. I get: 23:09:22.730 Patchbay deactivated. 23:09:22.765 Statistics reset. Cannot connect to server socket err = No such file or directory Cannot connect to server socket jack server is not running or cannot be started 23:09:23.059 ALSA connection graph change. 23:09:23.250 ALSA connection change. Then I press the 'play' button. I get: 23:10:07.865 Startup script... 23:10:07.866 artsshell -q terminate Cannot connect to server socket err = No such file or directory Cannot connect to server socket jack server is not running or cannot be started sh: artsshell: not found 23:10:08.268 Startup script terminated with exit status=32512. 23:10:08.268 JACK is starting... 23:10:08.269 \/usr\/bin\/jackd -dalsa -dhw:0 -r44100 -p1024 -n2 23:10:08.275 JACK was started with PID=1764. Cannot create thread 1 Operation not permitted Cannot create thread 1 Operation not permitted jackdmp 1.9.6 Copyright 2001-2005 Paul Davis and others. Copyright 2004-2010 Grame. jackdmp comes with ABSOLUTELY NO WARRANTY This is free software, and you are welcome to redistribute it under certain conditions; see the file COPYING for details JACK server starting in realtime mode with priority 10 Cannot lock down memory area (Cannot allocate memory) audio_reservation_init Acquire audio card Audio0 creating alsa driver ... hw:0|hw:0|1024|2|44100|0|0|nomon|swmeter|-|32bit Using ALSA driver HDA-Intel running on card 0 - HDA Intel at 0xdfebc000 irq 42 configuring for 44100Hz, period = 1024 frames (23.2 ms), buffer = 2 periods ALSA: final selected sample format for capture: 32bit integer little-endian ALSA: use 2 periods for capture ALSA: final selected sample format for playback: 32bit integer little-endian ALSA: use 2 periods for playback Cannot use real-time scheduling (RR\/10)(1: Operation not permitted) AcquireSelfRealTime error alsa_driver_xrun_recovery JackAudioDriver::ProcessAsync: read error, skip cycle alsa_driver_xrun_recovery JackAudioDriver::ProcessAsync: read error, skip cycle alsa_driver_xrun_recovery JackAudioDriver::ProcessAsync: read error, skip cycle alsa_driver_xrun_recovery JackAudioDriver::ProcessAsync: read error, skip cycle alsa_driver_xrun_recovery JackAudioDriver::ProcessAsync: read error, skip cycle alsa_driver_xrun_recovery JackAudioDriver::ProcessAsync: read error, skip cycle alsa_driver_xrun_recovery JackAudioDriver::ProcessAsync: read error, skip cycle alsa_driver_xrun_recovery JackAudioDriver::ProcessAsync: read error, skip cycle alsa_driver_xrun_recovery JackAudioDriver::ProcessAsync: read error, skip cycle alsa_driver_xrun_recovery JackAudioDriver::ProcessAsync: read error, skip cycle alsa_driver_xrun_recovery JackAudioDriver::ProcessAsync: read error, skip cycle alsa_driver_xrun_recovery JackAudioDriver::ProcessAsync: read error, skip cycle alsa_driver_xrun_recovery JackAudioDriver::ProcessAsync: read error, skip cycle alsa_driver_xrun_recovery JackAudioDriver::ProcessAsync: read error, skip cycle alsa_driver_xrun_recovery JackAudioDriver::ProcessAsync: read error, skip cycle alsa_driver_xrun_recovery JackAudioDriver::ProcessAsync: read error, skip cycle 23:10:15.341 Could not connect to JACK server as client. - Overall operation failed. - Server communication error. If I press nothing, the above read error message repeats infinitely. I installed JACK from repositories and this is what I got."} {"id":"134093","title":"Why aren't crontabs stored in user home directories?","text":"I'm curious to know: why are crontabs stored in \/var rather than in the user's home directories? It makes it a total pain to isolate these files for upgrades but I suspect that there is a logical reason..."} {"id":"134092","title":"Virtualbox installation","text":"I'm trying to install virtualbox. But when I run dpkg -i {dpkg package} I get following error: sudo dpkg -i virtualbox-4.1_4.1.18-78361~Ubuntu~precise_amd64.deb Selecting previously unselected package virtualbox-4.1. (Reading database ... 245018 files and directories currently installed.) Unpacking virtualbox-4.1 (from virtualbox-4.1_4.1.18-78361~Ubuntu~precise_amd64.deb) ... Setting up virtualbox-4.1 (4.1.18-78361~Ubuntu~precise) ... Adding group `vboxusers' (GID 124) ... Done. * Stopping VirtualBox kernel modules [ OK ] * Uninstalling old VirtualBox DKMS kernel modules [ OK ] * Trying to register the VirtualBox kernel modules using DKMS Error! Bad return status for module build on kernel: 3.11.0-12-generic (x86_64) Consult \/var\/lib\/dkms\/vboxhost\/4.1.18\/build\/make.log for more information. * Failed, trying without DKMS * Recompiling VirtualBox kernel modules * Look at \/var\/log\/vbox-install.log to find out what went wrong In vbox-installation.log I have this: CC [M] \/var\/lib\/dkms\/vboxhost\/4.1.18\/build\/vboxdrv\/r0drv\/linux\/memobj-r0drv-linux.o \/var\/lib\/dkms\/vboxhost\/4.1.18\/build\/vboxdrv\/r0drv\/linux\/memobj-r0drv-linux.c: In function ‘rtR0MemObjNativeMapUser’: \/var\/lib\/dkms\/vboxhost\/4.1.18\/build\/vboxdrv\/r0drv\/linux\/memobj-r0drv-linux.c:1451:38: error: ‘VM_RESERVED’ undeclared (first use in this function) vma->vm_flags |= VM_RESERVED; \/* This flag helps making 100% sure some bad stuff wont happen (swap, core, ++). *\/ ^ \/var\/lib\/dkms\/vboxhost\/4.1.18\/build\/vboxdrv\/r0drv\/linux\/memobj-r0drv-linux.c:1451:38: note: each undeclared identifier is reported only once for each function it appears in make[2]: *** [\/var\/lib\/dkms\/vboxhost\/4.1.18\/build\/vboxdrv\/r0drv\/linux\/memobj-r0drv-linux.o] Error 1 make[1]: *** [\/var\/lib\/dkms\/vboxhost\/4.1.18\/build\/vboxdrv] Error 2 make: *** [_module_\/var\/lib\/dkms\/vboxhost\/4.1.18\/build] Error 2 make: Leaving directory `\/usr\/src\/linux-headers-3.11.0-12-generic' I did sudo apt-get install build-essential linux-headers-`uname -r` but the problem still exist. Thanks for all answers"} {"id":"134096","title":"Are dropbear and OpenSSH host keys compatible?","text":"The title basically says it all. But mind: **host key** , not the login key. And if they're not compatible out of the box, is there a way to convert between them - and what would be the steps in that case? Rationale: it would be nice to be able to bring up a dropbear instance in the scope of the initrd, if boot fails, but do so by incorporating the host keys (via initramfs-tools hooks) from OpenSSH that is normally installed on the host."} {"id":"123711","title":"How do I recover from the Heartbleed bug in OpenSSL?","text":"CVE-2014-0160 a.k.a. Heartbleed is a vulnerability in OpenSSL. It looks scary. How do I determine whether I am affected? If I'm affected, what do I need to do? Apparently upgrading isn't enough."} {"id":"70406","title":"How to put value of echo pipe netcat commands into variable","text":"I have this command succession: echo -ne \"\/dev\/shm\/test.sh\" | netcat 89.196.167.2 4567 and let's say it return a string like, for example \"Hello...bla\". (on the 89.196.167.2 i have made a server that takes ssh comands and executes them and returns the result to the client, and it is running ok, it return what i need, so this is not the problem) I want to put this returned value, \"Hello...bla\", into a variable and use it. If i try this: var=echo -ne \"\/dev\/shm\/test.sh\" | netcat 89.196.167.2 4567;echo \"$var\" it doesn't work... Bash returns this: -bash: -ne: command not found Can you please help me with a solution?"} {"id":"87298","title":"Linux: How to check whether a process is slowed down by other running processes","text":"I have one process running on a RHEL 6.3 machine. Somehow this is taking a longer processing time than the same process running on another machine. How is it possible to know why this process is running slow or if any other parallel running process is slowing down this process?"} {"id":"146451","title":"Arch Linux RPI: How accurate is the time on the RPi in Linux?","text":"Currently I'm working on a application on my RPi which will be monitoring a set of GPIOs in real-time where the exact time when the GPIO turns HIGH is crucial for my application. And I need to know how the time is being dealt with on the RPi with the Arch Linux OS, is it synchronized towards a UDP NTP Time Server? If that's the case is it being updated continuously in a background thread\/deamon like other Linux stuff? Or is perhaps updated each time a call to get the time is made? Because two events might occur on two (or more) GPIOs simultaneously I need to implement the fastest solution possible to get the real-time functionality. The actual date is not important when the specific event happen, instead the exact time relative to the other events is. ( **i.e** the data recorded will be shown in a graph where the spacing between the events should be as exact as possible.) So the question could be broken down to: How is time handled on the RPi with Arch Linux, and how accurate is it in a multi-thread environment? Thanks in advance."} {"id":"44225","title":"Convert mysql count(*) to int in bash?","text":"I'd like to execute this and check if count is 0, 1 or > 1 in bash. mysql -e \"select count(*) from mydb.mydb;\" The output is: +----------+ | count(*) | +----------+ | 0 | +----------+ I don't know how to parse this. Also this will be used in a cron job, so I can't have any output."} {"id":"146459","title":"How to view files hidden by a mount on Debian 6","text":"I have been trying for a while to view files, hidden by a mount on my device sporting Debian 6, to no avail, and being new to Linux, I am compelled to ask the question: How do you view files hidden by a mount on Debian 6? I have gone over the many duplicates I came across as I was drafting this question the first 1 or 10 times and the following answers did not help in my case: 1. Answer to \"Access to original contents of mount point\" 2. Answer to \"Where do the files go if you mount a drive to a folder that already contains files?\" 3. Answer to \"What happened to the old files if we mount a drive to the directory? [duplicate]\" I also found this, but it was a little intimidating to try that with my limited knowledge of what I am even doing. I also asked Linux users around me, who all (both) say that it's impossible to see my files without `umount`ing. So just to make things clear, this is what I am working with: \/tmp # mkdir FOO \/tmp # cd FOO\/ \/tmp\/FOO # touch abc \/tmp\/FOO # cd ~ # mount \/dev\/sda1 \/tmp\/FOO\/ ~ # ls \/tmp\/FOO\/ bbb ~ # cd \/tmp\/ \/tmp # mkdir BAR \/tmp # cd ~ # mount --bind \/ \/tmp\/BAR ~ # cd \/tmp\/BAR\/ \/tmp\/BAR # ls bin etc lib media proc sbin sys usr dev home linuxrc mnt root selinux tmp var \/tmp\/BAR # cd tmp\/ \/tmp\/BAR\/tmp # ls \/tmp\/BAR\/tmp # @John1024: ~ # mount | grep \/tmp\/ \/dev\/sda1 on \/tmp\/FOO type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=cp932,iocharset=cp932,errors=remount-ro) \/dev\/root on \/tmp\/BAR type jffs2 (ro,relatime) What and to where should I `mount --bind` to see the files that were in `\/tmp\/somefolder`? Could the functionality of the solutions linked above be related to what build of Debian I am using? Edit: For clarification, these are some of the commands I tried: ~ # mount --bind \/tmp\/somefolder \/tmp\/anotherfolder ~ # mount --bind \/ \/tmp\/anotherfolder ~ # mount --bind \/dev\/sda1 \/tmp\/anotherfolder"} {"id":"123940","title":"Do I require a file system when I do not want to store any data","text":"I asked a question here Is it mandatory to have a file system One of the comments is : > how a system without file system would work on linux as even a printer or > ethernet card is considered as a file ? What is your goal here ? ...Kiwy Feb > 24 at 14:18 Now here is a log message when booting linux without a file system (which is hanging at the end): [Tue Apr 08 20:07:18.298 2014] [Tue Apr 08 20:07:18.298 2014] [Tue Apr 08 20:07:18.298 2014] U-Boot 2013.07 (Apr 08 2014 - 14:27:03) [Tue Apr 08 20:07:18.298 2014] [Tue Apr 08 20:07:18.298 2014] Memory: ECC disabled [Tue Apr 08 20:07:18.298 2014] DRAM: 1 GiB [Tue Apr 08 20:07:18.308 2014] SF: Detected N25Q128A with page size 64 KiB, total 16 MiB [Tue Apr 08 20:07:18.341 2014] *** Warning - bad CRC, using default environment [Tue Apr 08 20:07:18.341 2014] [Tue Apr 08 20:07:18.341 2014] In: serial [Tue Apr 08 20:07:18.341 2014] Out: serial [Tue Apr 08 20:07:18.341 2014] Err: serial [Tue Apr 08 20:07:18.341 2014] U-BOOT for Xilinx-ZC702-14.7 [Tue Apr 08 20:07:18.341 2014] [Tue Apr 08 20:07:18.341 2014] [Tue Apr 08 20:07:18.341 2014] SF: Detected N25Q128A with page size 64 KiB, total 16 MiB [Tue Apr 08 20:07:18.697 2014] Linux [Tue Apr 08 20:07:18.697 2014] Load Address: 0x00008000 [Tue Apr 08 20:07:18.697 2014] Entry Point: 0x00008000 [Tue Apr 08 20:07:18.697 2014] Verifying Hash Integrity ... OK [Tue Apr 08 20:07:18.697 2014] ## Loading fdt from FIT Image at 01000000 ... [Tue Apr 08 20:07:18.697 2014] Using 'conf@1' configuration [Tue Apr 08 20:07:18.697 2014] Trying 'fdt@1' fdt subimage [Tue Apr 08 20:07:18.697 2014] Description: Flattened Device Tree blob [Tue Apr 08 20:07:18.697 2014] Type: Flat Device Tree [Tue Apr 08 20:07:18.697 2014] Compression: uncompressed [Tue Apr 08 20:07:18.697 2014] Data Start: 0x0111d344 [Tue Apr 08 20:07:18.697 2014] Data Size: 11179 Bytes = 10.9 KiB [Tue Apr 08 20:07:18.697 2014] Architecture: ARM [Tue Apr 08 20:07:18.697 2014] Hash algo: crc32 [Tue Apr 08 20:07:18.697 2014] Hash value: a7a92b47 [Tue Apr 08 20:07:18.697 2014] Hash algo: sha1sha1+ OK [Tue Apr 08 20:07:18.702 2014] Booting using the fdt blob at 0x111d344 [Tue Apr 08 20:07:18.702 2014] UncomprOK [Tue Apr 08 20:07:18.702 2014] Loading Device Tree to 07ffa000, end 07fffbaa ... OK [Tue Apr 08 20:07:18.702 2014] [Tue Apr 08 20:07:18.702 2014] Starting kernel ... [Tue Apr 08 20:07:18.702 2014] [Tue Apr 08 20:07:19.453 2014] u @c0a7b000 s5568 r8192 d14912 u32768 [Tue Apr 08 20:07:19.453 2014] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 260096 [Tue Apr 08 20:07:19.453 2014] Kernel command line: root=mtd:jffs2 rw rootfstype=jffs2 console=ttyPS0,115200 [Tue Apr 08 20:07:19.453 2014] PID hash table entries: 4096 (order: 2, 16384 bytes) [Tue Apr 08 20:07:19.453 2014] Dentry cache hash table entries: 131072 (order: 7, 524288 bytes) [Tue Apr 08 20:07:19.453 2014] Inode-cache hash table entries: 65536 (order: 6, 262144 bytes) [Tue Apr 08 20:07:19.453 2014] __ex_table already sorted, skipping sort [Tue Apr 08 20:07:19.453 2014] Memory: 1024MB = 1024MB total [Tue Apr 08 20:07:19.453 2014] Memory: 1036960k\/1036960k available, 11616k reserved, 270339 16 [Tue Apr 08 20:07:19.625 2014] I reach build\/linux\/kernel\/xlnx-3.8\/source\/net\/socket.c: [Tue Apr 08 20:07:19.625 2014] DMA: preallocated 256 KiB pool for atomic coherent allocations [Tue Apr 08 20:07:19.625 2014] xgpiops e000a000.ps7-gpio: gpio at 0xe000a000 mapped to 0xf004e000 [Tue Apr 08 20:07:19.625 2014] GPIO IRQ not connected [Tue Apr 08 20:07:19.625 2014] XGpio: \/amba@0\/gpio@41220000: registered, base is 255 [Tue Apr 08 20:07:19.625 2014] GPIO IRQ not connected [Tue Apr 08 20:07:19.625 2014] XGpio: \/amba@0\/gpio@41200000: registered, base is 251 [Tue Apr 08 20:07:19.625 2014] usbcore: registered new interface driver usbfs [Tue Apr 08 20:07:19.625 2014] usbcore: registered new interface driver hub [Tue Apr 08 20:07:19.625 2014] usbcore: registered new device driver usb [Tue Apr 08 20:07:19.625 2014] Switching to clocksoutyPS0 at MMIO 0xe0001000 (irq = 82) is a xuartps [Tue Apr 08 20:07:19.629 2014] console [ttyPSxusbps-ehci xusbps-ehci.0: irq 53, io mem 0x00000000 [Tue Apr 08 20:07:19.670 2014] xusbps-ehci xusbps-ehci.0: USB 2.0 started, EHCI 1.00 [Tue Apr 08 20:07:19.675 2014] hub 1-0:1.0: USB hub found [Tue Apr 08 20:07:19.675 2014] hub 1-0:1.0: 1 port detected [Tue Apr 08 20:07:19.681 2014] xi2cps e0004000.ps7-i2c: 400 kHz mmio e0004000 irq 57 [Tue Apr 08 20:07:19.686 2014] xadcps f8007100.ps7-xadc: enabled: yes reference: external [Tue Apr 08 20:07:19.709 2014] xwdtps f8005000.ps7-wdt: Xilinx Watchdog Timer at f00ea000 with timeout 10s [Tue Apr 08 20:07:19.709 2014] sdhci: Secure Digital Host Controller Interface driver [Tue Apr 08 20:07:19.709 2014] sdhci: Copyright(c) Pierre Ossman [Tue Apr 08 20:07:19.709 2014] sdhci-pltfm: SDHCI platform and OF driver helper [Tue Apr 08 20:07:19.729 2014] usbcore: registered new interface driver usbhid [Tue Apr 08 20:07:19.729 2014] usbhid: USB HID core driver [Tue Apr 08 20:07:19.729 2014] I am at build\/linux\/kernel\/xlnx-3.8\/source\/drivers\/hid\/usbhid\/hid-core.c [Tue Apr 08 20:07:19.729 2014] VFP support v0.3: implementor 41 architecture 3 part 30 variant 9 rev 4 [Tue Apr 08 20:07:19.781 2014] MTD: MTD device with name \"jffs2\" not found. [Tue Apr 08 20:07:19.781 2014] List of all partitions: [Tue Apr 08 20:07:19.781 2014] No filesystem could mount root, tried: jffs2 [Tue Apr 08 20:07:19.781 2014] Kernel panic - not syncing: VFS: Unable to mount root fs on mtd:jffs2 [Tue Apr 08 20:07:19.781 2014] CPU1: stopping [Tue Apr 08 20:07:19.781 2014] Backtrace: [Tue Apr 08 20:07:19.781 2014] Function entered at [] from [] [Tue Apr 08 20:07:19.781 2014] r6:c0246418 r5:00000000 r4:00000001 r3:60000193 [Tue Apr 08 20:07:19.781 2014] Function entered at [] from [] [Tue Apr 08 20:07:19.781 2014] Function entered at [] from [] [Tue Apr 08 20:07:19.781 2014] r4:c0247ef4 r3:c0011f78 [Tue Apr 08 20:07:19.781 2014] Function entered at [] from [] [Tue Apr 08 20:07:19.781 2014] r5:ef07bf68 r4:f8f00100 [Tue Apr 08 20:07:19.824 2014] Function entered at [] from [] [Tue Apr 08 20:07:19.824 2014] Exception stack(0xef07bf68 to 0xef07bfb0) [Tue Apr 08 20:07:19.824 2014] bf60: c0a838d0 00000000 00000003 00000000 ef07a000 c01cd528 [Tue Apr 08 20:07:19.824 2014] bf80: ef07a000 c025c418 0000406a 413fc090 00000000 ef07bfbc ef07bfc0 ef07bfb0 [Tue Apr 08 20:07:19.824 2014] bfa0: c000e94c c000e950 60000113 ffffffff [Tue Apr 08 20:07:19.824 2014] r6:ffffffff r5:60000113 r4:c000e950 r3:c000e94c [Tue Apr 08 20:07:19.824 2014] Function entered at [] from [] [Tue Apr 08 20:07:19.824 2014] Function entered at [] from [] [Tue Apr 08 20:07:19.824 2014] r5:00000001 r4:c024cf68 [Tue Apr 08 20:07:19.824 2014] Function entered at [] from [<001c37c8>] [Tue Apr 08 20:07:19.844 2014] r6:10c03c7d r5:00000015 r4:2f06406a r3:c01c37b0 [Tue Apr 08 20:07:19.844 2014] MTD: MTD device with name \"jffs2\" not found. [Tue Apr 08 20:07:19.844 2014] List of all partitions: [Tue Apr 08 20:07:19.844 2014] No filesystem could mount root, tried: jffs2 [Tue Apr 08 20:07:19.844 2014] Kernel panic - not syncing: VFS: Unable to mount root fs on mtd: I am booting from flash. Now from the log it is very clear that many of the drivers are already loaded even though file system loading is failed (because I intentionally did not put the file system rootfs.jffs2 in flash ). Now referring to the comment above, if everything is file in linux, how come drivers are successfully loaded? You can see USB,GPIO, SD everything is coming before it asks for file system (and failed). So is it technically correct to say that > linux MUST have a file system **Some background** What I am trying to achieve is to have linux running on a system where a control application will be running. The application just captures some data and send it to some slaves. There is not question of storing data AT ALL. So would like to completely get rid of file system. As per my understanding file system is required for storing data and since I willnot storing any data so why have file system and increase the resource usage ? **Update** _Although I have mentioned this in **background** , but to be specific the sending of the data would take place using USB or Ethernet, so it is natural to have corresponding drivers._"} {"id":"140348","title":"What does \"tail -f \" do?","text":"I don't understand the function of the option `-f` added to the `tail` command. I know that `tail` views the \"last\" part of a file. The manual says that > `-f` outputs appended data as the file grows But I don't really understand what that means. I know the meaning of each word in the previous quotation, but I don't understand the meaning of the whole sentence."} {"id":"56720","title":"Extract name of file without extension in shell script","text":"> **Possible Duplicate:** > Best way to remove file extension from a string? > How to rename multiple files by removing the extension? I have a metric boatload of .txt files I'd like to load into a database. The tables have the same name as the .txt files, but without the extension. So I'd like to execute the command for f in *.txt; do mysql -u root -p -e \"LOAD DATA LOCAL INFILE '$f' INTO TABLE $f\" -D rn4; done However, the last `$f` is giving me headaches as I want it to only use the name, not the extension. So for the file `piRNA.txt` the command would look like mysql -u root -p -e \"LOAD DATA LOCAL INFILE 'piRNA.txt' INTO TABLE piRNA\" -D rn4 How do I do this? To make the answer useful for others, please do not just give me the command, but please write a line or two about how to extract the name in the general case."} {"id":"25166","title":"getting file name from the input path to the file in shell scripts","text":"> **Possible Duplicate:** > Best way to remove file extension from a string? Say that I have a script called `script.sh` In the shell I type script.sh ..\/folder\/file.py and in that file I know `echo $1` will output `..\/folder\/file.py` But is there anyway of getting just the filename without the extension... `file` only?"} {"id":"34549","title":"How to rename multiple files by removing the extension?","text":"I have a number of tiff files named: sw.001.tif sw.002.tif ... and I want to remove the `.tif` at the end of each of the files. How can I use the `rename` command to do this?"} {"id":"18764","title":"Which to choose - BSD or Unix-style commands where available?","text":"Commands like `ps` come with a lot of parameters, especially because they give the use an option to choose between Unix and BSD style flags. I hope you get my point here. So, when there's such an option available, which should I choose for maximum compatibility across all linux systems? (max. compatibility is one of the priorities for instance) I know that Unix style is quite obvious, but BSD commands for some reason include more readable information (column titles for example, CPU column etc). Of course, please correct me if I am wrong, but that's what I felt."} {"id":"33523","title":"Reinstall Debian","text":"I have a Debian based server but I don't have physical access to it and it doesn't have a DVD-drive or similar. I only have root access. Is it possible to format and reinstall Debian just by using the root account? I was thinking of solutions like installing to a separate partition and after install format the current partition or perhaps using VMWare and always run it as a VM although this would impede performance. This is because my Debian server is currently in my home country(at my parents) while I moved to another country. Do you think perhaps I should dump the server altogether and go for a hosted solution? I normally would prefer to keep my server because hosted solutions normally cost you more than having your own server and paying only for electricity."} {"id":"41545","title":"How to have tail -f show colored output with vim?","text":"In this question, Gilles answered > Yet another possibility is to run `tail -f` in an **Emacs** shell buffer and > use Emacs's syntax coloring abilities. Because I'm a vim user, I'd like to do this with _vim_ , not _emacs_. Does _vim_ have this feature?"} {"id":"83635","title":"Can not install wine on debian amd64:","text":"Can not install wine on debian amd64: > sudo aptitude install wine-bin Note: selecting \"wine-bin:i386\" instead of > the virtual package \"wine-bin\" The following NEW packages will be installed: > gcc-4.8-base:i386{ab} libasound2:i386{a} libc6:i386{a} libc6-i686:i386{a} > libdbus-1-3:i386{a} libdrm-intel1:i386{a} libdrm-nouveau2:i386{a} libdrm- > radeon1:i386{a} libdrm2:i386{a} libexpat1:i386{a} libffi6:i386{a} > libfontconfig1:i386{a} libfreetype6:i386{a} libgcc1:i386{ab} > libgcrypt11:i386{a} libgl1-mesa-dri:i386{a} libgl1-mesa-glx:i386{a} > libglapi-mesa:i386{a} libglu1-mesa:i386{a} libgnutls26:i386{a} > libgpg-error0:i386{a} libgpm2:i386{a} libgsm1:i386{a} libice6:i386{a} > libjbig0:i386 libjpeg8:i386{a} libllvm3.2:i386{a} libltdl7:i386{a} > liblzma5:i386{a} libmpg123-0:i386{a} libncurses5:i386{a} libodbc1:i386{a} > libp11-kit0:i386{a} libpciaccess0:i386{a} libpng12-0:i386{a} libsm6:i386{a} > libssl1.0.0:i386{a} libstdc++6:i386{ab} libtasn1-3:i386{a} libtiff4:i386{a} > libtinfo5:i386{a} libtxc-dxtn-s2tc0:i386{a} libuuid1:i386{a} > libv4l-0:i386{a} libv4lconvert0:i386{a} libwine:i386{a} > libwine-alsa:i386{a} libwine-bin:i386{a} libwine-gecko-1.4{a} > libwine-gl:i386{a} libx11-6:i386{a} libx11-xcb1:i386{a} libxau6:i386{a} > libxcb-dri2-0:i386{a} libxcb-glx0:i386{a} libxcb1:i386{a} > libxcomposite1:i386{a} libxcursor1:i386{a} libxdamage1:i386{a} > libxdmcp6:i386{a} libxext6:i386{a} libxfixes3:i386{a} libxi6:i386{a} > libxinerama1:i386{a} libxml2:i386{a} libxrandr2:i386{a} libxrender1:i386{a} > libxslt1.1:i386{a} libxxf86vm1:i386{a} wine-bin:i386{b} zlib1g:i386{a} 0 > packages upgraded, 71 newly installed, 0 to remove and 0 not upgraded. Need > to get 84.1 MB of archives. After unpacking 253 MB will be used. The > following packages have unmet dependencies: gcc-4.8-base : Breaks: > gcc-4.8-base:i386 (!= 4.8.1-7) but 4.8.1-6 is to be installed. > gcc-4.8-base:i386 : Breaks: gcc-4.8-base (!= 4.8.1-6) but 4.8.1-7 is > installed. libgcc1 : Breaks: libgcc1:i386 (!= 1:4.8.1-7) but 1:4.8.1-6 is to > be installed. libgcc1:i386 : Breaks: libgcc1 (!= 1:4.8.1-6) but 1:4.8.1-7 is > installed. libstdc++6 : Breaks: libstdc++6:i386 (!= 4.8.1-7) but 4.8.1-6 is > to be installed. libstdc++6:i386 : Breaks: libstdc++6 (!= 4.8.1-6) but > 4.8.1-7 is installed. wine-bin:i386 : Conflicts: wine64-bin but 1.5.30-2 is > installed. The following actions will resolve these dependencies: > > > Keep the following packages at their current version: 1) > gcc-4.8-base:i386 [Not Installed] > > > 2) libasound2:i386 [Not Installed] > 3) libc6:i386 [Not Installed] > 4) libc6-i686:i386 [Not Installed] > 5) libdbus-1-3:i386 [Not Installed] > 6) libdrm-intel1:i386 [Not Installed] > 7) libdrm-nouveau2:i386 [Not Installed] > 8) libdrm-radeon1:i386 [Not Installed] > 9) libdrm2:i386 [Not Installed] > 10) libexpat1:i386 [Not Installed] > 11) libffi6:i386 [Not Installed] > 12) libfontconfig1:i386 [Not Installed] > 13) libfreetype6:i386 [Not Installed] > 14) libgcc1:i386 [Not Installed] > 15) libgcrypt11:i386 [Not Installed] > 16) libgl1-mesa-dri:i386 [Not Installed] > 17) libgl1-mesa-glx:i386 [Not Installed] > 18) libglapi-mesa:i386 [Not Installed] > 19) libglu1-mesa:i386 [Not Installed] > 20) libgnutls26:i386 [Not Installed] > 21) libgpg-error0:i386 [Not Installed] > 22) libgpm2:i386 [Not Installed] > 23) libgsm1:i386 [Not Installed] > 24) libice6:i386 [Not Installed] > 25) libjbig0:i386 [Not Installed] > 26) libjpeg8:i386 [Not Installed] > 27) libllvm3.2:i386 [Not Installed] > 28) libltdl7:i386 [Not Installed] > 29) liblzma5:i386 [Not Installed] > 30) libmpg123-0:i386 [Not Installed] > 31) libncurses5:i386 [Not Installed] > 32) libodbc1:i386 [Not Installed] > 33) libp11-kit0:i386 [Not Installed] > 34) libpciaccess0:i386 [Not Installed] > 35) libpng12-0:i386 [Not Installed] > 36) libsm6:i386 [Not Installed] > 37) libssl1.0.0:i386 [Not Installed] > 38) libstdc++6:i386 [Not Installed] > 39) libtasn1-3:i386 [Not Installed] > 40) libtiff4:i386 [Not Installed] > 41) libtinfo5:i386 [Not Installed] > 42) libtxc-dxtn-s2tc0:i386 [Not Installed] > 43) libuuid1:i386 [Not Installed] > 44) libv4l-0:i386 [Not Installed] > 45) libv4lconvert0:i386 [Not Installed] > 46) libwine:i386 [Not Installed] > 47) libwine-alsa:i386 [Not Installed] > 48) libwine-bin:i386 [Not Installed] > 49) libwine-gl:i386 [Not Installed] > 50) libx11-6:i386 [Not Installed] > 51) libx11-xcb1:i386 [Not Installed] > 52) libxau6:i386 [Not Installed] > 53) libxcb-dri2-0:i386 [Not Installed] > 54) libxcb-glx0:i386 [Not Installed] > 55) libxcb1:i386 [Not Installed] > 56) libxcomposite1:i386 [Not Installed] > 57) libxcursor1:i386 [Not Installed] > 58) libxdamage1:i386 [Not Installed] > 59) libxdmcp6:i386 [Not Installed] > 60) libxext6:i386 [Not Installed] > 61) libxfixes3:i386 [Not Installed] > 62) libxi6:i386 [Not Installed] > 63) libxinerama1:i386 [Not Installed] > 64) libxml2:i386 [Not Installed] > 65) libxrandr2:i386 [Not Installed] > 66) libxrender1:i386 [Not Installed] > 67) libxslt1.1:i386 [Not Installed] > 68) libxxf86vm1:i386 [Not Installed] > 69) wine-bin:i386 [Not Installed] > 70) zlib1g:i386 [Not Installed] > > > Leave the following dependencies unresolved: 71) > libgl1-mesa-glx:i386 recommends libgl1-mesa-dri:i386 (>= 7.2) > > > 72) libncurses5:i386 recommends libgpm2:i386 > 73) libwine:i386 recommends libgsm1:i386 (>= 1.0.13) > 74) libwine:i386 recommends libv4l-0:i386 (>= 0.5.0)"} {"id":"137848","title":"apt-mirror clean script isn't deleting anything","text":"I am using `apt-mirror` to create a local Ubuntu mirror. It does succeed in downloading files from another mirror (there's about a couple gigabytes each week), but never removing anything or indicates files that can be deleted. I might run out of free space, eventually. The output of `apt-mirror` always include > 0.0 bytes in 0 files and 0 directories can be freed. > > Run \/var\/spool\/apt-mirror\/var\/clean.sh for this purpose. The `clean.sh` is ran every time `apt-mirror` executes, because the content of `\/var\/spool\/apt-mirror\/var\/postmirror.sh` is just \/var\/spool\/apt-mirror\/var\/clean.sh Running `clean.sh` produces this output: > Removing 0 unnecessary files [0 bytes]... done. > > Removing 0 unnecessary directories... done. Here's my `mirror.list` file: ############# config ################## # # set base_path \/var\/spool\/apt-mirror # # set mirror_path $base_path\/mirror # set skel_path $base_path\/skel # set var_path $base_path\/var # set cleanscript $var_path\/clean.sh # set defaultarch # set postmirror_script $var_path\/postmirror.sh # set run_postmirror 0 set nthreads 20 set _tilde 0 # ############# end config ############## deb-i386 http:\/\/ubuntu.c3sl.ufpr.br\/ubuntu\/ trusty main restricted universe multiverse deb-i386 http:\/\/ubuntu.c3sl.ufpr.br\/ubuntu\/ trusty-updates main restricted universe multiverse deb-i386 http:\/\/ubuntu.c3sl.ufpr.br\/ubuntu\/ trusty-backports main restricted universe multiverse deb-i386 http:\/\/ubuntu.c3sl.ufpr.br\/ubuntu\/ trusty-security main restricted universe multiverse deb-amd64 http:\/\/ubuntu.c3sl.ufpr.br\/ubuntu\/ trusty main restricted universe multiverse deb-amd64 http:\/\/ubuntu.c3sl.ufpr.br\/ubuntu\/ trusty-updates main restricted universe multiverse deb-amd64 http:\/\/ubuntu.c3sl.ufpr.br\/ubuntu\/ trusty-backports main restricted universe multiverse deb-amd64 http:\/\/ubuntu.c3sl.ufpr.br\/ubuntu\/ trusty-security main restricted universe multiverse clean http:\/\/archive.ubuntu.com\/ubuntu"} {"id":"137842","title":"What is the point of CTRL-s?","text":"`CTRL`+`s` stops all output to the terminal which can be restarted with `CTRL`+`q`. But, why does `CTRL`+`s` exist in the first place? What problem was trying to be solved by putting that control sequence in place?"} {"id":"28827","title":"Why is my bash prompt getting bugged when I browse the history?","text":"Often when I start looking at history of commands some of the characters from a command displayed aren't erased, for example: What's happening: prompt$ some_command prompt$ some_commanother_command What should have happened: prompt$ some_command prompt$ another_command I can't erase those characters and bash ignores them when executing the command. They also disappear when a new prompt is being displayed (after pressing `Enter` for example). I asked other people who work on Linux at my workplace and they said that they have that problem sometimes too, but they didn't have an idea on how solve that issue. I have Ubuntu 11.10 and I'm using guake. Here is my `PS1`: \\e[0;31m\\u \\A ${PWD##*\/}\\e[0;32m$(parse_git_branch)\\e[0;31m$\\e[m where `parse_git_branch` is parse_git_branch () { git name-rev HEAD 2> \/dev\/null | sed 's#HEAD\\ \\(.*\\)# (\\1)#' } As far as I know my colleagues have that problem even with less \"fancy\" PS1."} {"id":"78752","title":"why bash history overlap the prompt when scroll up in the history?","text":"I customized my bash prompt, PS1 value. `~\/.bashrc`: Color_Off='\\e[0m' # Text Reset BGreen='\\e[1;32m' # Green BPurple='\\e[1;35m' # Purple BWhite='\\e[1;37m' # White BIBlue='\\e[1;94m' # Blue PS1=\"[\\[$BGreen\\w\\]\\[$Color_Off\\]]\\n[\\[$BPurple\\u\\]\\[$BWhite\\]@\\[$BIBlue\\h\\]\\[$Color_Off\\]]\\$ \" When I scroll up in the history with up arrow from the keyboard, after a lot of command I can see these: [\/etc] [bicocca@bicoccag]$ vi [\/etc] [bicocca@bicoccag]$ vim [\/etc] [bicoclear The command overlaps the prompt. How I can resolve the issue? I tried to search in Google but I did not found anything. I am using RHEL6.4."} {"id":"56072","title":"Why does this PS1 value cause unexpected behaviour?","text":"> **Possible Duplicate:** > Why is my bash prompt getting bugged when I browse the history? I have set my `PS1` variable in `.bashrc` to be the following: `PS1='\\e[35m[\\W]:\\e[0m '` It achieved what it was intended to (change the color of the prompt which displays `cwd` inside `[]` and before `:`), but when I search through my command history, sometimes parts of commands that I cycle over become attached to the prompt. For example: [~]: echo \"something\" something [~]: date Sun Nov 18 17:07:54 PST 2012 [~]: sudo apt-get install vim ... Now, say I want to return to my `echo \"something\"` command, I press up and get [~]: sudo apt-get install vim I press up again and this happens [~]: sudo apt-date up again [~]: sudo apt-echo \"something\" and if I delete everything on the command line by pressing backspace, it deletes all the way back to [~]: sudo apt- It has no affect on the command. For example, the line `[~]: sudo apt-date` will still print the output of `date` etc. Why is this happening and how can I achieve the desired prompt without the side effects?"} {"id":"71779","title":"bash script that shows mysql innodb log file size","text":"I am creating bash script that gives me size of mysql innodb log file in **MB**. Currently I am getting its output in bytes. Please check it out following script and help to get output in MB. #! \/bin\/sh a=$(mysql -uroot -proot -e \"SHOW VARIABLES\" | grep innodb_log_file_size | cut -f2) b=$(echo \"$a\/$10240\" ) echo {\"Innodb_log_file_size\":\"'$b'\"' }"} {"id":"76200","title":"How to find files with a certain subpath?","text":"I need to find all xml-files that are placed in folders named `config`. Also `config` must be somewhere under a folder named `trunk`. For example, I am interested in all files like below: ~\/projects\/e7\/trunk\/a\/b\/c\/config\/foo.xml ~\/projects\/d\/trunk\/config\/bar.xml ~\/projects\/trunk\/config\/other.xml ~\/projects\/e\/e\/e\/trunk\/e\/e\/e\/e\/e\/e\/e\/e\/config\/eeeee.xml I tried the `find` command: find ~\/projects -regex \"*\/trunk\/*\/config\/*.xml\" , but the output was empty. What is the correct way to find the required files?"} {"id":"151316","title":"How to send a output of unix command from one server to another server?","text":"How to redirect the output of a unix command from one server to another server. I should be able to send the unix command's output from server-1. Then I should be able to receive the output in Server-2 and write it into a file."} {"id":"108514","title":"Reload \/etc\/default\/locale without reboot?","text":"After making changes to `\/etc\/default\/locale`, is it possible to reload\/active the new settings without a reboot?"} {"id":"120627","title":"Fixing permissions on a buffalo NAS (XFS via SMB)","text":"I have a `Buffalo dual harddrive NAS` and plugged one of the drives directly to an `SATA` port to speed up the file transfer (100 MBit is a 'bit' slow when transfering 2 TB of files). I used a live Ubuntu DVD to mount the volume. My problem now is, I can't delete or rename any of the files I copied directly via Linux to that drive. Windows 7 demands that I'm admin of this computer. I can't even see the permissions since I do not have permission to do so. Is there an easy way to fix this, preferably without hooking it back to the `SATA` port?"} {"id":"154845","title":"Reverse global and local marks in vi\/vim","text":"How can I reverse the capitalization convention of marks in vi\/vim? Normally a lower-case mark like \"a\" means is local to the current file, but upper case marks like \"A\" are global to the session. Since I normally use only global marks I want the lower case to be the global marks. In other words I want to reverse the default convention."} {"id":"77661","title":"Preventing duplicate entried in PATH (.cshrc)","text":"I have little experience with Linux, so I will appreciate some help. I need to prepend directories to the path variable in my `.cshrc` file and I want to make sure that the entries are not repeated when compared to existing directories in the path variable. Can someone please advise suitable commands for that? The path on my machine is `:` separated, not space separated."} {"id":"24739","title":"How to execute consecutive command from history?","text":"Suppose I want to execute a sequence of four commands that I have executed before. If the first one is 432 in the command-history, then I could do: $ !432; !433; !434; !435 I'm curious, is there a more efficient way to accomplish this?"} {"id":"33389","title":"Bash: repeat last N commands","text":"In bash you can repeat the last command by entering `!!`, or the third last command `!-3` for example. Is there a quick way to repeat the last 3 commands, without having to type out `!-1; !-2; !-3` explicitly?"} {"id":"154598","title":"VNC & SSH : local (win-putty) -> hop (linux) -> remote (linux)","text":"I'm gettin a headache trying to access a remote VLC & SSH. This is the situation : `Local` : Win box behind NAT, dynamic IP. I want to connect from here. `Hop` : Linux box, static IP server `Remote` : Linux box behind NAT, dynamic IP. I want to connect here As the `remote` has dynamic IP and is behind NAT, I make ssh reverse tunnels to the `hop` : ssh -R 55900:localhost:5900 -R 50022:localhost:22 user@hop This step seems to work. From the `hop`, I can ssh the `remote` connecting to localhost port 50022 : ssh -p 50022 user@localhost Then from the local, I make ssh tunnels to the hop, with putty : ![Making tunnels](http:\/\/i.stack.imgur.com\/tWB7W.jpg) Once the second tunnel is made on `local`, when I try to reach the `remote` SSH or VNC, the connection is straight closed. For SSH (via another instance of putty), I get the error \"Server unexpectedty closed the connection\" For VNC (TightVNC Viewer) : \"Connection has been gracefully closed\" I tried to change some putty options after looking for solutions on the web, as \"enable X11 forwarding\", or \"Allow agent forwarding\", but without success. Any idea of how to solve this? Thanks"} {"id":"89231","title":"Allow www-data to perform specific commands","text":"I need a PHP script to perform `git pull` however I am not naive enough to give it permissions on `git`. I've wrapped `git pull` in a script which `www- data` has permissions for, but I'm not sure how to give the script permissions on `git` itself: $ sudo tail -n1 \/etc\/sudoers www-data ALL=(ALL) NOPASSWD: \/home\/php-scripts\/git-pull $ cat \/home\/php-scripts\/git-pull #!\/bin\/bash \/usr\/bin\/git pull $ ls -la \/home | grep php-scripts drwxr-xr-x 2 ubuntu ubuntu 4096 Sep 3 09:26 php-scripts $ ls -la \/home\/php-scripts\/git-pull -rwxrwxr-x 1 ubuntu ubuntu 30 Sep 3 08:44 \/home\/php-scripts\/git-pull $ cat \/var\/www\/public_html\/git-wrapper.php \"; echo \"Return Value: {$value}\\n\"; foreach ( $output as $o) { echo $o.\"\\n\"; } ?> Note that `\/var\/www\/public_html\/` is in fact a git repository. I often perform `git pull` in that directory from the CLI. However, when I call this script in a web browser I see that the files were not updated via `git pull` and the following is output to the browser: Return Value: 1 This is on Ubuntu Server 12.04 with Git 1.7.9.5. The remote repository is on the same server."} {"id":"57768","title":"how to move files from one folder to other with appending time stamp to the name?","text":"> **Possible Duplicate:** > Renaming a bunch of files with date modified timestamp at the end of the > filename? I want to move files from one folder to another folder with appending time stamp to file names. For example, I have two files called `file1` and `file2` in folder `f1`. I want to move these files to folder `f2` as file names `file1_22_jan_11:42` and `file2_22_jan_11:42`."} {"id":"5860","title":"How do I recursively check permissions in reverse?","text":"There's a command, I think it comes with apache, or is somehow related to it, that checks permissions, all the way down. So if I have `\/home\/foo\/bar\/baz` it will tell me what the permissions are for `baz`, `bar`, `foo`, and `home`. Does anyone know what this command is or another way of doing this? The command basically starts at the argument, and works it's way up to `\/` letting you know what the permissions are along the way so you can see if you have a permission problem."} {"id":"5863","title":"Open a file given by the result of a command in vim","text":"I find myself doing the following almost every day 1. Run a find (`find -name somefile.txt`) 2. Open the result in `vim` The problem is I have to copy and paste the result of the `find` into the `vim` command. Is there any way to avoid having to do this? I have experimented a bit (`find -name somefile.txt | vim`) but haven't found anything that works. Thanks in advance"} {"id":"56842","title":"systemd failure on binfmt services","text":"Systemd has several failed services, and I don't know how to work it out: # systemctl --failed UNIT LOAD ACTIVE SUB JOB DESCRIPTION proc-sys-fs-binfmt_misc.automount loaded failed failed Arbitrary Executable File Formats File System Automount Point systemd-binfmt.service loaded failed failed Set Up Additional Binary Formats More details: # systemctl status systemd-binfmt.service systemd-binfmt.service - Set Up Additional Binary Formats Loaded: loaded (\/usr\/lib\/systemd\/system\/systemd-binfmt.service; static) Active: failed (Result: exit-code) since Tue, 2012-11-27 07:42:11 CST; 36min ago Docs: man:systemd-binfmt.service(8) man:binfmt.d(5) https:\/\/www.kernel.org\/doc\/Documentation\/binfmt_misc.txt Process: 213 ExecStart=\/usr\/lib\/systemd\/systemd-binfmt (code=exited, status=1\/FAILURE) CGroup: name=systemd:\/system\/systemd-binfmt.service # systemctl status proc-sys-fs-binfmt_misc.automount proc-sys-fs-binfmt_misc.automount - Arbitrary Executable File Formats File System Automount Point Loaded: loaded (\/usr\/lib\/systemd\/system\/proc-sys-fs-binfmt_misc.automount; static) Active: failed (Result: resources) Where: \/proc\/sys\/fs\/binfmt_misc Docs: https:\/\/www.kernel.org\/doc\/Documentation\/binfmt_misc.txt Any suggestions?"} {"id":"152857","title":"Can I use seq to go from 001 to 999?","text":"Can I use seq to go from 001 to 999?"} {"id":"108367","title":"Processing FreeBSD's PF logs with tcpdump\/sed\/awk","text":"I'm running FreeBSD and have PF firewall set up and this is command i use to display daily number of firewall hits (blocked traffic) sudo tcpdump -n -e -tttt -r \/var\/log\/pflog | grep $(date +%Y-%m-%d)|wc -l|sed 's\/ *\/\/' >> \/home\/pentago\/www\/pf.txt That displays number, say 95. I want to process pf.txt file in a way that each line has the date before hit count. For example: * 01-01-2014 - 95 * 02-01-2014 - 98 * 03-01-2014 - 113 * 04-01-2014 - 92 etc.. Simply put, I need sed\/awk to prepend the date to each new line of the file. Does that sound reasonable?"} {"id":"64002","title":"How do I make use of unused space on my boot drive on FreeBSD","text":"I have an old FreeBSD Server (running 7.3-RELEASE) that desperately needs additional storage. In fact, it has some-- the original 20G SCSI drives have been replaced by 300G SCSI drives, so in theory there is 280G available that could be used. I'd like to make use of this space. I think the best way to do this is by formatting the unused space as a new slice on the existing drive, but I'm not clear how to do this without destroying the data on the existing slice. Most of the documentation I can find about doing this refers to initial installation. I know how to set up slices and partitions during initial installation, but not how to claim unused space on the drive AFTER initial installation. (I'd also be happy to expand the slice and add additional partitions to the existing slice, but I've heard that this is riskier). I thought the easy way to do this might be to use \/stand\/sysinstall, but when I go into either Configure->FDisk or Configure->Label, I get this message: No disks found! Please verify that your disk controller is being properly probed at boot time. See the Hardware Guide on the Documentation menu for clues on diagnosing this type of problem. This is obviously untrue, since I'm actually running off of a disk when I get this message, but maybe sysinstall just doesn't like messing with the boot disk? Output of fdisk da0: ******* Working on device \/dev\/da0 ******* parameters extracted from in-core disklabel are: cylinders=2235 heads=255 sectors\/track=63 (16065 blks\/cyl) Figures below won't work with BIOS for partitions not in cyl 1 parameters to be used for BIOS calculations are: cylinders=2235 heads=255 sectors\/track=63 (16065 blks\/cyl) Media sector size is 512 Warning: BIOS sector numbering starts with sector 1 Information from DOS bootblock is: The data for partition 1 is: sysid 165 (0xa5),(FreeBSD\/NetBSD\/386BSD) start 63, size 35905212 (17531 Meg), flag 80 (active) beg: cyl 0\/ head 1\/ sector 1; end: cyl 1023\/ head 254\/ sector 63 The data for partition 2 is: The data for partition 3 is: The data for partition 4 is: Output of bsdlabel da0s1 # \/dev\/da0s1: 8 partitions: # size offset fstype [fsize bsize bps\/cpg] a: 2097152 0 4.2BSD 2048 16384 89 b: 2097152 2097152 swap c: 35905212 0 unused 0 0 # \"raw\" part, don't edit e: 2097152 4194304 4.2BSD 2048 16384 89 f: 29613756 6291456 4.2BSD 2048 16384 89 Update: I came a cross the advice to use sade for this purpose. Unfortunately, sade can't see much empty space: 0 63 62 - 12 unused 0 63 35905212 35905274 da0s1 8 freebsd 165 35905275 10501 35915775 - 12 unused 0 This may be a dead end. Do I need to figure out drive geometry somehow? It might be relevant to mention that the drive is a RAID 1 mirror set; originally the mirrored drives were both 20G SCSI drives but they've both been swapped out with 300G drives. I'm willing to temporarily break the mirror if that will help."} {"id":"20864","title":"What happens in each step of the Linux kernel-building process?","text":"I've read many tutorials about how to build custom kernels and boot Ubuntu using those kernels, and successfully followed the guides and booted custom kernels, but I have no understanding about what each of the command in the guides do and what is actually happening with each command. The procedure described on Ubuntu's site does a lot of work with `fakeroot`, `dpkg`, `make-kpkg`, some initramfs, and other horrible stuff that works but simply does not help me understand what is going on. * What is the output of `make` in a linux kernel directory? * Does it create a \"compressed kernel image\"? * What is the name of the \"compressed kernel image\" file and where is it placed? * What does `make modules` do? * Should `make modules` be done before or after `make`? * Doesn't `make` build my modules automatically? * What is the process (in English, not just the list of commands) of adding newly built kernels to the list of bootable kernels? * What does `make install` do? * Will `make install` add it to my list of bootable kernels so that I don't have to do anything more? * Is there an equivalent `make modules_install`?"} {"id":"69039","title":"awk, sed, grep, perl... which to print out in this case?","text":"I have this syntax in a file (http response times from analog): seconds<\/th>reqs<\/th>%reqs<\/th>Gbytes<\/th>%bytes<\/th><\/tr><\/thead> 0<\/td>10927<\/td> 0.47%<\/td>0.01<\/td> 0.18%<\/td><\/tr> <= 0.01<\/td>1026471<\/td>44.59%<\/td>0.11<\/td> 1.81%<\/td><\/tr> 0.01-0.02<\/td>535390<\/td>23.26%<\/td>0.06<\/td> 0.95%<\/td><\/tr> 0.02-0.05<\/td>93298<\/td> 4.05%<\/td>0.27<\/td> 4.29%<\/td><\/tr> etc. What I want to be left with is the value for seconds - so 2 characters after \"x\" and before the first < And also the request length, so 2 characters after \"R\" and before the next subsequent < Probably not the best exercise to get to grips with regex but that's what I'm stuck with. Any help would be incredibly useful. Expected result: seconds reqs 0 10927 <= 0.01 1026471 0.01-0.02 535390 0.02-0.05 93298"} {"id":"20863","title":"\"Short read block\" error trying to boot RHEL","text":"I changed my network configurations from static IP to DHCP and removed the DNS entry, etc. Then I rebooted the computer, but am now unable to boot, I get an error message along the lines of \"short read block filesystem ext3\". How can I fix this?"} {"id":"5832","title":"Is there an equivalent of GNU Screen's \"log\" command in tmux?","text":"I make heavy use of screen's \"log\" command to log the output of a session to a file, when I am making changes in a given environment. I searched through tmux's man page, but couldn't find an equivalent. Is anyone aware of a similar feature in tmux, or do I have to write my own wrapper scripts to do this? EDIT: I'm aware of 'script' and other utilities that allow me to log a session. The reason that screen's functionality is so useful is the ability to define a logfile variable which uses string escapes to uniquely identify each session. e.g. I have a shell function which, given a hostname, will SSH to that host in a new screen window and set the window title to the hostname. When I start a log of that session, it is prefixed with the window title. If this functionality doesn't exist in tmux, I'll have to create a new set of shell functions to set up 'scripts' of sessions I want to log. This isn't hugely difficult, but it may not be worth the effort given that screen does exactly what I need already."} {"id":"114155","title":"Install vlc in CentOS 6.4 and embed on web page","text":"I am doing the following: in `\/etc\/yum.repos.d\/`: $ wget http:\/\/pkgrepo.linuxtech.net\/el6\/release\/linuxtech.repo $ yum install vlc -y How do I get the player on my web page, because currently with embed tag it is still saying \"missing plug in\". Is this the best option for playing `stream.cgi`? I am doing all this so I can play `videostream.cgi` from my outdoor wireless network cam, because otherwise I cannot see how to ftp that stream having already tried within admin of camera network, and anyway if I could find a way I still wouldn't know how to convert the rtsp stream."} {"id":"148429","title":"What does __ prefix before some kernel api's convey?","text":"Why do some function calls in kernel specially have this prefix `__` example: `__init initialization(void)` is `__init` a macro? What does this convey? Are these a special class of function calls inside the kernel or do they resemble any assembly function body present inside? What actually are they trying to represent?"} {"id":"45639","title":"wait does not wait","text":"If i have a file called `myprogram` containing sleep 200 date Run this in the background: $ sh myprogram & i want to know when `myprogram` has completed by using `wait` command $ cat >notify wait PID echo \"Program completed\" $ sh notify & `PID` is the process ID given from third command, my problem is that the message \"program completed\" printed on the terminal immediately after the last command,why wait does not wait? , i am using ubuntu 11.10"} {"id":"48209","title":"Parsing the output of date with sed","text":"I am trying to replace the whitespaces in the output of date with '_' with no success. $date Fri Sep 14 14:10:04 EDT 2012 $ date | sed 's\/ \/_\/' Fri_Sep 14 14:10:24 EDT 2012 As you can see, the last command only replaced the first whitespace by a `_`'. Why did it skip the other whitespaces?"} {"id":"99523","title":"How to set xscreensaver to use blank mode without GUI?","text":"After installing `xscreensaver` in Arch Linux my laptop has started displaying fancy, battery-depleting animations when nobody is looking. How do I configure this to use the `blank` mode via the command line (i.e., without `xscreensaver-demo`)?"} {"id":"48200","title":"Recovered deleted files on Mac by command line","text":"I accidentally deleted a file by running: rm -rf .\/Desktop\/myScript.sh I think it's possible to recover the file, because the `rm` command removes temporarily. How can I recover the deleted file on Mac OSX?"} {"id":"7940","title":"I'm failing to restore a VirtualBox VM","text":"I am trying to restore a VM but I get this error message: ![enter image description here](http:\/\/i.stack.imgur.com\/SOuax.png) I think this happened because, while the VM was live, I removed one snapshot. How do I fix this, short of restoring older snapshots? **NOTE** : This problem happens when I use version **4.0.4**. Version **3.2.10** allows me to delete a snapshot of a VM, even though it's live. I guess it's a regression... watch me downgrading."} {"id":"42172","title":"How can I block a network with lighttpd?","text":"I already block some simple ip lighttpd but I want to block a whole network. I've problem to understand what is this network address for example 10.0.0.0\/8 and\/or 172.16.2.0\/24 network? What is this \/8 or \/24 means? I use $HTTP[\"remoteip\"] to add my ip I want to deny the access."} {"id":"76991","title":"Which tasks\/commands can't be executed with user gid=0 but not uid=0 on Linux","text":"In a Linux server I will have an user with gid=0 but it's uid won't be 0. As there are many commands with root:root and execute permissions for group I know there will be a lot of administrative task that this user can't do because many programs checks at start if UID=0 Anyone knows what commands\/tasks can't do a user with UID!=0 and GUID=0? That user could mount filesystems or change passwords...? For example, the user can't read messages as it has only read permissions for root owner. I know the question is open. Many thanks!"} {"id":"63785","title":"Best language to write linux services","text":"I want to create a crawler that scans one single web page and sends me an email in case something is wrong on the page (the page holds some webservers' status - Up\/Down). What would be the best language to write such a service in? I've considered PHP or Python, but as they are interpreted languages (+PHP has a max time limit that a script runs), I don't think they're the best fit for this. Also, C\/C++ is not an option. I was thinking about Java, since it has Threading and I may need it, but I'm not sure."} {"id":"97476","title":"Snapshot large changing files","text":"At home I have the following backup scheme: All machines daily rsync to the servers $FULL_COPY directory. The server takes snapshots of that directory daily (also weekly\/monthly), keeping at most X snapshots. Also using rsync: rsync -ar --link-dest=$LATEST_SNAPSHOT $FULL_COPY $NEW_SNAPSHOT This works great, files not changed since last snapshot get hard linked. The problem is large files (to be precise Thunderbird's inbox), a small change means an entire copy of the file. My snapshots are easily a couple of GB, but maybe only a few MB has changed. Is there a smarter way to do this? (my $FULL_COPY is also replicated on a remote machine, so I'm not in need of this redundancy). My only idea is a CoW filesystem supporting snapshots. But that would mean major surgery on my system which I'm not fond of."} {"id":"97478","title":"A Chromebook-like distro based on Firefox OS?","text":"I'm wondering if it's possible to make an operating system distro based on the same principle as Firefox OS or ChromeOS. One which is basically a Gnu\/Linux kernel \/ core of tools combined with Mozilla's \"Boot2Gecko\" stack of Gonk \/ Gecko \/ Gaia (https:\/\/wiki.mozilla.org\/B2G\/Architecture) and which runs apps written in HTML5 \/ javascript. I want this as something I can boot from a pendrive or install on an ordinary laptop (not for a mobile-phone). Does anyone know if there's currently a project to make this? Or, if not, what would be involved in trying to put one together? (Using B2G + http:\/\/www.linuxfromscratch.org\/ etc.)"} {"id":"90126","title":"How to disable SMTP auth plain for Citadel 8.20 on Slackware 14.0?","text":"How do I turn off SMTP AUTH PLAIN for Citadel 8.20 on Slackware 14.0? If I set up postfix to handle SMTP would this allow me to not have SMTP auth plain enabled"} {"id":"12439","title":"Can I configure my shell to print STDERR and STDOUT in different colors?","text":"I want to set my terminal up so `stderr` is printed in a different color than `stdout`; maybe red. This would make it easier to tell the two apart. Is there a way to configure this in `.bashrc`? If not, is this even possible? * * * **Note** : This question was merged with another that asked for `stderr`, `stdout` _and the user input echo_ to be output in _3 different colours_. Answers may be addressing either question."} {"id":"8861","title":"How to recover a crashed Linux md RAID5 array?","text":"Some time ago I had a RAID5 system at home. One of the 4 disks failed but after removing and putting it back it seemed to be OK so I started a resync. When it finished I realized, to my horror, that 3 out of 4 disks failed. However I don't belive that's possible. There are multiple partitions on the disks each part of a different RAID array. * md0 is a RAID1 array comprised of sda1, sdb1, sdc1 and sdd1. * md1 is a RAID5 array comprised of sda2, sdb2, sdc2 and sdd2. * md2 is a RAID0 array comprised of sda3, sdb3, sdc3 and sdd3. md0 and md2 reports all disks up while md1 reports 3 failed (sdb2, sdc2, sdd2). It's my uderstanding that when hard drives fail all the partitions should be lost not just the middle ones. At that point I turned the computer off and unplugged the drives. Since then I was using that computer with a smaller new disk. Is there any hope of recovering the data? Can I somehow convince mdadm that my disks are in fact working? The only disk that may really have a problem is sdc but that one too is reported up by the other arrays. **Update** I finally got a chance to connect the old disks and boot this machine from SystemRescueCd. Everything above was written from memory. Now I have some hard data. Here is the output of `mdadm --examine \/dev\/sd*2` \/dev\/sda2: Magic : a92b4efc Version : 0.90.00 UUID : 53eb7711:5b290125:db4a62ac:7770c5ea Creation Time : Sun May 30 21:48:55 2010 Raid Level : raid5 Used Dev Size : 625064960 (596.11 GiB 640.07 GB) Array Size : 1875194880 (1788.33 GiB 1920.20 GB) Raid Devices : 4 Total Devices : 4 Preferred Minor : 1 Update Time : Mon Aug 23 11:40:48 2010 State : clean Active Devices : 3 Working Devices : 4 Failed Devices : 1 Spare Devices : 1 Checksum : 68b48835 - correct Events : 53204 Layout : left-symmetric Chunk Size : 64K Number Major Minor RaidDevice State this 0 8 2 0 active sync \/dev\/sda2 0 0 8 2 0 active sync \/dev\/sda2 1 1 8 18 1 active sync \/dev\/sdb2 2 2 8 34 2 active sync \/dev\/sdc2 3 3 0 0 3 faulty removed 4 4 8 50 4 spare \/dev\/sdd2 \/dev\/sdb2: Magic : a92b4efc Version : 0.90.00 UUID : 53eb7711:5b290125:db4a62ac:7770c5ea Creation Time : Sun May 30 21:48:55 2010 Raid Level : raid5 Used Dev Size : 625064960 (596.11 GiB 640.07 GB) Array Size : 1875194880 (1788.33 GiB 1920.20 GB) Raid Devices : 4 Total Devices : 4 Preferred Minor : 1 Update Time : Mon Aug 23 11:44:54 2010 State : clean Active Devices : 2 Working Devices : 3 Failed Devices : 1 Spare Devices : 1 Checksum : 68b4894a - correct Events : 53205 Layout : left-symmetric Chunk Size : 64K Number Major Minor RaidDevice State this 1 8 18 1 active sync \/dev\/sdb2 0 0 0 0 0 removed 1 1 8 18 1 active sync \/dev\/sdb2 2 2 8 34 2 active sync \/dev\/sdc2 3 3 0 0 3 faulty removed 4 4 8 50 4 spare \/dev\/sdd2 \/dev\/sdc2: Magic : a92b4efc Version : 0.90.00 UUID : 53eb7711:5b290125:db4a62ac:7770c5ea Creation Time : Sun May 30 21:48:55 2010 Raid Level : raid5 Used Dev Size : 625064960 (596.11 GiB 640.07 GB) Array Size : 1875194880 (1788.33 GiB 1920.20 GB) Raid Devices : 4 Total Devices : 4 Preferred Minor : 1 Update Time : Mon Aug 23 11:44:54 2010 State : clean Active Devices : 1 Working Devices : 2 Failed Devices : 2 Spare Devices : 1 Checksum : 68b48975 - correct Events : 53210 Layout : left-symmetric Chunk Size : 64K Number Major Minor RaidDevice State this 2 8 34 2 active sync \/dev\/sdc2 0 0 0 0 0 removed 1 1 0 0 1 faulty removed 2 2 8 34 2 active sync \/dev\/sdc2 3 3 0 0 3 faulty removed 4 4 8 50 4 spare \/dev\/sdd2 \/dev\/sdd2: Magic : a92b4efc Version : 0.90.00 UUID : 53eb7711:5b290125:db4a62ac:7770c5ea Creation Time : Sun May 30 21:48:55 2010 Raid Level : raid5 Used Dev Size : 625064960 (596.11 GiB 640.07 GB) Array Size : 1875194880 (1788.33 GiB 1920.20 GB) Raid Devices : 4 Total Devices : 4 Preferred Minor : 1 Update Time : Mon Aug 23 11:44:54 2010 State : clean Active Devices : 1 Working Devices : 2 Failed Devices : 2 Spare Devices : 1 Checksum : 68b48983 - correct Events : 53210 Layout : left-symmetric Chunk Size : 64K Number Major Minor RaidDevice State this 4 8 50 4 spare \/dev\/sdd2 0 0 0 0 0 removed 1 1 0 0 1 faulty removed 2 2 8 34 2 active sync \/dev\/sdc2 3 3 0 0 3 faulty removed 4 4 8 50 4 spare \/dev\/sdd2 It appears that things have changed since the last boot. If I'm reading this correctly sda2, sdb2 and sdc2 are working and contain synchronized data and sdd2 is spare. I distinctly remember seeing 3 failed disks but this is good news. Yet the array still isn't working: Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10] md125 : inactive sda2[0](S) sdb2[1](S) sdc2[2](S) 1875194880 blocks md126 : inactive sdd2[4](S) 625064960 blocks md127 : active raid1 sda1[0] sdd1[3] sdc1[2] sdb1[1] 64128 blocks [4\/4] [UUUU] unused devices: md0 appears to be renamed to md127. md125 and md126 are very strange. They should be one array not two. That used to be called md1. md2 is completely gone but that was my swap so I don't care. I can understand the different names and it doesn't really matter. But why is an array with 3 \"active sync\" disks unreadable? And what's up with sdd2 being in a separate array? **Update** I tried the following after backing up the superblocks: root@sysresccd \/root % mdadm --stop \/dev\/md125 mdadm: stopped \/dev\/md125 root@sysresccd \/root % mdadm --stop \/dev\/md126 mdadm: stopped \/dev\/md126 So far so good. Since sdd2 is spare I don't want to add it yet. root@sysresccd \/root % mdadm --assemble \/dev\/md1 \/dev\/sd{a,b,c}2 missing mdadm: cannot open device missing: No such file or directory mdadm: missing has no superblock - assembly aborted Apparently I can't do that. root@sysresccd \/root % mdadm --assemble \/dev\/md1 \/dev\/sd{a,b,c}2 mdadm: \/dev\/md1 assembled from 1 drive - not enough to start the array. root@sysresccd \/root % cat \/proc\/mdstat Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10] md1 : inactive sdc2[2](S) sdb2[1](S) sda2[0](S) 1875194880 blocks md127 : active raid1 sda1[0] sdd1[3] sdc1[2] sdb1[1] 64128 blocks [4\/4] [UUUU] unused devices: That didn't work either. Let's try with all the disks. mdadm --stop \/dev\/md1 mdadm: stopped \/dev\/md1 root@sysresccd \/root % mdadm --assemble \/dev\/md1 \/dev\/sd{a,b,c,d}2 mdadm: \/dev\/md1 assembled from 1 drive and 1 spare - not enough to start the array. root@sysresccd \/root % cat \/proc\/mdstat Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10] md1 : inactive sdc2[2](S) sdd2[4](S) sdb2[1](S) sda2[0](S) 2500259840 blocks md127 : active raid1 sda1[0] sdd1[3] sdc1[2] sdb1[1] 64128 blocks [4\/4] [UUUU] unused devices: No luck. Based on this answer I'm planning to try: mdadm --create \/dev\/md1 --assume-clean --metadata=0.90 --bitmap=\/root\/bitmapfile --level=5 --raid-devices=4 \/dev\/sd{a,b,c}2 missing mdadm --add \/dev\/md1 \/dev\/sdd2 Is it safe? **Update** I publish the superblock parser script I used to make that table in the my comment. Maybe someone will find it useful. Thanks for all your help."} {"id":"26834","title":"Can't make a copy of \/var\/lib\/mysql\/ibdata1","text":"I have a RedHat Linux server and I'm trying to make a copy of `\/var\/lib\/mysql\/ibdata1`, but I'm receiving an error saying permission denied and the file cannot be opened. I'm logged in as root user and tried to use `sudo cp`... Any idea of what I'm doing wrong? Sorry for my ignorance, but I don't know much about Unix systems. I was trying `sudo su mysql` to make the copy, then it asks for a password that should be the one I have, but it is saying it's wrong!"} {"id":"26836","title":"How can I find all files that do NOT contain a text string?","text":"What **concise** command can I use to find all files that do NOT contain a text string? I tried this (using -v to invert grep's parameters) with no luck: find . -exec grep -v -l shared.php {} \\; Someone said this would work: find . ! -exec grep -l shared.php {} \\; But it does not seem to work for me. This page has this example: find .\/logs -size +1c > t._tmp while read filename do grep -q \"Process Complete\" $filename if [ $? -ne 0 ] ; then echo $filename fi done < t._tmp rm -f t_tmp But that's cumbersome and not at all concise. ps: I know that `grep -L *` will do this, but how can I use the find command in combination with grep to excluded files is what i really want to know. pss: Also I'm not sure how to have grep include subdirectories with the `grep -L *` syntax, but I still want to know how to use it with `find` :)"} {"id":"106489","title":"z in bash script returns zero","text":"#[ -z \"\" ] #echo $? returns 0 #[ -a \"\" ] #echo $? returns 1 except z all other alphabets throw 1 What might be the reason?"} {"id":"26833","title":"Redirecting output when I execute \"bash -c ...\" from a C program","text":"Say I have a C program and in it I want to execute a shell command and redirect its output to file, by using the stdlib system function. system(\"bash -c \\\"echo $HOME\\\" > a.txt\"); Now this is for illustration, it actually doesn't work. How do I make the output redirection work? Because I'm calling bash from a function I need the process itself to do the redirecting."} {"id":"116174","title":"Copy files based on date\/time from subset of directories","text":"I'm teaching a class where (~80) students are submitting assignments that I can access via webdav, organized by student in directories named by their unique identifier. The students are split into two groups that submit assignments on different days of the week. I'd like to create a bash script to automatically download files for each subset of students into a local directory. What I don't know how to do is the following: 1. Select a specific subset of folders by name to copy files from. * Edited based on comments: The webdav server I connect to has 80 directories named by student, these 80 directories are made up of two groups of students. * I would like to select files from directories in each group, i.e., Group1 contains directories `StudentA\/ StudentC\/ StudentD\/`. Group 2 would contain the directories `StudentB\/ StudentE\/ StudentF\/`. 2. Specify the beginning date\/time of files to be copied. End date\/time would be useful to since I take deductions for late assignments. Any help on either of these would be appreciated."} {"id":"96987","title":"YUM: How to prevent EPEL from upgrading packages installed from other repos?","text":"I would like to leave EPEL enabled and configure it to allow updating only the packages that were installed from EPEL itself in the first place (packages which were manually installed from EPEL because of specific needs). **Is there a yum conf directive to allow this?** * CentOS 6.4 * Yum 3.2.29"} {"id":"149487","title":"gtar fails to perform incremental backup","text":"The following script fails to perform incremental backup, but creates full backup instead. On another FreeBSD server exactly same script works just fine (creating incremental backups). Servers are identical, same FreeBSD 10.0-RELEASE on both machines. Script it exactly the same. Version of gtar is identical. File system is identical. Not sure what's going on. Searched for days! Please help. #!\/bin\/sh sourcedir=\"\/home\" targetdir=\"\/backup\/home\" now=$(date +\"%Y%m%d%H%M\") cd $sourcedir for dir in *\/ do base=$(basename \"$dir\") gtar -cz -g \"$targetdir\/.gtar-incremental\" -f \"$targetdir\/${base}-$now.tar.gz\" \"\/home\/$dir\" chmod 600 \"$targetdir\/${base}-$now.tar.gz\" done"} {"id":"151774","title":"diskio\/diskiograph in Conky only understands physical device names?","text":"In case this is so, it can be a huge downer in modern Linux distros, since the device names are very often assigned arbitrarily. So if you have no more than two HDDs in your system, but two USB flash drives sticking in their ports, things might look like this after bootup: \/dev\/sda .. HDD #1 \/dev\/sdb .. USB flash drive #1 \/dev\/sdc .. USB flash drive #2 \/dev\/sdd .. HDD #2 I have searched high and low and tried various hacks for my `.conkyrc` to no avail. It just does not seem to work. I even thought about \"creating\" the format required for conky by executing a system command, but even this failed. In `bash`, this can be achieved by $ basename $(readlink \/dev\/disk\/by-label\/mydisklabel) Though conky DOES allow execution of system commands, it seems that in {diskio}\/{diskiograph} options, this is not possible. So the following will NOT work: ${diskio \/dev\/${execp basename $(readlink \/dev\/disk\/by-label\/mydisklabel)}} Neither would the variant with the UUID work (not shown here). Has anyone of you guys ever managed to \"teach\" this to conky? It's so insanely versatile, but it's almost unbelievable that (compared to the good old days) `udev` and friends will no longer keep drives in a certain order, but scramble them again on each bootup sequence, while tools (GKrellM is none the better!) stubbornly insist on physical drive\/device names."} {"id":"24570","title":"pattern search and display the last occuring pattern?","text":"I have a log file containing **startup** and **shutdown** times for everday. I want to see the last pattern pattern for startup and shutdown(which is located at the end of the file being updated everyday). Also I dont want all the lines between the startup and shutdown.I want only few(say 3) lines after the last startup and few(say 3 lines) after the last shutdown. Any suggestions for a one liner."} {"id":"62123","title":"Create swap partition after install","text":"I already have parititon contain data under lvm enviroment with centos 5.8 output of fdisk -l root@server [~]# fdisk -l Disk \/dev\/sda: 1000.2 GB, 1000204886016 bytes 255 heads, 63 sectors\/track, 121601 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System \/dev\/sda1 * 1 25 200781 83 Linux \/dev\/sda2 26 121601 976559220 8e Linux LVM output of lvdisplay # lvdisplay --- Logical volume --- LV Name \/dev\/sysvg\/ROOT VG Name sysvg LV UUID 6oy3Rj-ka3K-mL9s-vjjG-1Iqw-dniq-UbWzvJ LV Write Access read\/write LV Status available # open 1 LV Size 919.44 GB Current LE 29422 Segments 1 Allocation inherit Read ahead sectors auto - currently set to 256 Block device 253:0 --- Logical volume --- LV Name \/dev\/sysvg\/TMP VG Name sysvg LV UUID jTKLBt-eNz0-KxmV-E5Nk-jjC0-FlRb-qny62p LV Write Access read\/write LV Status available # open 1 LV Size 9.88 GB Current LE 316 Segments 1 Allocation inherit Read ahead sectors auto - currently set to 256 Block device 253:1 --- Logical volume --- LV Name \/dev\/sysvg\/SHM VG Name sysvg LV UUID NpKjhl-tzzn-Dk3G-A6dl-4QJB-QCc2-IkbDH5 LV Write Access read\/write LV Status available # open 1 LV Size 2.00 GB Current LE 64 Segments 1 Allocation inherit Read ahead sectors auto - currently set to 256 Block device 253:2 output of df -h root@server [~]# df -h Filesystem Size Used Avail Use% Mounted on \/dev\/mapper\/sysvg-ROOT 891G 125G 721G 15% \/ \/dev\/mapper\/sysvg-TMP 9.6G 153M 9.0G 2% \/tmp \/dev\/mapper\/sysvg-SHM 8.0G 8.0K 8.0G 1% \/dev\/shm \/dev\/sda1 190M 19M 162M 11% \/boot tmpfs 8.0G 8.0K 8.0G 1% \/dev\/shm output for \/etc\/fstab root@server [~]# cat \/etc\/fstab \/dev\/sysvg\/ROOT \/ ext3 usrjquota=quota.user,jqfmt=vfsv0 1 1 \/dev\/sysvg\/TMP \/tmp ext3 defaults 1 2 \/dev\/sysvg\/SHM \/dev\/shm ext3 defaults,usrquota 1 2 LABEL=\/boot \/boot ext3 defaults 1 2 tmpfs \/dev\/shm tmpfs defaults 0 0 devpts \/dev\/pts devpts gid=5,mode=620 0 0 sysfs \/sys sysfs defaults 0 0 proc \/proc proc defaults 0 0 \/tmp \/var\/tmp ext3 defaults,bind,noauto 0 0 I don't have any idea how to create swap partition , and i worried about creating cause any DATA LOSS"} {"id":"79722","title":"Tell ffserver which track to use","text":"I want to stream videos via ffserver. My videos are in container formats like mkv and avi and sometimes have multiple audio\/video tracks. How can I tell ffserver which track to use? It seems to always take the first one."} {"id":"145576","title":"Unable to access website hosted on virtual machine","text":"I'm on a mac (osx 10.9.3) running CentOS7 in virtualbox. I would like to access the website hosted on the virtual machine. Browsing to the Guest IP returns webpage not available. I'm able to `ping` and `ssh` to the VM. I've set bridged adapter for the network settings in the VM. I've given `\/etc\/httpd\/conf\/httpd.conf` Listen 80 and host IP address. `telnet` and `curl` to Guest IP returns connection refused. I'm guessing it's a firewall \/ iptables configuration problem where I need to allow the host. How do I configure CentOS firewall \/ iptables to allow host?"} {"id":"91983","title":"How to reach only an application in QEMU emulation without X?","text":"I run an OpenBSD guest on an OpenBSD host (Desktop) with QEMU. Because I want to run a webbrowser in a separated environment. I can reach the QEMU machine via ssh -X so I can see the webbrowser. But that's not really safe (because AFAIK X wasn't designed by security in mind). **Q:** How can I reach the webbrowser (xxxterm) from the host OpenBSD machine safely and with good performance? ps.: question is based on this"} {"id":"55121","title":"Compiling libqwplot3d on armhf","text":"This started as an attempt to compile GNURadio on armhf (Pandaboard & Beagleboard). Thanks to the answer by Mike Larsen. I tried to compile libqwplot3d. apt-get build-dep qwtplot3d apt-get source qwtplot3d cd qwtplot3d-*\/ dpkg-buildpackage And get the following result in the last step: user@lord-xm:~\/qwtplot3d-0.2.7+svn191$ dpkg-buildpackage dpkg-buildpackage: export CFLAGS from dpkg-buildflags (origin: vendor): -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security dpkg-buildpackage: export CPPFLAGS from dpkg-buildflags (origin: vendor): -D_FORTIFY_SOURCE=2 dpkg-buildpackage: export CXXFLAGS from dpkg-buildflags (origin: vendor): -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security dpkg-buildpackage: export FFLAGS from dpkg-buildflags (origin: vendor): -g -O2 dpkg-buildpackage: export LDFLAGS from dpkg-buildflags (origin: vendor): -Wl,-Bsymbolic-functions -Wl,-z,relro dpkg-buildpackage: source package qwtplot3d dpkg-buildpackage: source version 0.2.7+svn191-5ubuntu2 dpkg-buildpackage: source changed by Scott Kitterman dpkg-buildpackage: host architecture armhf dpkg-source --before-build qwtplot3d-0.2.7+svn191 fakeroot debian\/rules clean dh_testdir dh_testroot rm -f build-stamp rm -rf build dh_clean dpkg-source -b qwtplot3d-0.2.7+svn191 dpkg-source: info: using source format `3.0 (quilt)' dpkg-source: info: building qwtplot3d using existing .\/qwtplot3d_0.2.7+svn191.orig.tar.gz dpkg-source: info: building qwtplot3d in qwtplot3d_0.2.7+svn191-5ubuntu2.debian.tar.gz dpkg-source: info: building qwtplot3d in qwtplot3d_0.2.7+svn191-5ubuntu2.dsc debian\/rules build dh_testdir mkdir -p build\/qt4 cp -Rl `ls . |grep -v build|grep -v debian` build\/qt4 cd build\/qt4 && qmake-qt4 qwtplot3d.pro && \/usr\/bin\/make WARNING: doc.path is not defined: install target not created make[1]: Entering directory `\/home\/user\/qwtplot3d-0.2.7+svn191\/build\/qt4' g++ -c -pipe -g -D_REENTRANT -Wall -W -fPIC -DQT_WEBKIT -DGL2PS_HAVE_ZLIB -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I\/usr\/share\/qt4\/mkspecs\/linux-g++ -I. -I\/usr\/include\/qt4\/QtCore -I\/usr\/include\/qt4\/QtGui -I\/usr\/include\/qt4\/QtOpenGL -I\/usr\/include\/qt4 -Iinclude -I\/usr\/X11R6\/include -Itmp -o tmp\/qwt3d_axis.o src\/qwt3d_axis.cpp In file included from \/usr\/include\/GL\/glu.h:38:0, from include\/qwt3d_openglhelper.h:11, from include\/qwt3d_types.h:26, from include\/qwt3d_drawable.h:7, from include\/qwt3d_label.h:10, from include\/qwt3d_axis.h:5, from src\/qwt3d_axis.cpp:1: \/usr\/include\/GL\/gl.h:162:17: error: conflicting declaration âtypedef double GLdoubleâ \/usr\/include\/qt4\/QtOpenGL\/qgl.h:85:17: error: âGLdoubleâ has a previous declaration as âtypedef GLfloat GLdoubleâ In file included from \/usr\/include\/GL\/gl.h:2085:0, from \/usr\/include\/GL\/glu.h:38, from include\/qwt3d_openglhelper.h:11, from include\/qwt3d_types.h:26, from include\/qwt3d_drawable.h:7, from include\/qwt3d_label.h:10, from include\/qwt3d_axis.h:5, from src\/qwt3d_axis.cpp:1: \/usr\/include\/GL\/glext.h:5327:19: error: conflicting declaration âtypedef ptrdiff_t GLintptrâ \/usr\/include\/GLES2\/gl2.h:38:26: error: âGLintptrâ has a previous declaration as âtypedef khronos_intptr_t GLintptrâ \/usr\/include\/GL\/glext.h:5328:19: error: conflicting declaration âtypedef ptrdiff_t GLsizeiptrâ \/usr\/include\/GLES2\/gl2.h:39:26: error: âGLsizeiptrâ has a previous declaration as âtypedef khronos_ssize_t GLsizeiptrâ In file included from include\/qwt3d_types.h:26:0, from include\/qwt3d_drawable.h:7, from include\/qwt3d_label.h:10, from include\/qwt3d_axis.h:5, from src\/qwt3d_axis.cpp:1: include\/qwt3d_openglhelper.h: In function âbool Qwt3D::ViewPort2World(double&, double&, double&, double, double, double)â: include\/qwt3d_openglhelper.h:106:97: error: cannot convert âdouble*â to âGLdouble* {aka float*}â for argument â7â to âGLint gluUnProject(GLdouble, GLdouble, GLdouble, const GLdouble*, const GLdouble*, const GLint*, GLdouble*, GLdouble*, GLdouble*)â include\/qwt3d_openglhelper.h: In function âbool Qwt3D::World2ViewPort(double&, double&, double&, double, double, double)â: include\/qwt3d_openglhelper.h:122:95: error: cannot convert âdouble*â to âGLdouble* {aka float*}â for argument â7â to âGLint gluProject(GLdouble, GLdouble, GLdouble, const GLdouble*, const GLdouble*, const GLint*, GLdouble*, GLdouble*, GLdouble*)â make[1]: *** [tmp\/qwt3d_axis.o] Error 1 make[1]: Leaving directory `\/home\/user\/qwtplot3d-0.2.7+svn191\/build\/qt4' make: *** [build-stamp] Error 2 dpkg-buildpackage: error: debian\/rules build gave error exit status 2 user@lord-xm:~\/qwtplot3d-0.2.7+svn191$ How do fix this and proceed? I am using the Ubuntu 12.04 image for OMAP"} {"id":"91988","title":"Accent error on OpenWrt 12.09?","text":"[user@localhost ~] ssh -x -a root@192.168.1.1 BusyBox v1.19.4 (2013-03-14 11:28:31 UTC) built-in shell (ash) ----------------------------------------------------- ATTITUDE ADJUSTMENT (12.09, r36088) ----------------------------------------------------- root@ROUTER:~# touch 'árvíztűrő tükörfúrógép' root@ROUTER:~# ls -la drwxr-xr-x 1 root root 0 Aug 31 11:26 . drwxr-xr-x 1 root root 0 Jan 1 1970 .. drwx------ 2 root root 0 Aug 15 16:09 .ssh -rw-r--r-- 1 root root 0 Aug 31 11:26 ????rv??zt??r?? t??k??rf??r??g??p root@ROUTER:~# ls -la áárvíztűrő\\ tükörfúrógép -rw-r--r-- 1 root root 0 Aug 31 11:26 ????rv??zt??r?? t??k??rf??r??g??p root@ROUTER:~# rm áárvíztűrő\\ tükörfúrógép **Q:** Why? The accent handling was ok a few versions before.. What am I doing wrong? UPDATE: the same problem occurs if I put this in cron."} {"id":"55125","title":"Alias for directory listing sorted by time modified in reverse order","text":"When I need to find my recently used files, this command: `ls -lt` lists in ascending order (by time), when there are lots files, I need to scroll to the top to see needed files, because wont fit in terminal screen. After finding out that `tac` inverses the output, I use: `ls -lt dir\/ | tac` Is there more fun way of doing it, without using external scripts\/utils?"} {"id":"110512","title":"Uninstall JDK rpm to reinstall","text":"Where do I find the JDK install to uninstall? @terdon had explained using an `rpm` type download so it would be easier to uninstall, but I cannot find it."} {"id":"90998","title":"Block Particular Command in Linux for Specific user","text":"How to block command, let say `mkdir` for specific user ? What I did just created read-only function and store in users profile `~\/.bashrc` \/bin\/mkdir() { echo \"mkdir command not allow for you\" } mkdir() { echo \"mkdir command not allow for you\" } .\/mkdir() { echo \"mkdir command not allow for you\" } readonly -f \/bin\/mkdir readonly -f mkdir readonly -f .\/mkdir **Test:** rahul@ubuntu:~$ cd \/bin\/ rahul@ubuntu:\/bin$ .\/mkdir \/home\/rahul\/ggg mkdir command not allow for you rahul@ubuntu:\/bin$ cd rahul@ubuntu:~$ mkdir testing mkdir command not allow for you rahul@ubuntu:~$ \/bin\/mkdir testing mkdir command not allow for you So my question is What should be the way of achieving this ? is there any tool for this ? Update 1 # But if user is smart , he could copy mkdir binary and rename it and use it . So how to achieve this ?"} {"id":"150827","title":"How can I replace root \/ filesystem with another filesystem?","text":"When the Linux kernel starts up, it uses initrd as the root \/ filesystem, then replaces that with a filesystem partition in fstab. Based on a test in an early init script, I want to replace that root \/ filesystem with another filesystem partition. How to do that?"} {"id":"27001","title":"Unable to boot VM: Error 13: Invalid or Unsupported Executable Format","text":"I used VMWare vConverter and everything converted fine, but when I try to boot I get an error: ![Error 13: Invalid or unsupported executable format](http:\/\/i.stack.imgur.com\/H4h4E.jpg) The physical machine boots correctly, so I don't think it is a source machine issue. I am not sure why the VM won't boot; aren't VMs exact copies of source machines?"} {"id":"92187","title":"Setting IFS for a single statement","text":"I know that a custom IFS value can be set for the scope of a single command\/built-in. Is there a way to set a custom IFS value for a single statement?? Apparently not, since based on the below the global IFS value is affected when this is attempted #check environment IFS value, it is space-tab-newline printf \"%s\" \"$IFS\" | od -bc 0000000 040 011 012 \\t \\n 0000003 #invoke built-in with custom IFS IFS=$'\\n' read -r -d '' -a arr <<< \"$str\" #environment IFS value remains unchanged as seen below printf \"%s\" \"$IFS\" | od -bc 0000000 040 011 012 \\t \\n 0000003 #now attempt to set IFS for a single statement IFS=$'\\n' a=($str) #BUT environment IFS value is overwritten as seen below printf \"%s\" \"$IFS\" | od -bc 0000000 012 \\n 0000001"} {"id":"74055","title":"bash - reading user variable into bash script grep","text":"I've tried every possible combination to get this bash script working. It's part of a larger script, and it basically prompts for a username (to check if it exists) and returns the appropriate response: #! \/bin\/bash # Script to see if User exists clear echo -n \"Enter user to check: \" read $uzer grep -c '^${uzer}:' \/etc\/passwd if [ $? -eq 0 ]; then echo \"User does exist :)\" else echo \"No such user\" fi In terminal the following works fine: grep -c '^devuser1:' \/etc\/passwd RETURNS: 1 grep -c '^devuser1234:' \/etc\/passwd RETURNS: 0 I've tried many combinations of passing the read variable into `'^${uzer}:'` with no joy. Any ideas what else I can try?"} {"id":"132779","title":"How to read an IP address backwards?","text":"If we have this string (IP address): `192.168.1.1` How can I derive the (DNS reverse record form) from this string, so it will be shown like `1.1.168.192.in-addr.arpa` using a shell script?"} {"id":"52762","title":"Trying to sort on two fields, second then first","text":"I am trying to sort on multiple columns. The results are not as expected. Here's my data (people.txt): Simon Strange 62 Pete Brown 37 Mark Brown 46 Stefan Heinz 52 Tony Bedford 50 John Strange 51 Fred Bloggs 22 James Bedford 21 Emily Bedford 18 Ana Villamor 44 Alice Villamor 50 Francis Chepstow 56 The following works correctly: bash-3.2$ sort -k2 -k3 **Possible Duplicate:** > Getting \"Not found\" message when running a 32-bit binary on a 64-bit system Ok I feel like I'm having some sort of brain fade moment, please help me out. I just installed Unreal Tournament on my Linux Mint Debian Edition OS. The startup script was complaining about a missing file so I decided to check it out manually. ~\/Desktop $ ut \/usr\/local\/bin\/ut: 78: .\/ut-bin: not found ~\/Desktop $ cd \/usr\/local\/games\/ut\/System\/ \/usr\/local\/games\/ut\/System $ ls -l ut-bin -rwxrwxr-x 1 root staff 91336 Jan 28 11:33 ut-bin \/usr\/local\/games\/ut\/System $ .\/ut-bin bash: .\/ut-bin: No such file or directory `ut-bin` is a binary executable according to the `file` command. Why is bash complaining about a missing file? I tried executing it in another shell and got a similar error. I also launched a new terminal with no change. What am I missing here?"} {"id":"79768","title":"executable lies about own existence","text":"Okay, I'm completely baffled on this one. I'm installing a piece of software called InterPro Scan for my superiors, and it is complaining about an executable not existing. Please see below. root@cpt:\/usr\/local\/lib\/iprscan# bin\/Linux\/seqret bash: bin\/Linux\/seqret: No such file or directory root@cpt:\/usr\/local\/lib\/iprscan# ls bin\/Linux\/seqret bin\/Linux\/seqret root@cpt:\/usr\/local\/lib\/iprscan# stat bin\/Linux\/seqret File: `bin\/Linux\/seqret' Size: 949624 Blocks: 1856 IO Block: 4096 regular file Device: 801h\/2049d Inode: 38541532 Links: 1 Access: (0755\/-rwxr-xr-x) Uid: ( 1257\/ UNKNOWN) Gid: ( 1055\/ UNKNOWN) Access: 2013-06-17 17:28:41.317364148 -0500 Modify: 2009-12-16 05:57:46.000000000 -0600 Change: 2013-06-17 17:28:33.049363860 -0500 Birth: - root@cpt:\/usr\/local\/lib\/iprscan# md5sum bin\/Linux\/seqret bc08e679fb146bc47e6f41636dcc1f88 bin\/Linux\/seqret root@cpt:\/usr\/local\/lib\/iprscan# file \/usr\/local\/lib\/iprscan\/bin\/binaries\/seqret \/usr\/local\/lib\/iprscan\/bin\/binaries\/seqret: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU\/Linux 2.2.5, not stripped It exists! But it says it doesn't? I'm incredibly confused. root@cpt:\/usr\/local\/lib\/iprscan# \/usr\/local\/lib\/iprscan\/bin\/iprscan -cli -i \/usr\/local\/lib\/iprscan\/test.seq -o \/usr\/local\/lib\/iprscan\/test.out -format raw -goterms -iprlookup This calls the wrapper script: \/usr\/local\/lib\/iprscan\/conf\/seqret.sh: line 18: \/usr\/local\/lib\/iprscan\/bin\/binaries\/seqret: No such file or directory \/usr\/local\/lib\/iprscan\/bin\/iprscan: checkParams: unable to create input files: formatSequences: This is the original call to the wrapper script: \/usr\/local\/lib\/iprscan\/conf\/seqret.sh \/usr\/local\/lib\/iprscan\/tmp\/20130617\/iprscan-20130617-17561022\/iprscan-20130617-17561022.seqs > \/usr\/local\/lib\/iprscan\/tmp\/20130617\/iprscan-20130617-17561022\/iprscan-20130617-17561022.input.formatted: exit status 127 All of the input files exist. The wrapper script itself root@cpt:\/usr\/local\/lib\/iprscan# cat \/usr\/local\/lib\/iprscan\/conf\/seqret.sh #!\/bin\/bash ##### NOTE #### # Should be already set by iprscan_wrapper.pl. # If not just add the full path to your iprscan installation #IPRSCAN_HOME=\/your\/path\/here\/to\/iprscan ############### IPRSCAN_HOME=\/usr\/local\/lib\/iprscan #Needed for seqret & sixpack emboss applications EMBOSS_ROOT=$IPRSCAN_HOME\/conf export EMBOSS_ROOT EMBOSS_ACDROOT=$IPRSCAN_HOME\/conf\/acd export EMBOSS_ACDROOT # \"$@\" is related to the command line of formatcmd tag in file iprscan.conf. $IPRSCAN_HOME\/bin\/binaries\/seqret -osf fasta -auto -stdout \"$@\""} {"id":"53259","title":"problem occur during installation of moses scripts","text":"> **Possible Duplicate:** > \/bin\/sh: .\/check-dependencies.pl: not found — but check-dependencies.pl > exists! I obtain an error when I compile `moses-script`, which reads as follows: minakshi@minakshi-Vostro-3500:~\/Desktop\/monu\/moses\/scripts$ make release # Compile the parts make all make[1]: Entering directory `\/home\/minakshi\/Desktop\/monu\/moses\/scripts' # Building memscore may fail e.g. if boost is not available. # We ignore this because traditional scoring will still work and memscore isn't used by default. cd training\/memscore ; \\ .\/configure && make \\ || ( echo \"WARNING: Building memscore failed.\"; \\ echo 'training\/memscore\/memscore' >> ..\/..\/release-exclude ) checking for a BSD-compatible install... \/usr\/bin\/install -c checking whether build environment is sane... yes checking for gawk... no checking for mawk... mawk checking whether make sets $(MAKE)... yes checking for g++... g++ checking whether the C++ compiler works... yes checking for C++ compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether we are using the GNU C++ compiler... yes checking whether g++ accepts -g... yes checking for style of include used by make... GNU checking dependency style of g++... gcc3 checking for gcc... gcc checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking dependency style of gcc... gcc3 checking for boostlib >= 1.31.0... yes checking for cos in -lm... yes checking for gzopen in -lz... yes checking for cblas_dgemm in -lgslcblas... no checking for gsl_blas_dgemm in -lgsl... no checking how to run the C++ preprocessor... g++ -E checking for grep that handles long lines and -e... \/bin\/grep checking for egrep... \/bin\/grep -E checking for ANSI C header files... yes checking for sys\/types.h... yes checking for sys\/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking n_gram.h usability... no checking n_gram.h presence... no checking for n_gram.h... no checking for size_t... yes checking for ptrdiff_t... yes configure: creating .\/config.status config.status: creating Makefile config.status: creating config.h config.status: config.h is unchanged config.status: executing depfiles commands make[2]: Entering directory `\/home\/minakshi\/Desktop\/monu\/moses\/scripts\/training\/memscore' make all-am make[3]: Entering directory `\/home\/minakshi\/Desktop\/monu\/moses\/scripts\/training\/memscore' make[3]: Leaving directory `\/home\/minakshi\/Desktop\/monu\/moses\/scripts\/training\/memscore' make[2]: Leaving directory `\/home\/minakshi\/Desktop\/monu\/moses\/scripts\/training\/memscore' touch release-exclude # No files excluded by default pwd=`pwd`; \\ for subdir in cmert-0.5 phrase-extract symal mbr lexical-reordering; do \\ make -C training\/$subdir || exit 1; \\ echo \"### Compiler $subdir\"; \\ cd $pwd; \\ done make[2]: Entering directory `\/home\/minakshi\/Desktop\/monu\/moses\/scripts\/training\/cmert-0.5' make[2]: Nothing to be done for `all'. make[2]: Leaving directory `\/home\/minakshi\/Desktop\/monu\/moses\/scripts\/training\/cmert-0.5' ### Compiler cmert-0.5 make[2]: Entering directory `\/home\/minakshi\/Desktop\/monu\/moses\/scripts\/training\/phrase-extract' make[2]: Nothing to be done for `all'. make[2]: Leaving directory `\/home\/minakshi\/Desktop\/monu\/moses\/scripts\/training\/phrase-extract' ### Compiler phrase-extract make[2]: Entering directory `\/home\/minakshi\/Desktop\/monu\/moses\/scripts\/training\/symal' make[2]: Nothing to be done for `all'. make[2]: Leaving directory `\/home\/minakshi\/Desktop\/monu\/moses\/scripts\/training\/symal' ### Compiler symal make[2]: Entering directory `\/home\/minakshi\/Desktop\/monu\/moses\/scripts\/training\/mbr' make[2]: Nothing to be done for `all'. make[2]: Leaving directory `\/home\/minakshi\/Desktop\/monu\/moses\/scripts\/training\/mbr' ### Compiler mbr make[2]: Entering directory `\/home\/minakshi\/Desktop\/monu\/moses\/scripts\/training\/lexical-reordering' make[2]: Nothing to be done for `all'. make[2]: Leaving directory `\/home\/minakshi\/Desktop\/monu\/moses\/scripts\/training\/lexical-reordering' ### Compiler lexical-reordering ## All files that need compilation were compiled make[1]: Leaving directory `\/home\/minakshi\/Desktop\/monu\/moses\/scripts' \/bin\/sh: .\/check-dependencies.pl: not found make: *** [release] Error 127 We don't know why this error occurs? check-dependencies.pl file existed in scripts folder ..."} {"id":"134395","title":"make: arm-elf-gcc: Command not found","text":"I'm working on an application for a Moxa UC-7110, and I have installed their tool chain, which provides a cross compiler for their arm architecture on uClinux. I'm on on Ubuntu 12.04 LTS. I'm having trouble getting the compiler to work though. I was able to run the tool chain installer successfully, and I see the arm-elf-gcc compiler under \/usr\/local\/bin along with others. However, when I run make, I get a command not found error. Here is the make file: srcdir = . LDFLAGS = -Wl,-elf2flt LIBS = CFLAGS = --verbose # Change these if necessary CC = arm-elf-gcc CPP = arm-elf-gcc -E all: hello hello: $(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(LIBS) $@.c clean: rm -f $(OBJS) hello core *.gdb I've checked my PATH: \/usr\/local\/sbin:\/usr\/local\/bin:\/usr\/sbin:\/usr\/bin:\/sbin:\/bin And when I run `which arm-elf-gcc` I get `\/usr\/local\/bin\/arm-elf-gcc`. I even get tab completion, but when I try to run the `arm-elf-gcc` directly I still get `bash: \/usr\/local\/bin\/arm-elf-gcc: No such file or directory`. I've verified that the file exists, but for some reason Ubuntu doesn't see it. Any ideas?"} {"id":"99562","title":"I get \"bash: ...: No such file or directory\" even though the executable is there","text":"Operating system: Lubuntu 13.10, 64-bit. I installed the Seamonkey browser from http:\/\/www.seamonkey-project.org\/ following the instructions quoted below from http:\/\/www.seamonkey- project.org\/doc\/install-and-uninstall#install_linux > To install SeaMonkey by downloading the tar.bz2 file: > > Create a directory named \"seamonkey2\" (mkdir seamonkey2) and change to that > directory (cd seamonkey2). > Click the link on the site you're downloading SeaMonkey from to download > the package (seamonkey-2.*.tar.bz2) file into the seamonkey2 directory. > Decompress the file with the following command: > > `tar jxvf seamonkey-2.*.tar.bz2` > > This creates a \"seamonkey\" directory under your seamonkey2 directory. > Change to the seamonkey directory (cd seamonkey). > Run SeaMonkey with the following command: > > `.\/seamonkey` I followed the instructions but here is what I see with the following commands: [05:28 PM] ~\/seamonkey2\/seamonkey $ ll seam* -rwxr-xr-x 1 vasa1 vasa1 82816 Oct 29 08:23 seamonkey* -rwxr-xr-x 1 vasa1 vasa1 82820 Oct 29 08:23 seamonkey-bin* * * * [05:28 PM] ~\/seamonkey2\/seamonkey $ seamonkey bash: \/home\/vasa1\/seamonkey2\/seamonkey\/seamonkey: No such file or directory [05:28 PM] ~\/seamonkey2\/seamonkey $ seamonkey-bin bash: \/home\/vasa1\/seamonkey2\/seamonkey\/seamonkey-bin: No such file or directory [05:28 PM] ~\/seamonkey2\/seamonkey $ .\/seamonkey bash: .\/seamonkey: No such file or directory [05:29 PM] ~\/seamonkey2\/seamonkey $ .\/seamonkey-bin bash: .\/seamonkey-bin: No such file or directory [05:29 PM] ~\/seamonkey2\/seamonkey $ So why is `bash` saying \"No such file or directory\" although the directory and files (seamonkey and seamonkey-bin) exist? Here is the output of `cat \/etc\/environment`: [05:38 PM] ~ $ cat \/etc\/environment PATH=\"\/usr\/local\/sbin:\/usr\/local\/bin:\/usr\/sbin:\/usr\/bin:\/sbin:\/bin:\/usr\/games:\/usr\/local\/games:\/home\/vasa1\/seamonkey2\/seamonkey\" [05:38 PM] ~ $ Here is the output of `file seamonkey` and `ldd seamonkey`: [06:29 PM] ~\/seamonkey2\/seamonkey $ file seamonkey seamonkey: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU\/Linux 2.6.9, stripped [06:30 PM] ~\/seamonkey2\/seamonkey $ ldd seamonkey linux-gate.so.1 => (0xf7726000) libpthread.so.0 => \/lib32\/libpthread.so.0 (0xf76f6000) libdl.so.2 => \/lib32\/libdl.so.2 (0xf76f1000) libstdc++.so.6 => not found libm.so.6 => \/lib32\/libm.so.6 (0xf76ae000) libgcc_s.so.1 => not found libc.so.6 => \/lib32\/libc.so.6 (0xf74fc000) \/lib\/ld-linux.so.2 (0xf7727000) [06:31 PM] ~\/seamonkey2\/seamonkey $"} {"id":"21475","title":"When executable files aren't","text":"> **Possible Duplicate:** > Can't execute some binaries in chroot environment (zsh: Not found) Today I ran into something that has me stumped. A co-worker is working with a specific pre-compiled binary he downloaded (available here). On the Ubuntu 10.04 LTS Server he's working on, attempting to execute this file yields file- not-found, even with permissions set right. And yet, when I attempt the same thing from OpenSUSE 11.4, it runs just fine. Running `file` on it gives me: > ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked > (uses shared libs), for GNU\/Linux 2.6.15, stripped Both the Ubuntu and OpenSUSE boxes are 64-bit installs, and `file` returns the same information on both machines. Which looks just fine to me. And on the opensuse box, LDD even gives me a short list of library files. Hand checking, all of those specified files also exist on the Ubuntu server. Strace output is different though: Opensuse: > execve(\".\/trid\", [\".\/trid\"], [\/* 122 vars *\/]) = 0 Ubuntu (giving full path does not change result): > execve(\".\/trid\", [\".\/trid\"], [\/* 19 vars *\/]) = -1 ENOENT (No such file or > directory) What can cause a file like this to not be executable in this way?"} {"id":"30063","title":"skype not found on Oneiric 64, but it is right there","text":"> **Possible Duplicate:** > Can't execute some binaries in chroot environment (zsh: Not found) I have something weird here. Cannot find a file although it is right there. $ skype command not found: skype $ whereis skype skype: \/usr\/bin\/skype \/usr\/share\/skype $ \/usr\/bin\/skype file or directory not found: \/usr\/bin\/skype $ ls -l \/usr\/bin\/skype -rwxr-xr-x 1 root root 21362968 2011-06-08 12:26 \/usr\/bin\/skype $ type \/usr\/bin\/skype \/usr\/bin\/skype is \/usr\/bin\/skype $ which skype \/usr\/bin\/skype Any explanation for that? Happened only with skype so far, no matter if on zsh or bash. I'm on Ubuntu Natty 64, had not encountered anything like that before."} {"id":"117314","title":"Getting 'no such file or directory' even though the file is clearly there","text":"I'm having a perplexing issue. If I try to run a script via: root@myServer:~\/dig# .\/minerd.sh I get: -bash: .\/minerd.sh: No such file or directory If I try: root@myServer:~\/dig# ~\/dig\/minerd.sh I still get: -bash: \/root\/dig\/minerd.sh: No such file or directory If I do: root@myServer:~\/dig# ls ~\/dig\/minerd.sh Then I get: \/root\/dig\/minerd.sh So, the file is clearly there. I have also previously done `chmod +x` on it. But still, its not allowing me to run it for some reason. What am I doing wrong? Edit: Even moving the file to a different name doesn't work: root@myServer:~\/dig# mv minerd.sh test.sh root@myServer:~\/dig# .\/test.sh -bash: .\/test.sh: No such file or directory"} {"id":"147679","title":"Executable exists for everything but bash & file manager","text":"I am running Debian. I was trying to use truecrypt the other day. I downloaded and extracted the zip, and ran the installer. I just extracted the file, and did not install it. I then tried executing it, and apparently it does not exist. First I just double clicked the file from thunar (xfce4 file manager), and it told me the file did not exist. I then tried the following: ~$ cd \/home\/share\/crypt\/truecrypt\/ \/home\/share\/crypt\/truecrypt$ ls -al truecrypt-linux_x86-64 -rwxrwxrwx 1 abstruselyarcane root 4873328 Feb 7 2012 truecrypt-linux_x86-64 #Its not a figment of my imagination \/home\/share\/crypt\/truecrypt$ file truecrypt-linux_x86-64 truecrypt-linux_x86-64: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), stripped # It is indeed an executable \/home\/share\/crypt\/truecrypt$ .\/truecrypt-linux_x86-64 bash: .\/truecrypt-linux_x86-64: No such file or directory # It doesn't exist? \/home\/share\/crypt\/truecrypt$ sudo .\/truecrypt-linux_x86-64 [sudo] password for abstruselyarcane: sudo: unable to execute .\/truecrypt-linux_x86-64: No such file or directory \/home\/share\/crypt\/truecrypt$ ldd truecrypt-linux_x86-64 not a dynamic executable # file just said it is an executable! I am very confused right now. EDIT: I has been suggested to be that I'm running a 64bit from a 32bit, I went to the other post, and tested my distro: ~$ uname -m x86_64"} {"id":"53097","title":"\/bin\/sh: .\/check-dependencies.pl: not found — but check-dependencies.pl exists!","text":"I'm trying to build Moses, but when I run `make` I get the following output: minakshi@minakshi-Vostro-3500:~\/Desktop\/working-dir\/moses\/scripts$ make release # Compile the parts make all make[1]: Entering directory `\/home\/minakshi\/Desktop\/working-dir\/moses\/scripts' # Building memscore may fail e.g. if boost is not available. # We ignore this because traditional scoring will still work and memscore isn't used by default. cd training\/memscore ; \\ .\/configure && make \\ || ( echo \"WARNING: Building memscore failed.\"; \\ echo 'training\/memscore\/memscore' >> ..\/..\/release-exclude ) checking for a BSD-compatible install... \/usr\/bin\/install -c checking whether build environment is sane... yes checking for gawk... no checking for mawk... mawk checking whether make sets $(MAKE)... yes checking for g++... g++ checking whether the C++ compiler works... yes checking for C++ compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether we are using the GNU C++ compiler... yes checking whether g++ accepts -g... yes checking for style of include used by make... GNU checking dependency style of g++... gcc3 checking for gcc... gcc checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking dependency style of gcc... gcc3 checking for boostlib >= 1.31.0... yes checking for cos in -lm... yes checking for gzopen in -lz... yes checking for cblas_dgemm in -lgslcblas... no checking for gsl_blas_dgemm in -lgsl... no checking how to run the C++ preprocessor... g++ -E checking for grep that handles long lines and -e... \/bin\/grep checking for egrep... \/bin\/grep -E checking for ANSI C header files... yes checking for sys\/types.h... yes checking for sys\/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking n_gram.h usability... no checking n_gram.h presence... no checking for n_gram.h... no checking for size_t... yes checking for ptrdiff_t... yes configure: creating .\/config.status config.status: creating Makefile config.status: creating config.h config.status: config.h is unchanged config.status: executing depfiles commands make[2]: Entering directory `\/home\/minakshi\/Desktop\/working-dir\/moses\/scripts\/training\/memscore' make all-am make[3]: Entering directory `\/home\/minakshi\/Desktop\/working-dir\/moses\/scripts\/training\/memscore' make[3]: Leaving directory `\/home\/minakshi\/Desktop\/working-dir\/moses\/scripts\/training\/memscore' make[2]: Leaving directory `\/home\/minakshi\/Desktop\/working-dir\/moses\/scripts\/training\/memscore' touch release-exclude # No files excluded by default pwd=`pwd`; \\ for subdir in cmert-0.5 phrase-extract symal mbr lexical-reordering; do \\ make -C training\/$subdir || exit 1; \\ echo \"### Compiler $subdir\"; \\ cd $pwd; \\ done make[2]: Entering directory `\/home\/minakshi\/Desktop\/working-dir\/moses\/scripts\/training\/cmert-0.5' make[2]: Nothing to be done for `all'. make[2]: Leaving directory `\/home\/minakshi\/Desktop\/working-dir\/moses\/scripts\/training\/cmert-0.5' ### Compiler cmert-0.5 make[2]: Entering directory `\/home\/minakshi\/Desktop\/working-dir\/moses\/scripts\/training\/phrase-extract' make[2]: Nothing to be done for `all'. make[2]: Leaving directory `\/home\/minakshi\/Desktop\/working-dir\/moses\/scripts\/training\/phrase-extract' ### Compiler phrase-extract make[2]: Entering directory `\/home\/minakshi\/Desktop\/working-dir\/moses\/scripts\/training\/symal' make[2]: Nothing to be done for `all'. make[2]: Leaving directory `\/home\/minakshi\/Desktop\/working-dir\/moses\/scripts\/training\/symal' ### Compiler symal make[2]: Entering directory `\/home\/minakshi\/Desktop\/working-dir\/moses\/scripts\/training\/mbr' make[2]: Nothing to be done for `all'. make[2]: Leaving directory `\/home\/minakshi\/Desktop\/working-dir\/moses\/scripts\/training\/mbr' ### Compiler mbr make[2]: Entering directory `\/home\/minakshi\/Desktop\/working-dir\/moses\/scripts\/training\/lexical-reordering' make[2]: Nothing to be done for `all'. make[2]: Leaving directory `\/home\/minakshi\/Desktop\/working-dir\/moses\/scripts\/training\/lexical-reordering' ### Compiler lexical-reordering ## All files that need compilation were compiled make[1]: Leaving directory `\/home\/minakshi\/Desktop\/working-dir\/moses\/scripts' \/bin\/sh: .\/check-dependencies.pl: Permission denied make: *** [release] Error 126 minakshi@minakshi-Vostro-3500:~\/Desktop\/working-dir\/moses\/scripts$ make release # Compile the parts make all make[1]: Entering directory `\/home\/minakshi\/Desktop\/working-dir\/moses\/scripts' # Building memscore may fail e.g. if boost is not available. # We ignore this because traditional scoring will still work and memscore isn't used by default. cd training\/memscore ; \\ .\/configure && make \\ || ( echo \"WARNING: Building memscore failed.\"; \\ echo 'training\/memscore\/memscore' >> ..\/..\/release-exclude ) checking for a BSD-compatible install... \/usr\/bin\/install -c checking whether build environment is sane... yes checking for gawk... no checking for mawk... mawk checking whether make sets $(MAKE)... yes checking for g++... g++ checking whether the C++ compiler works... yes checking for C++ compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether we are using the GNU C++ compiler... yes checking whether g++ accepts -g... yes checking for style of include used by make... GNU checking dependency style of g++... gcc3 checking for gcc... gcc checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking dependency style of gcc... gcc3 checking for boostlib >= 1.31.0... yes checking for cos in -lm... yes checking for gzopen in -lz... yes checking for cblas_dgemm in -lgslcblas... no checking for gsl_blas_dgemm in -lgsl... no checking how to run the C++ preprocessor... g++ -E checking for grep that handles long lines and -e... \/bin\/grep checking for egrep... \/bin\/grep -E checking for ANSI C header files... yes checking for sys\/types.h... yes checking for sys\/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking n_gram.h usability... no checking n_gram.h presence... no checking for n_gram.h... no checking for size_t... yes checking for ptrdiff_t... yes configure: creating .\/config.status config.status: creating Makefile config.status: creating config.h config.status: config.h is unchanged config.status: executing depfiles commands make[2]: Entering directory `\/home\/minakshi\/Desktop\/working-dir\/moses\/scripts\/training\/memscore' make all-am make[3]: Entering directory `\/home\/minakshi\/Desktop\/working-dir\/moses\/scripts\/training\/memscore' make[3]: Leaving directory `\/home\/minakshi\/Desktop\/working-dir\/moses\/scripts\/training\/memscore' make[2]: Leaving directory `\/home\/minakshi\/Desktop\/working-dir\/moses\/scripts\/training\/memscore' touch release-exclude # No files excluded by default pwd=`pwd`; \\ for subdir in cmert-0.5 phrase-extract symal mbr lexical-reordering; do \\ make -C training\/$subdir || exit 1; \\ echo \"### Compiler $subdir\"; \\ cd $pwd; \\ done make[2]: Entering directory `\/home\/minakshi\/Desktop\/working-dir\/moses\/scripts\/training\/cmert-0.5' make[2]: Nothing to be done for `all'. make[2]: Leaving directory `\/home\/minakshi\/Desktop\/working-dir\/moses\/scripts\/training\/cmert-0.5' ### Compiler cmert-0.5 make[2]: Entering directory `\/home\/minakshi\/Desktop\/working-dir\/moses\/scripts\/training\/phrase-extract' make[2]: Nothing to be done for `all'. make[2]: Leaving directory `\/home\/minakshi\/Desktop\/working-dir\/moses\/scripts\/training\/phrase-extract' ### Compiler phrase-extract make[2]: Entering directory `\/home\/minakshi\/Desktop\/working-dir\/moses\/scripts\/training\/symal' make[2]: Nothing to be done for `all'. make[2]: Leaving directory `\/home\/minakshi\/Desktop\/working-dir\/moses\/scripts\/training\/symal' ### Compiler symal make[2]: Entering directory `\/home\/minakshi\/Desktop\/working-dir\/moses\/scripts\/training\/mbr' make[2]: Nothing to be done for `all'. make[2]: Leaving directory `\/home\/minakshi\/Desktop\/working-dir\/moses\/scripts\/training\/mbr' ### Compiler mbr make[2]: Entering directory `\/home\/minakshi\/Desktop\/working-dir\/moses\/scripts\/training\/lexical-reordering' make[2]: Nothing to be done for `all'. make[2]: Leaving directory `\/home\/minakshi\/Desktop\/working-dir\/moses\/scripts\/training\/lexical-reordering' ### Compiler lexical-reordering ## All files that need compilation were compiled make[1]: Leaving directory `\/home\/minakshi\/Desktop\/working-dir\/moses\/scripts' \/bin\/sh: .\/check-dependencies.pl: not found make: *** [release] Error 127 The error message says `.\/check-dependencies.pl` is \"not found\", but I see the file present in the `scripts` folder. So why does this error occur?"} {"id":"91699","title":"\"No such file or directory\" on files that exist?","text":"In the past day, I've found at least 4 binaries that say \"bin-name: No such file or directory\" when I try to run them. Even if I type part of the name and tab complete it, I get the same error. I'm on an x86_64 architecture. Output of `file`: fez-09152013-bin: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU\/Linux 2.6.24, BuildID[sha1]=0x78612e4aac547367548dcc7cc3067c3cfcf2f177, stripped Output of `strace`: execve(\".\/fez-09152013-bin\", [\".\/fez-09152013-bin\"], [\/* 23 vars *\/]) = -1 ENOENT (No such file or directory) dup(2) = 3 fcntl(3, F_GETFL) = 0x8002 (flags O_RDWR|O_LARGEFILE) fstat(3, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 1), ...}) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f3fda17a000 lseek(3, 0, SEEK_CUR) = -1 ESPIPE (Illegal seek) write(3, \"strace: exec: No such file or di\"..., 40strace: exec: No such file or directory ) = 40 close(3) = 0 munmap(0x7f3fda17a000, 4096) = 0 exit_group(1) = ? Output of `ldd`: Not a dynamic executable Output of `strings` is way too long to indent, so here's a link: http:\/\/pastebin.com\/t7MmugLY apt-get error: Reading package lists... Done Building dependency tree Reading state information... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation: The following packages have unmet dependencies: ia32-libs : Depends: ia32-libs-i386 but it is not installable E: Unable to correct problems, you have held broken packages."} {"id":"68505","title":"no such file or directory","text":"I have a 64-bit Ubuntu and want to execute a 32-bit FreeRTOS binary. The error message says no such file or directory. The files are there I can read them with `ls -l`."} {"id":"55614","title":"Linux From Scratch: make no such file or directory, bad interpreter","text":"> **Possible Duplicate:** > Getting “Not found” message when running a 32-bit binary on a 64-bit system I have finished the chapter 5 of the book. And after I entered the chroot I realized that `make` is not working even though it is present. root:\/sources\/linux-3.5.2# make mrproper bash: \/tools\/bin\/make: No such file or directory the path is correct echo $PATH \/bin:\/usr\/bin:\/sbin:\/usr\/sbin:\/tools\/bin AND ls -l \/tools\/bin\/make -rwxr-xr-x 1 root root 559139 Nov 13 11:19 \/tools\/bin\/make I read on LFS FAQ that is probably due to a bad interpreter (link) so I did readelf -l \/tools\/bin\/make | grep interpreter [Requesting program interpreter: \/lib64\/ld-linux-x86-64.so.2] so it's wrong they said it should be something like **\/tools\/lib\/ld- linux.so.2** Is there a way to precise when building it the right interpreter ? Thanks"} {"id":"89964","title":"Debian Wheezy 7.1 - can't launch Skype or Firefox","text":"I've installed Skype by using `dkpg` and when I try to run it, this is what I get `-bash: \/usr\/bin\/skype: No such file or directory`. Which is very strange since `ls -l | grep skype` shows this: -rwxr-xr-x 1 root root 30717480 May 7 01:43 skype I had similiar problems when I installed FireFox, but since I didn't need it all that much, didn't care. However, I do need Skype on Linux. Output of my `$PATH` variable: \/home\/max\/.rvm\/gems\/ruby-2.0.0-p247\/bin:\/home\/max\/.rvm\/gems\/ruby-2.0.0-p247@global\/bin:\/home\/max\/.rvm\/rubies\/ruby-2.0.0-p247\/bin:\/home\/max\/.rvm\/bin:\/usr\/local\/bin:\/usr\/bin:\/bin:\/usr\/local\/games:\/usr\/games Anyone care to explain?... Because I'm stunned."} {"id":"66220","title":"Existing file can not be found?","text":"\/usr\/share\/tipp10$ ll insgesamt 9408 drwxr-xr-x 3 myname ssl-cert 4096 Feb 26 20:07 .\/ drwxr-xr-x 288 root root 12288 Feb 26 20:07 ..\/ -rwxrwxrwx 1 myname ssl-cert 9480 Okt 6 2010 error.wav* drwxrwxrwx 4 myname ssl-cert 4096 Feb 26 20:07 help\/ -rwxrwxrwx 1 myname ssl-cert 16368 Dez 30 2010 license_de.txt* -rwxrwxrwx 1 myname ssl-cert 16291 Dez 30 2010 license_en.txt* -rwxrwxrwx 1 myname ssl-cert 5928 Okt 6 2010 metronome.wav* -rwxrwxrwx 1 myname ssl-cert 9537480 Mär 11 2011 tipp10* -rwxrwxrwx 1 myname ssl-cert 1255 Nov 7 2008 tipp10.png* -rwxrwxrwx 1 myname ssl-cert 13312 Dez 18 2010 tipp10v2.template* \/usr\/share\/tipp10$ pwd tipp10 \/usr\/share\/tipp10 \/usr\/share\/tipp10$ file tipp10 tipp10: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU\/Linux 2.6.4, not stripped manuel@P5KC:\/usr\/share\/tipp10$ ldd tipp10 \\tdas Programm ist nicht dynamisch gelinkt # (Program is not dynamic linked) \/usr\/share\/tipp10$ .\/tipp10 bash: .\/tipp10: File not found Ubuntu 12.04 x64 What the heck is wrong here? **EDIT: --------------------- SOLUTION ---------------------** .. for those, who dont want to read the complete dup article. My OS is 64-bit. I though 32-bit apps would run on 64-bit machines. 32-bit apps can run on a 64-bit machine, but only if the requisite supporting libraries are installed. For running 32-bit programs, try installing the ia32-libs package."} {"id":"25602","title":"Why is (free_space + used_space) != total_size in df?","text":"> **Possible Duplicate:** > ext4: How to account for the filesystem space? I have a ~2TB ext4 USB external disk which is about half full: $ df Filesystem 1K-blocks Used Available Use% Mounted on \/dev\/sdc 1922860848 927384456 897800668 51% \/media\/big I'm wondering why the total size (1922860848) isn't the same as Used+Available (1825185124)? From this answer I see that 5% of the disk might be reserved for root, but that would still only take the total used to 1921328166, which is still off. Is it related to some other filesystem overhead? In case it's relevant, `lsof -n | grep deleted` shows no deleted files on this disk, and there are no other filesystems mounted inside this one. Edit: As requested, here's the output of `tune2fs -l \/dev\/sdc` tune2fs 1.41.14 (22-Dec-2010) Filesystem volume name: big Last mounted on: \/media\/big Filesystem UUID: 5d9b9f5d-dae7-4221-9096-cbe7dd78924d Filesystem magic number: 0xEF53 Filesystem revision #: 1 (dynamic) Filesystem features: has_journal ext_attr resize_inode dir_index filetype needs_recovery extent flex_bg sparse_super large_file huge_file uninit_bg dir_nlink extra_isize Filesystem flags: signed_directory_hash Default mount options: (none) Filesystem state: clean Errors behavior: Continue Filesystem OS type: Linux Inode count: 122101760 Block count: 488378624 Reserved block count: 24418931 Free blocks: 480665205 Free inodes: 122101749 First block: 0 Block size: 4096 Fragment size: 4096 Reserved GDT blocks: 907 Blocks per group: 32768 Fragments per group: 32768 Inodes per group: 8192 Inode blocks per group: 512 Flex block group size: 16 Filesystem created: Wed Nov 23 14:13:57 2011 Last mount time: Wed Nov 23 14:14:24 2011 Last write time: Wed Nov 23 14:14:24 2011 Mount count: 2 Maximum mount count: 20 Last checked: Wed Nov 23 14:13:57 2011 Check interval: 15552000 (6 months) Next check after: Mon May 21 13:13:57 2012 Lifetime writes: 144 MB Reserved blocks uid: 0 (user root) Reserved blocks gid: 0 (group root) First inode: 11 Inode size: 256 Required extra isize: 28 Desired extra isize: 28 Journal inode: 8 Default directory hash: half_md4 Directory Hash Seed: 68e954e4-59b1-4f59-9434-6c636402c3db Journal backup: inode blocks"} {"id":"110329","title":"Is there something wrong with df output?","text":"I'm using the command `df -h` to check disk usage on CentOS 6.4. I see an inconsistency with the output. ![df -h](http:\/\/i.stack.imgur.com\/ft4pN.jpg) look at the line Filesystem: total 490Gb, used 55Gb, and Available 411Gb. What is it mean? I think that 490 - 55 = 435 ?"} {"id":"148035","title":"Is dash or some other shell \"faster\" than bash?","text":"I always thought that the only benefit of using dash instead of bash was that dash was smaller, and therefore many instances of dash would start faster at boot time. But I have done some research, and found some people migrating all their scripts to dash in the hope they would run faster, and I also found this in the article DashAsBinSh in the Ubuntu Wiki: > The major reason to switch the default shell was _efficiency_. bash is an > excellent full-featured shell appropriate for interactive use; indeed, it is > still the default login shell. However, it is rather large and _slow to > start up **and operate**_ by comparison with dash. Nowadays I've been using lots of bash scripts for many things on my system, and my problem is that I have a particular script that I'm running continuously 24\/7, that spawns around 200 children, which together heat my computer 10°C more than in normal usage. It is a rather large script with lots of bashisms, so porting them to POSIX or some other shell would be very time consuming (and POSIX doesn't really matter for personal use), but it would be worth if I could reduce some of this CPU usage. I know there are also other things to consider, like calling an external binary like `sed` for a simple bashism like `${foo\/bar}`, or `grep` instead of `=~`. **TL;DR** is really bash slower to start up **and operate** in comparison with dash? Are there other Unix shells which are more _efficient_ than bash?"} {"id":"52787","title":"Filesystem writes seemingly lost","text":"I've been experimenting with tcpdump, and I've found some very bizarre filesystem behavior. It doesn't look to be a tcpdump problem as I'll explain in a second. The following command produces no file: tcpdump -w test.pcap Yet this command produces the PCAP file as expected: tcpdump -w - > test.pcap At first I figured that tcpdump must be encountering some error when writing the file that the shell wasn't, so I straced and found that the writes were occurring just fine! open(\"test.pcap\", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 4 fstat(4, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7ff9bf5cb000 rt_sigaction(SIGUSR1, {0x4557d0, [], SA_RESTORER, 0x7ff9bea2ab60}, {SIG_DFL, [], 0}, 8) = 0 write(2, \"tcpdump: \", 9tcpdump: ) = 9 write(2, \"listening on eth0, link-type EN1\"..., 73listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes) = 73 poll([{fd=3, events=POLLIN}], 1, 1000) = 1 ([{fd=3, revents=POLLIN}]) poll([{fd=3, events=POLLIN}], 1, 1000) = 1 ([{fd=3, revents=POLLIN}]) poll([{fd=3, events=POLLIN}], 1, 1000) = 1 ([{fd=3, revents=POLLIN}]) write(4, \"\\324\\303\\262\\241\\2\\0\\4\\0\\0\\0\\0\\0\\0\\0\\0\\0\\377\\377\\0\\0\\1\\0\\0\\0001\\2\\210P\\34\\3\\3\\0\"..., 4096) = 4096 poll([{fd=3, events=POLLIN}], 1, 1000) = 1 ([{fd=3, revents=POLLIN}]) poll([{fd=3, events=POLLIN}], 1, 1000) = 1 ([{fd=3, revents=POLLIN}]) write(4, \"\\232\\241\\4\\17X\\213\\f9+\\225\\35\\t\\364QF\\223\\242\\7\\217Y\\226\\373l\\231vQ\\354\\223\\250i\\336.\"..., 4096) = 4096 poll([{fd=3, events=POLLIN}], 1, 1000) = 1 ([{fd=3, revents=POLLIN}]) poll([{fd=3, events=POLLIN}], 1, 1000) = 1 ([{fd=3, revents=POLLIN}]) write(4, \"\\34\\226\\346%\\354\\210\\342\\331\\377\\373\\222d\\261\\0\\5\\207wX\\6i`\\0U\\260\\350\\260\\300\\250\\0\\16\\335\\241\"..., 4096) = 4096 test.pcap gets opened as file descriptor 4, and then several writes occur to that descriptor with the syscall reporting that the requested number of bytes was in fact written. Even so, no file is created. I scoured the filesystem for test.pcap and found nothing. What could produce this behavior? tcpdump version 4.3.0 libpcap version 1.3.0 GNU bash, version 4.2.37(1)-release (x86_64-pc-linux-gnu) Linux persephone 3.4.9-gentoo #1 SMP Wed Oct 3 10:02:39 EDT 2012 x86_64 Intel(R) Xeon(R) CPU E5645 @ 2.40GHz GenuineIntel GNU\/Linux"} {"id":"104758","title":"TPS Based Shell Script","text":"I am writing a shell script to test my soap web service's load handling. But I am not sure how to simulate the TPS value. Can you help me to find a way to handle that ?"} {"id":"21873","title":"How can I create a direct 8khz audio pipe in Ubuntu?","text":"I'm interested in creating musical programs like these: http:\/\/www.youtube.com\/watch?v=GtQdIYUtAHg&feature=player_embedded Essentially these programs just generate sequences of integers, which (apparently), when fed directly into a 8khz audio stream (like \"\/dev\/audio\"), produce interesting music. My problem is that my system does not have \/dev\/audio. In fact, looking through my \/dev, it's unclear to me whether any of the devices is a direct audio interface. I have two questions: 1. Is there a nice package which will let me pipe in a stream of numbers from the command line, and produce a matching 8Khz audio output? 2. If not, how might I go about directly accessing my audio device?"} {"id":"104755","title":"How can I create a local function in my bashrc?","text":"My .bashrc had some code that was repetitive so I used a function to simplify it do_stuff() { local version=$1 export FOO_${version}_X=\"17\" export FOO_${version}_Y=\"42\" } do_stuff '5.1' do_stuff '5.2' However, now when I use my shell the \"do_stuff\" name is in scope so I can tab- complete and run that function (potentially messing up my environment variables). Is there a way to make \"do_stuff\" visible only inside the .bashrc?"} {"id":"127235","title":"Is data=journal safer for Ext4 as opposed to data=ordered?","text":"The default journal mode for Ext4 is `data=ordered`, which, per the documentation, means that > \"All data are forced directly out to the main file system prior to its > metadata being committed to the journal.\" However, there is also the `data=journal` option, which means that > \"All data are committed into the journal prior to being written into the > main file system. Enabling this mode will disable delayed allocation and > O_DIRECT support.\" My understanding of this is that the `data=journal` mode will journal all data as well as metadata, which, on the face of it, appears to mean that this is the safest option in terms of data integrity and reliability, though maybe not so much for performance. Should I go with this option if reliability is of the utmost concern, but performance much less so? Are there any caveats to using this option? For background, the system in question is on a UPS and write caching is disabled on the drives."} {"id":"26060","title":"How do I downgrade my nVidia Driver in openSUSE 12.1?","text":"I'm trying to trouble-shoot a problem that I've been having. Downgrading my nVidia driver is about the only thing I haven't tried. I have an nVidea GeForce 6200 and installed the latest driver version 290.10, but Í'd like to try an earlier version. When I search for my driver on the nVidia website, it always brings me to the download page for the latest version. How can I find an _older_ version to install? Here's some potentially relevant information: **OS Information** OS: Linux 3.1.0-1.2-default i686 System: openSUSE 12.1 (i586) KDE: 4.7.2 (4.7.2) \"release 5\" **Display Info** Vendor: nVidia Corporation Model: GeForce 6200 (0x0221) 2D driver: nvidia 3D driver: NVIDIA 290.10 Please let me know if you need anything else."} {"id":"119316","title":"Dual screen for plymouth with NVIDIA drivers","text":"If I set plymouth to work with drivers the NVIDIA splash screen only appears on one monitor. While if I set it up with the nouveau driver appears on both monitors. Does anyone know how to configure plymouth with drivers NVIDIA to splash screen look at the two monitors?"} {"id":"64371","title":"Why are multiple command-line terminal consoles available\/running at the same time on RHEL systems?","text":"I'm studying for the RHCSA and am trying to wrap my mind around a seemingly basic concept: terminal consoles. I don't understand how\/why RHEL systems make 6 terminal consoles (`\/dev\/tty _N_`) available for use. If I'm managing a server (or workstation for that matter), under what circumstances would I want to hop between terminals (e.g. `Ctrl`+`Alt`+`F2`)? Wouldn't I just be connected to one terminal and work from there?"} {"id":"153951","title":"Sum up the selected fields","text":"I have a file with a numeric value in character positions 86 to 99. I want to sum up the entire amount present in the file, only for lines which contain `RS` at position 124-125. I am trying to do like `amt=$(cat custbills.cmp| cut -c124-125|grep 'RS'|cut -c86-99|awk '{s+=$1 } END {print s }')` and when i do `echo $amt` it is showing Zero. what is wrong in this. Fields in the file from 86 to 111 like `0000000016.65201406051101` In this `16.65` is amount. I have 300 records in this file. Sample data from 1 to 136 fields: `reportname 123456-78956 customername 0000000016.65201406051101 10RS 000000`"} {"id":"2865","title":"Moving linux install to a new computer","text":"I know that it can, in some circumstances, be difficult to move a Windows installation from one computer to another (physically move the hard drive), but how does that work on linux? Aren't most of the driver modules loaded at bootup? So theoretically would it be that much of a hassle? Obviously xorg configs would change and proprietary ATI drivers and such would have to be recompiled (maybe?). Is there more to it than I'm thinking of? Assume the 2 computers are from the same era, ie both i7s but slightly different hardware. Update: Thanks for the answers. This is mostly for my own curiosity. I have my linux system up and running at work, but eventually I'd like to move to a computer that I can get dual video cards into so I can run more than 2 monitors. But not any time soon"} {"id":"30754","title":"Getting new server. How do I move everything over?","text":"> **Possible Duplicate:** > Moving linux install to a new computer A buddy of mine has found me a new server for our role-playing forums we run and my other web sites. I finally have my current server stable and running good though it is a bit slow (AMD 2400+ 2 GB RAM). I am running Ubuntu 11.4 (maybe?). I don't know what I am getting yet or if there are hard drives in the system. If there are no hard drives, can I just put my hard drive from the existing computer into the new one? If there is a hard drive (or RAID), what would be the best approach to migrate the server to the new one? I am running LAMP with WordPress, phpBB and couple other small web applications. I also have SVN running. That is basically it. I keep all software up-to-date."} {"id":"67282","title":"Copying a working Linux instead of installing a new one","text":"It is possible to move an installed Linux from one drive to another or from one disk to another by two methods: 1. `dd` command which copies sector by sector including boot sector 2. `cp` command, and then installing\/updating `grub` These are very handy and easy methods, but I have no seen any instruction for using these methods for installing a new Linux on a new machine. Is there any disadvantage for this? For example, we can boot from a Live CD, and copy the files of a minimal installed Linux (without grub); then installing grub through `chroot`. In other words, we can have a minimal linux on a USB drive, and install it on any machine (by boot from it, copy itself, chroot, etc). The only things that should be altered (to my knowledge) is `grub` and `fstab` from on machine to another. Is there any disadvantage or drawback? NOTE: I know that Live CD installers somehow do a similar task, but I am curious if simple copying can cause problem on a new machine?"} {"id":"36770","title":"How to create a single page PDF file out of multiple EPS files with GhostScript","text":"I'm trying to merge eps files into a pdf file using GS, however, I cannot get it to put multiple eps files without page breaks in between even if original files are small. The command I'm using is: gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=out_file [list of eps files...]"} {"id":"58960","title":"Screen resolution problem in Fedora 17 on Oracle VirtualBox 4.2","text":"I have HP Pavilion dv6 6119tx system which has a screen resolution of 1366X768. But after installing fedora 17 on VirtualBox with Guest additions, the default resolution is 1280X768. Whenever I switch to fullscreen mode, I have some black space left on both left and right sides of screen. Please help. Please also suggest me some resources to learn basics of Linux, commands in Linux(specifically Fedora 17)."} {"id":"58967","title":"Linux From Scratch 7.2: Error while making binutils-2.22 in chapter 6","text":"I get the following error while executing `make tooldir=\/usr` ..\/..\/binutils-2.22\/libiberty\/regex.c:130:1: warning: function declaration isn't a prototype [-Wstrict-prototypes] ..\/..\/binutils-2.22\/libiberty\/regex.c:130:7: warning: conflicting types for built-in function 'malloc' [enabled by default] ..\/..\/binutils-2.22\/libiberty\/regex.c:131:1: warning: function declaration isn't a prototype [-Wstrict-prototypes] ..\/..\/binutils-2.22\/libiberty\/regex.c:131:7: warning: conflicting types for built-in function 'realloc' [enabled by default] In file included from \/usr\/include\/bits\/string2.h:1296:0, from \/usr\/include\/string.h:633, from ..\/..\/binutils-2.22\/libiberty\/regex.c:149: \/usr\/include\/stdlib.h:470:14: error: conflicting types for 'malloc' ..\/..\/binutils-2.22\/libiberty\/regex.c:130:7: note: previous declaration of 'malloc' was here In file included from ..\/..\/binutils-2.22\/libiberty\/regex.c:638:0: ..\/..\/binutils-2.22\/libiberty\/regex.c: In function 'byte_regex_compile': ..\/..\/binutils-2.22\/libiberty\/regex.c:2439:7: warning: implicit declaration of function 'free' [-Wimplicit-function-declaration] ..\/..\/binutils-2.22\/libiberty\/regex.c:2439:33: warning: incompatible implicit declaration of built-in function 'free' [enabled by default] ..\/..\/binutils-2.22\/libiberty\/regex.c:2500:17: warning: incompatible implicit declaration of built-in function 'free' [enabled by default] ..\/..\/binutils-2.22\/libiberty\/regex.c:2533:36: warning: incompatible implicit declaration of built-in function 'free' [enabled by default] ..\/..\/binutils-2.22\/libiberty\/regex.c:2640:28: warning: incompatible implicit declaration of built-in function 'free' [enabled by default] ..\/..\/binutils-2.22\/libiberty\/regex.c:3643:26: warning: incompatible implicit declaration of built-in function 'free' [enabled by default] ..\/..\/binutils-2.22\/libiberty\/regex.c:4150:5: warning: incompatible implicit declaration of built-in function 'free' [enabled by default] ..\/..\/binutils-2.22\/libiberty\/regex.c: In function 'byte_re_compile_fastmap': ..\/..\/binutils-2.22\/libiberty\/regex.c:4835:11: warning: implicit declaration of function 'abort' [-Wimplicit-function-declaration] ..\/..\/binutils-2.22\/libiberty\/regex.c:4835:11: warning: incompatible implicit declaration of built-in function 'abort' [enabled by default] ..\/..\/binutils-2.22\/libiberty\/regex.c: In function 'byte_re_match_2_internal': ..\/..\/binutils-2.22\/libiberty\/regex.c:7424:11: warning: incompatible implicit declaration of built-in function 'abort' [enabled by default] ..\/..\/binutils-2.22\/libiberty\/regex.c: In function 'xregcomp': ..\/..\/binutils-2.22\/libiberty\/regex.c:7978:4: warning: incompatible implicit declaration of built-in function 'free' [enabled by default] ..\/..\/binutils-2.22\/libiberty\/regex.c: In function 'xregexec': ..\/..\/binutils-2.22\/libiberty\/regex.c:8053:7: warning: incompatible implicit declaration of built-in function 'free' [enabled by default] ..\/..\/binutils-2.22\/libiberty\/regex.c: In function 'xregerror': ..\/..\/binutils-2.22\/libiberty\/regex.c:8081:5: warning: incompatible implicit declaration of built-in function 'abort' [enabled by default] ..\/..\/binutils-2.22\/libiberty\/regex.c: In function 'xregfree': ..\/..\/binutils-2.22\/libiberty\/regex.c:8114:3: warning: incompatible implicit declaration of built-in function 'free' [enabled by default] make[2]: *** [regex.o] Error 1 make[2]: Leaving directory `\/sources\/binutils-build\/libiberty' make[1]: *** [all-libiberty] Error 2 make[1]: Leaving directory `\/sources\/binutils-build' make: *** [all] Error 2 The complete output is here, and the page I was using is here Can anyone help me? EDIT: `\/usr\/include\/stdlib.h` (line 470) extern void *malloc (size_t __size) __THROW __attribute_malloc__ __wur; `binutils-2.22\/libiberty\/regex.c` (line 130) char *malloc ();"} {"id":"105403","title":"How to list namespaces in Linux?","text":"Is there any method in Linux to list all namespaces on the running host? I need to check namespaces for particular processes (e.g. processes running in LXC-container and all other processes on the host) and then find out cgroups of them."} {"id":"58969","title":"How to list keys added to ssh-agent with ssh-add?","text":"How and where can I check what keys have been added with `ssh-add` to my `ssh- agent` ?"} {"id":"38608","title":"How to determine why my computer crashed?","text":"Yesterday, I ran a `bash` script for about 10 hours. When I went to use the computer, it locked up. * I have an Eee PC with Debian. * The screen was still visible, but the mouse or keyboard had not effect. * I tried `Ctrl``Alt``Delete`, `Ctrl``Alt``Backspace`, `Ctrl``Alt``F1`, but to no effect. * The hard drive light showed no activity. How can I determine what went wrong? What logs can I check?"} {"id":"38602","title":"When can one reboot from inside a chroot environment?","text":"Sometimes when I chroot into some folder , I could use `reboot` to reset my box, but sometimes I can't. So I want to know why I could do that sometimes and why. **UPDATE** The chroot environment is another Linux system installed on a different partition and I prepare the chroot as follows: mount --bind \/dev chroot\/dev mount --bind \/sys chroot\/sys mount -t proc proc chroot\/proc"} {"id":"146128","title":"How can I have my .bashrc only invoke TMUX if it exists on my system?","text":"I use tmux on most boxes, but not all. I have the following line in my .bashrc file: [ -z \"$TMUX\" ] && export TERM=xterm-256color && exec tmux which invoke tmux if it exists. I _thought_ the `[ -z $TMUX ]` meant that it would only be used if tmux exists. However on another system, without tmux, I get -bash: exec: tmux: not found and the login attempt fails On my main system I see $ echo $TMUX \/private\/var\/folders\/ks\/266xy5lj7x35gfj4csc66444b48rvq\/T\/tmux-373580663\/default,55084,4 I also tried just `[ $TMUX ]` (i.e. no `-z`) but that didn't help I'm also looking for a robust solution that works in Ubuntu as well as OSX"} {"id":"146121","title":"How can I tell if lack of memory is causing these crashes?","text":"I have a tornado web server running a flask application that connects to a postgres 9.3 database on an ubuntu 12.04 box. The application has been crashing intermittently and I am trying to understand why. The customer service for my cloud provider (digital ocean) says: > Many times, we see smaller sized droplets that run a full LAMP stack, run > out of memory due to the many processes that are running, that can cause > slow connections or services like Apache and MySQL crashing. How can I investigate this hypothesis? Is there a way to see how much memory is being used at different times on the server? Are there logs that might point to why the application is crashing?"} {"id":"112004","title":"What did `uniq -t` do?","text":"I have some old code from 2003 which uses `-t` option for `uniq` command. It throws an error since that option is probably not supported anymore. Here's the piece which uses the command: egrep -n \"{ IA32_OP\" ia32-decode.c | \\ awk '{ print $1 $3 $4 }' | \\ sort -t '(' +1 | \\ uniq -t ':' -f 1 | \\ sed 's\/\\(.*\\)\\:IA32_OP(\\(.*\\)),\/#define IA32_OP_\\2 \\1\/g' >> ia32_opcodes.h What did that option do back then? What can I substitute that command with?"} {"id":"60000","title":"How to find system call implementations in Linux\/Android 2.6.29?","text":"> **Possible Duplicate:** > Understanding the Linux kernel source I want to modify some system calls for tracing purposes. To be specific, whenever a system call `open` is made, I want to print some messages. I have been looking into the internet and the code and I found `open.c` in `kernel\/goldfish\/fs\/` directory. And there are many functions in this file. How would I know which function is being called exactly. I could have written some `printk` call in all these functions to find it but I have to do it for other system calls also. So, I have a few questions, 1) What is the best way to find implementation details of system calls? 2) I am using Kernel 2.6.29 (goldfish-Android). Are system calls implementation different in different kernel versions? 3) `strace` tells me that `msgget` ,`msgrecv` and 'SYS_24' system calls are being made. I look into `Android\/bionic\/libc\/SYSCALLS.txt` file and msgget is not there. But when I look into `android\/bionic\/libc\/kernel\/arch-arm\/asm\/unistd.h` file, I can find `msgget` there. I can't understand what's going on and then how can I find implementation for `msgget` ? Thanks."} {"id":"17204","title":"Linux source, where are sys_umount and sys_mount system calls?","text":"> **Possible Duplicate:** > Understanding the linux kernel source I am **sure** that I must be missing something, here. I cannot for the life of me find the source code for these system calls. I can find their numbers, and I can find their prototypes, but I cannot seem to actually find the functions that implement them. In case anyone's interested: the reason that I am trying to find them is so that I can debug a problem with the kernel's floppy driver and\/or my floppy drive itself. I can dd to\/from it just fine. The drive works in DOS and Windows just fine. But when I mount a disk (any disk, doesn't matter what), the disk is mounted for approximately 1\/10 of a second and then automatically unmounted. I am trying to find out why and if there is a way that I can patch my kernel locally to work around it. I know, I know, nobody uses floppies anymore. But I guess I am a nobody. :)"} {"id":"795","title":"passwordless ssh for another username?","text":"I want to do a passwordless ssh connection for a subversion project. Right now I'm using ssh+svn, and it's a little annoying, because I have to type the password any time I want to transact with the server. I've found several tutorials on the web about how to generate a key for passwordless ssh, but they all seem to assume that I'm using the same username on the remote system as I am for my home system. However, the username that I use for ssh+svn is different that the user account name on the system that I'm running. How do I set this up properly? I haven't had luck with just changing the name in the key file."} {"id":"19494","title":"How to colorize text in emacs?","text":"I want to view (and\/or edit) colorized text in emacs, such as is output by `ls -l --color=always`, `tree...`, or whatever. The text I refer to exists in a file. When I open that file in emacs, I want to be able to see it colorized, or toggle it to show ANSI (SGR) escape sequences. `ansi-color.el` _seems_ be be what I need, but I haven't been able to get it to do any colorizing of the ANSi escape **sequences** , but I do see blue-bold for individual **contol bytes** (eg. `^A` and `^[`)... I'm not sure if that is a feature of `ansi-color`, but I think it is. According to the ansi-color.el comments, it can work with strings and regions, but even that doesn't seem to work.. For example the function `ansi-color- apply-on-region` is not recognized by `M-x`. It says, \"No match\" I've added `(require 'ansi-color)` to my _.emacs_ file and even `(add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on)`. I get no error or warning when emacs starts, so I'm stuck. How can I get the standard functions to work, and can it be made to automatically apply when opening a file whose name is suffixed with `.col`?"} {"id":"71577","title":"Linux distro to run a MIDI-server on a PII 333 MHz","text":"I am looking for a Linux distro that can be used to redirect MIDI message from the network to the soundboard a TurtleBeach Montego from 1997. Currently the computer is running Windows 98 se and I get a total latency of 10 ms when feeding audio back through an analog cable. Since the computer has no display, I cannot do any remote control (other than shutdown, which I have added as ad- hoc messages). Full hardware list: * Sound: TurtleBeach Montego * Graphics: NVIDIA GeForce 6200 AGP * CPU: Pentium II Deschutes 333 MHz * RAM: 256 MB * IDE controller The following is a list of requirements for the setup * A total latency shorter or equal to 10 ms * SSH * ALSA * Utility programs (ls, cp, ... ) Also, it would be nice to achive digital audio return through \"what you hear\" port without increased latency (on Windows 98 I cannot come below 40 ms if I do so). All distros seems to be too demanding for that machine. Do I need to configure my own? I do not need any GUI since it is just a server."} {"id":"15137","title":"What does deb-src mean in the sources.list?","text":"I know I can download binary packages from repositories beginning with \"`deb`\", but what does `deb-src` do? E.g.: deb-src http:\/\/archive.ubuntu.com\/ubuntu natty universe in \/etc\/apt\/sources.list in Ubuntu 11.04"} {"id":"29245","title":"How to list files that were changed in a certain range of time?","text":"How can I list recursively all files that were changed between 22.12.2011 and 24.12.2011?"} {"id":"88525","title":"need to move files to different folder based on the creation date","text":"I have set of files created from Monday to Friday.. a -- > 08\/20 a1---> 08\/21 a2---> 08\/21 a3---> 08\/21 a4---> 08\/22 a5 --> 08\/23 I need to move only 08\/21 file to diffrenet folder. How is this possible ?"} {"id":"31760","title":"File extensions for unix shell scripts","text":"On wikipedia, the article for .sh says: > For the .sh file extension type, see Bourne shell. How about other unix shells? I know that the shebang is used _inside the file_ to indicate an interpreter for execution, but I wonder: * What are good practices for file extensions for unix shell scripts? * Is it common for shell scripts to end with `.sh` **regardless** of which shell they run on? * Are there any other commonly used file extensions for unix shell scripts?"} {"id":"39553","title":"Linux Ubuntu \/ Mint Live CD user-home customization","text":"I'm trying to customize Linux Mint Live CD with these instruction (uck doesn't work for me). What I want is to have more icons at its Live CD user (`\/home\/mint\/Desktop`) but I can't find `\/home\/mint` on the squashfs filesystem nor at the initrd fs. The changes I make in `\/etc\/skel` do not apply either. What am I missing? (I'm using a lxdm wm.)"} {"id":"20975","title":"How do I handle switches in a shell script?","text":"Are there some built-in tools that will recognize `-x` and `\\--xxxx` as switches, and not arguments, or do you have to go through all the input variables, test for dashes, and then parse the arguments thereafter?"} {"id":"49096","title":"What is the canonical way to implement order independent options in bash scripts?","text":"> **Possible Duplicate:** > How do I handle switches in a shell script? Most common shell commands allow the user to specify options in any random order. Positional Parameters like `$1` as commonly used in bash (I tend to write all my scripts in Bash but I don't think this question is actually Bash specific) scripts on the other hand, are order specific. Now I could come up with _some_ way to remove the need for the user of a bash script to observe any particular order in the supplying of optional arguments. (Using regular expressions or globs to test for the presence of some particular option in the `$@` expansion comes to mind.) However, I am really trying to find out whether there is a particularly canonical way to implement such options. Given the common syntax for options like `-r` for many shell commands I certainly feel there should be."} {"id":"22640","title":"How to code shell script with command line arguments like -la","text":"> **Possible Duplicate:** > How do I handle switches in a shell script? I know how to deal with simple arguments $1-$9 but I don't know how to code it with such as `-la`, for example `ls -la`. Could you show me example?"} {"id":"77933","title":"using devtmpfs for \/dev","text":"I have noticed the following option in the kernel: CONFIG_DEVTMPFS Device Drivers -> Generic Driver Options -> Maintain devtmpfs to mount at \/dev And I see that it is enabled by default in the Debian distribution kernel `3.2.0-4-amd64` I am trying to understand what difference this option brings. Without this option, `\/dev` is mounded as `tmpfs` , with this option, it is moundet as `devtmpfs`. Other than that, I don't see any difference. The `help` did not clarify it for me either: > This creates a tmpfs\/ramfs filesystem instance early at bootup. In this > filesystem, the kernel driver core maintains device nodes with their default > names and permissions for all registered devices with an assigned > major\/minor number. > > It provides a fully functional \/dev directory, where usually udev runs on > top, managing permissions and adding meaningful symlinks. > > In very limited environments, it may provide a sufficient functional \/dev > without any further help. It also allows simple rescue systems, and reliably > handles dynamic major\/minor numbers. Could somebody please explain the difference between using `CONFIG_DEVTMPFS` vs the standard `\/dev`?"} {"id":"39556","title":"How can the job of SDFlasher.exe given with FriendlyARM utility be accomplished on Linux?","text":"I am playing with **FriendlyARM Tiny 6410**. The instructions on setting up an SD card for booting self compiled versions of linux kernel involve the use of **SDFlasher.exe**. People have tried to find an alternative for Linux here http:\/\/www.friendlyarm.net\/forum\/topic\/3295 in vain. I am sure that whatever the utility does can be accomplished using some simple commands on the terminal, provided we know what exactly it does. Can somebody help? The getting started instructions are available here - http:\/\/www.minidevs.com\/Tiny6410\/Bootloader.html#2_1_Create_the_SD_boot_card_39_45863506360910833"} {"id":"77930","title":"VIM(Mercurial) +python3.2 on debian wheezy: Could not load library function PySys_SetArgv","text":"> .\/configure --enable-python3interp=dynamic --enable-gui=gtk2 > --with-python3-config-dir=\/usr\/lib\/python3.2\/ make vim --version|grep pyth +cryptv +linebreak -python +viminfo -cscope +lispindent +python3\/dyn +vreplace but if i do: :python3 print('hi') I get: E448: Could not load library function PySys_SetArgv E263: Sorry, this command is disabled, the Python library could not be loaded."} {"id":"33895","title":"How to execute one command on all files within a folder","text":"Saying, I have this tree and I want to execute `ruby` on all scripts within the folder. How could I archive through **one line of command**. .\/ ..\/ rb-script\/ sample1.rb sample2.rb"} {"id":"78110","title":"How to change the forgotten root password?","text":"I am very new to Debian linux, I forgot my root password...actually I think I know what it is because it is the same password I have for pretty much everything but in the Terminal in tell me \"Sorry, try again.\" Is there a way to reset the password? If so how? I am very new and I am not familiar with any type of command proms in the Terminal."} {"id":"72217","title":"how to use syslog to avoid log file being garbled when multiple proceses are trying to write to the same log fille?","text":"I wanted to know usage of syslog when multple processes are trying to write to the same log file like for i in $var do some process >> logfile & done wait"} {"id":"31494","title":"Can Bumblee really help with Optimus Laptops?","text":"I bought Lenovo Z570 which comes with nVidia GEForce GT520M (Optimus technology) and recently I installed Ubuntu 11.10. Surprisingly, whenever I boot my system CPU fan rotates at very high speed and so my battery backup is screwed up.I googled about this problem but I am not able to come to some conclusion. According to some vague sources, because of some bug, the Linux kernel is not able to support Optimus technology as of now. Does anyone have any solution for this problem?"} {"id":"131434","title":"How to detect a desktop application hanging","text":"I want to write a script that will detect whether a particular desktop application is responding and kill it. Is this possible? I know I've seen the GNOME desktop put up a \"Application is not responding\" dialog, and I figure it sends some sort of signal to the window and waits a certain amount of time for a response. If there's a way to do something like that, I'd appreciate some details. Thank you! (This is on xfce, if it matters)"} {"id":"131432","title":"Which driver is handling my touchpad?","text":"I would like to know how to determine which driver (out of those below) is handling my touchpad: appletouch.ko.gz, cyapa.ko.gz, sermouse.ko.gz, synaptics_usb.ko.gz, bcm5974.ko.gz, psmouse.ko.gz, synaptics_i2c.ko.gz, vsxxxaa.ko.gz"} {"id":"88296","title":"Get vertical cursor position","text":"This might sound pretty weird, but I know how to set the vertical cursor position in Bash like this: echo -e \"\\e[12H\" This moves the cursor to the 12th line (starting with 1). So how do I get the cursor position (line number) using linux bash? It would be helpful if I could simply store this value in a variable so I can calculate with it. **EDIT:** This is the error I get: $ sh rowcol.sh -en read: 9: Illegal option -d test.sh: 12: Bad substitution"} {"id":"108316","title":"host only ip address: can it be 10.*.*.*?","text":"My router is set to have computers IP range from 10.1.1.1 to 10.1.1.60 I'm trying to run Linux in virtual box in a host computer with windows 7. The host computer has 10.1.1.5 currently, which is dynamic, set by DHCP on the router. The command, `ipconfig`, on the host computer shows the VirtualBox host only IP address 192.168.56.2 and Linux in it was well connected to the network. But later I changed the IP address of Linux as static 10.1.1.16 using `vim \/etc\/network\/interfaces`. Then in the host computer's network configuration settings, I changed the IP address of VirtualBox as 10.1.1.16. Now my Linux is no longer connecting to the network. I'm new to this and am attempting to learn how these things work. Please help in showing me, what did I do wrong?"} {"id":"83956","title":"SMTP\/POP server only for internal e-mails on hosted domain","text":"We have a domain for a web site and e-mail that's hosted off-site. (We don't have a reliable enough connection to host it ourselves.) Our shared host sometimes has SMTP problems, but never POP problems. Is it possible to set up an e-mail server on CentOS 6.4 that will work internally (i.e. sending between e-mail addresses on our domain, even though our network domains are named differently than our web site) even if our Internet is down or our shared host's SMTP server is down, but will use our shared host's SMTP for outside addresses, and will still allow POP mail to be retrieved from the shared host, e.g. when we're at home or on the road?"} {"id":"103932","title":"Parsing a delimited text file in bash as command arguments","text":"I have a text file split up like so: field1,field2,field3 xield1,xield2,xield3 dield1,dield2,dield3 gield1,gield2,gield3 Each of these columns will be a parameter to a program, and I would like the program to be called for each line I was hoping for a loop, something like: for $i in file command $field2 -x $field3 -PN -$field1 >> output done What would be the best way to accomplish something like this in bash?"} {"id":"19742","title":"How can I revert a package to a specific version on Gentoo?","text":"I'm a Debian user pretty much new to Gentoo. I wanted to install a specific version of a package namely the 1.39.0 version of dev-libs\/boost, http:\/\/packages.gentoo.org\/package\/dev-libs\/boost. But I already did \"emerge dev-libs\/boost\" which installed me version 1.46.1-r1. machine ~ # emerge --search boost (...) * dev-libs\/boost Latest version available: 1.46.1-r1 Latest version installed: 1.46.1-r1 Size of files: 41,016 kB Homepage: http:\/\/www.boost.org\/ Description: Boost Libraries for C++ License: Boost-1.0 How can I revert this package back to version 1.39.0? Thank you in advance."} {"id":"130742","title":"How to enable printk selectively?","text":"I want to print some statements from kernel but not all. So can I use printk selectively? By selectively I mean I want to enable printk only at particular places and disable it everywhere else. Right now I can only enable (in the kernel configuration enabling printk) or disable it globally; I have no choice at all."} {"id":"137943","title":"Cross-compiling OpenSSH for Android","text":"I'm working on compiling OpenSSH for Android based on this answer at Stack Overflow. Here's what I've done so far: * Building on Ubuntu 14.04 amd64. * `apt-get install build-essential gcc-arm-linux-androideabi` Download zlib, then do: cd zlib-1.2.8 .\/configure --prefix=\/vagrant\/build make CC=arm-linux-androideabi-gcc make install This fails at the `make` step: gcc -shared -Wl,-soname,libz.so.1,--version-script,zlib.map -O3 -fPIC -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN -o libz.so.1.2.8 adler32.lo crc32.lo deflate.lo infback.lo inffast.lo inflate.lo inftrees.lo trees.lo zutil.lo compress.lo uncompr.lo gzclose.lo gzlib.lo gzread.lo gzwrite.lo -lc \/usr\/bin\/ld: crc32.lo: Relocations in generic ELF (EM: 40) crc32.lo: error adding symbols: File in wrong format collect2: error: ld returned 1 exit status make: *** [libz.so.1.2.8] Error 1 What am I missing here? Is there something else it needs to know about to be able to build zlib? Next in the process is to build OpenSSL: cd openssl-1.0.1h\/ .\/Configure dist --prefix=\/vagrant\/build\/ make CC=\"arm-linux-androideabi-gcc\" AR=\"arm-linux-androideabi-ar r\" RANLIB=\"arm-linux-androideabi-ranlib\" make install This again fails at the `make` step: make[2]: Entering directory `\/vagrant\/openssl-1.0.1h\/apps' ( :; LIBDEPS=\"${LIBDEPS:--L.. -lssl -L.. -lcrypto }\"; LDCMD=\"${LDCMD:-cc}\"; LDFLAGS=\"${LDFLAGS:--O}\"; LIBPATH=`for x in $LIBDEPS; do echo $x; done | sed -e 's\/^ *-L\/\/;t' -e d | uniq`; LIBPATH=`echo $LIBPATH | sed -e 's\/ \/:\/g'`; LD_LIBRARY_PATH=$LIBPATH:$LD_LIBRARY_PATH ${LDCMD} ${LDFLAGS} -o ${APPNAME:=openssl} openssl.o verify.o asn1pars.o req.o dgst.o dh.o dhparam.o enc.o passwd.o gendh.o errstr.o ca.o pkcs7.o crl2p7.o crl.o rsa.o rsautl.o dsa.o dsaparam.o ec.o ecparam.o x509.o genrsa.o gendsa.o genpkey.o s_server.o s_client.o speed.o s_time.o apps.o s_cb.o s_socket.o app_rand.o version.o sess_id.o ciphers.o nseq.o pkcs12.o pkcs8.o pkey.o pkeyparam.o pkeyutl.o spkac.o smime.o cms.o rand.o engine.o ocsp.o prime.o ts.o srp.o ${LIBDEPS} ) \/usr\/bin\/ld: openssl.o: Relocations in generic ELF (EM: 40) \/usr\/bin\/ld: openssl.o: Relocations in generic ELF (EM: 40) openssl.o: error adding symbols: File in wrong format collect2: error: ld returned 1 exit status make[2]: *** [link_app.] Error 1 make[2]: Leaving directory `\/vagrant\/openssl-1.0.1h\/apps' make[1]: *** [openssl] Error 2 make[1]: Leaving directory `\/vagrant\/openssl-1.0.1h\/apps' make: *** [build_apps] Error 1 Again it seems to be having the same problem, not being able to read a file that it wrote. I haven't made it to the final step of compiling OpenSSH yet, but this is how I assume that I'd do it: cd openssh-6.6p1 .\/configure --host=arm-linux --with-libs --with-zlib=$HOME\/zlibArm --with-ssl-dir=$HOME\/opensslArm --disable-etc-default-login CC=gcc-arm-linux-gnueabi-gcc AR=gcc-arm-linux-gnueabi-ar make Why is my compilation above failing for Zlib and OpenSSL when compiling for `arm-linux-androideabi`? How can I compile OpenSSH (specifically the client and the agent) for Android on ARM?"} {"id":"86844","title":"Is there a way to listen to process?","text":"I want to know if there is a way to listen to a process in linux & unix - when it ends and what's the exit code of the process(script). I dont want to write a script that will run `X` seconds and check by `ps -ef | grep PID` if the process is still alive. I want to know if there is a way that the process will notify me when it ended and what was its exit code."} {"id":"45101","title":"Find a file in lots of zip files (like find command for directories)","text":"> **Possible Duplicate:** > Find recursively all archive files of diverse archive formats and search > them for file name patterns I need to search for a file in all zip files in a directory. Is there a tool like `find` that be able to search in ZIP files? I tried this: find \/path\/ -iname '*.zip' -print -exec unzip -l {} \\; |grep -i '' But this only prints path of file in zip file and not the zip file name itself! Thanks"} {"id":"80143","title":"How to create a daemon which would be listening to dbus and fire script on message","text":"I want to create a daemon, which would fire up a shell script in the background every time I unlock the screen on my ubuntu. I managed to create such script according to answer to related question: run-script-on-screen- lock-unlock. And it works well in terminal window. But now I want to create a daemon from that and I didn't get any luck yet. Any suggestions?"} {"id":"10353","title":"Where can I find the source code of libgio?","text":"I want to study how its GFileInfo components works."} {"id":"125056","title":"Why VMware DHCP persists getting offline?","text":"I am trying to set up a SSH server in my remote machine which is running Windows 7 on it currently. So first I set up a Oracle VirtualBox but it did not work for me properly. Then I decided to go with VMware instead of dealing with the problems of the VirtualBox. I installed VMware, installed an Ubuntu Virtual Machine inside. It is now working like a charm. But I have a problem. It gets disconnected after a while. As you can see below, it is disconnected. And it can get started to work properly again only if I switch manually to Vmnet8 and back to vmnet0 again. In the end (after performing the switching process) It takes a random Subnet address everytime it gets connected. My problem is I need to have always the same Subnet address everytime I get connected and set the system so that it never gets disconnected. So that I connect to the machine via SSH using putty without getting into settings and port forwarding processes and everything at everytime that I need to connect. ![Problem Screnshot](http:\/\/i.stack.imgur.com\/RAIxc.png)"} {"id":"88560","title":"Should I change SSD?","text":"Demsg shows this EXT4-fs error (device sda1): ext4_ext_get_blocks: inode #7743113: (comm flush-8:0) bad extent address iblock: 3503, depth: 1 pblock 0 EXT4-fs (sda1): delayed block allocation failed for inode 7743113 at logical offset 3503 with max blocks 1 with error -5 This should not happen!! Data will be lost EXT4-fs error (device sda1): ext4_ext_get_blocks: inode #7743113: (comm flush-8:0) bad extent address iblock: 3509, depth: 1 pblock 0 EXT4-fs (sda1): delayed block allocation failed for inode 7743113 at logical offset 3509 with max blocks 2 with error -5 This should not happen!! Data will be lost EXT4-fs error (device sda1): ext4_ext_get_blocks: inode #7743113: (comm flush-8:0) bad extent address iblock: 3513, depth: 1 pblock 0 EXT4-fs (sda1): delayed block allocation failed for inode 7743113 at logical offset 3513 with max blocks 1 with error -5 This should not happen!! Data will be lost EXT4-fs error (device sda1): ext4_ext_get_blocks: inode #7743113: (comm flush-8:0) bad extent address iblock: 3519, depth: 1 pblock 0 EXT4-fs (sda1): delayed block allocation failed for inode 7743113 at logical offset 3519 with max blocks 1 with error -5 This should not happen!! Data will be lost EXT4-fs error (device sda1): ext4_ext_get_blocks: inode #7743113: (comm flush-8:0) bad extent address iblock: 3525, depth: 1 pblock 0 EXT4-fs (sda1): delayed block allocation failed for inode 7743113 at logical offset 3525 with max blocks 1 with error -5 This should not happen!! Data will be lost EXT4-fs error (device sda1): ext4_ext_get_blocks: inode #7743113: (comm flush-8:0) bad extent address iblock: 3528, depth: 1 pblock 0 EXT4-fs (sda1): delayed block allocation failed for inode 7743113 at logical offset 3528 with max blocks 1 with error -5 This should not happen!! Data will be lost possible SYN flooding on port 80. Sending cookies. EXT4-fs error (device sda1): ext4_ext_get_blocks: inode #7743113: (comm flush-8:0) bad extent address iblock: 3529, depth: 1 pblock 0 EXT4-fs (sda1): delayed block allocation failed for inode 7743113 at logical offset 3529 with max blocks 3 with error -5 This should not happen!! Data will be lost Also I can't do a lot with the disk. Simple commands like fails root@host [\/home1]# rm -rf cprestore rm: cannot remove `cprestore\/home4\/site\/public_html\/hello\/cache\/site.com\/http%3A%2F%2Fsite.com%2Fh%2F20019%2Fszh%2F%25E6%25B1%2589%25E5%258F%25A3%25E4%25B8%25AD%25E5%258D%258E%25E5%2585%25A8%25E5%259B%25BD%25E6%2580%25BB%25E5%25B7%25A5%25E4%25BC%259A%25E6%2597%25A7%25E5%259D%2580': Input\/output error rm: cannot remove `cprestore\/home4\/site\/public_html\/hello\/cache\/site.com\/http%3A%2F%2Fsite.com%2Ft%2Ffoo%2Fszh%2F%25D7%25A7%25D7%2598%25D7%2592%25D7%2595%25D7%25A8%25D7%2599%25D7%2594%3A%25D7%2590%25D7%2595%25D7%25A0%25D7%2599%25D7%2595%25D7%25AA_%25D7%259E%25D7%25A2%25D7%25A4%25D7%2599%25D7%259C%25D7%2599%25D': Input\/output error rm: cannot remove `cprestore\/home4\/site\/public_html\/hello\/cache\/site.com\/http%3A%2F%2Fsite.com%2Fp%2F%25E9%259F%25A9%25E6%2588%2590%25E7%258F%25A0%25E4%25B8%258D%25E9%259B%2585%25E8%25A7%2586%25E9%25A2%2591%25E5%25AE%258C%25E6%2595%25B4%25E7%2589%2588%2Fszh%2F1': Input\/output error My fstab is like this: # # \/etc\/fstab # Created by anaconda on Wed Nov 1 00:29:46 2000 # # Accessible filesystems, by reference, are maintained under '\/dev\/disk' # See man pages fstab(5), findfs(8), mount(8) and\/or blkid(8) for more info # UUID=9fac7ae7-9948-4612-88dc-e652fc4ceb73 \/ ext4 defaults 1 1 UUID=1daa52c7-a5da-464d-a4c7-2ee19ef017af \/boot ext3 defaults 1 2 UUID=12649fb1-fd53-4558-8a2a-79692ada8b19 swap swap defaults 0 0 tmpfs \/dev\/shm tmpfs defaults 0 0 devpts \/dev\/pts devpts gid=5,mode=620 0 0 sysfs \/sys sysfs defaults 0 0 proc \/proc proc defaults 0 0 \/usr\/tmpDSK \/tmp ext3 defaults,noauto 0 0 \/dev\/sda1 \/home1 auto auto,noatime,defaults 0 2 \/dev\/sdb1 \/home2 auto auto,noatime,defaults 0 2 \/dev\/sdc1 \/home3 auto auto,noatime,defaults 0 2 As you see I check every reboot My provider said he did some fchk and now it's running again. However, it's been happening several time. Each time it happens it costs me a lot. I wonder if this is hardware or sotware?"} {"id":"10926","title":"Changing group and retaining environment variables","text":"On campus, everyone's primary group is `user` and each person is additionally associated to groups depending on the courses he or she is taking, lab he or she works at, etc. My coworker and I are members of group `foo`, so we use `newgrp foo` and `umask 7` to ensure our files are accessible to the two of us without granting _everyone_ permission. Neither of us minded this. However, we now need our `PATH` environment variable to first point to our lab's `bin` folder before the rest in the `PATH`. We thought a simple script would work, but it doesn't as the `PATH`'s contents don't persist after executing `newgrp`: #!\/bin\/tcsh setenv PATH \"\/path\/to\/lab\/bin:$PATH\" newgrp foo The default shell is `tcsh`. Does anyone have any suggestions? Thanks!"} {"id":"80857","title":"My process was killed but I cannot understand the kernel notice","text":"I have a custom application running on an embedded x86 setup (built using buildroot and uClibc). The application has been running fine but this morning when I returned to work I discovered my process had been killed and the following output on my terminal SAK: killed process 1008 (CX_SC3): fd#4 opened to the tty SAK: killed process 1009 (CX_SC3): fd#4 opened to the tty SAK: killed process 1011 (CX_SC3): fd#4 opened to the tty SAK: killed process 1012 (CX_SC3): fd#4 opened to the tty Now `CX_SC3` is my process - it has multiple threads, one of which opens `\/dev\/ttyS0` to send messages over a radio modem. The fd number is 4 for the serial port. What I don't understand is 1. What the SAK means 2. The PID listed above must refer to a process that was killed by my application as there is only ever one instance of my application running at a time. Is it possible that these PIDs are actually my thread IDs (as my application does run 4 threads always). 3. If my application killed other processes, why was my application also killed? 4. What does the `opened to the tty` part mean? From some research this suggests that this has something to do with a interrupt character sent to the tty that I used to start the program. I am sure that the above is pretty obvious when you are a linux guru but I am struggling - can anyone suggest what events could have lead to the following output? My embedded setup is very small, uses `busybox` and runs `vsftpd` and very little else other than my custom application. It is vital that my application is robust so if anyone can suggest\/guess as to what sequence of events could have caused the above I will be very grateful. **EDIT:** In response to the comment below, if this is due to a SAK being detected, is there anything that can accidentally trigger this? Is it possible that anything being read on the serial port has triggered this? Also, how can I find the SAK combination for my system - I do not have a `rc.sysinit` or `rc.local` file anywhere in my root file system. **UPDATE:** I have managed to pin this event down to the point at which my host machine shuts down. I have a serial cable between my host machine and my target device which I use to send serial data to the embedded target. When I leave the target running, but shutdown the host, my application is killed as described above. When I disconnect the serial cable prior to shutting down my host machine then my application does not get killed and runs as normal. This behaviour happens even after I have performed echo 0 > \/proc\/sys\/kernel\/sysrq as advised."} {"id":"96753","title":"Could Autorun Virus, affect my PC via Wine?","text":"I have installed wine and I am afraid that viruses will affect my PC now. I will not open any other .exe file other than mine one (which I use everyday)"} {"id":"138325","title":"mutt: how to display selected new messages diferently in index","text":"I have my own colors defined for `mutt`. When I start `mutt`, the cursor (i.e. indicator) is on the first message (i.e. the first message on the top is selected). I have defined colors for the selected message, and I have colors defined for new messages as well: ... color indicator color233 color67 color index color75 color232 ~N .... Unfortunately, The selected message looks the same, regardless whether the message is new or not. Is there a way to have a different color for selected new messages, so that I can immediately recognize that the selected message is new? Otherwise I have to move the cursor down, to see that the message is new. I have tried the obvious solution: color indicator color233 color67 ~N but that does not work. Mutt complains: Error in .muttrc, line 15: too many arguments"} {"id":"40261","title":"Debian: program in boot","text":"I just configured my new VPS with Apache, PHP, MySQL and ProFTPd. I wanted to install a smtp server, but I was advised to do a apt-get upgrade first. I did this, and I got up a blue screen where I could choose between two alternatives. It said something about GRUB 2 installer. I chose the alternative that was already selected, the topmost. I chose not to update the GRUB2, and use the old one that was installed. Now, ProFTPd doesn't start in boot anymore. I have to \/etc\/init.d\/proftpd start every time. How do I fix this? Should I have chosen to update GRUB2? Should I do apt-get upgrade again and try to do the same GRUB2 installer again?"} {"id":"40262","title":"copying multiple files to multiple directories","text":"I've a problem copying many files in different directories. Let me explain better: Let's say I have the following in a dir: $ ls file1 file2 file3 file4 file5 dir1 dir2 dir3 and I want to copy every file* in every dir* with a single command. I've tried with: echo dir{1..3} | xargs cp file{1..5} '{}' \\; My intent was to tell xargs to process every single dir* from echo and copy all the files in the input processed but this and similar didn't work. I would like to avoid the use of a script because it's a task I have to repeat for about 20 directories and the names of the files are slightly different so I'd prefer modifying a command rather than a script."} {"id":"10226","title":"Multiline pattern match using sed, awk or grep","text":"Is it possible to do a multiline pattern match using `sed`, `awk` or `grep`? Take for example, I would like to get all the lines between `{` and `}` So it should be able to match 1. {} 2. {.....} 3. {..... .....} Initially the question used `

` as an example. Edited the question to use `{` and`}`."} {"id":"93875","title":"Setting up server to share music with tv","text":"Can someone please point me in the right direction? Hopefully first by letting me know if this is possible... I recently purchased a home theater system which you plug via hdmi into the tv. It has its own nice gui with netflix, and youtube, and blah blah blah. One of the options was to \"browse your computer.\" When you click on it it tries to connect to a server to find music\/videos. Can I use my Ubuntu installed laptop to host a server to put music on and play it wirelessly essentially? I believe this is possible and should be pretty straight forward. How would I go about creating a server on the same laptop I would be interacting with it...I could then secure copy or sftp the files back and forth. Is there like special settings to keep in mind? Any words of wisdom would be appreciated. Tx C"} {"id":"17962","title":"Bash: keybinding\/trap issue","text":"My .bashrc has the following: # Alt+L lists current directory bind -x \"\\\"\\el\\\":ls -ltrF --color=auto;\" # trap commands and echo them to xterm titlebar. trap 'echo -ne \"\\033]0;$BASH_COMMAND - $USER@${HOSTNAME}>$(pwd)\\007\"' DEBUG Demo of the problem: bash-4.2$ [Alt+L] #works total 0 -rw-rw-r-- 1 me 1234 0 Aug 3 07:11 foo -rw-rw-r-- 1 me 1234 0 Aug 3 07:11 bar bash-4.2$ ls -ltr #fails first time bash: -ltr: command not found bar foo bash-4.2$ ls -ltr #works second time total 0 -rw-rw-r-- 1 me 1234 0 Aug 3 07:11 foo -rw-rw-r-- 1 me 1234 0 Aug 3 07:11 bar As you can see, the `ls` command fails the first time after executing the key binding. I believe it has to do with the trap. Removing the trap fixes the issue. Is there any way to fix this without removing the trap?"} {"id":"110750","title":"What is the difference between \"du -sh *\" and \"du -sh .\/*\"?","text":"The title says it all. What's the difference between those 2 commands? **NOTE:** I'm more interested in the `*` and `.\/*` part."} {"id":"110754","title":"How to fix kdenlive crashes on Ubuntu 13.10 during scene finding","text":"I am new to the video editing software `kdenlive` and tried to use it to edit a large `avi`` file. I added the`avi`clip and started a job to find the scenes in this avi. Halfway through the clip (after 30 minutes or so),`kdenlive` suddenly crashed. How can I fix this problem? Additional information related to my questions will be given below once they are asked. As I have no idea whether the issue is related to Ubuntu, the desktop, kdenlive or the `avi` file, I cannot be more specific at this point. **Additional information** * Sometimes the program outputs the following: Unable to start Dr. Konqi But there seems to exist no package which might solve this problem."} {"id":"57013","title":"Zip all files in directory?","text":"Is there a way to zip all files in a given directory with the `zip` command? I've heard of using `*.*`, but I want it to work for extensionless files, too."} {"id":"49842","title":"How does one include the session-name in status bar for byobu-tmux?","text":"I'd like to include the session name of my current tmux session in the status bar. There's nothing in ~\/.byobu\/status that allows me to do this and including the tmux configuration directive `#S` in the `tmux_left` line doesn't work (for obvious reasons). Cheers."} {"id":"144586","title":"Swap partition in LVM?","text":"I was wondering if putting the swap partition into a logical volume group has any drawbacks (e.g. performance), or would it be \"just the same\" as having it as a separate primary\/logical partition? I like the fact that it could be easily resized if necessary, but am not sure about possible drawbacks. _Case of application_ : CentOS 7 Webserver."} {"id":"106825","title":"How good is gnash as a replacement for flash?","text":"Fedora suggests the Gnash plugin as a replacement for the Flash plugin and I am seriously considering it. My question is: how good is the Gnash plugin as a replacement for the Flash plugin? In my case, I'm not interested in anything advanced, just being able to watch youtube videos."} {"id":"70928","title":"Shell wildcards and dot files","text":"I am a beginner terminal user trying to understand wildcards. I think I pretty much have a good grasp on it, but I have a couple of questions: Why do the following two codes work as expected: ls -d .[!.]?* echo [D]* But the following 2 don't: ls -d [.][!.]?* echo [D] In the first command, I get an error: ls: cannot access [.][!.]*: No such file or directory When I am trying to get the same listing `ls -d .[!.]?*`. And for the second, the output is: [D] When I'm expecting an error proclamation along the lines of `No such file or directory`. What am I missing? What exactly makes an expression a wildcard, if those wildcard elements shown in the second set of examples above don't cut it? **Clarification** (Also in comments): The wildcard `[D]*` doesn't only output `D`, it also outputs `Desktop`, `Downloads` ... etc. However, I also tried `echo [D]` when I had a file named D and when I didn't. The output worked when the file `D` was there, but I also got the output `[D]` when it wasn't. I don't get why. Why did the presence of the file in the directory change the expression [D] from being a wild card to not?"} {"id":"48877","title":"wine error when using divfix","text":"When I'm logged in through SSH to a Scientific Linux 6.3 machine I get this error message: \/usr\/bin\/wine \/home\/USER\/.divfix\/DivFix++.exe -i INPUT.avi -o out.avi wine: created the configuration directory '\/home\/test\/.wine' No protocol specified No protocol specified No protocol specified No protocol specified No protocol specified No protocol specified Application tried to create a window, but no driver could be loaded. Make sure that your X server is running and that $DISPLAY is set correctly. err:systray:initialize_systray Could not create tray window Application tried to create a window, but no driver could be loaded. Make sure that your X server is running and that $DISPLAY is set correctly. I have set the DISPLAY variable..: grep -i display ~\/.bashrc export DISPLAY=\":0.0\" I have X\/GUI: yum groupinstall \"Desktop\" \"Desktop Platform\" \"X Window System\" \"Fonts\" I have \"yum update\" and then rebooted (so up-to-date). What am I missing? please help. UPDATE: xset -q No protocol specified xset: unable to open display \":0.0\""} {"id":"12462","title":"How to install color schemas for Kate running on GNOME","text":"How do I install schemas(like this one; for syntax highlighting, etc) for Kate (which is originally for KDE) running on GNOME 3? Trying to install with the install.sh script took no effect. Also, if you happen to know any good schemas for Kate (for Python), please let me know."} {"id":"7777","title":"How can I get real-time information about monitor plug\/unplug events?","text":"When I connect or disconnect the USB device, udev shows\/monitors that event. But udev is not enough smart to detect the plug-out or plug-in of the monitor. Is there any way\/tool\/utility from which I will get real-time information about the plug-out or plug-in of a monitor?"} {"id":"84604","title":"gedit reverting settings to default","text":"I'd like to revert to the fresh gedit on my system. Any idea how to get back to default state? So that all my preferences would be lost as well as having activated only the plugins active by default? **Some background** My feeling is that it takes quite some time for the gedit to launch on my system and would like to start with the clean table once again. **Distros\/versions** I'd like to achieve this on both of my systems: Xubuntu 12.10 (gedit 3.6) as well as Fedora 17 (gedit 3.4.2)."} {"id":"117074","title":"How to notice log file changes with Linux standard tools?","text":"I need something that does not need to be installed. It's on an embedded system with very little space on the HD. I can't instal anything. I need to do it with something that is already included. I have a script that I want to run based on a certain line that appears in a log file. Currenty I placed this script to run every 5 minutes in the crontab and check the file for changes. Is there a way that I can have the system call the script only if the file has changed? Like, to tell the system to fire the script in case a system call was made to open that file with write permission?"} {"id":"10507","title":"Execute command when file changes","text":"> **Possible Duplicate:** > Can a bash script be hooked to a file? Hi there, I am trying to execute a command every time a file changes. Is this possible? I think there is some way to watch for a file, but I have no idea. Thank you!"} {"id":"5515","title":"Can a bash script be hooked to a file?","text":"I want a script to sleep unless a certain file is modifed\/deleted (or a file created in a certain directory, or ...). Can this be achieved in some elegant way? The simplest thing that comes to my mind is a loop that sleeps for some time before checking the status again, but maybe there is a more elegant way?"} {"id":"10729","title":"How can I make scripts run when a file\/directory changes in Linux (like Mac OS X’s launchd)?","text":"> **Possible Duplicate:** > Can a bash script be hooked to a file? On Mac OS X, there’s a handy daemon called launchd which (amongst other things) allows you to have scripts run when files or directories change (via the `WatchPaths` and `QueueDirectories` plist file options). Is there a (preferably Debian) Linux program\/package that includes this functionality?"} {"id":"57907","title":"Trigger action each time a file is modified","text":"> **Possible Duplicate:** > Can a bash script be hooked to a file? Is it possible to mount a mechanism to a file to perform an action (e.g. mark the change in some log file and such) each time the file is modified? I would like to be able to see what all the files modified are in a given time period or receive an alert each time someone modifies a file."} {"id":"96662","title":"awk read error bad address","text":"I have a file that is roughly 30GB. I am using, awk ' $1 <= 2000 ' myfile.txt >> myfile_new.txt But, I get this error after a while - awk: read error (Bad address) I guess this is because the file is too large. Is there any way to get past this? How else can I do this? What I need to do is quite simple, I have to extract all records that have value less than 2000 in a column."} {"id":"97393","title":"Mysql user privileges : Only CREATE table","text":"I am trying to create a user who will be able to manage all databases without the right to CREATE and DROP databases. I have been using the following link : http:\/\/dev.mysql.com\/doc\/refman\/5.0\/en\/privileges-provided.html#priv_create GRANT SELECT, INSERT, UPDATE, DELETE, ALTER ON *.* TO 'mysql'@'192.168.1.0\/255.255.255.0' IDENTIFIED BY PASSWORD 'toto' I would like to add CREATE in order to allow the user to create a table, but If I do this the user will be able to create a database too. Is it possible to provide CREATE \"table\" without CREATE \"database\" privilege ?"} {"id":"118531","title":"User made host aliases","text":"I would like to set up aliases for hosts `\/etc\/hosts` style, but I don't have root privileges. Would I be able to set these up from within my \/home directory? How?"} {"id":"57459","title":"How can I override the \/etc\/hosts file at user level?","text":"> **Possible Duplicate:** > Can I create a user-specific hosts file to complement \/etc\/hosts? In short: I would like to know if it is possible to get a `~\/hosts` file that could override the `\/etc\/hosts` file, since I don't have any privileged access. A machine I am working on does seem to be properly configured with a correct DNS server. When I try to ping usual machine **name** I am working with, it fails. But when I try to ping them by **IP address** it works as expected. I want to avoid changing any scripts and other _musuculary memorized handcrafted commmand line_ ™ that I made because of a single unproperly configured machine. I contacted sys admin, but they have other fish to fry. How can I implement that?"} {"id":"13828","title":"df says I have 20G more disk space used than du. Why?","text":"I used du to list all folders and sort by size, the results simply doesn't add up to how much disk space is used(using df). There's about 20G in discrepency, why? [root@xxx lib]# du --max-depth=1 -h \/| sort -n -r 310M \/lib 123M \/root 96K \/dev 88M \/etc 75G \/ 73G \/var 30M \/sbin 20M \/boot 20K \/tmp 18M \/lib64 16K \/mnt 16K \/lost+found 12K \/home 8.0K \/srv 8.0K \/selinux 8.0K \/opt 8.0K \/misc 8.0K \/media 7.0M \/bin 1.2G \/usr 0 \/sys 0 \/proc [root@xxx lib]# df -h Filesystem Size Used Avail Use% Mounted on \/dev\/mapper\/VolGroup00-LogVol00 298G 94G 189G 34% \/ \/dev\/sda1 99M 26M 69M 28% \/boot tmpfs 2.0G 0 2.0G 0% \/dev\/shm"} {"id":"17510","title":"`du -sh` reports different used size than `df -h`","text":"> **Possible Duplicates:** > linux free disk space confusion > Why is there a discrepancy in disk usage reported by df and du? `df -h` says that I have 494G used on `\/var`: Filesystem Size Used Avail Use% Mounted on \/dev\/sda3 564G 494G 41G 93% \/var But `du -sh \/var` says it's `350G` What makes them different?"} {"id":"9612","title":"Why is there a discrepancy in disk usage reported by df and du?","text":"I have a Linux(CentOS) server, the OS+packages used around 5GB. Then, I transferred 97GB data from a Windows server to two folders on this Linux server, after calculated the disk usage, I see the total size of the two folders is larger than the disk used size. Run du -sh on each folder, one use 50GB, the other one use 47GB But run df -h, the used space is 96G. (50GB + 47GB + 5GB) > 96GB Is there any problem? Those two folders contain lots of files(1 million+). Thanks."} {"id":"152092","title":"Why does df show Available 0 when 1K-blocks minus Used is greater than 0?","text":"Why does it show 0 in the available column? [root@server log]# df Filesystem 1K-blocks Used Available Use% Mounted on \/dev\/sda2 4128448 4096484 0 100% \/ It's an ext3 filesystem."} {"id":"65461","title":"GPT Partition - Used Space immediately after creating partition","text":"I wanted to try out the new GPT system, and used it to partition my new HDD, with the partitions themselves using ext4. For some reason, about 1-2% of the space in each partition is already shown as used, both in `df` and `gparted`. Currently the only content of the partitions is the lost+found folder which occupies all of `16K`. Is there a reason for this? Can this be fixed? Or is this just the space used by the file table (or equivalent)? Edit: Is this more related ext4 than GPT? I found this just now, ext4: How to account for the filesystem space?"} {"id":"140473","title":"Why does \"df -h\" show out of sync space used?","text":"I have tried different commands to see sizes of partitions and space used\/left and it seems that they always differ in their results. Here is my space used\/left with from the command `df -h`: Size Used Avail Use% Mounted on 395G 355G 21G 95% \/home Notice that used and availabe only add up to 376G but size is 395G"} {"id":"139185","title":"SSD seems full, but file system says otherwise","text":"I'm running CentOS and have a 100GB Micron RealSSD P300. It appears that the drive is almost full, as noted by running `df`: Filesystem 1K-blocks Used Available Use% Mounted on \/dev\/sda3 94753636 86002428 3937948 96% \/ tmpfs 12298364 0 12298364 0% \/dev\/shm \/dev\/sda1 253871 58571 182193 25% \/boot However, running `du \/` tells another story: 6.9M \/bin 56M \/boot 188K \/dev 28M \/etc 3.3M \/home 251M \/lib 25M \/lib64 16K \/lost+found 4.0K \/media 4.0K \/mnt 8.0K \/opt 0 \/proc 11M \/root 18M \/sbin 4.0K \/selinux 0 \/service 4.0K \/srv 0 \/sys 436K \/tmp 1.4G \/usr 1.9G \/var What could be taking up all of these blocks that I can't see? Could the drive just be broken? I don't have too much experience working with SSDs, so perhaps there's an obvious step I'm missing?"} {"id":"120311","title":"Why are there so many different ways to measure disk usage?","text":"When I sum up the sizes of my files, I get one figure. If I run `du`, I get another figure. If I run `du` on all the files on my partition, it doesn't match what `df` claims is used. Why are there so many different figures for the total size of my files? Can't computers add? Speaking of adding: when I add the “Used” and “Available” columns of `df`, I don't get the total figure. And that total figure is smaller than the size of my partition. And if I add up my partition sizes I don't get my disk size! What gives?"} {"id":"45771","title":"df vs. du: why so much difference?","text":"> **Possible Duplicate:** > Why is there a discrepancy in disk usage reported by df and du? `df` says 8.9G used by the partition mounted in `\/` :~$ df -h Filesystem Size Used Avail Use% Mounted on \/dev\/sda5 227G 8.9G 207G 5% \/ However, a `du` in `\/` yields a **much** smaller number. :~# du -chs \/ 5.5G \/ 5.5G total I was expecting a smaller number, but why is to **so much** smaller?"} {"id":"122884","title":"Most accurate disk usage report?","text":"Since disk space is allocated in blocks, is it a more accurate representation of the actual space consumed by a directory to report it in blocks vs bytes? If a file of size 1,025 bytes resides on a file system where space on the file system is doled out in units of 1,024 byte blocks, that file consumes two whole blocks. That seems more accurate than to say that this file consumes 1,025 bytes of space. Edit: File system in question is ext4, no dedupe, no compression, fwiw. This is my attempt: def getDirUsage(filepath, block_size=1024): # block_size as reported by os.statvfs() ''' return the number of blocks consumed by a directory ''' total_size = int(math.ceil(os.path.getsize(filepath)\/block_size)) # debatable whether this should be included in the size allfiles = os.listdir(filepath) for f in allfiles: p = os.path.join(filepath,f) if os.path.isdir(p): total_size += getDirUsage(p,block_size) else: total_size += int(math.ceil(os.stat(p).st_size\/block_size)) return total_size"} {"id":"112144","title":"Disk space shows up as used but not on `du`","text":"I have a problem where 70G on a server seems unreachable: XXX@XXX:\/data$ df -h Filesystem Size Used Avail Use% Mounted on \/dev\/mapper\/ubuntu--Storage-root 120G 2.9G 111G 3% \/ udev 7.9G 4.0K 7.9G 1% \/dev tmpfs 3.2G 296K 3.2G 1% \/run none 5.0M 0 5.0M 0% \/run\/lock none 7.9G 0 7.9G 0% \/run\/shm \/dev\/sda1 228M 25M 192M 12% \/boot \/dev\/sdb1 19T 70G 18T 1% \/data and when checking usage in the mount point `\/data\/`: XXX@XXX:\/data$ du -h 8.0K .\/STR1 4.0K .\/STR2 16K . nothing shows up"} {"id":"144700","title":"df-command free disk-space wrong","text":"Filesystem Size Used Avail Use% Mounted on \/dev\/sda1 107G 4.4G 97G 5% \/ dev 3.9G 0 3.9G 0% \/dev run 3.9G 576K 3.9G 1% \/run tmpfs 3.9G 23M 3.9G 1% \/dev\/shm tmpfs 3.9G 0 3.9G 0% \/sys\/fs\/cgroup tmpfs 3.9G 14M 3.9G 1% \/tmp tmpfs 788M 4.0K 788M 1% \/run\/user\/1000 Why does df shows 97G Available Disk-Space? Shouldn't it be 102.6?"} {"id":"49053","title":"linux + add X days to date and get new virtual date","text":"I have Linux ( RH 5.3) machine I need to add\/calculate 10 days plus date so then I will get new date (expiration date)) for example # date Sun Sep 11 07:59:16 IST 2012 So I need to get NEW_expration_DATE = Sun Sep 21 07:59:16 IST 2012 Please advice how to calculate the new expiration date ( with bash , ksh , or manipulate date command ?)"} {"id":"7823","title":"Compiling code from vim","text":"New to `vim` and and I want to be able to compile code from within `vim` without running a new terminal and calling the compiler. How do I go about doing this? Note that this requirement is not restricted to `gcc` only, I sometimes need to call `python` also on the current script I am working on, so you get the idea..."} {"id":"60428","title":"Fedora 17 freezes at loading screen with a CD-based installation","text":"I'm trying to install F17 on my laptop (Toshiba A-665 ... 4gigs RAM, nividia gforce GTS350M,core-i7 1.7 GHz processor), but the liveCD boot freezes about 3\/4 of the way through the loading icon... EVERY TIME. I've checked the image, the LiveCD (using Fedora 17s own media checker) and re-downloaded \/ rewritten the ISO about a thousand times now. Conclusion: the ISO is fine, the media is fine. The Fedora live environment just WILL NOT BOOT. I even tried to install other Distros of Linux (Ubuntu 12.10, Opensuse 12.2), and both gave me the same problem exactly. To clarify: I turn on my laptop, push F12 to select CD\\DVD as boot device Fedora boot options appear, hit enter on the first option, screen flashes white-ish, little cursor at top left (about 3-5 seconds here) little icon appears on screen, starts filling up ~3\/4 of the way through, the icon stops filling at this point, the CD Drive stops spinning, as does the disk-usage light on my laptop. And I can't open the DVD Drive tray, with no response AT ALL. No \"could not find this, that, or the other thing\" errors. No response at all from the keyboard, I have to hold down the power button to reboot. I get exactly the same result (with different progress bar) when I select \"Trouble Shooting\" and then \"Boot in something-or-other graphics mode.\""} {"id":"90627","title":"Notify of changes on a file under \/proc","text":"I have written a small 'daemon' in bash that will switch to the headphones if they are detected, and if not, switch to an external USB speaker with PulseAudio. What I'm looking for is some way to get notification of changes on the file `\/proc\/asound\/card0\/codec#0`, just like `inotifywait` does on real files (considering files under \/proc to be as \"pseudo-files\"). I find my code a bit insane, because it runs `sleep 1` with `awk` for the whole day, that is 86400 times a day :) while sleep 1; do _1=${_2:-} _2=$(awk '\/Pin-ctls\/{n++;if(n==4)print}' '\/proc\/asound\/card0\/codec#0') [[ ${_1:-} = $_2 ]] || if [[ $_2 =~ OUT ]]; then use_speakers else use_internal fi done What I'm looking for is something like (this example doesn't work): codec=\/proc\/asound\/card0\/codec#0 while inotifywait $codec; do if [[ $(awk '\/Pin-ctls\/{n++;if(n==4)print}' $codec) =~ OUT ]]; then use_speakers else use_internal fi done This way the commands inside the loop would be run only when there are real changes on the `$codec` file."} {"id":"113513","title":"Do I need Nautilus on RedHat \/ CentOS \/ Scientific Linux 6?","text":"I've found that Nautilus causes problems in my Scientific Linux 6 desktop (specifically it gets into an infinite loop opening the file manager at startup). While those problems are interesting in their own right, it got me wondering if I really need it for anything. When I do this: sudo yum remove nautilus the problem goes away, and since I never interact with the GUI file manager this doesn't seem like a problem. Will this bite me later on? Are there some hidden uses for Nautilus other than browsing files with a GUI?"} {"id":"9544","title":"Can a user with \/sbin\/nologin shell login through ssh?","text":"Is it possible to ssh to a machine as a user with no valid shell (say, `mail`)? So far I cannot, and using the command below doesn't work: $ ssh mail@machine.local \/bin\/bash It will always say \"This account is currently not available.\". But if I'm logged-in to the machine and use 'su' $ su mail -s \/bin\/bash I can become user `mail`."} {"id":"104821","title":"How to stop a background process?","text":"I have started a wget on remote machine in background using `&`. Suddenly it stops downloading. I want to stop its process, then start it again. How can I stop it? I haven't close its shell window. But as you know it doesn't stop using `Ctrl`+`C` and `Ctrl`+`Z`."} {"id":"151807","title":"How to pass argument with spaces to a shell script function?","text":"I'm trying to pass multiple argument to a function, but one of them is consist of two words and I want shell function to deal with it as one arg: args=(\"$@\") function(){ echo ${args[0]} echo ${args[1]} echo ${args[2]} } when I call this command `sh shell hi hello guys bye` I get this hi hello guys But what I really want is: hi hello guys bye"} {"id":"99287","title":"Sending emails from AutoMySQLBackup from Linux Mint","text":"I have set AutoMySQLBackup on a Linux Mint machine and I want to have the backups sent to an email, but I cannot make it work. I'm new to Linux environment and don't understand it very much. I installed `mutt` and `Postfix`, but I don't know how to config them, so `AutoMySQLBackup` will be able to send the backups to a Gmail account."} {"id":"80460","title":"rm -r path : how to avoid being asked at each level?","text":"How to avoid being asked at each level if I want to delete that path? I just want to remove everything in a path?"} {"id":"90389","title":"How to upgrade Debian stable (Wheezy) to testing (Jessie)?","text":"I downloaded and installed Debian 7 Wheezy, the stable version, but I would like more recent apps and libs so I'd like to switch to testing version (aka Jessie). How do I proceed?"} {"id":"87312","title":"Upgrade debian from oldstable (squeeze) to unstable (sid)","text":"I am trying to get debian sid. Firstly, I installed a clean squeeze on my hard drive. I replaced everything in my 'sources.list' with 'deb http:\/\/ftp.de.debian.org\/debian unstable main contrib non-free'. Then I performed these commands: apt-get update (no errors), apt-get dist-upgrade (took 10 minutes, no errors), reboot. But after reboot its version is still 6.0.7. Repeating 'apt-get dist-upgrade' \"works\" but doesn't change much (or nothing)."} {"id":"67929","title":"This file must be edited with the 'visudo' command.?","text":"Why it is recommended to edit `\/etc\/sudoers` file with the `visudo` command? Here is a sample of the file: ## Sudoers allows particular users to run various commands as ## the root user, without needing the root password. ## ## Examples are provided at the bottom of the file for collections ## of related commands, which can then be delegated out to particular ## users or groups. ## ## This file must be edited with the 'visudo' command. Are there any special reasons for it?"} {"id":"27596","title":"CUPS printing of pdf files","text":"How can I tell the lpr command (cups) that my file is actually a pdf? `lpr file.pdf` won't print anything."} {"id":"27597","title":"What does the \"(8)\" in fsck(8) mean?","text":"*nix commands (and functions?) have a number with them, like `fsck(8)`, `killall(1)`, etc. What does the number mean?"} {"id":"21360","title":"setting Cygwin's $HOME to Windows profile directory","text":"Are there any drawbacks to having Cygwin and Windows share the same $HOME directory, in this case the Windows profile directory?"} {"id":"75535","title":"apt-get error 503","text":"I tried installing pyqt4-dev-tools on my machine using the following command: sudo apt-get install pyqt4-dev-tools after a few prompts the installation is aborted with the following message: Err http:\/\/archive.ubuntu.com\/ubuntu\/ precise\/main pyqt4-dev-tools i386 4.9.1-2ubuntu1 503 Service Unavailable [IP: 91.189.91.15 80] Failed to fetch http:\/\/archive.ubuntu.com\/ubuntu\/pool\/main\/p\/python-qt4\/pyqt4-dev-tools_4.9.1-2ubuntu1_i386.deb 503 Service Unavailable [IP: 91.189.91.15 80] E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing? I tried running apt-get with `\\--fix-missing`, same error. running apt-get update doesn't help either. I'm using linux mint, if it matters any thing."} {"id":"29255","title":"Mounting Remote Filesystem over SSH as a Different User","text":"Due to a breach of security, the administrators of the work server have implemented a new method of security. To log into the server, we must log in as our own user (which has severely limited permissions), then `su` into another user under which we can do development (which we cannot log in to from the outside). It used to be that we just logged in to a common user which had permissions, and I could simply mount the remote filesystem right onto my local filesystem using `sshfs`. Now that we have to `su` into another user, I can't simply mount it like I have before. I've done a reasonable amount of research and tried all \"solutions\" I found. I've been trying to make this work for some time. My question is: is there a way to `su` into a different user inside a `sshfs` mount? Perhaps running a script on the server after the mount completes or something? I would use something like this, but I don't have `sudo` access on the server, only `su`. As a side note, my development computer is running LM11, and I'm mounting a share on some old Red Hat server."} {"id":"78359","title":"What is causing this Copy command to enter sleep state?","text":"I am trying to recursively copy a huge directory of installables over 25G and want to preserve the owner and group id, permission modes and so on. So I ran the below commands: bash-3.2$ date; cp -rpP \/source\/path\/Oracle \/target\/path\/Oracle;date; Tue Jun 4 09:44:54 EDT 2013 ... * * * **Some observations:** * Today (Wed Jun 5 12:09:25 EDT 2013) I notice that it still hasn't completed and appears to be stuck somewhere. I started analyzing the process and it seems to be sleeping: bash-3.2$ truss -p 09431; read(10, 0xFFBEF288, 32768) (sleeping...) * The last entry also shows that its asleep. bash-3.2$ pflags 09431 9431: cp -rpP \/source\/path\/Oracle \/target\/path\/Oracle data model = _ILP32 flags = RLC|ASYNC|MSACCT|MSFORK flttrace = 0xfffffbff sigtrace = 0xfffffeff 0xffffffff HUP|INT|QUIT|ILL|TRAP|ABRT|EMT|FPE|BUS|SEGV|SYS|PIPE|ALRM|TERM|USR1|USR2|CLD|PWR|WINCH|URG|POLL|STOP|TSTP|CONT|TTIN|TTOU|VTALRM|PROF|XCPU|XFSZ|WAITING|LWP|FREEZE|THAW|CANCEL|LOST|XRES|JVM1|JVM2|RTMIN|RTMIN+1|RTMIN+2|RTMIN+3|RTMAX-3|RTMAX-2|RTMAX-1|RTMAX entryset = 0x00000401 0x04000000 0x00000000 0x00000028 0x80000000 0x00000000 0x00000000 0x00000000 exitset = 0xfffffffe 0xffffffff 0xffffffff 0xffffffd7 0x7fffffff 0xffffffff 0xffffffff 0xffffffff \/1: flags = ASLEEP read(0xa,0xffbef288,0x8000) * Finally tried `pfiles` bash-3.2$ pfiles -F 09431 9431: cp -rpP \/source\/path\/Oracle \/target\/path\/Oracle Current rlimit: 256 file descriptors 0: S_IFCHR mode:0620 dev:363,0 ino:12582922 uid:502012187 gid:7 rdev:24,3 O_RDWR|O_NOCTTY|O_LARGEFILE \/devices\/pseudo\/pts@0:3 1: S_IFCHR mode:0620 dev:363,0 ino:12582922 uid:502012187 gid:7 rdev:24,3 O_RDWR|O_NOCTTY|O_LARGEFILE \/devices\/pseudo\/pts@0:3 2: S_IFCHR mode:0620 dev:363,0 ino:12582922 uid:502012187 gid:7 rdev:24,3 O_RDWR|O_NOCTTY|O_LARGEFILE \/devices\/pseudo\/pts@0:3 3: S_IFDIR mode:0750 dev:377,1 ino:1135681 uid:502012187 gid:502012187 size:4096 O_RDONLY|O_NDELAY|O_LARGEFILE FD_CLOEXEC \/source\/path\/Oracle 4: S_IFDIR mode:0750 dev:377,1 ino:1135682 uid:502012187 gid:502012187 size:4096 O_RDONLY|O_NDELAY|O_LARGEFILE FD_CLOEXEC \/source\/path\/Oracle\/Middleware 5: S_IFDIR mode:0750 dev:377,1 ino:14640507 uid:502012187 gid:502012187 size:4096 O_RDONLY|O_NDELAY|O_LARGEFILE FD_CLOEXEC \/source\/path\/Oracle\/Middleware\/user_projects 6: S_IFDIR mode:0750 dev:377,1 ino:14640508 uid:502012187 gid:502012187 size:4096 O_RDONLY|O_NDELAY|O_LARGEFILE FD_CLOEXEC \/source\/path\/Oracle\/Middleware\/user_projects\/epmsystem2 7: S_IFDIR mode:0750 dev:377,1 ino:6480147 uid:502012187 gid:502012187 size:4096 O_RDONLY|O_NDELAY|O_LARGEFILE FD_CLOEXEC \/source\/path\/Oracle\/Middleware\/user_projects\/epmsystem2\/EssbaseServer 8: S_IFDIR mode:0750 dev:377,1 ino:6480149 uid:502012187 gid:502012187 size:4096 O_RDONLY|O_NDELAY|O_LARGEFILE FD_CLOEXEC \/source\/path\/Oracle\/Middleware\/user_projects\/epmsystem2\/EssbaseServer\/essbaseserver1 9: S_IFDIR mode:0750 dev:377,1 ino:6480151 uid:502012187 gid:502012187 size:4096 O_RDONLY|O_NDELAY|O_LARGEFILE FD_CLOEXEC \/source\/path\/Oracle\/Middleware\/user_projects\/epmsystem2\/EssbaseServer\/essbaseserver1\/bin 10: S_IFIFO mode:0660 dev:377,1 ino:9088704 uid:502012187 gid:502012187 size:0 O_RDONLY|O_LARGEFILE \/source\/path\/Oracle\/Middleware\/user_projects\/epmsystem2\/EssbaseServer\/essbaseserver1\/bin\/ESSBASE1_1 11: S_IFREG mode:0660 dev:326,22000 ino:128325 uid:502012187 gid:502012187 size:0 O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE \/target\/path\/Oracle\/Middleware\/user_projects\/epmsystem2\/EssbaseServer\/essbaseserver1\/bin\/ESSBASE1_1 * * * **UPDATE:** _Note that the above`cp` process has been killed. So below observations are trying to reproduce the issue._ * **File** that is getting blocked: bash-3.2$ ls -l ESSBASE1_1 prw-rw---- 1 kent kent 0 Nov 22 2011 ESSBASE1_1 * When I try to cp this file individually: bash-3.2$ cp ESSBASE1_1 ESSBASE1_1kent # PID = 08745 ... it hangs too. * Looking at `pflags`, it seems to be sleeping. bash-3.2$ pflags 08745 8745: cp ESSBASE1_1 ESSBASE1_1kent data model = _ILP32 flags = MSACCT|MSFORK \/1: flags = ASLEEP read(0x3,0xffbf6bc8,0x8000) * Searching for all other processes using this file bash-3.2$ fuser -f \/source\/path\/Oracle\/Middleware\/user_projects\/epmsystem2\/EssbaseServer\/essbaseserver1\/bin\/ESSBASE1_1 \/source\/path\/Oracle\/Middleware\/user_projects\/epmsystem2\/EssbaseServer\/essbaseserver1\/bin\/ESSBASE1_1: 8745o 25057o Note that the 'o' indicates that the process is using the file as an open file. * Finding at the processes: bash-3.2$ pstree | grep 8745 | | | |--- 09695 kent grep 8745 | | \\--- 08745 kent cp ESSBASE1_1 ESSBASE1_1kent bash-3.2$ pstree | grep 25057 | | | \\--- 09700 kent grep 25057 | | |-+- 25057 kent 86:43 \/some\/path\/Oracle\/Middlewa Process with PID 25057 is a server process. * The open file is on a mount-point. It's a NAS disk. bash-3.2$ cat \/etc\/mnttab | grep apps server1.com:\/vol\/server1_nec_nosnap0\/dev_apps \/source\/path\/ nfs rw,xattr,dev=5e40001 1362894854 * * * * Can anyone help me understand what is causing the copy command to freeze up? * I can guess that the application is running and that might be in some way preventing any other process from accessing a particular file. * But in such a scenario I would expect `cp` to abort and throw me an error rather than stay blocked indefinitely. * As per the update, it seems process `PID=25057` seems to be using the file as an open file. But why does this block the `cp` command?"} {"id":"78351","title":"i3wm can't create new tiles and mouse won't move","text":"I installed i3wm and X using the tutorials in the Arch wiki for a new Arch installation. I have Intel video, so I installed the xf86-video-intel package (which takes care of the driver). But when I run: `startx` I'm taken to i3 (which I've never used before), but the mouse won't move (I'm running Ubuntu dual boot on this machine and mouse works great there) and when I try to create a new tile (`alt-enter`), the cursor turns into what looks like a clock surrounded by a frame of sorts, and doesn't recover. When I try to exit (`alt-shift-e`), I'm presented with a tab asking me to be sure, which I have to click with my mouse, which isn't moving, so I can't exit without shutting down (i.e., pressing the i\/o power button on the laptop). Here is a log from startup. I pressed new window a couple of times and then shut the computer down: 06\/05\/13 01:08:09 - i3 4.5.1 (2013-03-18, branch \"tags\/4.5.1\") starting 06\/05\/13 01:08:09 - Parsing configfile \/home\/tjb1982\/.i3\/config deciding for version 4 due to this line: # i3 config file (v4) 06\/05\/13 01:08:09 - [libi3] libi3\/font.c Using X font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1 06\/05\/13 01:08:09 - Used number 1 for workspace with name 1 06\/05\/13 01:08:09 - auto-starting i3-config-wizard 06\/05\/13 01:08:09 - startup id = i3\/i3-config-wizard\/723-0-arch_TIME0 06\/05\/13 01:08:09 - executing: i3-config-wizard 06\/05\/13 01:08:09 - Starting bar process: i3bar --bar_id=bar-hjnjco --socket=\"\/run\/user\/1000\/i3\/ipc-socket.723\" 06\/05\/13 01:08:09 - executing: i3bar --bar_id=bar-hjnjco --socket=\"\/run\/user\/1000\/i3\/ipc-socket.723\" 06\/05\/13 01:08:09 - Not a managed window, ignoring UnmapNotify event The config file \"\/home\/tjb1982\/.i3\/config\" already exists. Exiting. 06\/05\/13 01:08:09 - IPC: looking for config for bar ID \"bar-hjnjco\" 06\/05\/13 01:08:09 - workspace visible? fs = 0x1bdb0f0, ws = 0x1bdb0f0 06\/05\/13 01:08:09 - WM_CLASS changed to i3bar (instance), i3bar (class) 06\/05\/13 01:08:09 - WM_NAME changed to \"i3bar for output LVDS1\" 06\/05\/13 01:08:09 - Using legacy window title. Note that in order to get Unicode window titles in i3, the application has to set _NET_WM_NAME (UTF-8) 06\/05\/13 01:08:09 - This window is of type dock 06\/05\/13 01:08:09 - Checking window 0x00a00007 (class i3bar) 06\/05\/13 01:08:09 - dock status does not match 06\/05\/13 01:08:09 - Checking window 0x00a00007 (class i3bar) 06\/05\/13 01:08:09 - dock status matches 06\/05\/13 01:08:09 - ClientMessage for window 0x0000009e 06\/05\/13 01:08:26 - startup id = i3\/i3-sensible-terminal\/723-1-arch_TIME366852 06\/05\/13 01:08:26 - executing: i3-sensible-terminal 06\/05\/13 01:08:26 - Not a managed window, ignoring UnmapNotify event 06\/05\/13 01:08:28 - startup id = i3\/i3-sensible-terminal\/723-2-arch_TIME368252 06\/05\/13 01:08:28 - executing: i3-sensible-terminal 06\/05\/13 01:08:28 - Not a managed window, ignoring UnmapNotify event 06\/05\/13 01:08:30 - startup id = i3\/i3-sensible-terminal\/723-3-arch_TIME370387 06\/05\/13 01:08:30 - executing: i3-sensible-terminal 06\/05\/13 01:08:30 - Not a managed window, ignoring UnmapNotify event 06\/05\/13 01:08:31 - startup id = i3\/i3-sensible-terminal\/723-4-arch_TIME371331 06\/05\/13 01:08:31 - executing: i3-sensible-terminal 06\/05\/13 01:08:31 - Not a managed window, ignoring UnmapNotify event [libi3] libi3\/font.c Using X font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1 Contents of ~\/.i3\/config (replaced `#` with `;` for markdown legibility [which I didn't need to do, but I'm leaving it anyway): ; i3 config file (v4) ; ; Please see http:\/\/i3wm.org\/docs\/userguide.html for a complete reference! ; ; This config file uses keycodes (bindsym) and was written for the QWERTY ; layout. ; ; To get a config file with the same key positions, but for your current ; layout, use the i3-config-wizard ; ; Font for window titles. Will also be used by the bar unless a different font ; is used in the bar {} block below. ISO 10646 = Unicode font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1 ; The font above is very space-efficient, that is, it looks good, sharp and ; clear in small sizes. However, if you need a lot of unicode glyphs or ; right-to-left text rendering, you should instead use pango for rendering and ; chose a FreeType font, such as: ; font pango:DejaVu Sans Mono 10 ; use Mouse+Mod1 to drag floating windows to their wanted position floating_modifier Mod1 ; start a terminal bindsym Mod1+Return exec i3-sensible-terminal ; kill focused window bindsym Mod1+Shift+q kill ; start dmenu (a program launcher) bindsym Mod1+d exec dmenu_run ; There also is the (new) i3-dmenu-desktop which only displays applications ; shipping a .desktop file. It is a wrapper around dmenu, so you need that ; installed. ; bindsym Mod1+d exec --no-startup-id i3-dmenu-desktop ; change focus bindsym Mod1+j focus left bindsym Mod1+k focus down bindsym Mod1+l focus up bindsym Mod1+semicolon focus right ; alternatively, you can use the cursor keys: bindsym Mod1+Left focus left bindsym Mod1+Down focus down bindsym Mod1+Up focus up bindsym Mod1+Right focus right ; move focused window bindsym Mod1+Shift+j move left bindsym Mod1+Shift+k move down bindsym Mod1+Shift+l move up bindsym Mod1+Shift+semicolon move right ; alternatively, you can use the cursor keys: bindsym Mod1+Shift+Left move left bindsym Mod1+Shift+Down move down bindsym Mod1+Shift+Up move up bindsym Mod1+Shift+Right move right ; split in horizontal orientation bindsym Mod1+h split h ; split in vertical orientation bindsym Mod1+v split v ; enter fullscreen mode for the focused container bindsym Mod1+f fullscreen ; change container layout (stacked, tabbed, toggle split) bindsym Mod1+s layout stacking bindsym Mod1+w layout tabbed bindsym Mod1+e layout toggle split ; toggle tiling \/ floating bindsym Mod1+Shift+space floating toggle ; change focus between tiling \/ floating windows bindsym Mod1+space focus mode_toggle ; focus the parent container bindsym Mod1+a focus parent ; focus the child container ;bindsym Mod1+d focus child ; switch to workspace bindsym Mod1+1 workspace 1 bindsym Mod1+2 workspace 2 bindsym Mod1+3 workspace 3 bindsym Mod1+4 workspace 4 bindsym Mod1+5 workspace 5 bindsym Mod1+6 workspace 6 bindsym Mod1+7 workspace 7 bindsym Mod1+8 workspace 8 bindsym Mod1+9 workspace 9 bindsym Mod1+0 workspace 10 ; move focused container to workspace bindsym Mod1+Shift+1 move container to workspace 1 bindsym Mod1+Shift+2 move container to workspace 2 bindsym Mod1+Shift+3 move container to workspace 3 bindsym Mod1+Shift+4 move container to workspace 4 bindsym Mod1+Shift+5 move container to workspace 5 bindsym Mod1+Shift+6 move container to workspace 6 bindsym Mod1+Shift+7 move container to workspace 7 bindsym Mod1+Shift+8 move container to workspace 8 bindsym Mod1+Shift+9 move container to workspace 9 bindsym Mod1+Shift+0 move container to workspace 10 ; reload the configuration file bindsym Mod1+Shift+c reload ; restart i3 inplace (preserves your layout\/session, can be used to upgrade i3) bindsym Mod1+Shift+r restart ; exit i3 (logs you out of your X session) bindsym Mod1+Shift+e exec \"i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -b 'Yes, exit i3' 'i3-msg exit'\" ; resize window (you can also use the mouse for that) mode \"resize\" { ; These bindings trigger as soon as you enter the resize mode ; Pressing left will shrink the window’s width. ; Pressing right will grow the window’s width. ; Pressing up will shrink the window’s height. ; Pressing down will grow the window’s height. bindsym j resize shrink width 10 px or 10 ppt bindsym k resize grow height 10 px or 10 ppt bindsym l resize shrink height 10 px or 10 ppt bindsym semicolon resize grow width 10 px or 10 ppt ; same bindings, but for the arrow keys bindsym Left resize shrink width 10 px or 10 ppt bindsym Down resize grow height 10 px or 10 ppt bindsym Up resize shrink height 10 px or 10 ppt bindsym Right resize grow width 10 px or 10 ppt ; back to normal: Enter or Escape bindsym Return mode \"default\" bindsym Escape mode \"default\" } bindsym Mod1+r mode \"resize\" ; Start i3bar to display a workspace bar (plus the system information i3status ; finds out, if available) bar { status_command i3status } ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; automatically start i3-config-wizard to offer the user to create a ; keysym-based config which used his favorite modifier (alt or windows) ; ; i3-config-wizard will not launch if there already is a config file ; in ~\/.i3\/config. ; ; Please remove the following exec line: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; exec i3-config-wizard"} {"id":"59501","title":"Convert file path to URI in bash","text":"How can I convert a file path to an URI in the command-line? **Example** : \/home\/MHC\/directory with spaces and ümläuts to file:\/\/\/home\/MHC\/directory%20with%20spaces%20and%20%C3%BCml%C3%A4uts"} {"id":"37883","title":"Why do Mono applications only start from their own directory?","text":"If I want to run the application `monodevelop`, I need to chdir to `\/usr\/lib\/monodevelop\/Bin` and then execute `.\/MonoDevelop.exe`. This is the same for all other Mono applications such as `banshee`, `tomboy`, etc. If I attempt to run the Mono applications from another location by simply running `monodevelop`, or even from their own directory, I get _TypeInitializationExceptions_ like this: > behrooz@behrooz:\/usr\/lib\/monodevelop\/bin$ monodevelop > FATAL ERROR [2012-05-04 11:24:39Z]: MonoDevelop failed to start. Some > of the assemblies required to run MonoDevelop (for example gtk-sharp, > gnome-sharp or gtkhtml-sharp) may not be properly installed in the > GAC. System.TypeInitializationException: An exception was thrown by > the type initializer for Gtk.Application ---> > System.EntryPointNotFoundException: glibsharp_g_thread_supported at > (wrapper managed-to-native) GLib.Thread:glibsharp_g_thread_supported > () at GLib.Thread.get_Supported () [0x00000] in :0 > at Gtk.Application..cctor () [0x00000] in :0 --- > End of inner exception stack trace --- at > MonoDevelop.Ide.IdeStartup.Run (MonoDevelop.Ide.MonoDevelopOptions > options) [0x0007e] in > > \/home\/behrooz\/Desktop\/Monodevelop\/monodevelop-2.8.6.5\/src\/core\/MonoDevelop.Ide\/MonoDevelop.Ide\/IdeStartup.cs:95 > at MonoDevelop.Ide.IdeStartup.Main (System.String[] args) [0x0004f] in > > \/home\/behrooz\/Desktop\/Monodevelop\/monodevelop-2.8.6.5\/src\/core\/MonoDevelop.Ide\/MonoDevelop.Ide\/IdeStartup.cs:503 Why is that? I have tried reinstalling all Mono, Wine, GTK, Glib, X, Gnome packages. > apt-get --purge --reinstall install $(dpkg --get-selections| grep mono |grep > install |grep -v deinstall |awk'{print $1}') I also tried starce on \"open\" and got nothing by myself System Configuration: - Debian 6.0-updates 64 bit - Kernel 3.2.0-2, 3.2.0-1, 3.1 and 3 EDIT: not a kernel thing - Gnome 3.4 EDIT:but a gnome thing - Mono 2.10.5 TLS: __thread SIGSEGV: altstack Notifications: epoll Architecture: amd64 Disabled: none Misc: softdebug LLVM: supported, not enabled. GC: Included Boehm (with typed GC and Parallel Mark) update: with upgrading to the new monodevelop 3.0.2 and latest mono, I can run monodevelop with command \"monodevelop\" in terminal,no chdir.but gnome-shell cannot run it. Finally found it: as root: cd \/usr\/local\/ find | grep mono|xargs rm -rf # Use with caution\/some applications may get messed up(stellarium has MONOchrome images...)"} {"id":"144016","title":"What is a pager?","text":"I saw \"pager\" in several places: > `less` is a terminal pager program on Unix > > option `-P` for `man` Specify which output pager to use. What is a pager? How is it related to and different from a terminal? Thanks."} {"id":"107034","title":"Mac OS X LDAP query via dscl yields different results for same user with same datasource","text":"Where is the `NFSHomeDirectory` attribute stored for a Mac user who authenticates via LDAP? It doesn't seem to be in the LDAP database on the backend so I assume Open Directory is involved. I have 2 servers, one is 10.5.8 and one is 10.7. Each is an Open Directory Master. We also have Sun LDAP which is the authoritative LDAP for our entire environment. When I do `dscl \/LDAPv3\/our.ldap.server read \/Users\/ouruser` I get a different result for the `NFSHomeDirectory` attribute on the two servers, but I'm querying the same LDAP server in both instances. How could this be? What am I not understanding? I assume the attributes are all stored in LDAP since that is what I'm querying. Could it be caching? ### Some history The newer server was created by cloning the old one with Carbon Copy Cloner and then updating it. Pinging the LDAP server results in the same IP on both machines."} {"id":"151390","title":"How to check a particular directory is mounted?","text":"How to check a particular directory is mounted on the Linux machine. For instance there is a folder named test, I want to check if it is mounted or not."} {"id":"66210","title":"How can I have more than one possibility in a script's shebang line?","text":"I'm in a bit of an interesting situation where I have a Python script that can theoretically be run by a variety of users with a variety of environments (and PATHs) and on a variety of Linux systems. I want this script to be executable on as many of these as possible without artificial restrictions. Here are some known setups: * Python 2.6 is the system Python version, so python, python2, and python2.6 all exist in \/usr\/bin (and are equivalent). * Python 2.6 is the system Python version, as above, but Python 2.7 is installed alongside it as python2.7. * Python 2.4 is the system Python version, which my script does not support. In \/usr\/bin we have python, python2, and python2.4 which are equivalent, and python2.5, which the script supports. I want to run the same executable python script on all three of these. It would be nice if it tried to use \/usr\/bin\/python2.7 first, if it exists, then fall back to \/usr\/bin\/python2.6, then fall back to \/usr\/bin\/python2.5, then simply error out if none of those were present. I'm not too hung up on it using the most recent 2.x possible, though, as long as it's able to find one of the correct interpreters if present. My first inclination was to change the shebang line from: #!\/usr\/bin\/python to #!\/usr\/bin\/python2.[5-7] since this works fine in bash. But running the script gives: \/usr\/bin\/python2.[5-7]: bad interpreter: No such file or directory Okay, so I try the following, which also works in bash: #!\/bin\/bash -c \/usr\/bin\/python2.[5-7] But again, this fails with: \/bin\/bash: - : invalid option Okay, obviously I could just write a separate shell script that finds the correct interpreter and runs the python script using whatever interpreter it found. I'd just find it a hassle to distribute two files where one should suffice as long as it's run with the most up-to-date python 2 interpreter installed. Asking people to invoke the interpreter explicitly (e.g., `$ python2.5 script.py`) is not an option. Relying on the user's PATH being set up a certain way is also not an option. ## Edit: Version checking within the Python script is **not** going to work since I'm using the \"with\" statement which exists as of Python 2.6 (and can be used in 2.5 with `from __future__ import with_statement`). This causes the script to fail immediately with a user-unfriendly SyntaxError, and prevents me from ever having an opportunity to check the version first and emit an appropriate error. **Example:** (try this with a Python interpreter less than 2.6) #!\/usr\/bin\/env python import sys print \"You'll never see this!\" sys.exit() with open('\/dev\/null', 'w') as out: out.write('something')"} {"id":"50306","title":"Asus Bluetooth Dongle with Atheros (ath3k) chip - OpenSUSE - probe failed with error -5","text":"I'm trying to use an Asus USB Bluetooth Dongle in OpenSUSE. Unfortunately when I plug it in, dmesg gives me the following output: usb 8-2: new full speed USB device using uhci_hcd and address 3 usb 8-2: New USB device found, idVendor=0cf3, idProduct=3000 usb 8-2: New USB device strings: Mfr=0, Product=0, SerialNumber=0 ath3k: probe of 8-2:1.0 failed with error -5 lsusb gives the following output: Bus 005 Device 004: ID 0cf3:3005 Atheros Communications, Inc. The modules ath3k and bluetooth are loaded, but neither bluedevil nor the OpenSUSE bluetooth adapter tool detect the stick. I'm using the 2.6.37.6-0.20-desktop kernel from the OpenSUSE repositories under openSUSE 11.4 32bit. The following packages are installed: * bluedevil * bluez * bluez * compat * bluez-firmware * bluez-gstreamer * bluez-hcidump * bluez-test * gnome-bluetooth * libbluedevil1 * libbluetooth3 * libgnome-bluetooth8"} {"id":"5771","title":"Simplest way of forwarding all mail from server?","text":"> **Possible Duplicate:** > Lightweight outgoing SMTP server I am looking for a minimal mail solution (MTA) for a headless server which generate e-mails for local users and and fully qualified addresses from cron- jobs, etc. Ideally all mails to local user `foo` should be mapped to `foo@mydomain`, with possible modifications for `uid`<1024, and sent off to an external smtp server without involving `\/var\/mail`. Some years ago, I used sSMTP for a similar task, and I was wondering if this is still the way ahead? Also, how much of the default debian mail system should\/could I remove? * * * **Update** Ended up Googling a bit, and the obvious candidates seem to be * sSMTP: Not actively developed * eSMTP: Not actively developed according to home page * mSMTP: Recommended in front of sSMTP at http:\/\/www.scottro.net\/qnd\/qnd-ssmtp.html * nullmailer: Suggested by Gilles Even though eSMTP is not developed anymore, it seems to have the nicest documentation. It doesn't quite fit my needs though, at it seems to insist on delivering mail to local user `foo` via a Mail Delivery Agent (MDA) instead of pushing it out over smtp to `foo@some.domain`. Or maybe it does do the mapping if I add `qualify_domain` to the config. Might have to try it out... nullmailer appears to be running a queue in `\/var`, which is not something I want. Does anybody have experience with any of these?"} {"id":"22345","title":"\"invoke-rc.d: initscript cups, action \"start\" failed.\" while configure cups","text":"When I run `apt-get -f install`, I get the following abnormal output: Setting up cups (1.5.0-8) ... start: Job failed to start invoke-rc.d: initscript cups, action \"start\" failed. dpkg: error processing cups (--configure): subprocess installed post-installation script returned error exit status 1 Errors were encountered while processing: cups E: Sub-process \/usr\/bin\/dpkg returned an error code (1) I'm running under **Ubuntu Oneiric Ocelot, x64**. I'm not sure where to start to debug this. I appreciate any suggestions any of you may have."} {"id":"117387","title":"Understanding ls -l output","text":"When I run `ls -lrt` command on a Unix folder , I get the following output MyServer> ls -lrt total 10 drwxr-x--- 3 UnixUser other 512 Jul 22 2011 FolderA lrwxrwxrwx 1 UnixUser other 42 Aug 23 2011 BEA -> ..\/..\/..\/Some\/Folder\/SOLARIS\/BEA I am not sure what are BEA and Perlx.x in these folders. They do not seem to be files nor folders. Why is there a arrow besides them pointing to somewhere else?"} {"id":"35088","title":"Reading passwords without showing on screen in Bash Scripts","text":"How to read passwords in bash scripts in a way like tools which are not showing it on terminal ? (Changing font to black on black might be tricky by easy to copy&paste - so it's not solution)"} {"id":"92393","title":"USB hard drive boot problem","text":"I have a HP Probook 4525s laptop with Windows 7 and Ubuntu installed on it and an external USB Toshiba hard disk(320GB); I've tried to install for several times various linux distros on the USB HD (Ubuntu, Backtrack, Suse 11, Scientific Linux) but I have problems booting it. The instalation went well but, when it comes to boot the external HD, everything stops to a dash blinking forever on a black background. I've tried changing the boot order and manually select the booting device but doesn't solve the problem. If I remove the external HD when the dash blinks, the laptop boots the internal HD and I get the ubuntu boot menu. I've tried booting from other computers and everything works fine, so it seems that my machine has a problem. What should I do in this case? Any suggestion may be useful."} {"id":"114177","title":"How to restore folders to their original destination using duplicity?","text":"After performing a backup of a couple of directories like so: # duplicity\\ --exclude \/home\/user\/Documents\/test1\/file\\ --include \/home\/user\/Documents\/test1\\ --include \/tmp\/test2\\ --exclude '**'\\ \/ file:\/\/\/home\/user\/Backup I wanted to test how the restoration works by deleting the backed up directories: # rm -rf \/home\/user\/Documents\/test1 \/tmp\/test2 And then, restoring the backup, # duplicity file:\/\/\/home\/user\/Backup \/ But I got the error, Restore destination directory \/ already exists. Will not overwrite. So it appears that I can't restore to the original destination without emptying the root folder even though the destination of these included folders have already been cleared. Is there a better way than to restore it to another location and then moving each folder one by one? # duplicity --file-to-restore home\/user\/Documents\/test1 file:\/\/\/home\/user\/Backup \/home\/user\/Restore1 # mv \/home\/user\/Restore1\/home\/user\/Documents\/test1 \/home\/user\/Documents\/test1 # duplicity --file-to-restore tmp\/test2 file:\/\/\/home\/user\/Backup \/home\/user\/Restore2 # mv \/home\/user\/Restore2\/tmp\/test2 \/tmp\/test2"} {"id":"23695","title":"How to update Debian kernel to latest in backports","text":"I have a machine running Debian stable, and I'd like to update the stock kernel to the latest kernel available in the backports repository. There are many kernel-related packages and virtual packages--what is the right way to do this and get the appropriate packages upgraded?"} {"id":"145057","title":"sed + remove the first directory from path","text":"Please advise on how to remove the first directory from a path by `sed`, (the inverse pf what `basename` does). For example echo \"\/mnt\/VPfig\/Amer\/AR4\/Celtel\/files\/COM.txt\" | sed ... I should get: \/VPfig\/Amer\/AR4\/Celtel\/files\/COM.txt"} {"id":"74794","title":"Why is dnsmasq putting my router IP in \/etc\/resolv.conf instead of 127.0.0.1?","text":"I'm having DNS resolution issues in various contexts which appear to trace back to my networking configuration. I'm running just the dnsmasq-base installation of dnsmasq on two Linux installations (Lubuntu 12.04 and 12.10). I haven't done anything in particular to configure dnsmasq, but I think some other changes I made previously may have lead to an incorrect configuration when upgrading. The working configuration on machine 'A' running 12.04 sets `\/etc\/resolv.conf` to use 127.0.1.1 (which in `\/etc\/hosts` is set to `$HOSTNAME`) On machine 'B' where certain applications such as OpenVPN experience DNS resolution issues, `\/etc\/resolv.conf` is set to 192.168.1.1, which is my gateway IP. Only certain applications are affected. Web-browsing, for example, works just fine. Any idea if this difference is the cause of the DNS resolution issues, and why 'B' is behaving differently? Edits: Both 'A' and 'B' are running dnsmasq, both are using DHCP to get DNS configuration, and I'm only using dnsmasq for DNS. There is no \/etc\/dnsmasq.conf file. I understand that this is normal when running just dnsmasq-base. The contents of \/etc\/resolvconf on the two machines appear to be identical. No extraneous\/missing files. Sorry I can't be more specific about the nature of the problem. \"DNS resolution issue\" was the end-point of my discussion with technical support at my VPN provider."} {"id":"128471","title":"Determine what device a directory is located on","text":"If I do # cd \/ # ln -s \/home test # cd test # mount --bind $PWD \/mnt the entry in `\/proc\/mounts` is \/dev\/sda2 \/mnt ext4 rw,noatime,data=ordered 0 0 which is the device that is mounted to `\/home` and is not easily deducible from `$PWD` which is `\/test`. How can I determine which device (i.e., \/dev\/sda2) is going to show up in `\/proc\/mounts` in general given that the bind mount may be to a directory\/file that is potentially \"obscured\" by symlinks, other bind mounts, etc?"} {"id":"78949","title":"What disk is a file \/ directory stored on?","text":"From the command line (bash) I would like to know what disk a given file is stored in. E.G.: $ [what filesystem is this file in command] \/tmp\/example\/file \/dev\/sda1"} {"id":"25528","title":"Is creating a sparse image using dd appropriate for backup\/restore from a RAID?","text":"I have two non-networked servers, each with 1.2TB of storage in a RAID5 config on an LSI MegaRaid 9240-8i controller. I have been trying without success to get Symantec Ghost to image one machine to the other due to driver issues, and so I was wondering if it wouldn't be easier to boot from a Linux LiveCD, plug in an external hard disk and `dd` the RAID partition to the external disk. The 1.2TB partition only has around 10GB of data on it, so I hope to generate a sparse image file (to avoid having to find a 1.2TB USB disk!). I have seen people use the `seek` parameter of `dd` to achieve this - is that an appropriate way to create an image of around 10GB size in this situation? Even if this is a sensible way to generate a sparse image, is this a sensible way to mirror one RAID to another of identical configuration, or do the commercial utilities such as Ghost and Acronis do some 'magic' that `dd` does not?"} {"id":"139259","title":"My iptables works the opposite from what I wanted","text":"I have this set of `iptables` rules ... $ sudo iptables -n -L Chain INPUT (policy ACCEPT) target prot opt source destination LOG all -- 0.0.0.0\/0 0.0.0.0\/0 limit: avg 5\/min bu REJECT tcp -- 192.168.1.134 0.0.0.0\/0 tcp dpt:22 reject-w Chain FORWARD (policy ACCEPT) target prot opt source destination Chain OUTPUT (policy ACCEPT) target prot opt source destination ... the above blocks 192.168.1.134 but it does not log attempts from 192.168.1.134. Instead connections from other clients are logged. I just want to log the dropped packets. What I want to do is log all dropped packets."} {"id":"144776","title":"ajaxterm using proportional font","text":"I have Ubuntu 14.04 LTS, Apache 2.4.7, Python 2.7.6 and Ajaxterm 0.10-12ubuntu1. Ajaxterm is proxied via Apache. Here's the apache.conf excerpt: # Suppresses the Via header ProxyVia Off # Do not flood the log #CustomLog \/var\/log\/apache2\/access.log combined env=!dontlog #SetEnvIf Request_URI \"^\/ajaxterm\/u\" dontlog ProxyRequests Off Order deny,allow Allow from all <\/Proxy> ProxyPass \/ajaxterm\/ http:\/\/localhost:8022\/ retry=0 ProxyPassReverse \/ajaxterm\/ http:\/\/localhost:8022\/ retry=0 When it was initially installed, Ajaxterm worked fine. Now, however, it uses a proportional font instead: ![Ajaxterm](http:\/\/i.stack.imgur.com\/ab4Pv.png) I've uninstalled and reinstalled it, but I can't figure out what the problem is. No errors appear in the browser console or network inspector."} {"id":"139252","title":"Give user permission to rm without password or sudo","text":"I'm trying to give the `ubuntu` user on my machine the ability to `rm` folders and files (mainly in the `\/www\/` folder) without the need to invoke a password or the need to use `sudo`. I've been following this article and ended up trying this in my `sudoers` file. ubuntu ALL = (ALL) NOPASSWD: \/bin\/rm This unfortunately doesn't do the trick. Can anyone help me with the proper configuration?"} {"id":"70549","title":"Learning Linux for intermediate user","text":"Here is my situation : * I know how to compile some programs. I know how `make` and `gcc` works. I know `bash`. * I am fairly comfortable with command-line. * I know how it works in my computer for some programs. I am not satisfied. What I want to learn is this : * I want to learn how programs really work, what really happens when I compile a program, which file gets copied in which directory, etc. I often find myself unable to successfully compile a program, so I end up using `apt-get` to install it. I find it to \"magical\" for me. I want to know what `apt-get` does to my computer. * I want to learn where to find configuration files and how to edit them. Particularly, I want to learn how mime-types work. I want to know more about environment variables as well. * In fact, I am looking for total control over my computer. I think installing Arch Linux would be a good thing, but I want to learn the above before. Can you show me a resource I can use which is not too technical at the same time? Do you have any suggestion, recommendation?"} {"id":"39846","title":"How to fix non-responsive Ubuntu system?","text":"I use Ubuntu. Sometimes, the system does not have any response with mouse and keyboard. Is there any way to solve this problem except hitting the reset button on the machine?"} {"id":"72840","title":"SSH connections not accepted after configuring NFS?","text":"I have a couple of servers in a VPC in Amazon EC2. One of them acts as a NFS server, and one of them as a client. I recently noticed a problem in the client that after a reboot, it would reject all SSH connections, presumably because SSH was not running. After transferring the EBS volume to another instance and taking a peek inside, I commented out the NFS line in `\/etc\/fstab` and tried attaching it back to the server and booting it. Lo and behold, I was able to connect with SSH. It seems that having the following line in my fstab is breaking everything on boot: 10.0.0.1:\/export\/share \/mnt\/shared nfs auto 0 0 Why is this causing SSH to fail to start? How can I have NFS automatically mount on boot without breaking networking\/SSH on the system? I've checked that `sudo mount -a` works properly, so it seems that there isn't an inherent problem in the fstab command. What's breaking and how can I fix it?"} {"id":"105304","title":"Restart sound indicator in ubuntu","text":"When the sound crashes, I can restart it with: sudo alsa force-reload However, that doesn't bring the sound indicator (system tray indicator) back. I am running Ubuntu 13.10 with LightDm."} {"id":"146086","title":"Curious about strange ICMP type 3 code 10 traffic to my IP address","text":"My firewall (`iptables`) logs some strange ICMP type 3 code 10 traffic that I am curious to understand (specifically how or if this could be an exploit of some sort). > Type 3 = Destination Unreachable > Code 10 = Communication with Destination Host is Administratively > Prohibited). The logged traffic (4-6 packets a few seconds apart, once a day for the last months): > **IN** =eth0 **OUT** = **MAC** = _(eth0 MAC)_ **SRC** = _(Foreign IP > address)_ **DST** = _(My IP address)_ **LEN** =72 **TOS** =0x00 **PREC** > =0x00 **TTL** =50 **ID** =35145 **PROTO** =ICMP **TYPE** =3 **CODE** =10 [ > **SRC** = _(My IP address)_ **DST** = _(Foreign IP address)_ **LEN** =44 > **TOS** =0x00 **PREC** =0x00 **TTL** =50 **ID** =0 **DF** **PROTO** =TCP > **SPT** =25 **DPT** =53454 **WINDOW** =28200 **RES** =0x00 **ACK** **SYN** > **URGP** =0] All logs indicate that _(Foreign IP address)_ only transmits the above ICMP packet. No other traffic from _(Foreign IP address)_ is recorded in the same time period (see update below). By default, the system logs and drops any traffic originating from the country of _(Foreign IP address)_. Could this be an exploit, perhaps to trick _(My IP address)_ into transmitting something to _(Foreign IP address)_ , assuming I did not drop the traffic by default? Any insights are welcome. **Update** : The logs show that _(Foreign IP address)_ consistently connects to port 80 and 443 prior to the ICMP packets (9 and 7 hours before the ICMP packets, respectively). Both attempts dropped by the default firewall policy. According to Network-Tools.com the origin of _(Foreign IP address)_ is China(CN) in region Southern and Eastern Asia, and no host name is associated with the IP address."} {"id":"146084","title":"Cube not working in Fedora 20 KDE","text":"When I switch desktops on my Fedora 20 system, with the \"desktop cube\" it doesn't work. Instead of showing the cube effect, it displays briefly LibreOffice with an open document which I closed 10 minutes ago, and then it displays the selected desktop. I have 4 active desktops. Libreoffice does not show up in running processes. Also when the system has turned off the display when Idle and resuming, the screen is frozen and the cube doesn't work, not until I select a different desktop does the cube work and the screen is active. What is happening here and how to resolve it?"} {"id":"146080","title":"How do I find out what filesystem drivers are compiled-in into the linux kernel?","text":"On a running linux system, what is a portable (among linux distributions) way to find out what filesystems the current kernel has compiled-in (not through modules) support for? Consider for example my current Ubuntu x86_64 kernel: `3.11.0-24-generic #41-Ubuntu`. It has for instance no `\/proc\/config.gz`, which would be my first thought otherwise. The reason I'm interested is that I'd like to (programmatically) build a rescue environment with the current kernel and an initial ramdisk that the kernel will be able to load\/mount. **Is is as simple as comparing** `\/proc\/filesystems` **with** `lsmod` **?** If so: Do the modules always have the exact same name (first column from `lsmod` output) as the filesystem name (last column in `\/proc\/filesystems`)? Is there perhaps a more modern way such as `\/sys` instead of `\/proc` to look for info? My current approach is as follows. Can someone confirm that it is correct, or advise how to do it instead?: for fscand in $(awk '{print $NF}' \/proc\/filesystems) do if test $(lsmod | grep -c -e '^'${fscand}'[^a-z0-9_-]') -eq 0 then candlist=\"${fscand} ${candlist}\" fi done for fscand in $candlist do echo $fscand is compiled-in done"} {"id":"37413","title":"How do I shut down ports remotely without shutting myself out?","text":"I have an Ubuntu 11.04 server in a remote location on another continent, so I have no physical access to it. I only interact with it by `ssh` (and `scp`), and intend to only ever interact with it that way. For security purposes, I want to ensure that absolutely all ports on the server are closed, except for `ssh`. My understanding is still vague, despite having tried to find instructions on the web. What I've gathered so far is that I need to \"flush\" the \"iptables\", and also that I need to edit some files (`\/etc\/hosts`, maybe?), and reboot the machine. Obviously, though, I want to be very careful about this, because if I do it wrong, I could end up accidentally shutting down the ssh port, making the server inaccessible to me. If that happens, I have to go to the server administrator, who will reinstall the server, and make fun of me in the process. I'm not a server admin guru by any stretch, so I'm looking to establish a fool proof set of steps before I do this. So, how do I shut down all ports while still preserving my access? _**Bonus question:_** While doing this, should I, and can I, change the `ssh` port from 22 to a non-standard one? Does it really make a difference?"} {"id":"84750","title":"Is Windows Linux based","text":"Is Windows Linux based? Because I cannot find a stack exchange site for Windows. If there is not sit for Windows can anybody explain how to request a site."} {"id":"41334","title":"crontab sets up user variable, redirect output, and detect connetcted network","text":"I have three problem, all of them are about crontab. 1. Can I access `$HOME` variable in crontab ? for example, use `$HOME` like this: `PATH=$HOME\/bin:$HOME\/scripts:$PATH` ? or `* * * * * echo \"test\" > $HOME\/test.txt` ? 2. I want let crontab redirect normal `stdout` to `\/dev\/null`, but mail `stderr` to user. For example, when computer is **not** connected to network, then an entry in crontab like `* 2 * * * getmail -n -q ...` will return error, so crontab will send email to user with this error. 3. based on upper example, `getmail` will let crontab mail user when system is **not** connected to network, so I want a method to detect whether user is connected to network. About this method of detecting, it should has bellowing: 1. fast 2. simple 3. easy to combine with other crontab jobs, (like use control: &&, ||, | etc)"} {"id":"21850","title":"Repeatably generate a read error for testing?","text":"I'm trying to test the error handling in some software, in particular what happens when an error occurs reading from a file or pipe. Is there a simple way to send a certain amount of data to stdout and then generate an I\/O error? (I.e., the process doing the reading would see read(2) return -1.) A simple shell recipe would be great, but I don't mind writing code if that's the only way."} {"id":"86443","title":"How to view traffic over a forwarded ssh port?","text":"It is possible to setup an SSH port forward where the ssh client prints out the traffic exchanged over the ssh port to the screen or a file. I am trying to debug a problem and want to see what is being sent between a java process running on my local machine and a remote process running on Solaris. I am using the port forwarding via ssh so that i can step through the java program. Normally I would have to copy the .java files to the Solaris machine, build them and run and it is not very productive way to debug, thus the port forwarding. The client and server as using IIOP protocol so I can't use an http proxy to monitor the traffic."} {"id":"106140","title":"Gives access to root user for a period of time","text":"I want to know if it's possible to give access to root user for one week or a month, for example. It's possible to increase the period of time before the defined period ends? Is it possible to give access without time limitation, forever?"} {"id":"15818","title":"How to fake the source-port of a TCP packet?","text":"Is there an easy way (or is it possible at all) to rewrite a TCP packet as it leaves the machine? For example if I run telnet binfalse.de 22 it will search for an unused port to leave the machine. In this case it's `46576`: root@srv % lsof -i -P -n | grep telnet telnet 10150 user 3u IPv4 1159425 0t0 TCP 1.2.3.4:46576->87.118.88.39:22 (ESTABLISHED) But now I want to rewrite these packets to let the server think the requests came from port `1337`, or somewhat like this. Of course I know that I don't have to expect an answer in my `telnet` session. **EDIT:** Of course on `1337` another program is listening, so telling `telnet` to speak through `1337` is no option..."} {"id":"70895","title":"Output of command not in stderr nor stdout","text":"I've stumbled on this issue, so I'm wondering how is this possible? Standard run of command: # zabbix_sender -c zabbix_agentd.conf -k mmysql.QCInserts -o 14 info from server: \"Processed 0 Failed 1 Total 1 Seconds spent 0.000017\" sent: 1; skipped: 0; total: 1 OK, lets try to get the first line only: # zabbix_sender -c zabbix_agentd.conf -k mmysql.QCInserts -o 14 | head -1 sent: 1; skipped: 0; total: 1 What about standard head? # zabbix_sender -c zabbix_agentd.conf -k mmysql.QCInserts -o 14 | head sent: 1; skipped: 0; total: 1 Inverse grep? sed? tee?!?!?!!? # zabbix_sender -c zabbix_agentd.conf -k mmysql.QCInserts -o 14 | grep -v pero sent: 1; skipped: 0; total: 1 # zabbix_sender -c zabbix_agentd.conf -k mmysql.QCInserts -o 14 | sed 's\/foo\/bar\/' sent: 1; skipped: 0; total: 1 # zabbix_sender -c zabbix_agentd.conf -k mmysql.QCInserts -o 14 | tee sent: 1; skipped: 0; total: 1 stderr to stdout? # zabbix_sender -c zabbix_agentd.conf -k mmysql.QCInserts -o 14 2>&1 | tee sent: 1; skipped: 0; total: 1 I'm really puzzled..."} {"id":"15811","title":"Finding the right diplay driver for arch installation on a virtual box on Lenovo edge13''","text":"I'm checking arch on a virtualbox (running on ubuntu) before I install it on my machine. I have followed the wiki up until the display driver section. lspci gives: > VGA compatible controller: InnoTek Systemberatung GmbH Virtual Graphics > Adapter I assume this is some sort of virtualbox compatible layer, is there a way to by pass it and test my real display driver (intel of some kind) on the virtual box?"} {"id":"118289","title":"How do I authenticate to a wireless provider's \"open\" network without using a browser?","text":"This sort of a setup seems to be common in shopping malls and airports. In Western Canada Shaw provides such a service and calls it \"Shaw Open\". I'm pretty sure other locales have similar services from providers such as T-Mobile, etc. From something such as a cell phone it's not very complicated to do. No authentication is necessary to connect to the wifi hotspot as it is \"open\" for public access. But my cell phone won't connect to websites or remote services via apps **until I use my browser and sign in to a particular webpage provided by the ISP**. My question simply stated is: **How do I automate the authentication step from a device that doesn't typically have a traditional browser?** I have, in my particular case, a raspberry Pi configured with software that I want to use at trade shows etc. Theses locations have the same sort of \"open\" hotspots. The Raspi is meant to be self contained. It just does its business and talks to a website. But this outbound connection is blocked by the ISPs \"open\" connection because I haven't, nor can I complete the browser part of the process. Assuming I have credentials to do this on a particular provider's network, **how can I automate that part of the process without requiring me to open a terminal session to the Pi?** What kind of technology is even used here, that I can search for?"} {"id":"14350","title":"How to access network without NetworkManager in Fedora 15?","text":"I am running Fedora 15 on VirtualBox 4 and I am failing to reach the internet: $ ping 8.8.8.8 connect: Network is unreachable Firefox also refuses, telling me \"Server not found\". Running `sudo service network restart` and restarting the VM didn't help."} {"id":"108430","title":"Should my \/usr\/local\/bin be 700 permissions?","text":"I just installed npm and node.js, and I couldn't access `npm`. And I'm like \"why?\" and my OS is like \"because \/usr\/local\/bin is at 700 permissions\" and I'm like \"should it really be that way?\" \/usr\/local is supposed to be .. the local user's bin folder? Then why does it require root access? It is filled with GAE stuff. Maybe Google App Engine changed it, I don't know."} {"id":"38038","title":"Batch copying\/moving files in unix?","text":"Is there a way to batch copy\/move files in unix? I thought it might be an option for `cp\/mv` but I can't find any way to do it."} {"id":"14357","title":"List iptables rules as append command","text":"A while back I was watching over the shoulder of a Linux guru and he issued a command that listed all the iptables rules in the format of the append commands you would need to issue in order to build them, but despite all my googling and man page searching I can't figure out what he did. For example if the output from `iptables -nL INPUT` was: Chain INPUT (policy DROP) num target prot opt source destination 1 ACCEPT tcp -- 0.0.0.0\/0 192.168.0.1 tcp dpt:80 The output from the command I'm looking for would be something like: 1 -A INPUT -i eth0 -p tcp --dport 80 -d 192.168.0.1 -j ACCEPT I seem to remember that it was just another option passed into the standard `iptables -L` command, but I could be wrong. Does anyone know of a command to accomplish this?"} {"id":"88263","title":"Capture output of a bash command, parse it and store into different bash variables","text":"**Explanation:** I have a small _bash_ script which simply runs _any_ Linux command (e.g. say `ifconfig`) The typical output of _ifconfig_ is something like this: eth0 Link encap:Ethernet HWaddr 30:F7:0D:6D:34:CA inet addr:10.106.145.12 Bcast:10.106.145.255 Mask:255.255.255.0 inet6 addr: fe80::32f7:dff:fe6d:34ca\/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:1104666 errors:0 dropped:0 overruns:0 frame:0 TX packets:2171 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:444437904 (423.8 MiB) TX bytes:238380 (232.7 KiB) lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.255.0.0 inet6 addr: ::1\/128 Scope:Host UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:15900 errors:0 dropped:0 overruns:0 frame:0 TX packets:15900 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:467306 (456.3 KiB) TX bytes:467306 (456.3 KiB) Now what most people usually do is store the _entire_ output into a file\/variable and parse based on that. I however want to know if there is anyway that I could put _specific_ parts of the output in more than one variable (say a _bash variable_ called `${IPETH0}` to carry the IP address `10.106.145.12` from _eth0_ and `${IPLO}` to carry the IP address `127.0.0.1` from _lo_ in the above example _without running ifconfig command twice_ ). Something like what _tee_ command does with the input but I want to do this for the _output_ and store the output into 2 or _more_ variables in one go. Any ideas?"} {"id":"38034","title":"How do I generate a list of the characters occurring before a certain character only in lines that contain another certain character using regex?","text":"I know that's super confusing (total noob-sorry!). To clarify, I have a text file that looks like this: 407-OL? 408-2-OL? 408-OL? 418-het? 420-1 and 2- OL? 429-2-left unscored? 430-2-left both unscored? 431-1 and 2- Ri?? 436-1-just homozygote? 444-2-het? ins. both 456-2-ins 246 despite slight OL 456-1-ins 245 (weaker) 457-2-Ri? I want it to return the numbers on the left (before the dash), but only for lines that contain a question mark. In other words, I want this to be the output: 407 408 408 418 420 429 430 431 436 444 457 Any suggestions would be amazingly helpful! Thank you!"} {"id":"147024","title":"Command to 're-apply' previous command?","text":"Is there an easy way to re-apply a previous command to a new command line entry? Say I typed in `chmod u+r,g+x file.txt` but forgot the sudo. Could I simply type `sudo `'? Pardon for the possible noob question."} {"id":"89044","title":"LD_PRELOAD or similar to prevent network access","text":"I'd like to start a program disconnected from the network (because immediately upon starting it tries to download huge amounts of data, which can be prevented by changing settings as soon as it settles down). However, I really don't want to actually _bring the network down_ for this one program. Is there some LD_PRELOAD or similar to give the program the impression that the network is down? I'd rather not create a virtual machine."} {"id":"85932","title":"How can I redirect outbound traffic to port 80 using iptables locally?","text":"I'm trying to locally redirect ports on my Ubuntu machine using `iptables`. Similar to transparent proxying. I want to catch anything trying to leave my system on port 80 and redirect it to a remote host and port. Can I achieve this using the NAT and pre-routing functions of `iptables`?"} {"id":"47597","title":"How to add a path to system $PATH for all users's non-login shell for debian","text":"After installing some programs in `\/opt\/xxx\/bin`, I want to add `\/opt\/xxx\/bin` to system `$PATH` for all users's non-login shell. What should I do?"} {"id":"137341","title":"Failure to startx on Ubuntu 14.04 after security update - missing libXfont.so.1","text":"I had Ubuntu 14.04 running perfectly on my system and then it underwent a recommended security update. I let it update while I was at work and when I returned I found a black screen stating, \"No init found\" and \"mount: mounting \/dev\/mapper\/ubuntu-root on \/root failed: Invalid argument\". I followed some guides and ran the following commands: ls \/dev\/sd* sudo apt-get install lvm2 sudo pvscan sudo vgscan sudo vgchange -a y ubuntu-vg sudo fsck \/dev\/ubuntu-vg\/root After running those commands and rebooting, my Linux system was back up and running again; however, not quite like it was before. It starts up into command line mode (without GUI) and asks for my username and password. When I log in and try \"startx\" I get the following: user@home-pc:~$ startx xauth: timeout in locking authority file \/home\/user\/.Xauthority xauth: timeout in locking authority file \/home\/user\/.Xauthority \/usr\/bin\/X: error while loading shared libraries: libXfont.so.1: cannot open shared object file: No such file or directory xinit: giving up xinit: unable to connect to X server: Connection refused xinit: server error xauth: timeout in locking authority file \/home\/user\/.Xauthority user@home-pc:~$ I get the same message when I try \"sudo startx\". I believe this error is due to the symbolic link that is used to identify the \"libXfont.so.1\" file, but I don't know how to fix this problem. I already tried running \"sudo apt-get update && sudo-apt-get dist-upgrade\" in hopes that this would fix or finish the upgrade and\/or installing of the security update, but this didn't fix the problem. Does anyone have any idea on what is going on or how I can fix this?"} {"id":"83191","title":"How to make `sudo` preserve $PATH?","text":"I need to run a program installed on \/opt\/godi\/sbin (a custom directory). If I add that directory to my PATH, by adding the following line to my .bashrc file export PATH=$PATH:\/opt\/godi\/bin:\/opt\/godi\/sbin then I can try to run the command just fine (except that it fails because it needs sudo). However, when I try to use sudo: sudo godi_console I get the following error sudo: godi_console: command not found Inspecting the PATH variable after using sudo reveals that its not including the same PATH I have as a normal user: $ sudo sh # echo $PATH \/usr\/local\/sbin:\/usr\/local\/bin:\/usr\/sbin:\/usr\/bin:\/sbin:\/bin Why is the PATH not the same? Am I doing something wrong? I'm on Debian Jessie and unfortunately I cannot get around the issue by passing sudo the the absolute link to godi_console because godi_console itself also depends on the PATH being correctly set."} {"id":"47044","title":"is there something like a per-user daemon?","text":"I need to run some background processes that live as long as I am logged in with a certain user. Does there exist something like a per-user daemon? I know only of global daemons that live from computer startup 'till shutdown (or manual startup\/kill). for now I made a script that checks if the process already exists and creates the process if it doesn't. This script is then run with the `nohup` command from my `.profile`. This way the process launches on startup, and is only launched once (even with multiple `rxvt` terms coming and going). Yet, it never gets killed after I log (which isn't a disaster but it is cleaner to also terminate the process)."} {"id":"47075","title":"Reorder fields\/characters with cut command","text":"> **Possible Duplicate:** > Combining 2 different cut outputs in a single command? I have One file - temp.txt - which contains ABCDF PQRST LMNOP I tried this `cut` command $ cut -c 2-5 temp.txt BCDF QRST MNOP output is right. $ cut -c 1,2,3,4 temp.txt ABCD PQRS LMNO output is right. But when I change sequence, meaning $ cut -c 2-4,1 temp.txt ABCD PQRS LMNO above output displayed. but logically output is BCDA QRSP MNOL so my question is how this happen ,any reason behind that."} {"id":"136439","title":"Is it safe to pipe the stdout of A to B in parallel","text":"I'm running `A file | B --params > file.txt`. Since I want to accelerate the processing speed, I used the `parallel -j+0< a.txt` to run 20 jobs concurrently. a.txt contains all the commands: A file1 | B --params > file1.txt A file2 | B --params > file2.txt A fileN | B --params > fileN.txt Is this way safe? Will the stdout from different programs be messed when running in parallel?"} {"id":"87474","title":"How do I create an RPM package that would fail a YUM transaction if certain creteria are met","text":"I'm trying to package a product consisting of many packages. I'm successful with writing all the spec files, the dependencies between the packages and so on. They're all installed and work fine. The one thing I do not succeed to do, is to run a pre-requisition test: In certain cases, I would like the packages not to be installed at all, and the user getting an error, explaining him what he needs to fix first, before he runs the packages installation. For example: I want to verify that the user is running in runlevel 3, and if not, abort the whole installation, and ask the user to re-install CentOS in \"Minimal\" profile - as I don't want all the extra packages that comes with \"Desktop\". (This is just an example, I have a few such tests to perform). The way I approached this problem is this: I've created a sort of 'meta package', that its name appears in all the other packages 'Requires:' directive, so it would be installed first by YUM, and in that package spec file, in the `%pre` section, I did the various tests I wanted to perform, outputting test errors when applicable, and then '`exit 1`'. The reason I chose this approach is this: \"If every package depends on this package, and this package cannot be installed, the transaction must fail, as soon as the package manager wants to install a package that depends on a package that failed installation... after all, the dependency has not been met\". In Gentoo, for example, if a package fails installation, for whatever reason, emerge stops completely - even not for dependency issues; And there's a special flag to tell emerge to continue despite the error returned from one of the packages. The problem is that indeed the package fails when the tests fails (RPM specifically says that it returned code 1), BUT... YUM doesn't really seem to care that this happens - and just continues to install everything else, including packages that depend on a package that is not installed (!). At the very end, it simply reports that all the packages were installed successfully, expect for the package that deliberately failed... I'm guessing that the reason for that is that dependency checking happens before the transaction begins, and indeed, dependencies are met from the various repositories at YUM's disposal. Still, it does not make any sense to me that if a dependency eventually failed, the installation of dependent packages would continue. Is my logic flawed? I doubt it's a bug, as someone would have encountered it by now (this is on CentOS 6.3 if it matters...) - but all my Google-foo yielded nothing. I didn't even find someone asking the same question... maybe I'm using the wrong keywords? Am I approaching this wrong way? Any other idea (that fits into RPM specs or other YUM repository magic, even at the YUM .repo file... - but all contained within the YUM infrastructure, without external scripts to run before 'yum install') - would be greatly appreciated!"} {"id":"6473","title":"Need further explanation on TIME_WAIT","text":"Hi Unix\/Linux Gurus out there! I need a solid proof that TIME_WAIT (a lot of it actually) is the real culprit in the slowdown in one of our servers. The server is hosted on Parallels Baremetal virtualization, and the actual server is a VM: CentOS5 with dual CPU and 2GB RAM. A week ago, we started to notice that it was too slow that even doing an 'ls' on a directory with just a few files in there (around 20) would need around 1.5 seconds to display the results. I tried doing `vmstat` but it doesn't seem to be even using it's swap. No bottlenecks on the network. But running `top`, you'd see java mostly hogging the resource. Java is needed since this VM is our hudson server. One of my colleagues tried checking the connections via $ vmstat -vatpno And noticed that there where a lot of connections in TIME_WAIT...around 300+. So we tried applying some of the recommendations in this page particularly that of TCP_FIN_TIMEOUT, TCP_KEEPALIVE_INTERVAL & TCP_KEEPALIVE_PROBES. The connections in TIME_WAIT went lower but still fluctuates between 220 to 280(maybe due to the fact that a new connection is added from time to time and other connections in TIME_WAIT is not yet \"timed-out\"). Perhaps we could try adding TCP_TW_RECYCLE & TCP_TW_REUSE later when we don't see any improvement. Now going back to my main question: is there a solid evidence that a lot of TIME_WAIT'ed connections eat up a lot of RAM? Thanks in advance."} {"id":"124163","title":"Create ssh user which can only access home directory","text":"I read documentation on the internet on how to create a new user with SSH access. I figured it out and to create a user is quite simple. The next step I want to take is to jail this ssh server to the `\/home\/` directory on my machine. It needs the permission to write\/create folder\/files in directories of other users (CMS system). How can I implement this?"} {"id":"15364","title":"Recursively Gziping Files (and keep original files) & Gziping Text Input","text":"I need Gzip to pre-zip some static files for a webserver I'm building. All of the files I need to gzip will be in a folder named `.cache`. Since some clients may not accept responses that are gzipped, I would like to keep all of the original files when I gzip them. Is there any command I can use to recursively gzip the files in my `.cache` folder while still keeping the original files? Will this command gzip gzipped files (ones that are postfixed with .gz already) if run on a folder with already gzipped files? While we're on the topic of gzip: I've been looking for a way to gzip text input passed to gzip instead of files. I came up with postfixing a dash on the command (like `gzip -c -`), but I'm not sure if that will work or how I use it. Can anyone explain?"} {"id":"31518","title":"Replacing\/disabling plasma desktop\/wallpaper?","text":"I'm looking for a way to replace Plasma's wallpaper (desktop?) with Compiz's (or traditional). I'm running Compiz + Emerald as WM, and this disables the ability to have different activities on different virtual desktops at all, so this is the only way to have different wallpapers on each one. I noticed on Compiz's site, it suggests using wallpapercolor= 0,0,0,0 , but I'm running 4.8 and doubt this will work. I would switch to Gnome, as I had this working on it before, but I'm not a fan of Gnome3. Any help is appreciated."} {"id":"76731","title":"Configure Clock on different port other than port 80 in CentOS","text":"I installed CentOS 6.4 & noticed that port 80 is being used by Clock application [root@l-22733-p11 logs]# lsof -i tcp:80 COMMAND PID USER FD TYPE DEVICE SIZE\/OFF NODE NAME clock-app 10418 jack 21u IPv4 408998 0t0 TCP l-22733-p11.abc.com:51095->a23-3-105-136.deploy.akamaitechnologies.com:http (CLOSE_WAIT) clock-app 20477 jack 21u IPv4 408354 0t0 TCP l-22733-p11.abc.com:51088->a23-3-105-136.deploy.akamaitechnologies.com:http (ESTABLISHED) If I kill these processes, then the clock gets killed. How can I configure this clock to run on different port than port 80? This issue was not present with earlier version of CentOS. I want to run the Tomcat server on port 80 & it is giving me bind exception since clock is running on port 80."} {"id":"127960","title":"yum is not working","text":"[root@localhost ~]# yum install percona Loaded plugins: rhnplugin Bad id for repo: not installed, byte = 3 This system is not registered with RHN. RHN support will be disabled. YumRepo Error: All mirror URLs are not using ftp, http[s] or file. Eg. 6Server.10 is not a valid release or hasnt been released yet\/ http:\/\/mirror.centos.org\/centos\/6Server.10\/addons\/i386\/repodata\/repomd.xml: [Errno 14] HTTP Error 404 : http:\/\/mirror.centos.org\/centos\/6Server.10\/addons\/i386\/repodata\/repomd.xml Trying other mirror. Error: Cannot retrieve repository metadata (repomd.xml) for repository: addons. Please verify its path and try again You have new mail in \/var\/spool\/mail\/root"} {"id":"81904","title":"Repeat each line multiple times","text":"Would like to have each line in a file repeated a fixed number of times. e.g. have each line repeated four times: a b c becomes: a a a a b b b b c c c c I've done some searching, and there are a lot of questions and answers along the lines of doing the reverse, e.g. merging duplicate lines into single lines, and maybe a few about doubling lines by printing them again. It would be easy to do this in C, but I wish I knew more about the native commands so I wouldn't have to resort to these kinds of one-off throw-aways all the time."} {"id":"115035","title":"how do i redirect output from tailf & grep to a file","text":"All I wanted is to grep for specific lines in an ongoing log and re-direct it to some file.. tailf log | grep \"some words\" Now, I want the above command output to get re-directed to some file in on- going basis.... I tried, tailf log | grep \"some words\" >> file But that doesn't seem to work. What am I missing?"} {"id":"90423","title":"Can virtfs\/9p be used as root file system?","text":"Is it possible to use a folder shared from the host to the guest via virtfs\/9p as the root file system inside the guest? Loosely related to my previous question: Can virtfs\/9p be used to share the same host folder with multiple guests?"} {"id":"13323","title":"Why can't I pgrep a process?","text":"$ ps aux | grep -i ssh USER 4364 0.0 0.0 9004 1032 ? Ss 12:20 0:00 ssh -v -fND localhost:4000 USERNAME@SERVER-IP-ADDRESS $ pgrep localhost:4000 Why doesn't this work?"} {"id":"90398","title":"Problems in installing firefox 23 on centos 6.3 ( libpangoft2-1.0.so.0)","text":"XPCOMGlueLoad error for file \/home\/xd\/firefox\/firefox\/libxul.so: libpangoft2-1.0.so.0: cannot open shared object file: No such file or directory Couldn't load XPCOM. I cannot find a way to install libpangoft2-1.0.so.0 After searching, it _seemed_ to me that the library will be in the pango package. Accordingly, I tried yum install pango but get this Package pango-1.28.1-7.el6_3.x86_64 already installed and latest version Nothing to do How do I get this installed. PS: It is surprising that centos 6.3 needs to be upgraded to install firefox 23. I had to install libstdc++.i686, dbus-glib.i686 and it seems I have to install some more to get this browser to work. Same results with chrome"} {"id":"140346","title":"Can be for multiple virtual hosts in httpd.conf?","text":"I have 5 virtual hosts in `httpd.conf`. All of them have the configuration below except for one. Order Deny,Allow Deny from all Allow from IP.ADDRESS.GOES.HERE <\/Location> I think it would be better to tell all virtual hosts to have this except for one. Currently, I am telling each virtual host one by one to have this. Is there a wild card method to apply this setting to all virtual hosts and then remove this stanza from one of the virtual hosts in `httpd.conf`?"} {"id":"152429","title":"Search in mutt by date and time","text":"I've been using `mutt` for some days now, and I think I have the basics by now. I'm able to search messages by date (`l`, `~d date ...`) but what I need is to also search by time. Is it even possible?"} {"id":"1519","title":"How do I delete a file whose name begins with \"-\" (hyphen a.k.a. dash or minus)?","text":"How do you remove a file whose filename begins with a dash (hyphen or minus) `-`? I'm ssh'd into a remote OSX server and I have this file in my directory: tohru:~ $ ls -l total 8 -rw-r--r-- 1 me staff 1352 Aug 18 14:33 --help ... How in the world can I delete `\\--help` from a CLI? This issue is something that I come across in different forms on occasion, these files are easy to create, but hard to get rid of. I have tried using backslash rm \\-\\-help I have tried quotes rm \"--help\" How do I prevent the minus (dash or hyphen) character to be interpreted as an option?"} {"id":"116462","title":"How do I delete a unfortunately named folder?","text":"In an unfortunate series of events, I happened to create a folder named `\\--bindir=`. Thing is, I cannot `cd` to him because when I try to `cd` I get this message: bash: cd: --: invalid option cd: usage: cd [-L][-P [-e]]] [dir] I also get similar messages for other binaries I am executing with that as a parameter, e.g `rm -rf`, `rmdir`, `ls` etc. I know this sounds funny, and like those epic fail stories, but I would be glad if you could propose a fix, because I'm all out of them. As a post of proof that I am not trolling or anything, here is a picture of that epic fail: ![enter image description here](http:\/\/i.stack.imgur.com\/F59yH.png)"} {"id":"39094","title":"Linux Rename File Beginning with \"--\"","text":"> **Possible Duplicate:** > How do I delete a file whose name begins with \"-\" (hyphen a.k.a. dash or > minus)? This is an awkward one, I have received some files from a windows machine which have been named things like \"----index.html\" When I try to grep hello * in a directory containing these files I get grep errors and when I try to mv ----index.html index.html there are similar errors: mv: unrecognized option '----index.html' Try `mv --help' for more information. Can anyone shed any light on this? Thanks"} {"id":"22812","title":"How can I create a empty file whose name begins with a dash?","text":"How can we create a empty file with the unix name `-stuff`. It means the name start with `-`. I tried with `touch -stuff` but it didn't work."} {"id":"18634","title":"Handling an option-like filename in the shell","text":"> **Possible Duplicate:** > How do I delete a file whose name begins with \"--\"? Due to mismatched switches when I was trying to run a command, I have a log file named `-w` in a directory. I want to see its contents with `cat` (or `less`) and then delete it. I've tried escaping it with backslashes, single-quotes, double-quotes, parentheses, and backticks, but `cat` always complains that `w` is an unknown option. How can I properly reference this file?"} {"id":"52425","title":"Why do many CLI apps take a single “--” argument?","text":"> **Possible Duplicate:** > What does “--” (double-dash) mean? There are many command line tools that take a single \"--\" argument. For example: gem install mysql -- —–with-mysql-config=\/usr\/local\/mysql\/bin\/mysql_config It seems to be used as some kind of separator. Does it have a special meaning? Is it a commonly used idiom? If so, what's its purpose? PS: I'm not talking about arguments of the form `\\--argument`, I'm talking about when you have a `\\--` followed by white characters and other arguments."} {"id":"80121","title":"How can I remove a file called \"--help\" with bash command line?","text":"I've somehow managed to create a file with the name \"--help\". If I try to remove the file using \"rm\" funny stuff happens. Please help here's a printout of the dir listing: [pavel@localhost test]$ ls -la total 3640 drwxrwxr-x. 5 pavel pavel 4096 Jun 19 18:33 . drwxrwxr-x. 6 pavel pavel 4096 Jun 9 12:23 .. -rw-rw-r--. 1 pavel pavel 1070592 Jun 12 09:40 --help"} {"id":"55969","title":"What does - mean with association to Linux files and directories","text":"> **Possible Duplicate:** > What does “--” (double-dash) mean? What does '--' (two dashes) mean with association to Linux files and directories. I've found something else but not too sure if it is correct and relates to the same thing. \"Another convention is to use '--' (two dashes) to indicate the end of flags, and the beginning of file names.\""} {"id":"59119","title":"deal with file names with \"-\" as beginning on linux","text":"> **Possible Duplicate:** > How do I delete a file whose name begins with “-” (hyphen a.k.a. dash or > minus)? I'm using linux I have some files with file names like -0fdlfld -xfifd I want to delete them using shell \"rm\" but it doesn't work are there anyways to deal with such file names? thanks!"} {"id":"52167","title":"What does \"--\" mean in Linux\/Unix command line?","text":"> **Possible Duplicate:** > What does “--” (double-dash) mean? `git diff [options] [] [--] […]` In here, how should I understand what [--] means? And when should I use it."} {"id":"24275","title":"What good are the signs '-' (minus) in any Linux\/UNIX commands?","text":"> **Possible Duplicate:** > What does \"--\" (double-dash) mean? > Single dashes `-` for single-character options, but double dashes `\\--` for > words? I was reading the man zip page and I found this examples: [...] using the command **unzip -p backup | tar xf -** When [...] For example, **tar cf - . | zip | dd of=\/dev\/nrst0 obs=16k** is equivalent to **tar cf - . | zip - - | dd of=\/dev\/nrst0 obs=16k** I' like know the minus utility of these cases. Why two minus signs are written in the third case?"} {"id":"94309","title":"zip a directory that name start with `-`","text":"How can I zip a directory like `-foo`? `$ zip \"-foo\" \"-foo\"` shows only help page. I think `-foo` is recognized as a options, but I don't know how to solve it."} {"id":"84815","title":"how to remove a file named \"-f\" from the command-line?","text":"Here are some options a) rm -f b) rm \"-f\" (double quotes) c) rm '-f' (single quotes) d) all of the above e) none of the above"} {"id":"11376","title":"What does \"--\" (double-dash) mean? (also known as \"bare double dash\")","text":"I have seen `\\--` used in the `compgen` command. For example: compgen -W \"foo bar baz\" -- b What is the meaning of the `\\--`."} {"id":"87355","title":"Why cat, grep and other commands can't understand files starting with minus sign?","text":"If I have a file which name starting with single or several minus sign, for example `\\--1` it can't be used as a parameter of many commands. Even if I run cat --1 instead of file content I get unrecognised option error message: cat: unrecognized option '--1' Same effect appears when I type cat \"--1\" cat '--1' cat \\-\\-1 nothing works. Files starting with '-' is not illegal in file system, but it is quite hard to work with them in cli and scripts. OK, in case of `cat` or `grep` I can use cat <--1 and this will work, but rm --1 won't work either and it is quite hard to substitute this command with something else. Very uncomfortable after all. Is there any universal workaround different from not using such file names? BTW, if name file is single `-` and all most of commands will understand it as `stdin`, wouldn't they? And it would be hard not to use such file names since I can't rename them all in script using `mv` command either."} {"id":"152578","title":"Why do we use double hyphen in \"tar --anchored\" and single hyphen in \"tar -b\"?","text":"Why do we use double hyphen in `tar --anchored` and single hyphen in `tar -b`? I mean to say why some command line options have single hyphen (-) while some others have double (--)? Also a `git` example: git commit --amend git commit -a"} {"id":"73138","title":"delete file with name --help.tgz","text":"I have file with name `\\--help.tgz`. I want to delete but don't know how. I tried `rm \"--help.tgz\"`, `rm \\\\-\\\\-help.tgz` and it did not work. How can I delete a file with such name?"} {"id":"59082","title":"How to remove\/rename file which contains special character eg. \"-x\" using command line","text":"> **Possible Duplicate:** > What does “--” (double-dash) mean? Can anybody explain me below things i have file named \"-xyz\". if i try to remove or move that file using command line , it's unable to move. i tried below things : [rahul@srv100 ~]# ls -lrt -- \"-xyz\" -rw-r--r-- 1 rahul rahul 0 Dec 19 08:06 -xyz [rahul@srv100 ~]# mv \"-xyz\" xyz mv: invalid option -- x Try `mv --help' for more information. [rahul@srv100 ~]# mv \\-xyz xyz mv: invalid option -- x Try `mv --help' for more information. [rahul@srv100 ~]# mv -\\xyz xyz mv: invalid option -- x Try `mv --help' for more information. [rahul@srv100 ~]# mv '-xyz' xyz mv: invalid option -- x Try `mv --help' for more information. finally i rename that file using winscp, and after trying multiple ways i got one option and it's working. mv -- '-xyz' xyz Wish the help of \"--\", i created file\/directory as below mkdir -- --abc touch -- -xyz So my Question is what is this \"--\" in bash ? Please explain."} {"id":"21852","title":"Single dashes `-` for single-character options, but double dashes `--` for words?","text":"Where did the convention of using single dashes for letters and doubles dashes for words come from and why is continued to be used? For example if I type in `ls --help`, you see: -a, --all do not ignore entries starting with . -A, --almost-all do not list implied . and .. --author with -l, print the author of each file -b, --escape print octal escapes for nongraphic characters --block-size=SIZE use SIZE-byte blocks -B, --ignore-backups do not list implied entries ending with ~ ... I tried googling `\\- and -- convention` even with quotes with little success."} {"id":"3877","title":"How can I grep through files whose name begins with `-`?","text":"I've tried this. grep -r thanks * slave-iv grep: invalid option -- '@' Usage: grep [OPTION]... PATTERN [FILE]... Try `grep --help' for more information. Here's what the directory looks like. They're log files from pidgin. ls -1 -100000139702926@chat.facebook.com -100001138571192@chat.facebook.com -1021869012@chat.facebook.com -12120618@chat.facebook.com -1251570038@chat.facebook.com -1269333626@chat.facebook.com -1394365872@chat.facebook.com -1657581332@chat.facebook.com -211203163@chat.facebook.com -505152641@chat.facebook.com -549333601@chat.facebook.com -557177029@chat.facebook.com -573222477@chat.facebook.com -584051302@chat.facebook.com -65000319@chat.facebook.com -663869224@chat.facebook.com -664953132@chat.facebook.com -755682783@chat.facebook.com"} {"id":"28701","title":"Accidently created a file called -X, how can I delete it?","text":"> **Possible Duplicate:** > How do I delete a file whose name begins with \"-\" (hyphen a.k.a. dash or > minus)? Like an idiot, I ran this command: tar -cf -X awstats-icon icon tarfile.tar . I was trying to use the -X switch to exclude awstats-icon and icon directories. Now I have a large file named -X and I cannot seem to delete it. I tried using: rm -X rm `-X` rm '-X' However none of these have worked. Any suggestions?"} {"id":"136642","title":"How to make a TCP socket time out","text":"For network catastrophe simulations of our server environment, we are looking for a way to intentionally timeout a TCP socket. Are there any simple ways for existing sockets? Also, little C test-case program would be a plus. We have already tried putting down network interfaces during TCP buffer reading, and reading from disconnected mounted resources (samba). Out test server is Ubuntu 12.04.4."} {"id":"44713","title":"Can I configure bash to execute \"clear\" before every command typed in the console?","text":"I would like to configure bash to execute `clear` command every time I type some command in the terminal (before executing my command). How can I do that? I'm using Debian Linux."} {"id":"44716","title":"awk-Printing column value without new line and adding comma","text":"input.txt EN1 EN2 EN3 EN4 EN5 output EN1,EN2,EN3,EN4,EN5 I have tried awk.But it is not printing with comma awk 'BEGIN { OFS = \",\"} { printf $1}' input.txt I have GNU Awk 4.0.0 version"} {"id":"118883","title":"Basic rsync command for bit-identical copies","text":"As far as I undstand, the following command: sudo rsync --delete -azvr \/home\/oshiro\/Desktop\/source\/ \/home\/oshiro\/Desktop\/destination Is this all I need to create a simple synchronisation of files from 1 location to another? Or does the above command do anything more in the background which I don't know about? For example, does it create some sort of versioning, where I can specify a past time to get files how where were in the passed? That's a feature which I do not want to enable at this stage. All I want is bit-identical copy of the files from 1 location to another. Can I get rid of any of those parameters or do I need to add further parameters to make the copies bit-identical with no versioning. Basically, I don't want to create backups how the mac time machine backup system creates backups."} {"id":"85164","title":"Privileges on Linux?","text":"In Linux, I had created a userid. After creating this, I encountered a problem that the .EXE Files are not opened on simple click. They seem to be not privileged for my user account. How can I overcome from this?"} {"id":"119502","title":"Installing extra packages of Debian Wheezy from terminal (after a net install)","text":"I've installed the small image of Debian Wheezy from here but had to skip the mirror install of the extra packages. Now that I have the command line how do I get the rest of the stuff? When I tried `apt-get install ssh-server`, it told me to insert the CD."} {"id":"129105","title":"Most reliable way to check for connected client?","text":"I have an embedded Linux OS developed from scratch using Yocto. This talks to a Windows XP\/7 client. The embedded OS runs a DHCP server and gives an address to the client. The problem is that the client is \"locked down\" and blocks many standard ports and methods of doing things. If the client is detected present by the embedded system, my startup script will launch the server that tests the system; otherwise I kexec to another OS. **What is the best way to detect if a client connected over Ethernet is there on startup (in Linux) without adding significant bootup time to the system?** Here are the things I've tried and what does not work: 1. ICMP packets are blocked on the client side so traditional pinging does not work 2. arping works (as well as nmap using ARP scan) but Windows clients try to be \"smart\" and dial out so it takes 20-25 seconds to actually establish the connection, which is unacceptable; ideally, it should detect something in 5-10 seconds. Is there anything I can set on the server side to speed this up? It always boots into this partition first so the quickest solution is the best solution. 3. ifplugd, ethtool, netplugd, and probing \/sys\/class\/net\/eth0\/operstate and \/sys\/class\/net\/eth0\/carrier do not work because the Ethernet port on the embedded system is connected to an internal switch so it is always \"up\" and \"connected\" hardware wise 4. A future solution will likely use Bonjour on the client side and Avahi on the server so we can have a connectionless protocol, but this will take time to implement and I need an interim solution because any software we add to the client side takes a very long time to get approval for. Again, I can't do anything on the client side because these units are configured by another company and locked down. So what else can I try on the server to detect if the client is present?"} {"id":"93631","title":"Extract audio from video in Linux with a GUI program?","text":"When I use Thunar I like adding to custom actions command lines like those presented here, here and here to extract audio from videos. I mean **without transcoding\/altering the sound, just putting it out of the video** (a flv or mp4 video, for example, is a aac audio - which cannot be played as such, but rapped into a m4a, like in the the command in the links posted. a webm video has a ogg audio which needs to be extracted.) Now, I am using elementayOS, and will not use Thunar, nor Nautilus, just Pantheon-Files. I want to know if there is a GUI solution to achieve this."} {"id":"134165","title":"Hidden password is being displayed when invoking the su command?","text":"This is the first time it has happened to me where I am using the su command and it actually displays the password on the terminal and doesn't stay hidden. Here is my code snippet: sshpass -p \"password\" ssh -q username@74.11.11.11 \"su -lc 'mkdir temp\/'\" Code explanation: I am accessing a remote server and trying be root on that server to create a folder. In doing so I have to use the su command and it prompts me for the password. When I enter the password, it gets displayed and doesn't stay hidden."} {"id":"1680","title":"using cross-compiled Valgrind","text":"I have downloaded the sources from the Valgrind trunk and built it for using on an embedded Linux system(Montavista Linux) powered by an ARM926(ARMv5t architecture). Everything went well until I tried to run it to check some application I've made; Valgrind tells me: _\"valgrind: failed to start tool 'memcheck' for platform 'arm-linux': No such file or directory\"._ Trying to run any other tool gives the same message. For _make install_ I used the --prefix option pointing to the embedded system's filesystem which is mounted through NFS(e.g. --prefix=\/home\/NFS_mounted\/opt\/valgrind). I checked the installation location and the _lib_ directory there contains the proper tools; I also checked the corresponding pkgconfig file for Valgrind and it seems to be OK so I'm kind of clueless right now and can't figure out what's going wrong. 2 questions: 1. Is it correct to use\/install a cross-compiled Valgrind like that? Maybe I'm doing something wrong regarding the setup, or maybe there is something involving the host system that I'm missing(gdb\/gdbserver like). 2. Has anyone tried running it on ARM architectures? I'm aware that the support is fairly recent so I'm wondering if I could get decent results."} {"id":"111603","title":"How to access Win7 on a dual boot machine?","text":"I've been dual booting Win7 and Ubuntu for about 4 months and I got on it today to change the default boot on grub, because my girlfriend kept getting locked out when it reboots and, by default, goes to the Ubuntu partition. I tried using the command promt. I used the command found here which was `sudo gedit \/etc\/default\/grub` That didn't appear to do anything so I changed the grub using the file manager and changed \"Default grub=4\" which, is the boot I was supposed to use... This led to my Windows 7 partition dissapearing from the boot list, somehow, although all files are still showing up on the OS (checked through Ubuntu) and System Recovery shows my latest restore, attempted to restore and said it should be working.. So I'm assuming its hidden in some way? I'm using BT5R3. `\/etc\/default\/grub:` # If you change this file, run 'update-grub' afterwards to update # \/boot\/grub\/grub.cfg. GRUB_DEFAULT=4 #GRUB_HIDDEN_TIMEOUT=0 GRUB_HIDDEN_TIMEOUT_QUIET=true GRUB_TIMEOUT=10 GRUB_DISTRIBUTOR=`lsb_release -i -s 2> \/dev\/null || echo Debian` GRUB_CMDLINE_LINUX_DEFAULT=\"text splash vga=791\" GRUB_CMDLINE_LINUX=\"\" # Uncomment to disable graphical terminal (grub-pc only) #GRUB_TERMINAL=console # The resolution used on graphical terminal # note that you can use only modes which your graphic card supports via VBE # you can see them in real GRUB with the command `vbeinfo' GRUB_GFXMODE=1024x768 # Uncomment if you don't want GRUB to pass \"root=UUID=xxx\" parameter to Linux #GRUB_DISABLE_LINUX_UUID=true # Uncomment to disable generation of recovery mode menu entries #GRUB_DISABLE_LINUX_RECOVERY=\"true\" # Uncomment to get a beep at grub start #GRUB_INIT_TUNE=\"480 440 1\" Shell history: 1 exit 2 startx 3 apt-get software center 4 apt-get software-center 5 sudo apt-get software-center 6 install software-center 7 mkdir \/opt\/java 8 mv -f jre1.70_05\/ \/opt\/java 9 tar xzvf jre-7u45-linux-i586.tar.gz. 10 tar: tar xzvf jre-7u45-linux-i586.tar.gz 11 tar xzvf jre-7u45-linux-i586.tar.gz 12 apt-get install synaptic 13 help 14 install synaptic 15 apt-get synaptic 16 apt-get install synaptic 17 lspci -v 18 help] 19 help 20 help mapfile 21 help 22 info strict refs 23 startx 24 edit grub 25 search grub 26 apt-get install sphinxsearch 27 search grub 28 edit grub boot 29 find grub 30 startx 31 startsx 32 startx 33 -terminal 34 terminal 35 apt-get install rsplib-tools 36 --fix-missing 37 apt-get update 38 terminal 39 apt-get install rsplib-tools 40 terminal 41 update grub 42 update-grub 43 open partition manager 44 open 45 help 46 search partition manager 47 help 48 find partition manager 49 find partitionmanager 50 startx 51 find gparted 52 get gparted 53 get Gparted 54 get-apt Gparted 55 X-AppInstall-Package=gparted 56 help 57 startx 58 run history 59 history $ sudo grub-mkconfig > \/dev\/null Generating grub.cfg ... Found linux image: \/boot\/vmlinuz-3.2.6 Found initrd image: \/boot\/initrd.img-3.2.6 Found memtest86+ image: \/boot\/memtest86+.bin done $ sudo fdisk -l Disk \/dev\/sda: 1000.2 GB, 1000204886016 bytes 255 heads, 63 sectors\/track, 121601 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical\/physical): 512 bytes \/ 512 bytes I\/O size (minimum\/optimal): 512 bytes \/ 512 bytes Disk identifier: 0xb3b6d9a6 Device Boot Start End Blocks Id System \/dev\/sda1 * 1 13 102400 7 HPFS\/NTFS Partition 1 does not end on cylinder boundary. \/dev\/sda2 13 83647 671785946 7 HPFS\/NTFS \/dev\/sda3 83647 119927 291422209 5 Extended \/dev\/sda4 119927 121577 13249536 7 HPFS\/NTFS \/dev\/sda5 83647 118706 281610240 83 Linux \/dev\/sda6 118706 119927 9810944 82 Linux swap \/ Solaris"} {"id":"131346","title":"How do I replace symlinks in a path with their target within a script?","text":"I want to extract part of a file path up to a symlink, use `readlink` to find the path to the link target, and then replace the link name with the actual path. This has to be done within a script. For example, say I my original path is: \/path\/to\/*latest*\/files\/test.txt # where *latest* is the symlink Then I run `readlink` to reveal the target of the symlink: readlink \/path\/to\/*latest* ver2 The output of the script would then be \/path\/to\/ver2\/files\/test.txt NOTE that the original path could have several links so I don't want to run readlink -f on the whole path and file name. i.e. readlink -f \/path\/to\/latest\/files\/test.txt \/data\/today\/to\/v2\/files\/test.txt"} {"id":"111637","title":"ls -l --group-directories-first (act on symlinks as well)","text":"`ls` option `\\--group-directories-first` causes directories to be listed on the top, which makes the output of `ls` nice and clean: ls -l --group-directories-first However, it does not act on `symlinks`, which are actually `symlinks` to directories. There is a possibility to use ls -l -L --group-directories-first which will list both kind of directories on top, but will not distinguish between proper directory and symlinked directory, which is again confusing. Can `ls` display symlinked directories on top, while still keeping them distinct from regular directories? **EDIT:** I am using `bash`."} {"id":"154966","title":"Characters are encoded twice when I ask SSH to reattach a screen session on the remote host","text":"I want to be able to SSH to a remote host and restore a screen session with one command. Both hosts use UTF-8 locale. My problem is that then, inside the screen session, characters are encoded twice. As stated in other related questions, I need to pass the `-t` option to `ssh` command in order to allocate a pseudo-tty for an interactive session: http:\/\/stackoverflow.com\/questions\/474967\/automatically-or-more-easily- reconnect-to-a-screen-session-after-network-inter Thus the command I use is `ssh -t remotehost screen -dr`. When I restore screen this way, the characters I send from the keyboard are encoded twice, and the characters I receive from the remote host are decoded twice: localhost % ssh -t remotehost screen -dr remotehost % echo ä | hexdump -C 0000000 c3 83 c2 a4 0a 0000005 This doesn't happen if I first connect to the remote host and then restore screen: localhost % ssh remotehost remotehost % screen -dr remotehost % echo ä | hexdump -C 0000000 c3 a4 0a 0000003 What I mean by \"characters are encoded twice\" is that normally I see the same output if I type: localhost % echo ä | iconv -f ISO-8859-1 -t UTF-8 | hexdump -C 00000000 c3 83 c2 a4 0a 00000005 The pseudo-tty allocation alone doesn't cause the problem. I've tried: localhost % ssh -t remotehost \/bin\/zsh remotehost % screen -dr remotehost % echo ä | hexdump -C 0000000 c3 a4 0a 0000003"} {"id":"126173","title":"what programming language required to develop linux O.S?","text":"I want to know, what programming language is required to develop Linux operating system?. How to start and what are the required concepts ? I want to create my own O.S to my PC. I have knowledge in `C` and `C#.NET` as basic Programmer. Please suggest me the way."} {"id":"17040","title":"How to diff files ignoring comments (lines starting with #)?","text":"I've two configuration files, the original from the package manager and a customized one modified by myself. I've added some comments to describe behavior. How can I run `diff` on the configuration files, skipping the comments? A commented line is defined by: * optional leading whitespace (tabs and spaces) * hash sign (`#`) * anything other character The (simplest) regular expression skipping the first requirement would be `#.*`. I tried the `\\--ignore-matching-lines=RE` (`-I RE`) option of GNU diff 3.0, but I couldn't get it working with that RE. I also tried `.*#.*` and `.*\\\\#.*` without luck. Literally putting the line (`Port 631`) as `RE` does not match anything, neither does it help to put the RE between slashes. As suggested in “diff” tool's flavor of regex seems lacking?, I tried `grep -G`: grep -G '#.*' file This seems to match the comments, but it does not work for `diff -I '#.*' file1 file2`. So, how should this option be used? How can I make `diff` skip certain lines (in my case, comments)? Please do not suggest `grep`ing the file and comparing the temporary files."} {"id":"3586","title":"What do the numbers in a man page mean?","text":"So, for example, when I type `man ls` I see `LS(1)`. But if I type `man apachectl` I see `APACHECTL(8)` and if I type `man cd` I end up with `cd(n)`. I'm wondering what the significance of the numbers in the parentheses are, if they have any."} {"id":"18081","title":"What are the difference between man1, man2, man3... folders?","text":"> **Possible Duplicate:** > What do the numbers in a man page mean? What are the differences between man _X_ pages? Why are they separated?"} {"id":"153172","title":"man pages: meaning of '2' in STAT(2)?","text":"What's the significance of the number, like the `2` in `STAT(2)`, seen in man pages? For example, `man 2 stat` yields a man page with `STAT(2)` at the top and a description that begins, `The stat() function...`, while `man stat` yields a man page with `STAT(1)` at the top and a description that begins, `The stat utility...` I noticed the page for `STAT(1)` says `BSD General Commands Manual`, while that for `STAT(2)` says `BSD System Calls Manual`, so maybe the number is a code for the type of command?"} {"id":"30983","title":"What is the significance of the \"1\" in ls(1)?","text":"> **Possible Duplicate:** > What do the numbers in a man page mean? I see functions referred to with numbers in the parenthesis in documentation. What does this mean? It takes one argument? Sorry, noob."} {"id":"63677","title":"What does the number mean in a man page?","text":"> **Possible Duplicate:** > What do the numbers in a man page mean? If I type`man ls`, I see`LS(1)` in the top left and top right corners of the manpage. I also see programs on the internet being refered to this way. ex. `man(1), xman(1x), apropos(1), makewhatis(8) and catman(8).` What are these numbers (and in some cases letters)?"} {"id":"55116","title":"What means the \"integer argument\" in system call descriptions?","text":"> **Possible Duplicate:** > What do the numbers in a man page mean? All system calls described in manpages have an associated number such as `exec(3)`. What is the meaning of this number?"} {"id":"36274","title":"About the command and the number in the man","text":"> **Possible Duplicate:** > What do the numbers in a man page mean? such as: http:\/\/www.postfix.org\/qmgr.8.html The qmgr(8) daemon awaits t what's the meaning of 8? just don't know it."} {"id":"9838","title":"What is the meaning of the number part of man pages?","text":"> **Possible Duplicate:** > What do the numbers in a man page mean? As in the \"(1)\" in git-svn(1)"} {"id":"46670","title":"Deleting many files except one type","text":"> **Possible Duplicate:** > Deleting all files in a folder except files X, Y, and Z I am writing a script to compile many `.tex` files. After that, many auxiliaries files were created. So, I would like to remove them at the end of the script. I tough to use `rm $file.xxx` but I would have to write all the extensions by hand, since that I want to keep my source file and the pdf output, so I can not use the * to delete all. How to delete all the extensions except those with extension `.tex\/.pdf`? Thanks."} {"id":"118718","title":"How to copy files *to* a camera?","text":"I'd like to copy a firmware update file to my Canon 7D camera. After it was auto-mounted by `thunar` + `thunar-volman` + `gvfs-gphoto2` I tried the following: $ cp eos7d-v205-win\/7D000205.FIR \/run\/user\/1000\/gvfs\/gphoto2\\:host\\=%5Busb%3A001%2C012%5D\/ $ echo $? 0 $ ls \/run\/user\/1000\/gvfs\/gphoto2\\:host\\=%5Busb%3A001%2C012%5D\/ DCIM MISC So that went into a black hole. * * * The first time I try to copy it with `Ctrl`-`c` and `Ctrl`-`v` prints the following error message when pasting the file: > Error writing file. > > -108: No such file or directory. > > Do you want to skip it? If I try again after that it simply crashes: $ thunar Segmentation fault (core dumped) $ echo $? 139 * * * The Gphoto 2 shell has an _undocumented_ `put` function which I also tried: $ sudo umount \/run\/user\/1000\/gvfs $ gphoto2 --shell gphoto2: {...\/eos7d-v205-win} \/> help put Help on \"put\": Usage: put [directory\/]filename Description: Upload a file * Arguments in brackets [] are optional So this function takes a **single** argument with an **optional** directory. Weird, but should be doable. Some attempts at making it work: $ gphoto2 --shell gphoto2: {...\/eos7d-v205-win} \/> ls store_00010001\/ gphoto2: {...\/eos7d-v205-win} \/> put 7D000205.FIR *** Error *** You need to specify a folder starting with \/store_xxxxxxxxx\/ *** Error (-1: 'Unspecified error') *** gphoto2: {...\/eos7d-v205-win} \/> put \/store_00010001\/7D000205.FIR *** Error *** PTP Access Denied *** Error (-1: 'Unspecified error') *** gphoto2: {...\/eos7d-v205-win} \/> put \/store_00010001\/MISC\/7D000205.FIR *** Error *** PTP Access Denied *** Error (-1: 'Unspecified error') *** Maybe it's not supported? * * * Digikam has an upload feature, but that just reported ' _Failed to upload file \"7D000205.FIR\"._ ' Running it from the shell produced no more information. Too many WTFs per minute. **What do I need to do to copy a file to my camera in Arch Linux?**"} {"id":"80734","title":"Creating deb and rpm from the same source","text":"Is there a standard for source packages to be able to build rpms, debs (and perhaps others) without too much customization? I'm talking mostly about Python, PyQt programs."} {"id":"110271","title":"LFSH ... what is '\/lib\/init' for?","text":"I'm trying to understand the init\/boot process. My system is LMDE, so I presume it will be pretty much standard Debian in that regard. I believe I more or less understand the basics of the init scripts, `\/etc\/init.d\/`, `\/etc\/defaults\/` and so on, but there's this strange use of `\/lib\/init\/` for a few of the scripts that look to me like they should be in \/etc\/init.d\/ with all the rest. Can someone explain the logic of this? There's lots of discussion of `\/lib\/init\/rw\/` but none that I can find about `\/lib\/init\/` itself. This is all that's in there: drwxr-xr-x 3 root 4.0K 2013-12-25\/\/15:20:41 rw\/ -rw-r--r-- 1 root 1.3K 2014-01-21\/\/07:37:07 vars.sh -rw-r--r-- 1 root 3.3K 2014-01-21\/\/07:37:07 tmpfs.sh -rw-r--r-- 1 root 741 2014-01-21\/\/07:37:07 swap-functions.sh -rw-r--r-- 1 root 17K 2014-01-21\/\/07:37:07 mount-functions.sh -rw-r--r-- 1 root 4.4K 2014-01-21\/\/07:37:07 bootclean.sh Running `dpkg-query -S \/lib\/init` returns: initscripts: \/lib\/init"} {"id":"103045","title":"Use an alias with watch command","text":"The post repeat command every x seconds shows that `watch` is the utility that is useful for the invoking a command at fixed interval repeatedly. Now, I have very long commands, and have used aliases to group them logically to get a quicker output, like $ alias c1='grep \"checking for\" file1.log' $ alias c2='grep \"validated\" file1.log' $ (echo \"Checking: \"`c1`) && (echo \"Validated: \"`c2`) The output of 3rd command is like Checking: 100 Validated: 80 It is a long running process, I need to check the status of this process, to get the mentioned counts. But invoking the above with `watch` gives error > $ watch '(echo \"Checking: \"`c1`) && (echo \"Validated: \"`c2`)' > c1 command not found I can put the entire command in there and remove the aliases, but is there any other work-around to get the aliases working with `watch` command? **Note:** Did quickly go through the man page for `watch`, but didn't find any reference to `alias` in specific."} {"id":"79669","title":"GPU not listed in lspci after SysRQ reboot","text":"I have my Ubuntu Server machine with XFX 7970 GPU in it, and sometimes, when ATI driver fails, I have to reboot it manually. When I'm trying to reboot the machine using SysRQ, the system reboots well, but GPU is not listed in lspci output. It appears again after hand reboot. Is there a way to reboot it without hand reboot remotely?"} {"id":"155371","title":"remote desktop on host","text":"I have a host and I need people from Europe to access application on its desktop. So far I have told them to use `ssh -x -C user@host` and then launch an application with `application&` to get the app transferred to their desktop. That works, but they were complaining about the speed. Now I thought `VNC` might work better. so I installed a vncserver `Xvnc4` and I can connect to `127.0.0.1:5902` from the local shell but how can I tunnel this through ssh from external?"} {"id":"155375","title":"How to modify the Quadro driver to install on a GeForce","text":"I have a consumer GeForce GTX680. It's professional equivalent is Quadro K5000. Both cards have exactly the same chip inside (GK104), the hardware is nearly identical. I need to install the Quadro driver instead of Geforce so I can have access to quad-buffered stereo system-wide. Windows users can force a Quadro driver by unpacking it and modifying one of the *.inf files. I managed to unpack the linux driver with: sh NVIDIA* --extract-only I can see two files reffering to specific device IDs of cards - monitoring.conf and pci.ids But suspect that on Linux we might have just one generic driver for all cards as I downloaded both the GTX680 driver and K5000 driver and both appear to be the same from inside. So the method for Linux might be different. Does anybody know how to modify the official driver or manually choose the one for K5000 from the files?"} {"id":"51984","title":"Why am I observing different behaviour of echo?","text":"I am a bash beginner and observed the below behavior of echo #!\/bin\/bash x=\" hello\" echo $x echo \"$x\" Now when I run the above code I get ronnie@ronnie:~$ bash test.sh hello hello ronnie@ronnie:~$ So, can someone explain to me why `whitespace` in first case is not present in output and also points me to the documentation where this behavior is defined."} {"id":"105144","title":"udev rule for assigning known symlinks for identical usb serial devices","text":"I have two (and possibly in the future, more) USB serial devices which are identical (down to the serial number, unfortunately) - they're actually BTC miners. Currently they end up as `ttyUSBX` where X is 0, 1 or 2, as there's another unrelated USB serial device as well (which need not be worried about here). I would like to write a udev rule which will assign them predictable names within `\/dev`, like `\/dev\/miner0` where the zero is an incrementing integer. I don't care which of them ends up as which, but I do need them to be within a predictable range which won't change. Currently I have this: SUBSYSTEM==\"tty\", ATTRS{idVendor}==\"10c4\", ATTRS{idProduct}==\"ea60\", SYMLINK+=\"miner%n\" This is pretty close, as I end up with names like I want. The only problem is, since the miners and the third device can sometimes appear in a random order, I might end up with two of `miner0`, `miner1` and `miner2`, but I never know which two (without manually looking). If I add any more non-miner usb serial devices (which is a possibility), it'll exacerbate the problem. I had found reference to `%e` which looked like it did exactly what I wanted, but it doesn't seem to exist anymore. How might I give these devices predictable names? I'd prefer not to tie them to their location on the USB bus as well if possible. * * * **Further information\/background** It's worth mentioning that I'm not that bothered what the names are, just that they be known and unchanging even if\/when the device gets plugged into a different USB socket. I would simply forget the whole udev thing and use entries in `\/dev\/serial\/by-id`, but as they have the same serial number, there's only one of them in there! It's also worth mentioning that the reason for doing this is that the mining software needs to be told a list of devices to probe and find. I can just have it do all (it basically just finds all valid miners in the `ttyUSB*` range), but that annoys the non-miner device. So I need the names of the miners known ahead of time so I can configure it to use just those. Sadly it won't accept a wildcard (so just telling it to use `\/dev\/miner*` seems to be out of the question), hence this problem."} {"id":"105149","title":"Where is my Cursor?","text":"My OS is Ubuntu 13.10, I use the following code to remove the KDE desktop installed before: sudo apt-get purge kde* And then use the following code to install GNOME 3.10: sudo add-apt-repository ppa:gnome3-team\/gnome3-next && sudo apt-get update sudo apt-get update && sudo apt-get install gnome-shell ubuntu-gnome-desktop sudo add-apt-repository ppa:gnome3-team\/gnome3-staging sudo add-apt-repository ppa:gnome3-team\/gnome3 sudo apt-get update && sudo apt-get dist-upgrade After all these were done, I restart my computer and can not find my cursor in Unity, while all things are OK in GNOME. I want to find the cursor in Unity, what should I do?"} {"id":"105148","title":"Quoting in command substitution","text":"The command pdftk FileOne.pdf \"File two.pdf\" output Combined.pdf works as expected, merging PDF's One and Two. However, if I put the filenames in a file FileOne.pdf \"File Two.pdf\" and then use pdftk $(< Files.lst) output Combined.pdf I get the error messages Error: Failed to open PDF file: \"File Error: Unable to find file. Error: Failed to open PDF file: Two.pdf\" Obviously, `pdftk` is seeing the quotes, so I don't understand how it can distinguish the two cases (which is why I am posing the question in this forum). For the record, I am using MKS Toolkit Korn shell, invoked from Emacs. I get the same in the Cygwin bash shell."} {"id":"107807","title":"How to configure fonts on a remote X connection (XDMCP vs. ssh)?","text":"Connecting to a remote Solaris 10 system over X11 I observe inconsistent behavior regarding the used fonts. I am connecting from a Cygwin\/X system. When I connect using ssh forwarding like this $ ssh -Y mymachine.example.org fonts work as expected, i.e. the rendering is very nice and programs seem to find all kind of different fonts (e.g. gvim or emacs). When I connect to the same machine via XDMCP (to the stock blue Solaris 10 login manager screen) and login there seems only 1 fixed size font available. An Emacs from OpenCSW even fails to execute because it can't find the fonts it needs. It prints that it can't find a font using following specification: -dt-interface user-medium-r-normal-m I establish the XDMCP connection like this: $ XWin -query mymachine.example.org -from mywindowsclient.example.org My objective is no to get also proper fonts for the XDMCP use case. How can I investigate this issue? Can I duplicate some configuration which is implicitly used with `ssh -Y` for the XDMCP case? How is the font-thing usually setup during ssh-X11-forwarding?"} {"id":"116845","title":"rs232 to usb not working","text":"**I also asked this question on AskUbuntu but there nobody comments on it** I have a konig rs232 serial to usb adapter (no FTDI chip), but when I try to connect to a cisco switch\/router (via Putty, screen, minicom....), sometimes it just shows nothing (But it is connected because when i remove the USB it says disconnected, and sometimes it show garbage. But it also can just work ok, for about 5-10 seconds, after that it just freezes. I checked the adapter on an other linux pc (slackware), and here it just works flawless. I'm running ubuntu 13.10 (3-11-0-15-generic , Lenovo laptop) lsusb Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 001 Device 025: ID 0cf3:3004 Atheros Communications, Inc. Bus 001 Device 032: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port Bus 001 Device 003: ID 5986:0295 Acer, Inc Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub Bus 001 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 003 Device 002: ID 058f:6366 Alcor Micro Corp. Multi Flash Reader Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub dmesg | grep 2303 [22933.099512] pl2303 1-1.2:1.0: device disconnected [22934.926969] usb 1-1.2: New USB device found, idVendor=067b, idProduct=2303 [22934.927665] pl2303 1-1.2:1.0: pl2303 converter detected [22934.929688] usb 1-1.2: pl2303 converter now attached to ttyUSB0 **edit** I borrowed another converter from a friend (this one does have a FTDI chip), but it still doesn't work. I forgot to mention that i tried it on USB 2.0 as well as 3.0 **BUMP**"} {"id":"57006","title":"awk high precision arithmetic","text":"I am looking for a way to tell awk to do high-precision arithmetic in a substitution operation. This involves, reading a field from a file and substituting it with a 1% increment on that value. However, I am losing precision there. Here is a simplified reproduction of the problem: $ echo 0.4970436865354813 | awk '{gsub($1, $1*1.1)}; {print}' 0.546748 Here, I have a 16 digit after decimal precision but awk gives only six. Using printf, I am getting the same result: $ echo 0.4970436865354813 | awk '{gsub($1, $1*1.1)}; {printf(\"%.16G\\n\", $1)}' 0.546748 Any suggestions on to how to get the desired precision?"} {"id":"57001","title":"bash scripting - Any function to escape character?","text":"I am trying to automate some of my stuff and facing a issue, the problem boils down to escaping the value that is being passed as a argument to the script. ### myScript.sh #!\/bin\/bash loadPatch -name $1 where `$1` is the first argument and can have value like 'p12.9.5-bug34' Running it as myScript p12.9.5-bug34 produces no result. I checked with `echo $?` the output was successful, but the required operation didn't happen. I replaced `$1` with this actual value to test in the script and it worked as expected. There is no way for me to put a print statement in `loadPatch` to verify what arguments it has received. So, I envisage there is some escaping problem here and hence need to know, is there any function\/utility which I could use to escape the argument before using? Please let me know if you see any other error with this?"} {"id":"57003","title":"How do I stop Gthumb from opening when I plug in my camera?","text":"I'm using Linux Mint 13. Whenever I plug my camera into the USB port, Gthumb opens _and_ a directory window opens. I can't find config files, autoplay options or an option in the preferences of Gthumb to change this. How can I stop Gthumb opening when I plug in my camera? O_O"} {"id":"107703","title":"Why is my PC freezing while I'm copying a file to a pendrive?","text":"I have a really strange situation here. My PC works fine, at least in most cases, but there's one thing that I can't deal with. When I try to copy a file from my pendrive, everything is ok -- I got 16-19M\/s , it works pretty well. But when I try to copy something to the same pendrive, my PC freezes. The mouse pointer stops moving for a sec or two, then it moves a little bit and it stops again. When something is playing, for example, in Amarok, the sound acts like a machine gun. The speed jumps from 500K\/s to 15M\/s, average 8M\/s. This occurs only when I'm copying something to a pendrive. When the process of copying is done, everything backs to normal. I tried everything -- other pendrive, a different USB port on front panel or those ports from back, I even changed the USB pins on motherboard (front panel), but no matter where I put my USB stick, it's always the same. I tried different filesystem -- `fat32`, `ext4`. I have no problem with the device on Windows, on my laptop. It has to be my PC or something in my system. I have no idea what to look for. I'm using Debian testing with standalone Openbox. My PC is kind of old -- Pentium D 3GHz, 1GiB of RAM, 1,5TB WD Green disk. If you have something that would help me to solve this issue, I'd be glad to hear that. I don't know what else info I should provide, but if you need something, just ask, I'll update this post as soon as possible. I tried to reproduce this problem on ubuntu 13.04 live cd. I mounted my encrypted partition + encrypted swap and connected my pendrive to a usb port. Next I tried to start some apps, and now I have ~820MiB in RAM and about 400MiB in SWAP. There's no problem with copying, no freezing at all, everything is as it should be. So, it looks like it's a fault of the system, but where exactly? What would cause such a weird behavior?"} {"id":"61940","title":"Introspection of the interface of a shared library","text":"I have a problem with a library I'm working with for the first time ( it's Boost.Python but my question is much more general than this case). As a consequence I need to check what is the interface of the library I have built: so as to check if I have at least built everything correctly. _(Python is complaining that he doesn't see my module, though I put the .so renammed in .pyd into its PYTHONPATH, so there's something wrong in my library)_ I need to know all the names of the exposed functions of my .so library, and their prototype if possible. Are there commands or package that I could install to achieve something like this ?"} {"id":"39237","title":"'mv' equivalent of drag and drop with replace?","text":"In a GUI environment, a drag-and-drop with replace will replace files and entire directories (including contents) with whatever is being copied in. Is there a way to accomplish this same intuitive result with the 'mv' command?"} {"id":"81674","title":"What does `l` mean in an `ls` listing?","text":"When I run `ls -adl .*` in one of my directories, I get a file that has this listing: lrwxrwxrwx 1 user group 43 Jul 3 16:25 .#filename.py -> person@computer.edu.4018:1372874769 The filename and URL-looking thing are highlighted in red. **What does the`l` mean in `lrwxrwxrwx`? What kind of file is this?**"} {"id":"78295","title":"CentOS no network interface after installation in VirtualBox","text":"I have Ubuntu 12.10 on which i installed virtual box on which I setup centos 6.4 i386. On Ubuntu I have: 3.5.0-17-generic kernal running. On virtual box I install centos 6.4 and everything works fine, however when i boot into VM machine, there is only on loopback interface. Nothing else. I tried to manually add ifcfg-eth0 file but nothing happens. On VM settings i have added NAT and HostOnly interfaces but whenever I boot into centos there is just lo interface. What should I do?"} {"id":"153432","title":"User input in linux bash to check against a list and respond with result","text":"I am trying to get bash to ask for a user input from read and to check against a file or list of files, then respond with the result from that chesk. This is as far as I have gotten as of yet... read -p \"what are we looking for?\" RESP if [ \"$RESP\" = sed -n ${some line from inside file} .\/file | then do \"returned variable from file\" else echo \"You need more bash programming\" I know I am very new here but I cant figure it out, what ever the response is needs to be check against a file (what inside the file)- line by line then return an associated variable of that line say like \"RESP\"=line 3(or any line that matches) of .\/this_file return \"var1\" of that line Do \"var1\" fi Is this the way to do this what would this code look like in simple bash I am so lost please help example: line1:\"please open google\" \"var1[open http:www.google.com] pass \"var1\" to bash"} {"id":"64530","title":"How to copy Big files on other Linux Server Independent of TTY","text":"Actually i was trying to copy all the files in another director. Total size of the file is 188GB so its going to take a time. Im trying to copy for Linux server A to B using this command nohup scp Files-from-Server-A root@xxx.xxx.xxx.xxx:tmp & but as soon i close the terminal it stops copying the files but the process is still shown in process manager."} {"id":"107782","title":"Is the historical Unix V5 tr command padding behavior of set2 different from what we consider today \"classic\" System V (1983-1988) behavior?","text":"The `tr` command is almost 40 years old. It seemingly appeared in Unix for the first time in 1973 with Unix V4. The source for this is not available. Here is probably the second oldest available Unix implementation of the command from Unix V5 about 6 months later in June 1974: int dflag 0; int sflag 0; int cflag 0; int save 0; char code[256]; char squeez[256]; char vect[256]; struct string { int last, max, rep; char *p; } string1, string2; int inbuf[259]; main(argc,argv) char **argv; { int i, j; int c, d; char *compl; extern fout; string1.last = string2.last = 0; string1.max = string2.max = 0; string1.rep = string2.rep = 0; string1.p = string2.p = \"\"; if(--argc>0) { argv++; if(*argv[0]=='-'&&argv[0][4]!=0) { while(*++argv[0]) switch(*argv[0]) { case 'c': cflag++; continue; case 'd': dflag++; continue; case 's': sflag++; continue; } argc--; argv++; } } if(argc>0) string1.p = argv[0]; if(argc>1) string2.p = argv[1]; for(i=0; i<256; i++) code[i] = vect[i] = 0; if(cflag) { while(c = next(&string1)) vect[c&0377] = 1; j = 0; for(i=1; i<256; i++) if(vect[i]==0) vect[j++] = i; vect[j] = 0; compl = vect; } for(i=0; i<256; i++) squeez[i] = 0; for(;;){ if(cflag) c = *compl++; else c = next(&string1); if(c==0) break; d = next(&string2); if(d==0) d = c; code[c&0377] = d; squeez[d&0377] = 1; } while(d = next(&string2)) squeez[d&0377] = 1; squeez[0] = 1; for(i=0;i<256;i++) { if(code[i]==0) code[i] = i; else if(dflag) code[i] = 0; } inbuf[0] = 0; fout = dup(1); close(1); while((c=getc(inbuf)) >=0 ) { if(c == 0) continue; if(c = code[c&0377]&0377) if(!sflag || c!=save || !squeez[c&0377]) putchar(save = c); } flush(); } next(s) struct string *s; { int a, b, c, n; int base; if(--s->rep > 0) return(s->last); if(s->last < s->max) return(++s->last); if(*s->p=='[') { nextc(s); s->last = a = nextc(s); s->max = 0; switch(nextc(s)) { case '-': b = nextc(s); if(bp++!=']') goto error; s->max = b; return(a); case '*': base = (*s->p=='0')?8:10; n = 0; while((c = *s->p)>='0' && c<'0'+base) { n = base*n + c - '0'; s->p++; } if(*s->p++!=']') goto error; if(n==0) n = 1000; s->rep = n; return(a); default: error: write(1,\"Bad string\\n\",11); exit(); } } return(nextc(s)); } nextc(s) struct string *s; { int c, i, n; c = *s->p++; if(c=='\\\\') { i = n = 0; while(i<3 && (c = *s->p)>='0' && c<='7') { n = n*8 + c - '0'; i++; s->p++; } if(i>0) c = n; else c = *s->p++; } if(c==0) *--s->p = 0; return(c&0377); } With time this evolved and since the early days, there's been variations with how the command deals with sets of different length, and here my interest is with the case where set2 is shorter than set1. The _GNU Coreutils_ manual discusses the situation: > When tr is performing translation, set1 and set2 typically have the same > length. If set1 is shorter than set2, the extra characters at the end of > set2 are ignored. > > On the other hand, making set1 longer than set2 is not portable; POSIX says > that the result is undefined. In this situation, BSD tr pads set2 to the > length of set1 by repeating the last character of set2 as many times as > necessary. System V tr truncates set1 to the length of set2. > > By default, GNU tr handles this case like BSD tr. When the --truncate-set1 > (-t) option is given, GNU tr handles this case like the System V tr > >instead. This option is ignored for operations other than translation. > > Acting like System V tr in this case breaks the relatively common BSD idiom: > > > tr -cs A-Za-z0-9 '\\012' > > > because it converts only zero bytes (the first element in the complement of > set1), rather than all non-alphanumerics, to newlines. There is also such a discussion in _The Open GroupBase Specifications Issue 7 IEEE Std 1003.1_, 2013 Edition: > When string2 is shorter than string1, a difference results between > historical System V and BSD systems. A BSD system pads string2 with the last > character found in string2. Thus, it is possible to do the following: > > tr 0123456789 d > > which would translate all digits to the letter 'd'. Since this area is > specifically unspecified in this volume of POSIX.1-2008, both the BSD and > System V behaviors are allowed, but a conforming application cannot rely on > the BSD behavior. It would have to code the example in the following way: > > tr 0123456789 '[d*]' Now, if you read the man pages for the tr command in V4 and V5, you see the following reference in both: If string2 is short, it is padded with corresponding characters from string1. But that reference is omitted in the V6 manual and later early versions of Unix yet the V6 implementation of the command is line for line identical to V5? So you have a difference in the manuals but not in the code? Also, this implementation seems different from what is considered \"classic BSD or System V\" behavior i.e. pad from adding from set2 elements or truncate to length of set1. So is the V4-V5 implementation different from the System V milestone Unix and what is the rationale for that different implementation and ultimately why was it discarded down the road? How can I find out more information about such an early design of the command?"} {"id":"113723","title":"Multiple SSH tunnel through raspberry pi?","text":"In my home network I have a PC, raspberry pi, macbook and a few other devices which I want to access away from home. As it stands, I have setup VNC server on my PC along with remote desktop and have changed the default ports. These ports are open on my router and redirect to the PC so that I can access them via dynamic dns. However I was wondering if it was possible to close those open ports on the router, and instead leave only port 22 on the raspberry pi so I can use an SSH tunnel through the pi, to the PC and run VNC through that? If so how would the command prompt look? I understand vaguely how SSH tunnels work and can use them applying to 1 remote host, i.e: ssh -L 22222:localhost:5900 user@pi then running `localhost:22222` in my vnc viewer will let me connect to the pi. Reading up on the subject suggests I could do something like `ssh -L 22222:internal_pc_ip:5900 user@pi` and run `localhost:22222` like before? Can I do this?"} {"id":"37922","title":"How to prevent the auto creation of the \"Desktop\" folder?","text":"> **Possible Duplicate:** > Which application should I blame for compulsively creating a directory > again and again? When I upload files via Firefox, the `Open File` dialog appears and the `Desktop` folder is automatically created. I am using Arch Linux with Xmonad and quite frankly I don't need a `Desktop` folder inside my `home` folder. How do I stop this from happening in the future (i.e. disable the auto creation of the `Desktop` folder)?"} {"id":"20577","title":"How can I prepend a tag to the beginning of several files?","text":"I need to add PHP tags surrounding a file. It's easy to append them using find . -exec echo \"?>\" >> '{}' \\; but how can I _prepend_ the tag ` **Possible Duplicate:** > How can I prepend a tag to the beginning of several files? How do I insert text at the beginning of a file via terminal?"} {"id":"22957","title":"Download specific files with FTP?","text":"I am trying to use FTP to download several hundred files within a directory. Is there a way to only download specific files with FTP? Ideally, I would like to match specific files using a regular expression. Unfortunately, the directory is massive and it's too large to download the entire directory and then use find or grep locally to manipulate certain files. Is there a simply way to do what I am trying to do on Unix? If not, I plan to just write a script in perl or python. Thanks in advance for the help."} {"id":"2745","title":"How to run a script during Gnome log out","text":"I would like to run a script to rsync my home directory to another machine whenever I log out of Gnome. There is a way to hook into the Gnome logout process?"} {"id":"3525","title":"Is there a simple flag to prevent installing X and anything that depends on it via ports?","text":"I'm running FreeBSD in a small VMWare image and I want to keep it headless. Is there a setting someplace that will guarantee I never pull in X as a dependency, or will I have to rely solely on eternal vigilance? Thanks. See also: the same basic question on SuperUser"} {"id":"108185","title":"Installing OpenMediaVault without keyboard and monitor","text":"So I got the parts to my server delivered and assembled it. Now I have the problem that I don't have access to a monitor or keyboard and would like to install OMV to my server. I plan on running the OS from an USB stick (I know this is not recommended, but I got a SLC based stick, so it should be fine). I have a MacBook that's running OS X, could I setup the USB here and move it to the server and then just boot it there? Otherwise I guess I could use some sort of preseed file for headless installation, but I'm not well-versed in unix enviroments so I'm not sure how I should set it up. From what I gather I need to get the install iso on an USB and use that to install to another USB, is this possible to set up with a preseed file? I think OMV locks the OS drive, so ideally the stick should be split (1GB OS – 7GB Storage) so that the one half can be used for storing plugins and other stuff. On a sidenote, found this while looking for help\/guides: https:\/\/gist.github.com\/ngnpope\/3806732 Can I benefit from this in some way?"} {"id":"91167","title":"Setup linux cluster like Windows with CentOS or Ubuntu?","text":"Along the lines of this MSDN article, how would you setup a pair of Ubuntu or CentOS (or RHEL) servers in a cluster so they appear to hosted applications as a single server, but will continue to work even if a node in the cluster becomes inoperable (or needs maintenance, etc)? I presume this is possible."} {"id":"91161","title":"Cancel completion, but only completion, in zsh","text":"When a completion function takes a long time, I can interrupt it by pressing `Ctrl`+`C` (terminal interrupt key, sends SIGINT) or `Ctrl`+`G` (bound to `send-break`). I am then left with the uncompleted word. However, if I happen to hit `Ctrl`+`C` or `Ctrl`+`G` just as the completion function finishes, my key press may cancel the command line and give me a fresh prompt instead of cancelling the completion. How can I set up zsh so that a certain key will cancel an ongoing completion but do nothing if no completion function is active?"} {"id":"91807","title":"Why does skype not pick up my microphone?","text":"I've got `skype` running (32 bit mode) on Slackware64 -- the sound is fine but my mic is not able to be detected. KMIX shows that my mic is enabled, and I can hear myself when I test it. Some notifications I get in Konsole when starting `skype` are below: ALSA lib conf.c:4692:(snd_config_expand) Unknown parameters CARD=PCH ALSA lib control.c:953:(snd_ctl_open_noupdate) Invalid CTL default:CARD=PCH EDIT -- Added screenshot. ![enter image description here](http:\/\/i.stack.imgur.com\/bEDd7.png) Here is my ALSA mixer. If I turn the Front Mic all the way up, I can hear myself speaking through my output device. I have kept it down all the way so I don't hear myself. ![enter image description here](http:\/\/i.stack.imgur.com\/plNnL.png) Edit -- Another snapshot of AlsaMixer ![enter image description here](http:\/\/i.stack.imgur.com\/xbf9m.png)"} {"id":"27419","title":"How to use wildcards (*) when copying with scp?","text":"Why can't I copy with scp when I'm using `*` characters in the path? scp SERVERNAME:\/DIR\/* . What configs do SCP need to allow `*` in the path? UPDATE: the problem is not on server side, pscp is trying to use SCPv1, and that's why the error message: ![enter image description here](http:\/\/i.stack.imgur.com\/AWxRl.png)"} {"id":"21076","title":"How to show lines after each grep match until other specific match?","text":"I know that by using the `\"-A NUM\"` switch I can print specific number of trailing lines after each match. I am just wondering if it's possible to print trailing lines until a specific word is found after each match. e.g. When I search for \"Word A\" I want to see the line containing \"Word A\" and also the lines after it until the one containing \"Word D\". context: Word A Word B Word C Word D Word E Word F command: grep -A10 'Word A' I need this output: Word A Word B Word C Word D"} {"id":"115764","title":"How to remove cache device from bcache?","text":"I believe, that once I made sure my cache device state is \"clean\": $ sudo cat \/sys\/block\/bcache0\/bcache\/state I can just physically remove it from the machine when it is powered off or boot with liveCD and clean the superblock with: $ sudo dd if=\/dev\/zero of= bs=1024 count=1024 But I cannot find anywhere a confirmation, that this procedure wouldn't mess anything up."} {"id":"137101","title":"\"find: .: No such file or directory\" while using find on the current directory","text":"Find command seems not to work at all. For example, I'm in a directory where there absolutely is file named index.php and I execute this: [root@server htdocs]# find . -name \"index.php\" find: .: No such file or directory I always get this no such file or directory error. No matter what path I define, or what file I search for, I always get this error. I'm pretty sure that I'm overlooking something very simple. Can someone point out what I'm doing wrong? [root@server htdocs]# pwd \/srv\/www\/htdocs [root@server htdocs]# type -a find find is \/usr\/bin\/find [root@server htdocs]# ls -la | grep index.php -rw-rw-r-- 1 andris users 413 Sep 1 2013 index.php [root@server htdocs]# find . -name \"index.php\" find: .: No such file or directory [root@server htdocs]# find . . find: .: No such file or directory [root@server htdocs]# stat . File: `.' Size: 4096 Blocks: 8 IO Block: 4096 directory Device: ca00h\/51712d Inode: 155686 Links: 12 Access: (0775\/drwxrwxr-x) Uid: ( 504\/ andris) Gid: ( 100\/ users) Access: 2014-06-17 19:37:22.000000000 +0000 Modify: 2014-06-08 21:06:16.000000000 +0000 Change: 2014-06-08 21:06:16.000000000 +0000 [root@server htdocs]# find --version GNU find version 4.2.27 Features enabled: D_TYPE O_NOFOLLOW(enabled) LEAF_OPTIMISATION SELINUX `strace find .` output: https:\/\/gist.github.com\/andrisp\/f3adaf740548eead33da [root@server htdocs]# find . -noleaf -name \"index.php\" find: .: No such file or directory"} {"id":"61768","title":"What is the \"~\/\" directory?","text":"I'm trying to locate where some files are stored and I can easily browse to them via ssh by going to \"cd ~\/foldername\", however, I have no idea what directory \"~\/\" actually is. When I browse around folders via WinSCP (yes, I'm a Windows admin), I can't seem to locate this folder at all. This is probably the most \"noob\" question I've ever asked but I've been having a tough time Googling it due to the length and it not actually coming up. **Note:** I'm using Amazon Linux on EC2 if it makes any difference. Thanks in advance."} {"id":"67043","title":"Set environment variable for all of tmux shells when gnome-sessions gets restarted","text":"To solve this problem, I need to set the environment variable `DBUS_SESSION_BUS_ADDRESS` for all shells inside `tmux` every time I restart gnome without restarting tmux (this is often). How can I best solve this? * I cannot cleanly change another processes' environment. * I cannot send a command to every pane * I could set the environment variable in my `PROMPT_COMMAND`. It means I need to press `Enter` before I can run gnome applications. It's ugly and overkill. * I could set the environment variable by executing a command before every command, but that's a bit overkill. Is there another way to fix this in a cleaner way?"} {"id":"117737","title":"Does perf includes some \"graphing\" abilities?","text":"It's possible to create a bitmap or a vector image out of the data collected by the `perf` profiler under linux ?"} {"id":"66392","title":"How to authenticate a user with PAM, that is not the user that started the application","text":"I'm currently developing an authentication module for an application. The decision was made to do this by using PAM. I have made this work but it can only authenticate the user that started the application. This means that if I started the application as the user 'appname' the authentication only tells me it is successful if the user is 'appname' and not 'some_user' If I su to that 'some_user' and started the application in that terminal then I can authenticate 'some_user' but not 'appname' I turned on the debug flag for pam_unix in common-auth. Resulting in the following output when it rejects: unix_chkpwd[4107]: check pass; user unknown unix_chkpwd[4107]: password check failed for user (pamtest) [app]: pam_unix(other:auth): authentication failure; logname=[appname] uid=1000 euid=1000 tty= ruser=[appname] rhost= user=pamtest"} {"id":"66395","title":"Creating a local workspace for development\/testing","text":"I want to be able to `mount`, say \/home\/$USER\/workspace to \/usr\/local\/workspace. Right now I'm using the python package pyfilesystem which uses `fuse` to do that. My problem is, that inside that mount I am not able to create `symlinks`. I don't even need symlinks going outside the mount, but even a symlink that normally is created for a shared library during compilation, will not be created inside the mount. So I'm either looking for a totally different approach, or a tool (preferably written in `Python`) that does exactly what `pyfilesystem` is doing and supports the creation of symlinks. Further constraints: * Using a simple symlink instead of a mount does not work for me as the mounted directory will actually be inside a `chroot`. * Mounting must not require root privileges. * Changing `fstab` is not an option. * Thus using `mount bind` is not an option."} {"id":"119975","title":"How to set Linux to ask for authentication when running potentially dangerous commands?","text":"I've faced times when I accidentally ran dangerous commands and lost all my data. How do I set Linux to ask for current user password or root user password when running potentially dangerous commands like `rm -rf .` or `rm -rf \/` and many other?"} {"id":"106552","title":"apt-get install without debconf prompt","text":"I would like to install chef via apt non-interactively, but by default, apt installation brings up this prompt: ![apt install chef prompt](http:\/\/i.stack.imgur.com\/Rs9Ly.png) Is there a way to skip this step during installation or pass a value to apt install? I'm only using chef-solo, so don't actually need the server componenent, so simply press return on this prompt."} {"id":"91297","title":"How to undelete just deleted directory with \"rm -R\" command?","text":"I deleted an important directory with `rm -R` command. This is an very populer host data. It was located `\/var\/zpanel\/hostdata\/ayrintilih` After remove ayrintilih directory has gone everything. I tried to undelete with `ext4magic` program. But it need to another hdd volume for recovery. Error message: ERROR: can not use \"\/root\/recoveried\" for recover directory. It's the same filesystem : \"\/dev\/dm-0\" My ISP just replied my request: Unfortunately there is no way to add another Volume to a virtual Instance. If it would be a dedicated Server, we could do it, but not in a Cloudserver. You could try to minimize the partition and create another one, that would count as another Volume. We also recommend to have allways a Backup for your Important files."} {"id":"106558","title":"Is there any point in using `sudo` when you are the sole user of your machine?","text":"I'd like to know if there is any reason why I should use `sudo` instead of `su`, taking into account that I am the owner and sole user of my machine (and hence have root access whenever I want). Also, in case there is a good reason to prefer `sudo`, I want to know what privileges should I give myself. * * * **EDIT:** I have just found a very nice reference for `sudo`. If anyone is interested it is here."} {"id":"29047","title":"Can't access internet after connecting to L2TP IPsec VPN","text":"I have configured a L2TP VPN on Ubuntu server 11.04, and I can connect to it with a Mac client. But after connecting successfully to this L2TP VPN, my Mac cannot access the internet. To access the internet, I have to disconnect from the VPN. My local IP address on Mac is 192.168.1.105, after connecting to VPN, I use this IP: 10.1.2.2. How can I fix this?"} {"id":"123731","title":"Best parameters for ext4 filesystem to handle virtualbox disk images","text":"I have ext4 partition, which holds disk image files VirtualBox works with. They all are fixed-size images (i.e. files never change their size). They are defragmented as much as possible (with e4defrag). I assume that a lot of filesystem features are redundant in this case. I.e. as files are never created, never deleted, never change their size, only reading and \"in-place\" writing happens, and file contents are aligned on the hard- drive continuously, thus much simpler filesystem could be used in this case (no need for file attributes, directories, journal, etc). Theoretically, I could even use logical volumes instead of files in this case (I am just not sure that I want). So, questions: 1. How to tune ext4 filesystem, to get best performance in this case? 2. May be another filesystem is more suitable? (Some filesystem that don't support directories, and only continuous fixed-size files?) Or may be Linux has a possibility to mount _part_ of existing partition as a file? I.e. that I create unformatted partition \/dev\/sda2 and then * mount K-th to L-th bytes of it as \/somepath1\/somefile1.vdi, * mount M-th to N-th bytes of it as \/somepath2\/file2.vdi, * and so on."} {"id":"86297","title":"What can go wrong if \/var\/tmp is on a temporary filesystem?","text":"I have read that I should not mount \/var\/tmp as a temporary filesystem (e.g., as tmpfs), because files in \/var\/tmp must not be deleted on reboot. Is that correct? Suppose I did mount \/var\/tmp as a tmpfs, so its contents are deleted on every reboot. Would that be bad? If yes, what could go wrong? How bad would it be?"} {"id":"31066","title":"How can I add invisible watermark to images on commandline?","text":"Similar question here but for Tex -document. Imagemagick shows ways of watermarking here but not how to do it as invisible as possible. I currently just obfuscate some functional elements into photos so extremely hard to remove, without distorting the image itself. Is there some commandline tool to add invisible watermark to images, something like to check with microscope perhaps but still readable? I have a massive tree of images (of very different variety so watermark should adopt to env etc) -- some commandline tool to add watermarks fast invisibly on every photo?"} {"id":"153044","title":"remove Cinnamon Desktop replace with MATE","text":"I'm guessing this is something simple I'm missing because nobody else seems to have this problem I just installed fedora 20 which installs cinnamon desktop (I believe) and want to use MATE because that's what I'm familiar - this installed OK But how do I uninstall cinnamon? When I do yum groupremove \"Cinnamon Desktop\" I get \"No environment named Cinnamon Desktop\" exists"} {"id":"91834","title":"How do I set key binding for set mark in emacs?","text":"_I'm new to emacs and newer to lisp_ I'm trying to set Meta + spacebar to set the mark for highlighting text (at current cursor position). searching around online and experimenting I've ended up with the command `(global-set-key (kbd \"M-SPC\") 'push-mark nil nil 1)` The above command isn't working for me though, I'm getting an \"incorrect number of arguments error\". Got the function definition, push-mark &optional; position nomsg activate from elisp manual here **Position:** nil for position should default to current cursor position **nomsg:** I don't care about (I think) **activate:** apparently isn't true by default so I need to set it to...something. How would I format the command to pass in three values? _The error is definitely due to the push-mark function call as other functions such as backward-char (which I'm not passing inputs to) work correctly_"} {"id":"8707","title":"What's the difference between SFTP, SCP and FISH protocols?","text":"I used to think SCP is a tool to copy files over SSH, and copying files over SSH is called SFTP, which is itself a synonym to FISH. But now as I was looking for a Total Commander plugin to do this in Windows, I've noticed that on its page it says \"Allows access to remote servers via secure FTP (FTP via SSH). Requires SSH2. This is NOT the same as SCP!\". If it's not the same then what am I misunderstanding?"} {"id":"72577","title":"Update not working properly","text":"Whenever I write sudo apt-get update it does not work properly and shows following : tusharmakkar08@tusharmakkar08-Satellite-C660 ~ $ sudo apt-get update Ign http:\/\/archive.ubuntu.com nadia Release.gpg Ign http:\/\/packages.medibuntu.org nadia Release.gpg Ign http:\/\/archive.canonical.com nadia Release.gpg Get:1 http:\/\/packages.linuxmint.com nadia Release.gpg [197 B] Ign http:\/\/security.ubuntu.com nadia-security Release.gpg Hit http:\/\/dl.google.com stable Release.gpg Hit http:\/\/ppa.launchpad.net quantal Release.gpg Ign http:\/\/archive.ubuntu.com nadia-updates Release.gpg Hit http:\/\/archive.canonical.com quantal Release.gpg Get:2 http:\/\/packages.linuxmint.com nadia Release [17.6 kB] Get:3 http:\/\/security.ubuntu.com quantal-security Release.gpg [933 B] Hit http:\/\/dl.google.com stable Release.gpg Hit http:\/\/ppa.launchpad.net quantal Release Hit http:\/\/packages.medibuntu.org quantal Release.gpg Hit http:\/\/archive.ubuntu.com quantal Release.gpg Ign http:\/\/archive.canonical.com nadia Release Ign http:\/\/security.ubuntu.com nadia-security Release Hit http:\/\/dl.google.com stable Release Hit http:\/\/ppa.launchpad.net quantal\/main Sources Hit http:\/\/archive.canonical.com quantal Release Get:4 http:\/\/security.ubuntu.com quantal-security Release [49.6 kB] Hit http:\/\/dl.google.com stable Release Get:5 http:\/\/archive.ubuntu.com quantal-updates Release.gpg [933 B] Hit http:\/\/ppa.launchpad.net quantal\/main i386 Packages Ign http:\/\/packages.medibuntu.org nadia Release Get:6 http:\/\/packages.linuxmint.com nadia\/main i386 Packages [22.6 kB] Hit http:\/\/dl.google.com stable\/main i386 Packages Hit http:\/\/packages.medibuntu.org quantal Release Get:7 http:\/\/packages.linuxmint.com nadia\/upstream i386 Packages [11.3 kB] Hit http:\/\/archive.canonical.com quantal\/partner i386 Packages Get:8 http:\/\/packages.linuxmint.com nadia\/import i386 Packages [44.0 kB] Hit http:\/\/dl.google.com stable\/main i386 Packages Ign http:\/\/archive.ubuntu.com nadia Release Ign http:\/\/archive.ubuntu.com nadia-updates Release Hit http:\/\/archive.ubuntu.com quantal Release Get:9 http:\/\/archive.ubuntu.com quantal-updates Release [49.6 kB] Ign http:\/\/ppa.launchpad.net quantal\/main Translation-en_IN Ign http:\/\/ppa.launchpad.net quantal\/main Translation-en Get:10 http:\/\/security.ubuntu.com quantal-security\/main i386 Packages [104 kB] Hit http:\/\/packages.medibuntu.org quantal\/free i386 Packages Hit http:\/\/packages.medibuntu.org quantal\/non-free i386 Packages Ign http:\/\/dl.google.com stable\/main Translation-en_IN Err http:\/\/archive.canonical.com nadia\/partner i386 Packages 404 Not Found [IP: 91.189.92.191 80] Ign http:\/\/dl.google.com stable\/main Translation-en Ign http:\/\/archive.canonical.com nadia\/partner Translation-en_IN Ign http:\/\/dl.google.com stable\/main Translation-en_IN Ign http:\/\/archive.canonical.com nadia\/partner Translation-en Ign http:\/\/dl.google.com stable\/main Translation-en Ign http:\/\/archive.canonical.com quantal\/partner Translation-en_IN Get:11 http:\/\/security.ubuntu.com quantal-security\/restricted i386 Packages [3,531 B] Ign http:\/\/archive.canonical.com quantal\/partner Translation-en Get:12 http:\/\/security.ubuntu.com quantal-security\/universe i386 Packages [45.8 kB] Get:13 http:\/\/security.ubuntu.com quantal-security\/multiverse i386 Packages [1,402 B] Hit http:\/\/security.ubuntu.com quantal-security\/main Translation-en Hit http:\/\/security.ubuntu.com quantal-security\/multiverse Translation-en Hit http:\/\/archive.ubuntu.com quantal\/main i386 Packages Ign http:\/\/packages.linuxmint.com nadia\/import Translation-en_IN Hit http:\/\/archive.ubuntu.com quantal\/restricted i386 Packages Hit http:\/\/security.ubuntu.com quantal-security\/restricted Translation-en Hit http:\/\/archive.ubuntu.com quantal\/universe i386 Packages Hit http:\/\/archive.ubuntu.com quantal\/multiverse i386 Packages Ign http:\/\/packages.linuxmint.com nadia\/import Translation-en Hit http:\/\/security.ubuntu.com quantal-security\/universe Translation-en Ign http:\/\/packages.linuxmint.com nadia\/main Translation-en_IN Hit http:\/\/archive.ubuntu.com quantal\/main Translation-en Ign http:\/\/packages.linuxmint.com nadia\/main Translation-en Ign http:\/\/packages.linuxmint.com nadia\/upstream Translation-en_IN Hit http:\/\/archive.ubuntu.com quantal\/multiverse Translation-en Ign http:\/\/packages.linuxmint.com nadia\/upstream Translation-en Hit http:\/\/archive.ubuntu.com quantal\/restricted Translation-en Hit http:\/\/archive.ubuntu.com quantal\/universe Translation-en Get:14 http:\/\/archive.ubuntu.com quantal-updates\/main i386 Packages [225 kB] Get:15 http:\/\/archive.ubuntu.com quantal-updates\/restricted i386 Packages [4,841 B] Get:16 http:\/\/archive.ubuntu.com quantal-updates\/universe i386 Packages [179 kB] Get:17 http:\/\/archive.ubuntu.com quantal-updates\/multiverse i386 Packages [10.8 kB] Hit http:\/\/archive.ubuntu.com quantal-updates\/main Translation-en Hit http:\/\/archive.ubuntu.com quantal-updates\/multiverse Translation-en Hit http:\/\/archive.ubuntu.com quantal-updates\/restricted Translation-en Hit http:\/\/archive.ubuntu.com quantal-updates\/universe Translation-en Err http:\/\/packages.medibuntu.org nadia\/free i386 Packages 404 Not Found Err http:\/\/packages.medibuntu.org nadia\/non-free i386 Packages 404 Not Found Err http:\/\/security.ubuntu.com nadia-security\/main i386 Packages 404 Not Found [IP: 91.189.92.200 80] Ign http:\/\/packages.medibuntu.org nadia\/free Translation-en_IN Err http:\/\/security.ubuntu.com nadia-security\/restricted i386 Packages 404 Not Found [IP: 91.189.92.200 80] Err http:\/\/security.ubuntu.com nadia-security\/universe i386 Packages 404 Not Found [IP: 91.189.92.200 80] Ign http:\/\/packages.medibuntu.org nadia\/free Translation-en Err http:\/\/security.ubuntu.com nadia-security\/multiverse i386 Packages 404 Not Found [IP: 91.189.92.200 80] Ign http:\/\/security.ubuntu.com nadia-security\/main Translation-en_IN Ign http:\/\/packages.medibuntu.org nadia\/non-free Translation-en_IN Ign http:\/\/security.ubuntu.com nadia-security\/main Translation-en Ign http:\/\/security.ubuntu.com nadia-security\/multiverse Translation-en_IN Ign http:\/\/packages.medibuntu.org nadia\/non-free Translation-en Ign http:\/\/security.ubuntu.com nadia-security\/multiverse Translation-en Ign http:\/\/security.ubuntu.com nadia-security\/restricted Translation-en_IN Ign http:\/\/packages.medibuntu.org quantal\/free Translation-en_IN Ign http:\/\/security.ubuntu.com nadia-security\/restricted Translation-en Ign http:\/\/security.ubuntu.com nadia-security\/universe Translation-en_IN Ign http:\/\/security.ubuntu.com nadia-security\/universe Translation-en Ign http:\/\/security.ubuntu.com quantal-security\/main Translation-en_IN Ign http:\/\/security.ubuntu.com quantal-security\/multiverse Translation-en_IN Ign http:\/\/security.ubuntu.com quantal-security\/restricted Translation-en_IN Ign http:\/\/security.ubuntu.com quantal-security\/universe Translation-en_IN Ign http:\/\/packages.medibuntu.org quantal\/free Translation-en Ign http:\/\/packages.medibuntu.org quantal\/non-free Translation-en_IN Ign http:\/\/packages.medibuntu.org quantal\/non-free Translation-en Err http:\/\/archive.ubuntu.com nadia\/main i386 Packages 404 Not Found [IP: 91.189.92.202 80] Err http:\/\/archive.ubuntu.com nadia\/restricted i386 Packages 404 Not Found [IP: 91.189.92.202 80] Err http:\/\/archive.ubuntu.com nadia\/universe i386 Packages 404 Not Found [IP: 91.189.92.202 80] Err http:\/\/archive.ubuntu.com nadia\/multiverse i386 Packages 404 Not Found [IP: 91.189.92.202 80] Ign http:\/\/archive.ubuntu.com nadia\/main Translation-en_IN Ign http:\/\/archive.ubuntu.com nadia\/main Translation-en Ign http:\/\/archive.ubuntu.com nadia\/multiverse Translation-en_IN Ign http:\/\/archive.ubuntu.com nadia\/multiverse Translation-en Ign http:\/\/archive.ubuntu.com nadia\/restricted Translation-en_IN Ign http:\/\/archive.ubuntu.com nadia\/restricted Translation-en Ign http:\/\/archive.ubuntu.com nadia\/universe Translation-en_IN Ign http:\/\/archive.ubuntu.com nadia\/universe Translation-en Err http:\/\/archive.ubuntu.com nadia-updates\/main i386 Packages 404 Not Found [IP: 91.189.92.202 80] Err http:\/\/archive.ubuntu.com nadia-updates\/restricted i386 Packages 404 Not Found [IP: 91.189.92.202 80] Err http:\/\/archive.ubuntu.com nadia-updates\/universe i386 Packages 404 Not Found [IP: 91.189.92.202 80] Err http:\/\/archive.ubuntu.com nadia-updates\/multiverse i386 Packages 404 Not Found [IP: 91.189.92.202 80] Ign http:\/\/archive.ubuntu.com nadia-updates\/main Translation-en_IN Ign http:\/\/archive.ubuntu.com nadia-updates\/main Translation-en Ign http:\/\/archive.ubuntu.com nadia-updates\/multiverse Translation-en_IN Ign http:\/\/archive.ubuntu.com nadia-updates\/multiverse Translation-en Ign http:\/\/archive.ubuntu.com nadia-updates\/restricted Translation-en_IN Ign http:\/\/archive.ubuntu.com nadia-updates\/restricted Translation-en Ign http:\/\/archive.ubuntu.com nadia-updates\/universe Translation-en_IN Ign http:\/\/archive.ubuntu.com nadia-updates\/universe Translation-en Ign http:\/\/archive.ubuntu.com quantal\/main Translation-en_IN Ign http:\/\/archive.ubuntu.com quantal\/multiverse Translation-en_IN Ign http:\/\/archive.ubuntu.com quantal\/restricted Translation-en_IN Ign http:\/\/archive.ubuntu.com quantal\/universe Translation-en_IN Ign http:\/\/archive.ubuntu.com quantal-updates\/main Translation-en_IN Ign http:\/\/archive.ubuntu.com quantal-updates\/multiverse Translation-en_IN Ign http:\/\/archive.ubuntu.com quantal-updates\/restricted Translation-en_IN Ign http:\/\/archive.ubuntu.com quantal-updates\/universe Translation-en_IN Fetched 771 kB in 1min 19s (9,715 B\/s) W: Failed to fetch http:\/\/archive.canonical.com\/ubuntu\/dists\/nadia\/partner\/binary-i386\/Packages 404 Not Found [IP: 91.189.92.191 80] W: Failed to fetch http:\/\/security.ubuntu.com\/ubuntu\/dists\/nadia-security\/main\/binary-i386\/Packages 404 Not Found [IP: 91.189.92.200 80] W: Failed to fetch http:\/\/security.ubuntu.com\/ubuntu\/dists\/nadia-security\/restricted\/binary-i386\/Packages 404 Not Found [IP: 91.189.92.200 80] W: Failed to fetch http:\/\/security.ubuntu.com\/ubuntu\/dists\/nadia-security\/universe\/binary-i386\/Packages 404 Not Found [IP: 91.189.92.200 80] W: Failed to fetch http:\/\/security.ubuntu.com\/ubuntu\/dists\/nadia-security\/multiverse\/binary-i386\/Packages 404 Not Found [IP: 91.189.92.200 80] W: Failed to fetch http:\/\/packages.medibuntu.org\/dists\/nadia\/free\/binary-i386\/Packages 404 Not Found W: Failed to fetch http:\/\/packages.medibuntu.org\/dists\/nadia\/non-free\/binary-i386\/Packages 404 Not Found W: Failed to fetch http:\/\/archive.ubuntu.com\/ubuntu\/dists\/nadia\/main\/binary-i386\/Packages 404 Not Found [IP: 91.189.92.202 80] W: Failed to fetch http:\/\/archive.ubuntu.com\/ubuntu\/dists\/nadia\/restricted\/binary-i386\/Packages 404 Not Found [IP: 91.189.92.202 80] W: Failed to fetch http:\/\/archive.ubuntu.com\/ubuntu\/dists\/nadia\/universe\/binary-i386\/Packages 404 Not Found [IP: 91.189.92.202 80] W: Failed to fetch http:\/\/archive.ubuntu.com\/ubuntu\/dists\/nadia\/multiverse\/binary-i386\/Packages 404 Not Found [IP: 91.189.92.202 80] W: Failed to fetch http:\/\/archive.ubuntu.com\/ubuntu\/dists\/nadia-updates\/main\/binary-i386\/Packages 404 Not Found [IP: 91.189.92.202 80] W: Failed to fetch http:\/\/archive.ubuntu.com\/ubuntu\/dists\/nadia-updates\/restricted\/binary-i386\/Packages 404 Not Found [IP: 91.189.92.202 80] W: Failed to fetch http:\/\/archive.ubuntu.com\/ubuntu\/dists\/nadia-updates\/universe\/binary-i386\/Packages 404 Not Found [IP: 91.189.92.202 80] W: Failed to fetch http:\/\/archive.ubuntu.com\/ubuntu\/dists\/nadia-updates\/multiverse\/binary-i386\/Packages 404 Not Found [IP: 91.189.92.202 80] E: Some index files failed to download. They have been ignored, or old ones used instead. My Sources.list looks like : deb http:\/\/packages.linuxmint.com\/ nadia main upstream import deb http:\/\/archive.ubuntu.com\/ubuntu\/ nadia main restricted universe multiverse deb http:\/\/archive.ubuntu.com\/ubuntu\/ nadia-updates main restricted universe multiverse deb http:\/\/security.ubuntu.com\/ubuntu\/ nadia-security main restricted universe multiverse deb http:\/\/archive.canonical.com\/ubuntu\/ nadia partner deb http:\/\/packages.medibuntu.org\/ nadia free non-free # deb http:\/\/archive.getdeb.net\/ubuntu quantal-getdeb apps # deb http:\/\/archive.getdeb.net\/ubuntu quantal-getdeb games deb http:\/\/archive.ubuntu.com\/ubuntu\/ quantal main restricted universe multiverse deb http:\/\/archive.ubuntu.com\/ubuntu\/ quantal-updates main restricted universe multiverse deb http:\/\/security.ubuntu.com\/ubuntu\/ quantal-security main restricted universe multiverse deb http:\/\/archive.canonical.com\/ubuntu\/ quantal partner deb http:\/\/packages.medibuntu.org\/ quantal free non-free # deb http:\/\/archive.getdeb.net\/ubuntu quantal-getdeb apps # deb http:\/\/archive.getdeb.net\/ubuntu quantal-getdeb games"} {"id":"3953","title":"SCO Unix run interactive script when sending a print job","text":"I'm working with (read, \"around\") a proprietary ERP system on top of SCO Unix. It has several \"query at print time\" reports where you can assign a printer to send your job to. You usually input something like \"%lp5\", which spools your job to printer lp5. If I want to create a pseudo-printer that will interact with the user and then return control to the ERP how would I go about it? I have manipulated the LP interfaces scripts in the vein of this article, to include dynamic data into the reports and flow control to a print server. But now I want to do actual interaction with the user to connect print jobs with a separate HylaFax server that I've built, so I need a way of triggering a shell script and asking the user for fax coversheet information. Our system has a built in fax system using VsiFax (which I'm trying to subvert), but I don't see how it is performing the same function I'm trying to do. You usually send your job to the VsiFax system by printing to \"@fax\" which I don't know if it's a hardcoded printer on the ERP side or if there is some Unix convention that is being used to call a shell script. I guess what I'm looking for is a resource or some help on what the SCO Unix printer assignment conventions might be related to syntax of printer names (what does \"@\" and \"%\" mean and are there other special characters, and how I could call a shell script when sending that print job?"} {"id":"55090","title":"Change default DNS on openvpn connect","text":"I am using Network Manager on Ubuntu 12.10 to connect to an openvpn server. The connection works without problems. However, when I connect, I would like to change my default DNS server to a server on the vpn network. That way I can use domain names that are only defined on the vpn network. Is there a way I can make this automatic with Network Manager? I can also change settings on the openvpn server if that is the way I need to go. Thanks!"} {"id":"144208","title":"find files without extension","text":"Let say I have: foo.txt bar baz.ooo If I use `ls -1 !(*.*)` then I'll get only `bar` on the output. Great, now I wish to have same results with find - some `find -regex` that will do the job. **NOTE:** `find -name !(*.*)` is not the answer as `!(*.*)` in it is still Bash's glob which I can NOT use."} {"id":"34740","title":"Deduplication on partition level","text":"What are available solutions for block level or more detailed deduplication ? There are file-based ones - with \"Copy-On-Write\" approach. I'm looking for block level \"copy-on-write\", so I could periodically look for common blocks, or - preferably - parts of files, merge them and flag for CoW use manner. Is there sth like this available, or does it still need to be created ? I am not sure if Btrfs deduplication is block\/file\/subpart level ? There is LessFS, but I'am not sure what level of deduplication does it provide ? Maybe other solution?"} {"id":"34744","title":"Partitioning for Web Servers","text":"I was curious what some general best practices are in relation to partitioning for a new Linux VM that will be used as a web server? Are there certain guides that should be consulted or followed? What partitions should be created? What are the common sizes for the various partitions that should be created? Should I worry about LVMs, and if so, what do I need to know about them? I am working on building a template for many new web server builds and I wanted to make sure that I have something that will be able to be used now and for a little while into the future to turn up new servers with. Also, this will likely be used on CentOS 6.x or RHEL 6.x."} {"id":"35297","title":"Use AWK add new line if match exists","text":"I have a file with the following format: aaa@ bbb bbb@ ccc& ddddd@ aaaf ccc@ ddd& eee: abcd& dassda The output should be: aaaa@ bbb bbb@ ccc& ddddd@ aaaf ccc@ ddd& eee@ abcd& dassda How would I be able to achieve this using AWK? I've tried sed and awk but I can only print a new line after the delimeter, I don't know how to print the whole thing on the next line."} {"id":"107202","title":"How to write a script that will open up multiple tabs in the terminal?","text":"I am on OSX and using iTerm I have this so far #!\/bin\/sh open \/Applications\/iTerm.app & exit 0 So after opening, I need two windows and one of those windows will need to open 6 tabs. two of those tabs will need to enter into a certain directory, one of those needs to run an app like cd ~\/Desktop\/projects\/myNodeApp node app.js"} {"id":"20460","title":"How do I do a ls and then sort the results by date created?","text":"In what order are the dated ordered by? Certainly not alphanumeric order. `ls -lt` sorts by modification time. But I need creation time."} {"id":"24448","title":"Unpacking kernel-source rpm off-system (OpenSuse)?","text":"I'm using OpenSuse 11.2 from a LiveUSB USB flash\/stick, which arguably has not much place on it. I need to get the Linux sources for this version of OpenSuse, as they are needed to build a driver for an application I'm using. I have plenty of disk space on an attached hard-drive, so I'd like to \"install\" the sources there ( _note that on 11.2,`zypper --download-only` will by default download to \/var\/cache\/zypp\/packages, which crashes my LiveUSB setup_). So, I do the following: > cd \/media\/myhdrive\/ > wget http:\/\/download.opensuse.org\/update\/11.2\/rpm\/src\/kernel-source-2.6.31.14-0.8.1.src.rpm > mkdir kernel-source-2.6.31.14 > cd kernel-source-2.6.31.14\/ > rpm2cpio ..\/kernel-source-2.6.31.14-0.8.1.src.rpm | cpio -idmv --no-absolute-filenames > ls arch-symbols kernel-source.rpmlintrc patches.kabi.tar.bz2 built-in-where kernel-source.spec patches.kernel.org.tar.bz2 check-for-config-changes kernel-source.spec.in patches.rpmify.tar.bz2 check-supported-list kernel-spec-macros patches.rt.tar.bz2 compute-PATCHVERSION.sh kernel-syms.spec.in patches.staging.tar.bz2 .... ... and there is a bunch of `*.tar.gz` files (patches) - and not anything resembling C source files. I'm guessing there is a script\/command I should apply now to unpack the source tree, but I have no idea what it - I've seen `rpmbuild -bb ...` here, but I guess that will build yet another `.rpm` - while I want the actual sources unpacked (and that at a location I specify - not in `\/usr\/src` or anywhere on root filesystem). Any ideas what I should do now? Many thanks in advance for any answers, Cheers! EDIT: via Building a custom kernel - FedoraProject, trying `rpmbuild -bp`, but it fails: # man rpmbuild: # -bp Executes the \"%prep\" stage from the spec file. Normally this involves unpacking the sources and applying any patches. > mkdir src > rpmbuild --buildroot=$(pwd)\/src\/ -bp --target=$(uname -m) kernel-source.spec Building target platforms: i686 Building for target i686 error: Unable to open \/usr\/src\/packages\/SOURCES\/kernel-spec-macros: No such file or directory"} {"id":"50117","title":"Symbolic link to a socket","text":"From a security point of view, is it safe to create a symbolic link to a socket file? The following bits of context refer to the deployment of a web application on a shared hosting service. $ ls -al ~\/runtime\/supervisor srwx------ 1 myuser myuser 0 Oct 6 20:02 supervisord.sock $ pwd ~\/runtime\/deployment_1 $ ln -s ..\/supervisor\/supervisor.sock $ ls -al lrwxrwxrwx 1 myuser myuser 47 Oct 6 21:20 supervisord.sock -> ..\/runtime\/supervisor\/supervisord.sock= Should I set any special permissions on the symlink or something else?"} {"id":"61551","title":"Is the chromebook Linux based at its core?","text":"Just wondering if the Chromebook uses Linux in some way? If so, would there be a way to run Linux commands (e.g. Ssh) from a command line on it?"} {"id":"116060","title":"Remote executing Magic Sys Rq","text":"Is it possible to execute Magic SysRq keys on remote machine, using SSH? For example I'm trying to run like this: xdotool key Alt+Sys_Req+H But I do not see any help in console, also in \/var\/log\/syslog. Please assume that I do not have root access, and I can't write to \/proc\/sysrq-trigger."} {"id":"14684","title":"Removing control chars (including console codes \/ colours) from script output","text":"I can use the \"script\" command to record an interactive session at the command line. However, this includes all control characters _and_ colour codes. I can remove control characters (like backspace) with \"col -b\", but I can't find a simple way to remove the colour codes. Note that I want to use the command line in the normal way, so don't want to disable colours there - I just want to remove them from the script output. Also, I know can play around and try find a regexp to fix things up, but I am hoping there is a simpler (and more reliable - what if there's a code I don't know about when I develop the regexp?) solution. To show the problem: spl62 tmp: script Script started, file is typescript spl62 lepl: ls add-licence.sed build-example.sh commit-test push-docs.sh add-licence.sh build.sh delete-licence.sed setup.py asn build-test.sh delete-licence.sh src build-doc.sh clean doc-src test.ini spl62 lepl: exit Script done, file is typescript spl62 tmp: cat -v typescript Script started on Thu 09 Jun 2011 09:47:27 AM CLT spl62 lepl: ls^M ^[[0m^[[00madd-licence.sed^[[0m ^[[00;32mbuild-example.sh^[[0m ^[[00mcommit-test^[[0m ^[[00;32mpush-docs.sh^[[0m^M ^[[00;32madd-licence.sh^[[0m ^[[00;32mbuild.sh^[[0m ^[[00mdelete-licence.sed^[[0m ^[[00msetup.py^[[0m^M ^[[01;34masn^[[0m ^[[00;32mbuild-test.sh^[[0m ^[[00;32mdelete-licence.sh^[[0m ^[[01;34msrc^[[0m^M ^[[00;32mbuild-doc.sh^[[0m ^[[00;32mclean^[[0m ^[[01;34mdoc-src^[[0m ^[[00mtest.ini^[[0m^M spl62 lepl: exit^M Script done on Thu 09 Jun 2011 09:47:29 AM CLT spl62 tmp: col -b < typescript Script started on Thu 09 Jun 2011 09:47:27 AM CLT spl62 lepl: ls 0m00madd-licence.sed0m 00;32mbuild-example.sh0m 00mcommit-test0m 00;32mpush-docs.sh0m 00;32madd-licence.sh0m 00;32mbuild.sh0m 00mdelete-licence.sed0m 00msetup.py0m 01;34masn0m 00;32mbuild-test.sh0m 00;32mdelete-licence.sh0m 01;34msrc0m 00;32mbuild-doc.sh0m 00;32mclean0m 01;34mdoc-src0m 00mtest.ini0m spl62 lepl: exit Script done on Thu 09 Jun 2011 09:47:29 AM CLT"} {"id":"47826","title":"Redirecting without color","text":"> **Possible Duplicate:** > Removing control chars (including console codes \/ colours) from script > output How do I disable all color codes when redirecting to file? I previously asked how to redirect everything to file, now I want to know how to redirect without colors. So instead of: ^[(B^[[m^[[1m^[[31m:: ^[(B^[[m^[[1mDaemon script ^[(B^[[m^[[1m^[[31mntpd^[(B^[[m^[[1m does not exist or is not executable.^[(B^[[m I'm looking forward to achieve plain: `:: Daemon script ntpd does not exist or is not executable.` ### Update: Looking at jw013 provided link, I tried the `sed` approach: `rc.d restart ntpd | sed -r \"s\/\\x1B\\\\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]\/\/g\" &> progress.txt` But it didn't even redirect, and simply displayed the colored output to the console. ### Update 2: After user1146332 comment, in order to pipe STDERR, I have to pipe with `|&`. `rc.d restart ntpd | sed -r \"s\/\\x1B\\\\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]\/\/g\" &> progress.txt` Resulted in: `^[(B:: ^[(BDaemon script ^[(Bntpd^[(B does not exist or is not executable.^[(B` It's tidier, but still some codes remain. But that `sed` RegExp is too hard for me to decypher."} {"id":"49516","title":"Is it possible to uncolor STDIN before writing it to file?","text":"> **Possible Duplicate:** > Removing control chars (including console codes \/ colours) from script > output Is there a utility which uncolors colored output? Something like the `uncolor` utility in the example below: $ .\/colored_output | uncolor > plain.txt The aim is to remove characters like \"`[0m[32m`\" and \"`[0m[1m`\" which get additionally output."} {"id":"50210","title":"How can i redirect the output to a file when the program is build with ncurses library","text":"> **Possible Duplicate:** > Removing control chars (including console codes \/ colours) from script > output If we redirect output to file in this pattern `top >> somefile.txt`, we get lot of garbage value in the output. But for `top` there is batch (`top -b -n1 >> somefile.txt`) option where the file output is as desired. In case of programs like `nethogs` there is no such options. Is there is good way to output in such case."} {"id":"131399","title":"extract value between two search patterns on same line","text":"I have the following in a file Output.dat. I need to extract the value between **dn: uid=** and **,ou=** dn: uid=user1,ou=Active,ou=Member,dc=domain,dc=org dn: uid=user2@abc.com,ou=Active,ou=Member,dc=domain,dc=org dn: uid=usertest,ou=Active,ou=Member,dc=domain,dc=org dn: uid=abc1,ou=Active,ou=Member,dc=domain,dc=org I tried using `sed -e '\/dn: uid=\/,\/,ou=\/p' output.dat but it returns complete line instead of value. when tried to use `sed -e '\/dn: uid=\/,\/,ou=\/\\1\/p' output.dat` then got the following error: sed: -e expression #1, char 18: unknown command: `\\'"} {"id":"73190","title":"Unix vs Mac OS X, Notable Difference","text":"I was searching Unix vs OS X. I found a notable difference at From http:\/\/www.unix.com\/unix-dummies-questions-answers\/919-mac-osx-vs-unix.html > OS X is a evolutionary kernel from the MACH and BSD linage. Can anyone help me understand this? * * * What are the notable differences between Unix and Mac OS X."} {"id":"22135","title":"Success\/fail tests for cURL (don't execute second line if first line fails)","text":"According to Using \"&&\" is not effective for cURL submit form (don't execute second line if first line fails) In below code; first line is curl submit; second line is for queuing: curl -b cookies.txt \\ -d title=\"$(sed '1,\/sblmtitle\/d;\/slpstitle\/,$d' sedut.html)\" \\ -d taxonomy%5Btags%5D%5B1%5D=\"$( sed '1,\/sblmkategori\/d;\/slpskategori\/,$d' sedut.html )\" \\ -d teaser_include=1 \\ -d body=\"$(sed '1,\/sblmkonten\/d;\/slpskonten\/,$d' sedut.html)\" \\ -d field_source%5B0%5D%5Burl%5D=\"$( sed '1,\/sblmurl\/d;\/slpsurl\/,$d' sedut.html )\" \\ -d changed= \\ -d form_build_id=form-424f851ad50bd4781c8c25ab7efd5c4c \\ -d form_token=0e7cc7437faf816f1ecd96087286bda9 \\ -d form_id=post_node_form \\ -d op=Save http:\/\/www.web.org\/submit\/post && for file in $(ls *.html | sort -r | tail -1); do mv $file sedut.html done If `cURL` fails to submit, it will print out `sedut.html` contents. If `cURL` success submitting, it will print nothing. But `cURL` always giving `0` no matter if it success or failed in submitting. I think the best workflow is \"If `cURL` print nothing, run second line\" and \"If `cURL` print something, don't run second line\" I've just looked linux `if` command but still have no idea how to implement this because the example have different case."} {"id":"22137","title":"How to watch rss feed for new entries from bash script?","text":"I need to watch a RSS feed from our hudson ci server. Each time a new entry is available i want to play a sound by calling `#>play sound.wav`. Does anyone know a tool which can watch a rss-feed and fire a command each time a new entry appears? I had a look at `rsstail` but it gets all entries from the feed and not the latest or only the ones that are new since the last lookup."} {"id":"151451","title":"simulate the read only environment without the users realizing it in VirtualBox","text":"I have configured the Virtual Box in my machine. Now, I have the original Virtual Box images available under the folder `\/home\/original_vbox_images`. Now, the Virtual Box, as per the configuration, uses the images from the location `\/root\/VirtualBox VMs\/`. I am planning on providing root access to the users in the guest OS installed in Virtual Box. So basically, the users can do anything with root access in the guest OS machine. (I expect the users to even execute **rm -rf \/** ). Now, during reboot, I want the initial Virtual Box image that I have with me to be available again. So, I thought of doing something like this. vi \/root\/Desktop\/newscript.sh cp -R \/home\/original_vbox_images\/ \/root\/VirtualBox VMs\/ Now, after giving execute permission on the script, I will add it to `\/etc\/rc.local` as below. vi \/etc\/rc.local sh \/root\/Desktop\/newscript.sh As of now, I have 10 GB HDD. However, I plan on increasing the capacity of the Virtual HDD. The problem is, the copy might take longer time and won't be efficient. I am looking for some other elegant solution."} {"id":"77430","title":"Free all function keys ( F1-F12 ) for gnome-terminal","text":"I'm using `gnome-terminal` and I need to free all the F keys because I need to remap them to something else inside `vim`, how I can do that? I'm running Ubuntu 13.04."} {"id":"77434","title":"Taking a sparse snapshot","text":"I would like to take a dm snapshot of a drive. I do not want to take the snapshot of the unused and deallocated blocks. Is there any way of determining the used blocks and sectors of a hard drive without being file system aware. I would like to take a snapshot without having the empty parts of my disk backed up."} {"id":"85364","title":"How can I check what signals a process is listening to?","text":"How can I verify whether a running process will catch a signal, or ignore it, or block it? Ideally I'd like to see a list of signals, or at least not have to actually send the signal to check."} {"id":"152731","title":"How can I overlay lines in a transparent, inactive layer over my screen?","text":"I'm attempting to line up some items on my screen, and it'd be useful to have a mostly-transparent guide as an overlay. Ideally, I would draw a vertical line that persists in the foreground, while not stealing focus from the window beneath. I've tried the built-in mouse marks in KDE, and ardesia, but both draw in freeform, and don't allow creating straight horizontal or vertical lines. (Gromit-MPX appears to be the same.) ## Usage example I've navigating genomes with igv, and sometimes I need to work out which features line up. I'd like to be able to draw temporary vertical lines to see what lines up, for example in the following screenshot. ![enter image description here](http:\/\/i.stack.imgur.com\/d8B55.png)"} {"id":"37469","title":"Sort fields inline","text":"I'm trying to sort within a line of input over an unknown number of fields: Input: ab bc bc ab cd ef bc bc cd ef cd bc ab ef ab bc cd gh Output: ab bc ab bc bc cd ef bc cd ef ab cb cd ab bc cd ef gh I've been using something like `awk '{if($2 < $1) print $2,$1;else print}'` but seems like it would get messy over more than two fields. Any help?"} {"id":"101129","title":"xterminal dosen't pass key-strokes to emacs","text":"I opened emacs using `emacs -nw`. Now, when I press `M`-`v`, it opens the view menu of the terminal, instead of passing the command to emacs. Is there a way to prevent this from happening? (I'm running on linux mint)"} {"id":"32740","title":"User's executed commands log file","text":"In Unix based systems, is there a `log file` that stores user's executed command(s)?"} {"id":"93470","title":"Automatic replacement of strings in gedit","text":"I want to replace some strings defined by me in gedit, after a word has been completed and\/or the document has been saved. For example \\ðrac should be replaced with \\frac How do I do this in gedit or with a plugin for gedit? If it is not possible in gedit, then I'm happy for suggestions of other programs that has the feature with the same basic feature set as gedit."} {"id":"98084","title":"Change the location of .bashrc","text":"Is it possible to change the location of `.bashrc` from `\/home\/orhanc\/.bashrc` to some other directory?"} {"id":"98225","title":"kernel address space mappings with respect to virtual address space - a question based on text by Robert Love","text":"In LKD 3rd edition, chapter 12 under Zones, Robert Love says: > In particular, Linux has to deal with two shortcomings of hardware with > respect to memory addressing: > > 1. Some hardware devices can perform DMA (direct memory access) to only > certain memory addresses. > > 2. Some architectures can physically addressing larger amounts of memory > than they can virtually address. Consequently, some memory is not > permanently mapped into the kernel address space. > > My Questions: 1. First is okay, what does he mean by 2? 2. Does he mean to say: Some architectures can address larger amounts of physical memory than they can address virtual addresses? 3. How's that possible? I thought virtual address space is larger than physical memory or at least (if any) equal to physical memory. 4. Also, isn't it because VAS (virtual address space) is larger than physical memory, some memory is not permanently mapped into KAS (kernel address space). But I'm guessing that only physical memory is mapped into KAS. Let me know what he means by point #2 above and what wrong assumption(s) I'm making here."} {"id":"74160","title":"Two GUI applications as different users on the same screen","text":"I am logged as user A. I want to run a GUI application as user B. User, not root. User B is local too, not remote, I only need different environment variables. I don't want to run the second X, I want them on the same display. I have no problem with programs running in terminal, the `su - ...` works. For graphical there is an error message: Application initialization failed: couldn't connect to display \":0.0\" or Gtk-WARNING **: cannot open display: :0.0 Is there a good way to fix it? The article about correct using of `xhost` or something?"} {"id":"36241","title":"CentOS eth0 not starting","text":"Why would my new CentOS Virtual Machine not start eth0 on startup? I have to start it manually every time. How can I fix this? Thanks."} {"id":"139192","title":"zsh completion - show more options than just the alias","text":"I am trying to modify the behaviour of zsh completion and its menus. I'm stuck, and I've read so much documentation it's making my head spin. The following is only an example; I'd prefer answers that aren't specific to `cd`. I have zsh set up to only show the select menu if the completion is unambiguous (`zstyle ':completion:*:*:*:*:*' menu select=2`). I have an alias `alias cd='nocorrect cd'`. When I do `cd` (no space), zsh thinks it is unambiguous, and completes the alias. zsh thinks it is unambiguous--indeed, when I do `cd<^D>`, it only shows the one possible completion. In my mind, it should show other completion options like `cdiff`. Indeed, when I do `cd<^Xn>`, I see those other options. This is also the demonstrated behaviour in the ZSH User's Guide, section 6.5.2. I sort of see what's going on. I have my completers set up as `zstyle ':completion:*' completer _expand _expand_alias _complete _ignored _match _correct _approximate _prefix`, so I can understand why it thinks expanding that alias is the first priority. I just can't figure out why it's the _only_ option. I would think it's something to do with `tag-order`, like in the second example in the user guide section 6.4.2. However, I don't have anything like that set up for this context (`:completion::complete:-command-::`), or anything else it might inherit from. All of my completion-related settings are in this file on Github. Going up from there, you can see my zsh configuration in its entirety; however, I don't have anything set up for `:completion:` outside of this file, including in my `.zshrc`, so I doubt anything's overriding it. So, can someone please explain to me what to do to get the behaviour I want? FYI, I am using zsh with the Prezto framework, which I believe is irrelevant since the problem is entirely related to built-in zsh features and modules. * * * Some output: `cd`: just changes `cd` to `nocorrect cd`, no menu. $ cd<^D> -- alias -- nocorrect cd $ cd<^Xn> -- external command -- cdbs-edit-patch cd-fix-profile cdiff cd-create-profile cd-iccdump -- builtin command -- cd -- shell function -- cdls -- alias -- cd -- parameter -- CDPATH cdpath"} {"id":"41278","title":"To which audio format can I convert aac lost-free with ffmpeg?","text":"Since I did not manage to get the audio work with ffmpeg -i video.mp4 -acodec copy -vcodec copy out.avi I'm searching for an audio format to which I can convert `aac` lost-free. Does such an audio-format exist for this scope?"} {"id":"138227","title":"Iptables not forwarding. Input instead","text":"I have set up iptables on my ubuntu headless server: iptables -S -P INPUT ACCEPT -P FORWARD DROP -P OUTPUT ACCEPT -A INPUT -s 10.1.3.90\/32 -i eth0 -j LOG --log-prefix \"INPUT: \" -A INPUT -i eth1 -j ACCEPT -A INPUT -i ppp0 -j ACCEPT -A FORWARD -s 10.1.3.90\/32 -i eth0 -j LOG --log-prefix \"FORWARD: \" -A FORWARD -i eth0 -j ACCEPT -A FORWARD -i eth1 -o eth0 -j ACCEPT -A FORWARD -i ppp0 -o eth0 -j ACCEPT iptables -S -t nat -P PREROUTING ACCEPT -P INPUT ACCEPT -P OUTPUT ACCEPT -P POSTROUTING ACCEPT -A PREROUTING -s 10.1.3.90\/32 -j LOG --log-prefix \"ROUTE: \" -A PREROUTING -i eth0 -p tcp -m tcp --dport 22 -j ACCEPT -A PREROUTING -i eth0 -p tcp -m tcp --dport 11108 -j DNAT --to-destination 169.254.1.2:11108 -A PREROUTING -i eth0 -p udp -m udp --dport 11108 -j DNAT --to-destination 169.254.1.2:11108 -A PREROUTING -i eth0 -p tcp -m tcp --dport 5555 -j DNAT --to-destination 169.254.1.2:5555 -A PREROUTING -i eth0 -j DNAT --to-destination 169.254.2.2 -A POSTROUTING -o eth0 -j MASQUERADE -A POSTROUTING -s 169.254.1.2\/32 -o eth0 -j MASQUERADE -A POSTROUTING -s 169.254.2.2\/32 -o eth0 -j MASQUERADE When i send UDP packet to port 11108 it should be routed to ppp0 169.254.1.2:11108 and FORWARD rule should apply. instead a INPUT rule is applied and packet is not routed. this is the log from kernel. there is no FORWARD: Jun 20 10:58:51 ubuntu kernel: [ 337.871043] INPUT: IN=eth0 OUT= MAC=00:1c:42:02:04:dd:00:1c:42:d7:b0:24:08:00 SRC=10.1.3.90 DST=10.1.3.117 LEN=52 TOS=0x00 PREC=0x00 TTL=128 ID=22127 PROTO=UDP SPT=11108 DPT=11108 LEN=32 Jun 20 10:58:53 ubuntu kernel: [ 339.865420] INPUT: IN=eth0 OUT= MAC=00:1c:42:02:04:dd:00:1c:42:d7:b0:24:08:00 SRC=10.1.3.90 DST=10.1.3.117 LEN=68 TOS=0x00 PREC=0x00 TTL=128 ID=22484 PROTO=UDP SPT=11108 DPT=11108 LEN=48 Jun 20 10:58:55 ubuntu kernel: [ 341.864446] INPUT: IN=eth0 OUT= MAC=00:1c:42:02:04:dd:00:1c:42:d7:b0:24:08:00 SRC=10.1.3.90 DST=10.1.3.117 LEN=68 TOS=0x00 PREC=0x00 TTL=128 ID=22818 PROTO=UDP SPT=11108 DPT=11108 LEN=48 Jun 20 10:58:57 ubuntu kernel: [ 343.707469] ROUTE: IN=eth0 OUT= MAC=ff:ff:ff:ff:ff:ff:00:1c:42:d7:b0:24:08:00 SRC=10.1.3.90 DST=10.1.3.255 LEN=229 TOS=0x00 PREC=0x00 TTL=128 ID=23133 PROTO=UDP SPT=138 DPT=138 LEN=209 Jun 20 10:58:57 ubuntu kernel: [ 343.863994] INPUT: IN=eth0 OUT= MAC=00:1c:42:02:04:dd:00:1c:42:d7:b0:24:08:00 SRC=10.1.3.90 DST=10.1.3.117 LEN=68 TOS=0x00 PREC=0x00 TTL=128 ID=23266 PROTO=UDP SPT=11108 DPT=11108 LEN=48 Jun 20 10:58:59 ubuntu kernel: [ 345.877465] INPUT: IN=eth0 OUT= MAC=00:1c:42:02:04:dd:00:1c:42:d7:b0:24:08:00 SRC=10.1.3.90 DST=10.1.3.117 LEN=52 TOS=0x00 PREC=0x00 TTL=128 ID=23684 PROTO=UDP SPT=11108 DPT=11108 LEN=32 Jun 20 10:58:59 ubuntu kernel: [ 345.879215] INPUT: IN=eth0 OUT= MAC=00:1c:42:02:04:dd:00:1c:42:d7:b0:24:08:00 SRC=10.1.3.90 DST=10.1.3.117 LEN=68 TOS=0x00 PREC=0x00 TTL=128 ID=23707 PROTO=UDP SPT=11108 DPT=11108 LEN=48 Jun 20 10:59:00 ubuntu kernel: [ 346.010347] ROUTE: IN=eth0 OUT= MAC=ff:ff:ff:ff:ff:ff:00:1c:42:d7:b0:24:08:00 SRC=10.1.3.90 DST=10.1.3.255 LEN=78 TOS=0x00 PREC=0x00 TTL=128 ID=23798 PROTO=UDP SPT=137 DPT=137 LEN=58 Jun 20 10:59:00 ubuntu kernel: [ 346.759893] ROUTE: IN=eth0 OUT= MAC=ff:ff:ff:ff:ff:ff:00:1c:42:d7:b0:24:08:00 SRC=10.1.3.90 DST=10.1.3.255 LEN=78 TOS=0x00 PREC=0x00 TTL=128 ID=23811 PROTO=UDP SPT=137 DPT=137 LEN=58 Jun 20 10:59:01 ubuntu kernel: [ 347.509887] ROUTE: IN=eth0 OUT= MAC=ff:ff:ff:ff:ff:ff:00:1c:42:d7:b0:24:08:00 SRC=10.1.3.90 DST=10.1.3.255 LEN=78 TOS=0x00 PREC=0x00 TTL=128 ID=23944 PROTO=UDP SPT=137 DPT=137 LEN=58 Jun 20 10:59:01 ubuntu kernel: [ 347.878185] INPUT: IN=eth0 OUT= MAC=00:1c:42:02:04:dd:00:1c:42:d7:b0:24:08:00 SRC=10.1.3.90 DST=10.1.3.117 LEN=68 TOS=0x00 PREC=0x00 TTL=128 ID=24086 PROTO=UDP SPT=11108 DPT=11108 LEN=48 Jun 20 10:59:01 ubuntu kernel: [ 347.881900] INPUT: IN=eth0 OUT= MAC=00:1c:42:02:04:dd:00:1c:42:d7:b0:24:08:00 SRC=10.1.3.90 DST=10.1.3.117 LEN=52 TOS=0x00 PREC=0x00 TTL=128 ID=24109 PROTO=UDP SPT=11108 DPT=11108 LEN=32"} {"id":"138264","title":"Debian 7 remote access - grey background","text":"I Have got problem. After installing gnome\/kde and vnc I have a problem while opening remote vnc- viewer. Grey background occeress http:\/\/i.imgur.com\/QomWGIR.png What is the problem with it? Debian 7\/64bit\/wheezy"} {"id":"77404","title":"Unable to concatenate files with find .\/subdir\/* -print0 | sort | xargs -0 cat > merge.txt","text":"I am trying to concatenate thousands of files that result from processing the pieces output by `split` with find .\/subdir\/* -print0 | sort | xargs -0 cat > full_merge.txt The files under `subdir` are: something.foo.aaaaa.output something.foo.aaaab.output something.foo.aaaac.output ... But I get `File name too long` Why?"} {"id":"77400","title":"GNU toolchains against GCC SVN?","text":"Is there anything like CodeSourcery which provides prebuilt binaries for arm toolchains built against gcc-svn. http:\/\/elinux.org\/Toolchains#Prebuilt_toolchains Otherwise, a working instruction for successfully building against gcc-svn would be fine."} {"id":"19439","title":"How can I display syntax highlighting on a file?","text":"Is there a variant of `cat` that outputs syntax-highlighted lines of code when used on a source file? An idea: maybe `vi[m]` or another editor can be asked to dump the syntax- highlighted contents of said files to `stdout` and exit immediately?"} {"id":"98810","title":"How to `cat` file with syntax highlight?","text":"In my hello.c: > \/* Hello World program *\/ > > #include > > main() { > > > printf(\"Hello World\"); > > > } How can i `cat` this file on terminal with syntax highlight?"} {"id":"137453","title":"mount.cifs fails while smbclient succeeds","text":"I'm trying to mount a NetApp CIFS share to one of our servers and I keep getting \"Permission Denied\" printed to stderr and `NT_STATUS_WRONG_PASSWORD` printed to the running `dmesg`. root@xxxehpvld05 ~ $ mount.cifs -vv \/\/zhp-nas.xxx.com\/perspectives \/mnt\/secure\/cifs -o credentials=\/etc\/cifs.creds mount error(13): Permission denied Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) root@xxxehpvld05 ~ $ dmesg | tail CIFS VFS: cifs_mount failed w\/return code = -13 Status code returned 0xc000006a NT_STATUS_WRONG_PASSWORD CIFS VFS: Send error in SessSetup = -13 CIFS VFS: cifs_mount failed w\/return code = -13 Status code returned 0xc000006a NT_STATUS_WRONG_PASSWORD CIFS VFS: Send error in SessSetup = -13 CIFS VFS: cifs_mount failed w\/return code = -13 Status code returned 0xc000006a NT_STATUS_WRONG_PASSWORD CIFS VFS: Send error in SessSetup = -13 CIFS VFS: cifs_mount failed w\/return code = -13 The `smbclient` command, however works without issue, using the same exact credentials file: root@xxxehpvld05 ~ $ smbclient -L \/\/zhp-nas.xxx.com\/perspectives -A \/etc\/cifs.creds Domain=[XXX] OS=[Windows 5.0] Server=[Windows 2000 LAN Manager] Sharename Type Comment --------- ---- ------- IPC$ IPC Remote IPC ZHPSubmit-dev Disk [...snip...] It seems like if one works the other should as well especially since the credentials file also specifies the domain name."} {"id":"24026","title":"How to run a command when a directory's contents are updated?","text":"There is a directory A whose contents are changed frequently by other people. I have made a personal directory B where I keep all the files that have ever been in A. Currently I just occasionally run rsync to get the files to be backed up from A to B. However I fear the possibility that some files will get added in A, and then removed from A before I get the chance to copy them over to B. What is the best way to prevent this from occurring? Ideally i'd like to have my current backup script run every time the contents of A get changed."} {"id":"49067","title":"FTP Upload Hook","text":"> **Possible Duplicate:** > How to run a command when a directory's contents are updated? I need to be notified and perform other tasks when a file is uploaded onto my server. Is there any method\/system call that will be triggered or anything that I can hook onto? I'm using vsftpd as my ftp server."} {"id":"53607","title":"How to monitor specific files in unix","text":"> **Possible Duplicate:** > How to run a command when a directory’s contents are updated? Any one know how to monitor files in Unix. I want to take backup of that files when its modified and store it in another server."} {"id":"123322","title":"Some files under `\/` are owned by UID `501`, is this dangerous?","text":"I just noticed that that the directory `\/usr` was owned by UID `501` on my system. Such a user does not exist on my system, as verified by looking at `\/etc\/passwd`. Have I suffered a security breach, or is there some more normal reason for this to happen?"} {"id":"123329","title":"Midnight Commander displays 'Unselect' dialog when I press F4 to edit a file","text":"When I press F4 in Midnight Commander, I expect it to edit a file. It displays the 'Unselect' dialog instead. What could have caused it and how can I fix it? This may or may not be caused by my attempts to change the editor to `nano`"} {"id":"7122","title":"Does LVM impact performance?","text":"I have to migrate a few servers to Linux, and one important aspect that I need to evaluate is that my new host system must have elastic storage capacity. Naturally, doing some basic research, I came across LVM. Is there any performance penalty for using lvm? If so, how can I measure it? What I am considering right now is to have Linux as a host OS with LVM and virtualized Linux boxes running on top of it (should I add LVM on the guest OS as well?)."} {"id":"7121","title":"CentOS 5.5 Install Customization","text":"I'm having a frustrating time with customizing my initial CentOS 5.5 installation. I want to have a specific set of the packages installed (e.g. I want Java and httpd but not OpenOffice or NewsServer) but each time I carefully go through all the customization screens on installation it seems to somewhat randomly select and deselect other options. I'm trying to write up a repeatable step-by-step doc but something isn't right. I've tried picking just \"Desktop - Gnome\" or \"Server GUI\" or even none of them. Then I choose the \"Customize now\" option and go through each of the packages that I want. What's odd is what comes out after the reboot is different each time. Does it matter which default package group I choose if I'm going to customize the lists? Another oddity happens if I try to customize after the fact. For instance, if I try to just remove OpenOffice, it removes Gnome as a side-effect. I didn't uncheck the Gnome box but it appears that since OpenOffice is dependent upon Gnome, it gets removed as well. This implies that I need to do a minimal install and build it up as needed. Am I missing some core metaphor that the installer is using? I'm using the exact same DVD image each time so I'm confused why I'm having such different results. Also I'm using the graphical installation mode. Ideally I'd be able to create a kickstart config from a good install. Any pointers would help."} {"id":"42052","title":"How to tweet using terminal?","text":"I would like to tweet a message using terminal. I tried something like: curl -u 'TwitterUsername':'TwitterPassword' -d status=”Your Message Here” https:\/\/twitter.com\/statuses\/update.xml but seems this isn't working anymore. I get a error like this one: Basic authentication is not supported<\/error> <\/errors> So, how could we tweet from the terminal? PS.: my motivation to this is because I use the Yakuake terminal a lot, and it would be awesome to tweet from there."} {"id":"84546","title":"Preventing script execution and file downloads in a directory?","text":"I have a directory on my website where I'm storing files uploaded by users. I use a whitelist for uploaded file types and also save the files with hashed names, but from what I've read another good security precaution is to stop script execution in the directory. I also want to prevent files in the directory from being directly accessed since I don't want users to be able to download files that aren't theirs. My server runs Linux with Apache. Is the following .htaccess file correct for what I'm trying to achieve? order deny,allow deny from all SetHandler None <\/FilesMatch>"} {"id":"592","title":"Is there a graphical front end to the Solaris Service Management Facility?","text":"I have a few service errors at startup on an opensolaris installation that I keep put off fixing since I would need to figure out the line commands again. Is there an easier to use front end?"} {"id":"109080","title":"Was my Unix server compromised?","text":"Someone asked if this constituted a break-in and wondered if their server had been compromised. > Jan 12 04:16:51 foo sshd[26725]: Failed password for root from 61.174.51.207 > port 1076 ssh2 > Jan 12 04:16:54 foo sshd[26822]: Disconnecting: Too many authentication > failures for root > Jan 12 04:16:54 foo sshd[26825]: Failed password for root from > 61.174.51.207 port 1076 ssh2 > Jan 12 04:16:54 foo sshd[27324]: PAM 5 more authentication failures; > logname= uid=0 euid=0 tty=ssh ruser= rhost=61.174.51.207 user=root \"secure\" > 229L, 24376C How does one go about diagnosing whether their server was compromised?"} {"id":"47946","title":"Unable to install Mono 2.6 on CentOS","text":"I have an application that breaks on mono 2.10, so I'm trying to install an older mono instead. I found an RPM and tried to install it, but it won't install (I believe) because the glibc and gcc versions that are on CentOS 6.3 are too high. (it actually says it lacks the dependencies for GLIBC_2.7 and GCC_3.3.1 even though I have versions 2.12 and 4.4 installed as part of CentOS 6.3, so I can only assume it's a problem because they're too high) How should I proceed?"} {"id":"77885","title":"How can I connect to Gnome 3 with a Windows VNC client?","text":"I used to be able to connect to my Gnome 3 desktop from a Windows machine with a VNC client. But after an upgrade (on the Linux side) a while ago, it quit working. When I attempt to connect, all I can get is a message saying \"No matching security types\" or \"No supported authentication methods!\" (depending on which client I try). In Gnome 3, I've turned on Screen Sharing under Settings > Sharing. Under that, I have Remote View on, Remote Control on, Approve All Connections on, Require Password off. I'm running Arch Linux with vino 3.8.1. On the Windows side, I've tried TigerVNC 1.0.1 & 1.2.0 and UltraVNC 1.0.9.6.2. How can I get this working?"} {"id":"18104","title":"How can I convert a PEM key into a RSA key pair?","text":"I was just sent a PEM key from a client as a means to access their Amazon EC2 instance. How do I convert this into something I could use with OpenSSH?"} {"id":"30075","title":"how to resize horizontally a screen region","text":"I am using `screen` to split my terminals but I would like to be able to resize the horizontal dimension of the split screens. If I do `C-a :resize 10` I only change the vertical dimension to 10 lines. How do I achieve the same but for the horizontal dimension?"} {"id":"30072","title":"Not enough space on \/ to install new kernel update","text":"During a recent update I received this: Installing: kernel-default-2.6.37.6-0.11.1 [error] Installation of kernel-default-2.6.37.6-0.11.1 failed: (with --nodeps --force) Error: Subprocess failed. Error: RPM failed: installing package kernel-default-2.6.37.6-0.11.1.x86_64 needs 147MB on the \/ filesystem Abort, retry, ignore? [a\/r\/i] (a): i Installing: kernel-desktop-2.6.37.6-0.11.1 [error] Installation of kernel-desktop-2.6.37.6-0.11.1 failed: (with --nodeps --force) Error: Subprocess failed. Error: RPM failed: installing package kernel-desktop-2.6.37.6-0.11.1.x86_64 needs 148MB on the \/ filesystem Abort, retry, ignore? [a\/r\/i] (a): i Installing: kernel-source-2.6.37.6-0.11.1 [error] Installation of kernel-source-2.6.37.6-0.11.1 failed: (with --nodeps --force) Error: Subprocess failed. Error: RPM failed: installing package kernel-source-2.6.37.6-0.11.1.noarch needs 432MB on the \/ filesystem Which I am assuming means my `\/` partition needs some room. So I checked the size\/space: Filesystem Size Used Avail Use% Mounted on \/dev\/sda1 25G 24G 208M 100% \/ How did `\/` grow to be so huge!? Is this a common occurrence and is there a quick trick to freeing up some space? I assume that there are things I'm not using in there and I've been able to update kernels easily for the past year -- so something is accumulating. I'd rather figure out what I free up (are old kernels kept?) instead of re- partitioning my whole drive to grow `\/`."} {"id":"38266","title":"Difference between Oracle VM and Citrix XEN?","text":"I`ve been testing Oracle-VM this day. Is there anyone out there who has tested both XEN-based solutions? What are the main differences?"} {"id":"72907","title":"Trouble communicating with FTDI FT245RL on ttyUSB0. works fine on Win7x64","text":"I purchased a Sainsmart 4 channel USB relay board which seems to be based on a FTDI FT245RL chip. I should be easy enough to use. when you plug it in it appears as a serial port (VCP). You send it three bytes which tell it what to turn on and off. E.g. \\xFF\\x00\\x01 turns on just relay 1 and \\xff\\x00\\x03 turns on relay 1 and 2. I wrote a very simple python program to test this on a Debian squeeze machine: import serial ser = serial.Serial('\/dev\/ttyUSB0') # Defaults to 9600 8N1 ser.open() ser.write(chr(255) + chr(0) + chr(3)) ser.close ...and nothing happened. Sometimes I get nothing, and sometimes it blocks. I installed the drivers on a win7x64 machine, and changed one line to point to COM3, it works great. I then tried it on a CentOS 5 machine and it doesn't work here either. I don't think it is permissions, I've added the users to the dialout and uucp groups respectively. I've also tried it as root. I was able to set up a udev rule on Debian which seems to work. If I do **lsusb** , this is the relevant result: Bus 005 Device 002: ID 0403:6001 Future Technology Devices International, Ltd FT232 USB-Serial (UART) IC If I do stty -F \/dev\/ttyUSB0 -a I get speed 9600 baud; rows 0; columns 0; line = 0; intr = ^C; quit = ^\\; erase = ^?; kill = ^U; eof = ^A; eol = ; eol2 = ; swtch = ; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; flush = ^O; min = 0; time = 0; -parenb -parodd cs8 hupcl -cstopb cread clocal -crtscts -ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8 -opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 -isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke"} {"id":"31305","title":"ssh \"-f\" don't give back hand in bash when listening to stdout\/stderr","text":"Please look at these: ## Does NOT return to the shell, but Ctrl-C can exit ssh -S none -fNR 13018:localhost:22 example.com | cat ## Returns to the shell (no \"-S none\") ssh -fNR 13019:localhost:22 example.com | cat ## Returns to the shell (no \"| cat\") ssh -S none -fNR 13020:localhost:22 example.com Why the first command does not return to the shell ? I expected it to return to the shell as the other did (as the `-f` _Requests ssh to go to background just before command execution._ ) and is present in the 3 samples I gave and seem to behave erraticaly upon redirection of its output (symbolized here by the `| cat`). The `-S none` is not a related option (especially that `-S none` should be the default behavior as I haven't any ControlMaster options set) and it seems nevertheless to change the behavior of `-f`. All this puzzles me. Is there any way to catch the stdout\/stderr of the last command with this command returning to the shell, to be able to react according to its output ? The whole story: I want to run SSH tunnel and upon failure, check if it is related to port being in use. In that case I'll try another port. I can't use error level as it is not distinctive, and while trying to catch stderr, I ran in ssh behaviors that are not clear for me and they seem even bogus (there shouldn't be any differences between using `-S none` and not using it, because it is the default value and I checked my `~\/.ssh\/config` that was empty, and the `\/etc\/ssh\/ssh_config` had no `ControlMaster` related option set.) EDIT: * It seems that I cannot reproduce the second example as described. Could the `ssh` process terminates sometimes _before_ and sometimes _after_ `cat` process opens the pipe ?"} {"id":"47508","title":"String syntax for the kbd macro in Emacs","text":"> **Possible Duplicate:** > Associating a function in Emacs after looking up the code with M-x > describe-key I have typed the following macros on my `.emacs` file (global-set-key (kbd \"M-\") 'windmove-left) ; move to left windnow (global-set-key (kbd \"M-\") 'windmove-right) ; move to right window (global-set-key (kbd \"M-\") 'windmove-up) ; move to upper window (global-set-key (kbd \"M-\") 'windmove-down) ; move to lower window However, when I press `Alt`+`left` or any of the other keyboard combinations, I get errors like the following in the minibuffer `M-o 3 c is undefined`. Why doesn't it work? I thought I was following the syntax described here (`kbd` macro)."} {"id":"11226","title":"Are there any desktop email clients that implement gmail style conversation view?","text":"I don't like threaded email views as much as the inline \"conversation view\" of gmail, however gmail is not as fast as I'd like it to be. Are there any desktop clients which provide a \"conversation view\"?"} {"id":"19058","title":"How to replace one char with another in all filenames of the current directories?","text":"How do you rename all files\/subdirs in the current folder? Lets say, I have many files and subdirs that are with spaces and I want to replace all the spaces with an underscore. File 1 File 2 File 3 Dir 1 Dir 3 should be renamed to File_1 File_2 File_3 Dir_1 Dir_3"} {"id":"155172","title":"Mathematical processing on text file","text":"I have 200 text files. Each text file contains one column of mathematical numbers (100k rows). I want to do some statistical processing on these data (finding the probit or quantile). I know the mean and sigma value associated for each file. Is there any direct way to calculate probit or quantile of a dataset? If not, then I know the formula for quantile which is =(sorted data- mean)\/sigma. e.g. _input_file.txt_ 12.2 10.11 15.55 5.01 ... ... 12.9 _temp.txt_ 5.01 10.11 12.2 12.9 15.55 ... ... Final output file should contain two columns. First column is same as `temp_output.txt` and second column is the following mathematical function on each element: = (row(i)-mean)\/sigma Where mean and sigma are two mathematical number say 10.1 and 2.02 respectively. Final output file should look like this for above values _output.txt_ 5.01 -2.51980198 10.11 0.004950495 12.2 1.03960396 12.9 1.386138614 15.55 2.698019802 ... ..."} {"id":"155170","title":"How to access a RHEL desktop remotely without unlocking the screen?","text":"I usually leave a lot of processes running on my RHEL 6 workstation, and sometimes need to access the desktop remotely on my Macbook. I have used Screen Sharing on Mac and it works fine, except that the RHEL desktop gets unlocked every time I do, so anybody that wants to play the smart-ass can simply drop by my desk and wreak havoc with the mouse and keyboard. Is there any way to leave the desktop screen locked when I access it remotely?"} {"id":"37368","title":"How can I get entries for a given time period from a 400MB+ log file?","text":"I have a 400MB+ Tomcat log file (`catalina.out`). How can I pull out entries for a given time period?"} {"id":"109857","title":"Combining options in find command","text":"Using the `find` command is there a way to combine options: i.e. find . -type fd -name \"somefile\" Although `-type` ignores the second option; I'm looking to find only files or directories."} {"id":"82647","title":"Adding a time stamp when moving a file in bash","text":"#!\/bin\/bash while read server <&3; do #read server names into the while loop if [[ ! $server =~ [^[:space:]] ]] ; then #empty line exception continue fi echo \"Connecting to - $server\" #ssh \"$server\" #SSH login while read updatedfile <&3 && read oldfile <&4; do echo Comparing $updatedfile with $oldfile if diff \"$updatedfile\" \"$oldfile\" >\/dev\/null ; then echo The files compared are the same. No changes were made. else echo The files compared are different. # copy the new file and put it in the right location # make a back up of the old file and put in right location (time stamp) # rm the old file (not the back up) #cp -f -v $newfile mv $oldfile \/home\/u0146121\/backupfiles\/$oldfile_$(date +%F-%T) fi done 3<\/home\/u0146121\/test\/newfiles.txt 4<\/home\/u0146121\/test\/oldfiles.txt done 3<\/home\/u0146121\/test\/servers.txt This is my whole script mv $oldfile \/home\/u0146121\/backupfiles\/$_$(date +%F) This moves the file correctly but it removes the actualy file name and just adds the date. I want to keep the original file name and add the current date to the file name."} {"id":"39131","title":"How to change permissions of multiple files found with find command?","text":"I have a directory with numerous files. Part of the files have the `755` permissions and the other part have `644` permissions. I'd like to convert the files with `755` permissions to `644`. I have tried the following line by running it from the directory itself: find . -perm 755 -exec chmod 644 {}\\; However as a result, the permission changed only for the directory itself and after changing it back I found out that the files permissions remained unchanged. Do I miss something?"} {"id":"16622","title":"bash: cd to the most recently modified child directory","text":"Wondering if there's an easy and\/or portable way to say \"change to the most recently modified child directory.\" I can use ls and awk but there's probably a better way. cd $( ls -ltrd *\/ | tail -1 | awk '{ print $8 }' ) I have to run a command in an \"output files\" directory with hundreds of subdirectories and 99% of the time I want to go to the most recently changed directory. I don't know what the names of the directories will be in advance."} {"id":"16623","title":"File permission execute only","text":"How can I set file to be executable only to other users but not readable\/writable, the reason for this I'm executing something with my username but I don't want to give out the password. I tried : chmod 777 testfile chmod a=x chmod ugo+x I still get permission denied when executing as another user."} {"id":"140780","title":"Cannot open GUI's via SSH connection?","text":"I've just connected to a Linux terminal using an `ssh` client. I'm running Linux on both desktops, but cannot open PDFs, IDE, or other graphics from the ssh client. How can I fix this?"} {"id":"59769","title":"How to view Graphical view of Application using ssh","text":"> **Possible Duplicate:** > How to forward X over SSH from Ubuntu machine? Is it possible that I can view the GUI of application when I pass some command to Redhat linux Server using ssh. Like when I pass command Firefox it launches the Firefox and I can see GUI Firefox. Note :: I have not installed vnc server."} {"id":"88100","title":"importing data from a text file to a bash script","text":"I need to import a text file like this below: AMBI CBNK CCXI CERE CLACW CNYD DAEG DLIA DLLR DNDN DSGX HAST HIBB, HPOL IRDMZ MARK NEPT NFEC NINE NRCIB OMER PLCC PLPM PSUN UNTK There are 25 entries, I need to pass them into a bash script. I want to run the program once for each symbol. The symbols are Nasdaq stock symbols. I'm trying to pull a quote with the script. I've been able to do this command manually: sh stock (symbol) > \/home\/user\/Desktop\/stockquote.txt by inputting the (symbol) manually, I need a a script to do it automatically."} {"id":"100787","title":"Bring Debian to second Position in the GRUB Menu at startup","text":"So, I currently have BOSS Linux and I am going to install debian (currently installing right now) And I want my older OS (BOSS linux), on the first position and the debian, (freshly installed) to be on the second. Please tell me how to do that"} {"id":"153638","title":"Apache web server configuration with a DNS server Linux 14.04 LTS","text":"I need to configure a Apache web server with a DNS server, it can be a simple local server configuration just to practice and see how a DNS server resolves a URL to an ip address and connects to a web server. I already have LAMP installed on my computer but I don't know how or where to start with the DNS server. If there are any tutorials similar to what Iam trying to do I would appreciate it."} {"id":"16990","title":"Using data read from a pipe instead than from a file in command options","text":"Per man definition, this command gets the input from a file. $ command -r FILENAME Suppose that `FILENAME` is a file containing a list of filenames, as it was generated using `ls > FILENAME`. How can I, instead, feed the command with the result of `ls` directly? In my head something like this should be possible: `$ ls | command -r` But it doesn't, the output of `ls` doesn't get hooked as an argument. Output: Usage: command -r FILENAME error: -r option requires an argument How could I obtain the desired effect?"} {"id":"24112","title":"\"cd \/\/\" and \"cd \/\" what is the difference?","text":"> **Possible Duplicate:** > unix, difference between path starting with '\/' and '\/\/' If I make a `cd \/\/` followed by a `pwd` I see: # cd \/\/ # pwd \/\/ why is that? what's the differece with: cd \/ pwd \/ Everything looks the same to me..."} {"id":"21156","title":"Install ffmpeg 0.7.1-5 from debian package","text":"I downloaded this package for ffmpeg. When I try to install it with command `sudo dpkg -i ffmpeg_0.7.1-5_i386.deb` it writes this error message: Unpacking ffmpeg (from ffmpeg_0.7.1-5_i386.deb) ... dpkg: error processing ffmpeg_0.7.1-5_i386.deb (--install): trying to overwrite '\/usr\/share\/ffmpeg\/libx264-ipod640.ffpreset', which is also in package libavcodec-extra-52 4:0.5.1-1ubuntu1.2 dpkg-deb: subprocess paste killed by signal (Broken pipe) Errors were encountered while processing: ffmpeg_0.7.1-5_i386.deb Could you help me with the installation of this particular version (0.7.1-5) for Ubuntu 10.04? EDIT: after command `sudo apt-get remove libavcodec52 libavcodec-extra-52` new output Should I go manually now step by step and install the dependencies (and possibly their dependencies) or is there some trick?"} {"id":"21485","title":"What is the maximum memory a 64bit process can consume?","text":"I know that there is a hardware capacity of 2^48 bits, and I know that there isn't a lot of native limiting of app memory constraints in general by the kernel, but is there an upper bound of the memory that an app can consume in general besides 2^48 because that's the number of channels available on the DIMM sockets? For reference, Redmond limits their products to ~2TB on most server products."} {"id":"125564","title":"strange NTP traffic","text":"I have a number of openSUSE VMs (mostly 13.1). One of the VMs is configured to sync its time with the outside world, the other ones sync with this one. This has never caused problems (I am aware of). Now I noticed that ntpd on the outside-connected VM causes about 9% CPU load (permanently!) and makes connections to 15+ hosts causing outbound traffic of about 100K\/s and inbound traffic at a little lower level (all from\/to my UDP port 123) – which even continues (now for several minutes) after I have stopped ntpd and there is no such outbound traffic any more. I had configured ntpd to the pool address de.pool.ntp.org but that does not make a difference. I made a distro upgrade (booting from DVD) and afterwards even reinstalled ntp without any change. **Edit: problem \"solved\"** After I have blocked incoming UDP 123 completely `ntpd` acts normally. I still don't understand what may have caused this. It should not be possible to connect to this VM port from the outside. There is no port forwarding in the VDSL router. But: A few minutes ago I sent a UDP packet to port 123 from the Internet and (whyever) the VDSL router passed it to the VM. If I repeat that now then the packet does not reach the VM any more. Maybe that was a strange NAT side effect of the many UDP 123 connections. I am going to block this traffic except for the intended servers."} {"id":"42289","title":"I installed Linux Mint 13 Maya (MATE) 64 bit, what should I choose when asked between Ubuntu, Fedora, etc?","text":"Every other download for Linux, I'm being asked what distribution I have (Ubuntu, Fedora, Debian etc) What should I choose having installed Linux Mint 13 Maya (MATE) 64 bit?"} {"id":"108629","title":"Utilizing a newer standalone glibc","text":"We're running RHEL6, which only officially supports glibc 2.12. A user is requesting that we install a newer version. I grabbed 2.18 from http:\/\/ftp.gnu.org\/gnu\/glibc\/ and had no trouble running configure\/make. However when I attempt a small program to test it, I don't get the desired result: **test.c** #include #include <\/scratch\/new-glibc-testing\/include\/gnu\/libc-version.h> int main (void) { puts (gnu_get_libc_version ()); return 0; } I then compile and run with: gcc test.c .\/a.out And the output I get is: 2.12 when I was hoping to get: 2.18 I also tried: gcc -I\/scratch\/new-glibc-testing\/include test.c and changed the define line to: #include which compiles, but gives the same result (2.12). I tried also using -nostdlib, ex: gcc -nostdlib -I\/scratch\/new-glibc-testing test.c This, however, throws errors: \/usr\/bin\/ld: warning: cannot find entry symbol _start; defaulting to 0000000000400144 \/tmp\/cc6x03Do.o: In function `main': test.c:(.text+0x5): undefined reference to `gnu_get_libc_version' test.c:(.text+0xd): undefined reference to `puts' collect2: ld returned 1 exit status `gcc --version` results in: **gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-4)**"} {"id":"53077","title":"Firefox circular-dependency hell on Linux Mint 13","text":"Having difficulty re-installing Firefox, after an installation to resolve `places.sqlite` issues. It appears that I'm trapped in _circular_ dependency hell. Need to resolve firefox dependency hell to attempt to resolve Tomcat6 project dependencies (don't ask), ASAP. Have been trying for hours. What I've done (brief) sudo apt-get purge firefox firefox-globalmenu firefox-gnome-support sudo apt-get update sudo apt-get install firefox firefox-globalmenu firefox-gnome-support sudo apt-get -f install * * * **Potential error sources:** Found in `sudo apt-get install firefox firefox- globalmenu firefox-gnome-support` > dpkg: error processing > \/var\/cache\/apt\/archives\/firefox_18.0~a2~hg20121027r113701-0ubuntu1~umd1~precise_amd64.deb > (--unpack): trying to overwrite '\/usr\/lib\/firefox\/extensions', which is also > in package mint-search-addon 2012.05.11 So, `\/usr\/lib\/firefox\/extensions` doesn't even EXIST! Deleted `\/var\/cache\/apt\/archives\/firefox_18.0~a2~hg20121027r113701` as per recommendations. Errors were encountered while processing: \/var\/cache\/apt\/archives\/firefox_18.0~a2~hg20121027r113701-0ubuntu1~umd1~precise_amd64.deb E: Sub-process \/usr\/bin\/dpkg returned an error code (1) Outputs: * `sudo apt-get purge firefox firefox-globalmenu firefox-gnome-support` tyler@machine ~ $ sudo apt-get purge firefox firefox-globalmenu firefox-gnome-support [sudo] password for tyler: Reading package lists... Done Building dependency tree Reading state information... Done Package firefox is not installed, so not removed The following packages will be REMOVED: firefox-globalmenu* firefox-gnome-support* 0 upgraded, 0 newly installed, 2 to remove and 38 not upgraded. 2 not fully installed or removed. After this operation, 460 kB disk space will be freed. Do you want to continue [Y\/n]? y (Reading database ... dpkg: warning: files list file for package `mysqltuner' missing, assuming package has no files currently installed. (Reading database ... 192642 files and directories currently installed.) Removing firefox-globalmenu ... Removing firefox-gnome-support ... * `tyler@machine ~ $ sudo apt-get install firefox firefox-globalmenu firefox-gnome-support` tyler@machine ~ $ sudo apt-get install firefox firefox-globalmenu firefox-gnome-support Reading package lists... Done Building dependency tree Reading state information... Done Suggested packages: latex-xft-fonts The following NEW packages will be installed: firefox firefox-globalmenu firefox-gnome-support 0 upgraded, 3 newly installed, 0 to remove and 38 not upgraded. Need to get 0 B\/24.8 MB of archives. After this operation, 54.3 MB of additional disk space will be used. (Reading database ... dpkg: warning: files list file for package `mysqltuner' missing, assuming package has no files currently installed. (Reading database ... 192619 files and directories currently installed.) Unpacking firefox (from ...\/firefox_18.0~a2~hg20121027r113701-0ubuntu1~umd1~precise_amd64.deb) ... dpkg: error processing \/var\/cache\/apt\/archives\/firefox_18.0~a2~hg20121027r113701-0ubuntu1~umd1~precise_amd64.deb (--unpack): trying to overwrite '\/usr\/lib\/firefox\/extensions', which is also in package mint-search-addon 2012.05.11 Selecting previously unselected package firefox-globalmenu. Unpacking firefox-globalmenu (from ...\/firefox-globalmenu_18.0~a2~hg20121027r113701-0ubuntu1~umd1~precise_amd64.deb) ... Selecting previously unselected package firefox-gnome-support. Unpacking firefox-gnome-support (from ...\/firefox-gnome-support_18.0~a2~hg20121027r113701-0ubuntu1~umd1~precise_amd64.deb) ... Processing triggers for man-db ... Processing triggers for desktop-file-utils ... Processing triggers for bamfdaemon ... Rebuilding \/usr\/share\/applications\/bamf.index... Processing triggers for gnome-menus ... Processing triggers for mintsystem ... Errors were encountered while processing: \/var\/cache\/apt\/archives\/firefox_18.0~a2~hg20121027r113701-0ubuntu1~umd1~precise_amd64.deb E: Sub-process \/usr\/bin\/dpkg returned an error code (1) * `sudo apt-get -f install` * 0 upgraded, 0 newly installed, 0 to remove, and 38 not upgraded Ideas? Tomcat6 only deploys my web application successfully in Firefox, not Chrome, so I'm really hoping to resolve this dependency issue."} {"id":"10662","title":"Oneliner for slicing an image?","text":"I'm looking for a oneliner command that would slice an image into given proportions. Say input would be filename and slice dimensions. Are there any standard command-line tools for this? I tried ImageMagick to no avail since it garbled my image immensely (it's big, mostly transparent, png)."} {"id":"13480","title":"Enforce site-wide SSL on Debian LAMP","text":"I have a Debian\/Linux Lenny LAMP server w\/Plesk Panel 10.2. I have a PHP\/MySQL webapp deployed in a Plesk \"webspace\". I want to enforce SSL on site-wide. Do I just forward port 80 to 443? For my single domain cert, do I forward www.domain.com to domain.com or do I forward domain.com to www.domain.com? Should this happen with .htaccess or some vhost config file?"} {"id":"90210","title":"Remove window frame of a program","text":"Is it possible to start a program without its window frame? For example: start flash standalone on a SUSE Linux Enterprise Server 11 sp2 machine without its window frame so it looks like when I start a browser and remove it's window- decoration and show the flash with the browser plugin. We could use the browser but the browser on SLES 11 sp2 is webkit 0.2 and is very bugy. I tried to remove the window with devilspie (http:\/\/rpm.pbone.net\/index.php3\/stat\/4\/idpl\/15612342\/dir\/opensuse_11.x\/com\/devilspie-0.22-10.1.i586.rpm.html) but it does nothing. I was able to install it and set de .ds files but they have no effect. I started the program with: devilspie -d -a Devil's Pie 0.22 starting... Loading \/etc\/devilspie Loading \/root\/.devilspie Loading \/root\/.devilspie\/flashplayer.ds 1 s-expression loaded. The \"flashplayer.ds\": (if (is (application_name) \"flashplayer\") (begin (undecorate) ) ) When I search for active windows with `xlsclients` it shows me that output: # xlsclients SLES11-SP2 xterm SLES11-SP2 \/usr\/bin\/xconsole -notify -nostdin -verbose -exitOnFail SLES11-SP2 flashplayer So the `application_name` must match. Any idea to resolv it with `devilspie` or an other \"trick\"?"} {"id":"96903","title":"Open a port CentOS","text":"I'm new in CentOS and I'm trying to create a little script in Python, something like: $ python -m SimpleHTTPServer If I try to access port 8000 in my web browser, I don't get access, however if I turn off the firewall with: $ system-config-firewall-tui I'm able to access the service. I just need to access port 3343 and 8880 but I don't want to disable the firewall."} {"id":"13158","title":"ranaming multiple file in unix","text":"> **Possible Duplicate:** > Renaming multiple files in unix Rename all files within a folder with the first word of their content(remember all the files should be text files. For example if a.txt contains “Unix is an OS” in its first line then a.txt should be renamed to Unix.txt"} {"id":"120911","title":"Your system isn't configured to run KVM properly","text":"I am trying to install OpenStack on Ubuntu 12.04.3 Desktop AMD 64 in VMware on a host Dell Inspiron15R 5521 with Windows 8 64-bit. I have followed the tutorial here but I'm getting error > Your system isn't configured to run KVM properly. Investigate this before > continuing. after I run the command as suggested in tutorial .\/openstack_networking.sh"} {"id":"20684","title":"How to manipulate awk variable NF in zsh?","text":"I have a simple command line: uptime | awk '{print $(NF - 2)}' In a bash shell, this works without a hitch, but when I run it in zsh, I get the following error: title:5: command not found: NF As usual this will be a pilot error (me not grokking how expansion works in zsh), but I cannot figure out what to do to get the same command to work in zsh. [Edit] The zsh version is 4.3.11 on OSX, and the output from `set -xv; uptime | awk '{print $(NF - 2)}'` is: $ set -xv; uptime | awk '{print $(NF - 2)}' title:5: command not found: NF +zsh:3> uptime +zsh:3> awk '{print $(NF - 2)}' 0.51 +precmd:1> title '%15<..<%~%<<' '%n@%m: %~' +title:1> [ '' '!=' true ']' +title:2> [[ xterm-256color == screen* ]] +title:4> [[ xterm-256color == xterm* ]] +title:5> print -Pn '\\e]2;%n@%m:\\ %~\\a' +title:6> print -Pn '\\e]1;%15\\<..\\<%~%\\<\\<\\a' +zsh:4> git_prompt_info +git_prompt_info:1> ref=+git_prompt_info:1> ref='' +git_prompt_info:1> return +zsh:4> vi_mode_prompt_info +vi_mode_prompt_info:1> echo '' So apparently the awk command works, but my terminal customization is borked."} {"id":"154782","title":"Is possible to change X server without kill client?","text":"My usecase: User opertes on `Server1` station. He can use ssh or whatever to connect with `Remote Station` and start some application on it and display it on his station (`Server1`). Now user has to change his place and operate on `Server2`. I know that he can start new instance of application and display it on `Server2`. But I want to dispaly the same running instane of application on `Server2`. Is it possible? How to do that? ![enter image description here](http:\/\/i.stack.imgur.com\/0KnfJ.png)"} {"id":"20351","title":"Prevent a subdirectory from getting deleted \/ enforce a directory structure","text":"imagine the following folder structure > ..\/documents > > ..\/documents\/templates I have two user groups: * editors * managers Users of both groups should be able to * create new files * modify any files * delete any files in ..\/documents. Both groups should also be able to read any files in ..\/documents\/templates. Only users in group \"managers\" should be able to * create new files * modify any files * delete any files in ..\/documents\/templates. The directory \"..\/documents\/templates\" should be undeletable for both groups! How can I achieve that? I came to the conclusion, that this isn't possible with Linux (even with POSIX ACLs), because you need to set g=rwx for \"documents\", which will allow users of both groups to create\/delete\/modify **any** files in that directory... but +w also allows the deletion of the subdirectory \"templates\" and I don't know a way to deny that."} {"id":"94465","title":"Best way to benchmark different encryption solutions on my system","text":"I want to compare different encryption solutions for encrypting my system, possibly different solutions for different parts of the system such as `\/usr` or `\/home`. In particular I look at dm-crypt partitions, containers, truecrypt, ecryptfs and encfs with different parameters. For several reasons I think that just measuring raw seq read and write speeds using `dd` is not enough: * seq read\/write gives me different CPU loads, for example ecryptfs loads only one core (up to 100%) whereas dm-crypt is faster, but loads both cores, so in real use ecryptfs may be faster when the system is under load from other applications (maybe not, but how do I benchmark this?) * it's all about an SSD so I want to have benchmark, which indicates for which option the system will feel more responsive, so I should include some random read write tests or something like that as well (but I don't know how to do so) * benchmarking a solution for `\/usr` may need other benchmarks than for `\/home` since the i\/o characteristics may be different I should add that my CPU doesn't support AES instructions, so it is a limiting factor in performance. I don't want to isolate a part of the system but compare the different encryption solutions for the SSD in my particular system. So what's the best way to benchmark in my case and how to do it in detail?"} {"id":"122125","title":"Suggest me an iscsi server which supports adding a target at runtime","text":"Default iscsitarget requires to restart the whole server after editing the `\/etc\/iet\/ietd.conf`. This is a problem as if, any iSCSI target is being read\/wrote the server restart will make every operation fail. Moreover I would need to programmatically interact with this server (in java) and, from what I saw, iscsitarget doesn't provide any library\/api to do so..and initiators don't contemplate this operation. So, I believe some other vendor created an iSCSI server more suited to my needs, do you know any?"} {"id":"55066","title":"How to decompress content of various archive types with one command","text":"> **Possible Duplicate:** > Is there any program to provide a consistent interface across multiple > archive types? I have to handle files that come as uncompressed text files or in various archive types (`.gz`, `.zip`, `.tar.gz`, `bz2`...). I want to process their content piped to another command. Is there a tool that detects whether a file is compressed and prints it content uncompressed? The best I could find is a combination of `zcat` (some archive types) and `cat` (non-compressed files)."} {"id":"1343","title":"How does \"top\" command show live results?","text":"How can I write a shell script that shows the results in real time? Something like the `top` command that updates the results after some fixed intervals of time. ![alt text](http:\/\/i.stack.imgur.com\/ZGsik.gif)"} {"id":"50750","title":"Command not found","text":"I am trying to stop a syslog using **chkconfig** but bash says that command is not available. But when I do > man chkconfig it opens man page. This is the command i'm trying to execute. **chkconfig syslog off && \/etc\/init.d\/syslog stop** ![Screen Cap](http:\/\/i.stack.imgur.com\/u88Au.png)"} {"id":"92104","title":"What is wrong with my cron job?","text":"I'm new to linux, and was told I could use a feature called cron job to run a python script I made execute every 10 minutes. Problem is the the python script isn't running. There doesn't seem to be a clear cut way to know if I've formatted the job correctly, but in any case I've tried a number of paths to no avail. Because I'm so new I'll show you the steps I took. On my RasPi, I first typed \"crontab -e\" and get a field like this: # Edit this file to introduce tasks to be run by cron. # # Each task to run has to be defined through a single line # indicating with different fields when the task will be run # and what command to run for the task Skipping more help text # 0 5 * * 1 tar -zcf \/var\/backups\/home.tgz \/home\/ # m h dom mon dow command and I add my line at the bottom, without removing the text above. *\/10 * * * * ~\/WeatherProject\/HOURLY\/windDirExtract.py The above didn't work, and someone else did something similar to this but still no luck. *\/10 * * * * \/home\/MyName\/WeatherProject\/HOURLY\/windDirExtract.py and then I tried different permutations but I've got nothing. *\/10 * * * * \/home\/MyName\/WeatherProject\/HOURLY python windDirExtract.py *\/10 * * * * \/home\/MyName\/WeatherProject\/HOURLY windDirExtract.py I'll make any edits if I haven't been clear, but first big question is can I even run short little python scripts with Cron Job, or did I just get bad advice?"} {"id":"92102","title":"mknod of content in directory","text":"I would like to create a virtual device from a directory i.e. you know, there's these cloud storage providers like dropbox and co and they generally have a software client and then give you access to files saved with them in a certain directory in your home directory. Now I would like to, instead being able to access the files in a directory, I would like to be able to mount it anywhere and access the files like as if they were on a device. How can I create a virtual device like this using mknod **edit 1** : I would like to mount multiple of these devices together in one directory using mhddfs (http:\/\/romanrm.ru\/en\/mhddfs) if possible **edit 2** : I am trying it out with Ubuntu One and Dropbox and I have created `~\/virtcld` in my home and \"mounted\" both cloud directories like this: `mhddfs ~\/Dropbox\/ ~\/Ubuntu\\ One\/ ~\/virtcld\/ -o allow_other` then I have created a bunch of test files in my virtualcd like `time dd if=\/dev\/zero of=test13.bin bs=1024 count=1000000` but once my Dropbbox is filled up, the files do not start to upload to the ubuntu One directory instead..."} {"id":"66624","title":"Where is Xkb getting its configuration?","text":"Is there a way to query where `xkb` is getting its configuration from? Under ArchLinux I have `\/etc\/X11\/xorg.conf.d\/00-keyboard.conf` with Section \"InputClass\" Identifier \"system-keyboard\" MatchIsKeyboard \"on\" Option \"XkbLayout\" \"us,us\" Option \"XkbVariant\" \"altgr-intl,colemak\" Option \"XKbOptions\" \"ctrl:nocaps,grp:alt_shift_toggle\" EndSection but when I start up, if I do `setxkbmap -query`, I only get rules: evdev model: evdev layout: us,us variant: altgr-intl, So neither the alternative variants nor options are recognized (needless to say, I cannot change layout). If I however run setxkbmap -layout \"us,us\" -variant \"altgr-intl,colemak\" -option \"ctrl:nocaps,grp:alt_shift_toggle\" I get the correct rules: evdev model: evdev layout: us,us variant: altgr-intl,colemak options: ctrl:nocaps,grp:alt_shift_toggle So is there a possibility something is overwriting my configuration? I am running GNOME\/Cinnamon"} {"id":"8377","title":"Linux package manager architecture","text":"I am looking for a guide on one of Linux Package manager architectures. For example **apt-get** (dpkg), or **yum** (rpm). I want to know how they manage the package list, file list, package versions and so on. I wonder if anyone could point me to some resource."} {"id":"8375","title":"How to change default log location of SMF registered processes","text":"I am trying to change default log location ( var\/svc\/logs\/) of each and every SMF registered processes and append to particular file (\/opt\/smf.log)."} {"id":"61399","title":"How to fix boot error UUID disk drive is not ready or not present where micro failed to load microcode_amd.bin and HDIO_GET_IDENTITY failed?","text":"When I updated to the new Kernel 3.7.2, everything goes ok, but when it comes to powering on Linux Mint, it shows me two warnings: ![enter image description here](http:\/\/i.stack.imgur.com\/mJmEw.png) ![enter image description here](http:\/\/i.stack.imgur.com\/4GwMF.png) What's wrong and what can I do?"} {"id":"128225","title":"Constant prompt for WPA2 password in Fedora","text":"I asked on the Fedora forums but no one responded so I am asking here. I am on Fedora 20 with Gnome 3. My machine is the Dell XPS 13 which has an Intel 7260 rev 6b wireless card. I connect to my home network with WPA2 just fine but after a few minutes I am prompted for my password (and the password is already filled in) so I hit connect and it goes away. Sometimes it will appear 4 or 5 times before going away for good (well until maybe 10 minutes later). It's extremely frustrating since I switched away from Ubuntu because of its issues with WPA enterprise and supposedly Fedora had no wireless issues at all. Apparently that isn't true. I'm not quite sure how to go about fixing this so if anyone can point me in the right direction that would be fantastic!"} {"id":"119673","title":"Debian partial Mirror - “debpartial-mirror” specific mirroring","text":"i am using a Debian 7.3 with debpartial-mirror in order to create and maintain an offline mirror. Since i need only the basic packages (Packages needed for Installation via PXEboot and maybe the most common packages that are installed afterwards) i can't figure out, how to achiev this. Right now, the mirror is trying to clone the whole archive, but i don't need all Packages, neither do i have a good connection to the internet to maintain the Archive properly if it is that big. Any help is appreciated. my debpartial-mirrir.conf is : ;; ;; debpartial-mirror configuration file. ;; [GLOBAL] ;; Show debug information? ;;debug = DEBUG ;; Mirror destination directory mirror_dir = \/install\/debian\/debpartial-mirror\/ ;; Which architectures should I download? architectures = amd64 ;; What should I look for, by default? components = main contrib non-free distributions = stable ;; What should I get? get_suggests = true get_recommends = true get_provides = true get_sources = false get_packages = true [wheezy] server = http:\/\/ftp.de.debian.org\/debian components = main contrib non-free distributions = stable ;;filter = subsection:base priority:important get_sources =false [wheezy-updates] server = http:\/\/ftp.debian.org\/debian components = main contrib non-free distributions = wheezy-updates filter = subsection:base priority:important resolve_deps_using = wheezy [wheezy-security] server = http:\/\/security.debian.org\/ components = main contrib non-free distributions = wheezy\/updates filter = subsection:base priority:important resolve_deps_using = wheezy [wheezy_debian-installer] server = http:\/\/ftp.debian.org\/debian components = main\/debian-installer distributions = wheezy"} {"id":"119678","title":"Opening a samba share in emacs","text":"I am using emacs-snapshot, and I added an application shortcut to my `.local\/share\/applications\/emacs-snapshot.desktop` : [Desktop Entry] Version=1.0 Name=Emacs Snapshot (GTK) GenericName=Emacs Comment=GNU Emacs Snapshot Text Editor Exec=\/usr\/bin\/emacs-snapshot-gtk TryExec=emacs-snapshot Terminal=false Type=Application Icon=emacs-snapshot Categories=Development;Utility;TextEditor; MimeType=text\/plain; When I browse my folders (Nautilus 3.4.2) and right click on files on my local disk, I can choose Open With -> Emacs Snapshot (GTK): ![emacs](http:\/\/i.stack.imgur.com\/7ii92.png) However, when I browse to a samba share (`smb:\/\/data\/mydata\/`) and click on a file, I am not given an option to open it in Emacs - even if I click \"Open with other application -> Show other applications\": ![Open with other applications](http:\/\/i.stack.imgur.com\/RVVDE.png) How do I fix it? Further info: * OS: Debian Wheezy * Emacs from http:\/\/emacs.naquadah.org\/ : emacs-snapshot-gtk * the output of `ldd \/usr\/bin\/emacs-snapshot-gtk`: http:\/\/pastebin.com\/0Rz9mKQA"} {"id":"22121","title":"What do the brackets around processes mean?","text":"mark@mark-VirtualBox:~\/auto\/lib$ ps -Awwo pid,comm,args PID COMMAND COMMAND 1 init \/sbin\/init 2 kthreadd [kthreadd] 3 ksoftirqd\/0 [ksoftirqd\/0] 5 kworker\/u:0 [kworker\/u:0] 6 migration\/0 [migration\/0] 7 cpuset [cpuset] 8 khelper [khelper] 9 netns [netns] 10 sync_supers [sync_supers] 11 bdi-default [bdi-default] 12 kintegrityd [kintegrityd] 13 kblockd [kblockd] 14 kacpid [kacpid] 15 kacpi_notify [kacpi_notify] 16 kacpi_hotplug [kacpi_hotplug] 17 ata_sff [ata_sff] 18 khubd [khubd] What do the brackets mean? Does args always return the full path to the process command (e.g. \/bin\/cat)"} {"id":"88094","title":"What is the meaning of ps process names printed in [] such as [cgroup]?","text":"when I do a command such as ps -aux on CentOS 6 I get a bunch of processes whos command is listed in [] as shown below. What is the meaning of the [] in the name? I am assuming that these are special processes of some kind, what makes a process name show up with a [] around it? [root@centos6 src]# ps -ef UID PID PPID C STIME TTY TIME CMD root 1 0 0 18:48 ? 00:00:01 \/sbin\/init root 2 0 0 18:48 ? 00:00:00 [kthreadd] root 3 2 0 18:48 ? 00:00:00 [migration\/0] root 4 2 0 18:48 ? 00:00:00 [ksoftirqd\/0] root 5 2 0 18:48 ? 00:00:00 [migration\/0] root 6 2 0 18:48 ? 00:00:00 [watchdog\/0] root 7 2 0 18:48 ? 00:00:02 [events\/0]"} {"id":"78461","title":"AIX why does ps display the process name between square brackets?","text":"On AIX 7 I have a process whose name appears between square brackets in the ps output: PID TTY TIME CMD 7798784 pts\/2 0:00 [myproc] 9044154 pts\/2 0:00 ps 10485770 pts\/2 0:00 bash I found that overwriting `argv[0][0]` leads to such a result. Is there any other reasons which could lead to this result?"} {"id":"110599","title":"vim avoid selecting underscore","text":"So I know that an underscore (`_`) is considered part of a word in `vim`. Working with Python, I normally end up having a lot of underscores. Is there a way to select part of a word excluding the underscore? For example in `long_name`, I'd just love to quickly select `long`."} {"id":"26675","title":"How can I change a user's default group in Linux?","text":"Being new to Linux administration, I'm a little confused about the following commands: useradd usermod groupadd groupmod I've just finished reading the user administration book in the Linux\/Unix Administrator's handbook, but some things are still a little hazy. Basically `useradd` seems straight forward enough: useradd -c \"David Hilbert\" -d \/home\/math\/hilbert -g faculty -G famous -m -s \/bin\/sh hilbert I can add \"David Hilbert\" with username `hilbert` , setting his default directory, shell, and groups. And I think that `-g` is his primary\/default group and `-G` are his other groups. So these are my next questions: 1. Would this command still work if the groups `faculty` and `famous` did not exist? Would it just create them? 2. If not, what command do I use to create new groups? 3. If I remove the user `hilbert` and there are no other users in those groups, will they still exist? Should I remove them? 4. After I run the `useradd` command above, how do I remove David from the `famous` group, and reassign his primary group to `hilbert` which does not yet exist?"} {"id":"22444","title":"Which device is using this logical volume?","text":"I'm trying to remove an LVM logical volume, which I believe is not currently in use. However, when I attempted to remove it, I get an error: # lvremove \/dev\/vg_service1\/lv_home Logical volume vg_service1\/lv_home is used by another device. It's definitely not mounted, as this returns nothing: # mount | grep lv_home Is there any way to tell what is using this logical volume?"} {"id":"127077","title":"Number of SSH connection(s) on a single linux machine","text":"I landed up in a situation wherein I had to access a Linux machine via puTTY.I made various attempts to SSH but failed to connect to the machine. I then realised my colleague was accessing the same Linux machine as root user,and I too wanted to access as a root user.I asked him to log out so that I can login as root. Is there a way we limit number of SSH login on a linux OS? Is this some kind of security feature that distinguishes a windows based OS with a linux based OS. I am fairly new to Linux,kindly help give a genuine answer. Thanks"} {"id":"127076","title":"Into which directory should I install programs in Linux?","text":"I want to install a program in Linux and run it as a daemon. (Team Speak 3 in this case, but the question is general in nature). There is no package provided, only tarred binaries. Where in directory structure should I put such a program by convention? On the web I found that \/opt is for \"optional addon apps\", while \/usr is for \"user programs\". I found one tutorial suggesting \/opt while the other sugested \/usr. So which one is \"more correct\"?"} {"id":"89530","title":"Difference between mail and mailx?","text":"Whats the difference between mail and mailx? I'm trying to troubleshoot a problem where I can send mail from server A with this `echo $MESSAGE | mail -s \"$SUBJECT\" -r $FROM $RECIPIENTS` command but executing the same command from server B throws me this error (Both servers are RHEL) mail: invalid option -- r Usage: mail [-iInv] [-s subject] [-c cc-addr] [-b bcc-addr] to-addr ... [-- sendmail-options ...] mail [-iInNv] -f [name] mail [-iInNv] [-u user] Now... going through mail manpages to ty to understand whats happening, `man mail` gives me this: In Server A MAILX(1) User Commands MAILX(1) NAME mailx - send and receive Internet mail SYNOPSIS mailx [-BDdEFintv~] [-s subject] [-a attachment ] [-c cc-addr] [-b bcc-addr] [-r from-addr] [-h hops] [-A account] [-S variable[=value]] to-addr . . . mailx [-BDdeEHiInNRv~] [-T name] [-A account] [-S variable[=value]] -f [name] mailx [-BDdeEinNRv~] [-A account] [-S variable[=value]] [-u user] But in server B MAIL(1) BSD General Commands Manual MAIL(1) NAME mail - send and receive mail SYNOPSIS mail [-iInv] [-s subject] [-c cc-addr] [-b bcc-addr] to-addr... [-- sendmail-options...] mail [-iInNv] -f [name] mail [-iInNv] [-u user] Now... if I try `man mailx` in server B I get: MAILX(P) POSIX Programmerâs Manual MAILX(P) PROLOG This manual page is part of the POSIX Programmerâs Manual. The Linux implementation of this interface may differ (consult the corresponding Linux manual page for details of Linux behavior), or the interface may not be imple- mented on Linux. NAME mailx - process messages SYNOPSIS Send Mode mailx [-s subject] address... Receive Mode mailx -e mailx [-HiNn][-F][-u user] mailx -f[-HiNn][-F][file] Server B has a different version of mail than Server A? Mailx and Mail are different things? I would like to use the -r option I use in server A but in server B and I don't really know whats happening."} {"id":"56298","title":"How to screen'ize already running session?","text":"> **Possible Duplicate:** > How can I disown a running process and associate it to a new screen shell? It is a good practice to run long processes in `screen` session, to protect them from session hangups. But what should I do if I already have a process that is running and I just forgot to run `screen`? Is it possible to 'capture' current session somehow and protect it with `screen`?"} {"id":"32509","title":"Hanging at \"Running Transaction Test\" when trying to install php-soap","text":"I have here a CentOS 5 and I'm trying to run `yum install php-soap` but the installer hangs on and the last step is `Running Transaction Test`. I found out that NFS shares are the problem. See here or here or here. I tried to unmount everything which came up when entering `cat \/etc\/mtab | grep nfs`. I also tried to use `umount -a -t nfs`. Then I run the install command. But I can't get this working. `strace yum -y update` show me many lines, but I can't get a sense out of it. Furthermore I tried \/bin\/rm \/var\/lib\/rpm\/__db.* cd \/var\/cache\/yum \/bin\/rm -rf * yum clean all yum update but still hangs on. Do I have to remove the mounts from the other server to this machine?"} {"id":"32508","title":"How can I open a new terminal in the same directory of the last used one from a window manager keybind?","text":"I'm using a tiling window manager and I switched from `gnome-terminal` with multiple tabs to multiple `urxvt` instances managed by the window manager. One of the features I miss is the ability to open a new terminal that defaults to the working directory of the last one. In short: **I need a way to open a new urxvt (bash) that defaults to $PWD of the last used one.** The only solution that comes to my mind is to save the current path on every `cd` with something like this: echo $PWD > ~\/.last_dir and restore the path on the new terminal in this way: cd `cat ~\/.last_dir` I can source the second command in `.bashrc` but I don't know how to execute the first one on every directory change :) Any simpler solution that does not involve `screen` or `tmux` usage is welcome."} {"id":"98036","title":"Shell script to send a mail once every 20 days","text":"Need a shell script to be called via cron job every day and see if it's 20th day,it should send a mail"} {"id":"98025","title":"Yum update shows \"Killed\"","text":"When I update my RHEL with `yum update` commend, it list all update packages, and after I hit Y for yes, got following response. Running rpm_check_debug Running Transaction Test Transaction Test Succeeded Running Transaction Warning: RPMDB altered outside of yum. Killed Please help me to update my server."} {"id":"74978","title":"How to copy datasets from prior version directory to latest version directory","text":"I've go a number of directories named like: \/data\/db\/OX\/8_10 \/data\/db\/OX\/9_1 \/data\/db\/OX\/9_2 And need to copy some files (all the `pt.*` files) from the second latest one (above `9_1`) to the latest one (above `9_2`). I have tried directly like this. cp -p \/data\/db\/OX\/9_1\/pt.* \/data\/db\/OX\/9_2 However, Instead of typing \/data\/db\/OX\/9_1\/ & \/data\/db\/OX\/9_2. I'd like to be able to write: cp -p \/data\/db\/OS\/\"$prior_version\"\/pt.* \/data\/db\/OS\/\"$latest_version\"\/ And derive `$prior_version` and `$latest_version` from the list of directories in `\/data\/db\/OX\/` in a shell script."} {"id":"75365","title":"Does fail2ban offer any additional protection to SSH if password login is already turned off?","text":"I’m setting up a Debian VPS on Linode to use as a public web server, and I’m following their security suggestions. The last suggestion they make is to install fail2ban, to avoid dictionary attacks on the server. They mention that by default it only monitors SSH login attempts. However, in a previous step, they suggested turning off SSH password login (which I did). Given that I’ve done this, does using fail2ban for SSH connections add any security?"} {"id":"104427","title":"Awesome WM tiles KDE networking and battery widget","text":"I currently use KDE with Awesome WM. I got the KDE bar at the bottom hidden, but I can un-hide with with the cursor when I need to use the Plasma Network Manager. With KWin, they would appear like little drawers from the bottom and where quite usable. With Awesome WM, these get tiled as well, making them pretty hard to use: ![](http:\/\/chaos.stw-bonn.de\/users\/mu\/uploads\/2013-12-09\/screenshot4.png) Is there some way to fix this? I tried setting `floating = true` for the class `plasma-desktop`, but that did not change anything. This is what I got with `sleep 10 && xprop` and clicking on the networking widget when it was extended: WM_STATE(WM_STATE): window state: Normal icon window: 0x0 _NET_WM_SYNC_REQUEST_COUNTER(CARDINAL) = 31457739 _NET_WM_USER_TIME(CARDINAL) = 14075167 _NET_STARTUP_ID(UTF8_STRING) = \"0\" _NET_WM_DESKTOP(CARDINAL) = 4294967295 _KDE_SHADOW_OVERRIDE(_KDE_SHADOW_OVERRIDE) = 0x1 _KDE_NET_WM_SHADOW(CARDINAL) = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0 _NET_WM_STATE(ATOM) = _NET_WM_STATE_STICKY, _NET_WM_STATE_SKIP_TASKBAR, _NET_WM_STATE_ABOVE XdndAware(ATOM) = BITMAP _MOTIF_DRAG_RECEIVER_INFO(_MOTIF_DRAG_RECEIVER_INFO) = 0x6c, 0x0, 0x5, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x10, 0x0, 0x0, 0x0 WM_CLIENT_LEADER(WINDOW): window id # 0x1e00004 _NET_WM_PID(CARDINAL) = 2404 _NET_WM_WINDOW_TYPE(ATOM) = _KDE_NET_WM_WINDOW_TYPE_OVERRIDE, _NET_WM_WINDOW_TYPE_NORMAL _MOTIF_WM_HINTS(_MOTIF_WM_HINTS) = 0x2, 0x3, 0x0, 0x0, 0x0 WM_PROTOCOLS(ATOM): protocols WM_DELETE_WINDOW, WM_TAKE_FOCUS, _NET_WM_PING, _NET_WM_SYNC_REQUEST WM_NAME(STRING) = \"plasma-desktop\" WM_LOCALE_NAME(STRING) = \"de_DE.UTF-8\" WM_CLASS(STRING) = \"plasma-desktop\", \"Plasma-desktop\" WM_HINTS(WM_HINTS): Client accepts input or input focus: True Initial state is Normal State. window id # of group leader: 0x1e00004 WM_NORMAL_HINTS(WM_SIZE_HINTS): user specified location: 1367, 20 program specified location: 1367, 20 user specified size: 838 by 1029 program specified size: 838 by 1029 program specified minimum size: 316 by 308 program specified maximum size: 1680 by 1050 window gravity: Static WM_CLIENT_MACHINE(STRING) = \"Martin-X220\" WM_COMMAND(STRING) = { \"\/usr\/bin\/plasma-desktop\" }"} {"id":"2976","title":"Different ways to execute a shell script","text":"There a several ways to execute a script, the ones I know are: \/path\/to\/script # using the path (absolute or relative) . script # using the . (dot) source script # using the `source` command Are the more of this? What are the differences between them? Are there situations that I must use one and not another?"} {"id":"63765","title":"What does sourcing a file mean in a shell?","text":"> **Possible Duplicate:** > Different ways to execute a shell script What happens when I issue the following command: source devenv.csh How does it differ from running it just as `devenv.csh` ?"} {"id":"57705","title":"Modeless vs modal editors","text":"I just started learning Linux and all my previous experience of programming has been using the Windows platform. I came across Vim editor and read that it is modal editor unlike notepad which is termed as a modeless editor. Can you please explain what is the difference between modeless and modal editors in general?"} {"id":"96173","title":"Check if debian\/control Build-Depends: requirements are satisfiable when backporting packages","text":"Debian\/Ubuntu question here. I routinely backport packages from more recent Ubuntu distros to older ones (LTS). I download (via dget) a Debian source, then cd into it and type `debuild -b`. It then says something like `dpkg-checkbuilddeps: Unmet build dependencies: dh-autoreconf gnome-pkg-tools (>= 0.7) yelp-tools gtk-doc-tools (>= 1.12) pkg-config libglib2.0-dev (>= 2.29.14) libgstreamer1.0-dev (>= 0.11.92) libgstreamer-plugins-base1.0-dev (>= 0.11.92) libxml2-dev (>= 2.6.0) libsm-dev libice-dev libgtk-3-dev (>= 3.0.0) libcanberra-dev (>= 0.1) libcanberra-gtk3-dev (>= 0.1) libnautilus-extension- dev (>= 2.91.90) libburn-dev (>= 0.4.0) libisofs-dev (>= 0.6.4) libtotem- plparser-dev (>= 2.32) libunique-dev (>= 1.0.0) libnotify-dev (>= 0.6.1) gobject-introspection (>= 0.6.3) libgirepository1.0-dev (>= 0.6.3) libappindicator3-dev (>= 0.0.7) libunity-dev (>= 5.0.0)` `apt-get build-dep` helps upto a certain point (but downloads dependencies for the _current_ package, not for the one I'm backporting). I could manually install all the listed dependencies and retry the `debuild` to see if `dpkg- checkbuilddeps` succeeds, but this is costly in time (and disk space). I guess I really I need a tool (or a script) that could check if the `Build- Depends:` requirements from `debian\/control` are satisfiable with the current repositories (or if not which further packages I need to backport). Is there an easy way to achieve this?"} {"id":"96171","title":"Is there a update manager whitout gnome dependencies for xfce?","text":"I'm looking a update manager for Debian Xfce. I installed xfce on a computer which will be use by laypersons. Therefore, I want another way (graphical) to launch `apt-get update && apt-get upgrade`. But I don't want to slow the system by adding gnome dependencies (update-manager-gnome is then not a solution). The solution using `cron` configured to launch commands such as `'apt-get update; apt-get upgrade -y --force-yes; apt-get dist-upgrade -y --force-yes;'` seems to me too dangerous. I would like to offer a choice by graphical way."} {"id":"21093","title":"Output traffic on different interfaces based on destination port","text":"My question is basically the same as Only allow certain outbound traffic on certain interfaces. I have two interfaces `eth1` (10.0.0.2) and `wlan0` (192.168.0.2). My default route is for `eth1`. Let's say I want all https-traffic to go through `wlan0`. Now if I use the solution suggested in the other question, https traffic will go through `wlan0`, but will still have the source-address of `eth1` (10.0.0.2). Since this address is not routeable for the `wlan0` gateway, answers won't ever come back. The easy way would be to just set the bind-addr properly in the application, but in this case it is not applicable. I figure I need to rewrite the src-addr: # first mark it so that iproute can route it through wlan0 iptables -A OUTPUT -t mangle -o eth1 -p tcp --dport 443 -j MARK --set-mark 1 # now rewrite the src-addr iptables -A POSTROUTING -t nat -o wlan0 -p tcp --dport 443 -j SNAT --to 192.168.0.2 Now tcpdump sees the outgoing packets just fine and ingoing packets arrive for 192.168.0.2, however they probably never end up in the application, because all I ever get to see, is that the application is resending the SYN-packet, although the SYN-ACK was already received. So I thought, maybe I need to rewrite the incoming address too: iptables -A PREROUTING -t nat -i wlan0 -p tcp --sport 443 -j DNAT --to 10.0.0.2 but that didn't work either. So I’m kind of stuck here. Any suggestions?"} {"id":"107980","title":"Route socks proxy traffic through wireless client","text":"I have a router with two Internet WANs: DSL (vlan1) and wireless client (eth1). They are both in default route: vlan is the first and eth1 is the second (I am using `ip route add default scope global nexthop via …`). I want to use eth1 Internet from my laptop using socks proxy. I tried to use srelay socks server with `–J eth1` option on the router but it didn’t work (page loads forever) although it works through DSL if I use `–J vlan1`. I also tried to use `ssh` as a socks server and mark packets with iptables to route them to eth1 using ip rule: iptables -t mangle -A OUTPUT -o vlan1 -j MARK --set-mark 1 After this command every program on the router starts using eth1 but I need that only the socks server uses eth1. Is it possible to mark only socks server packets? Now I have to use the second router for this purpose. I run socks server on it and add ip rule for its IP on the first router. I already tried this and it didn’t work. It’s not \"duplicate\" because I need this for proxy server on router. The problem is that I can’t mark packets based on port number because proxy server doesn’t keep this mark while proxyfing."} {"id":"40401","title":"Linux Bulk\/Remote Administration","text":"Beside our internal IT infrastructure, we've got around 500 Linux machines hosting our services for the on-line world. They are grouped in a bunch of clusters like Database A-n, Product A-n, NFS, Backoffice and so on. Furthermore, they are administered by an external provider, according to our specifications and requirements. However, we face a lot of trouble during (web-) software development, roll-out and deploy - especially because the dev- and staging-environments have almost nothing in common with the live systems (I spare out the nasty details..). Thus, I've tried to create virtual machines, copied the various live-systems as exactly as possible and prepared them to connect to e.g. the development- databases instead of the \"real\" ones transparently for developers (they aren't `root`). This works pretty well, but... I was wondering how one could administer those systems remotely and _in bulk_? Is there some software family I'm not aware of? Or, at least, some techniques or principles one should be familiar with? We would provide every developer with a bunch of images to be run locally (VirtualBox). The QA dept. would get virtual clusters (XEN or Hyper-V). If I need to provide an additional server-module, re-route a new database connection or just want to update everything provided by the package manager... how could I possibly do that without being forced to log on to every system and\/or ask my colleagues to download and run some fixture-script? I believe there are plenty of solutions. Well, somehow I'm too stupid to enter the correct keywords into the search engines... Or isn't this issue as trivial as it sounds? For the record: * Almost all systems are running Debian GNU\/Linux 6.x \"squeeze\" * No developer is forced to use a particular OS at his\/her workstation * The budget is limited, of course, but not too small to buy proprietary software * A solution that would involve our aforementioned provider is preferred"} {"id":"92664","title":"How to deploy programs on multiple machines","text":"I need to install a few programs on around 40 Kubuntu 13.04 machines, and would like to know what options I have to do it as efficiently as possible. EDIT: I have the repositories already set and the machines are all identical clones, with no LDAP auth or centralized server."} {"id":"143911","title":"How to replicate basic configuration tasks?","text":"_(This might be off-topic and\/or not answerable, but I want to ask anyway.)_ Recently, I am managing a lot of VPS server with Linux for my personal and professional projects. However, I am kind of tired by the repetitive tasks. Let's say I have to do the following after installation of a VPS * add some users, add them to sudoers * install the basic needed packages from apt-get * find out that the package X is not in the basic repository, so I add some repositories * do some basic configuration, both as a _root_ and as a user, copy-pasting some stuff from the internet to some files and see what sticks * finally start coding Is there any way to automate the whole process? Basically to \"seal\" the whole configuration, so I can then do all this in somehow more simplier way."} {"id":"52062","title":"How to find all images containing any text?","text":"I got a lot of images, and I need to find, which of them contain any text in English (to delete them). Is it possible to do it automatically?"} {"id":"52063","title":"How to write an abort-on-error script without adding `|| exit $?` to every line?","text":"I'm writing a bash script that should exit the error code of the last failed command and not continue execution. This can be achieved by adding a `|| exit $?` everywhere, but is there an easier way, e.g. a `set` option at the start to do this without uglifying every line?"} {"id":"102869","title":"Postfix Masquarade Name *and* Email address","text":"At the moment, I have a RHEL6 monitoring server that sends out emails with postfix. Originally it was sending them out as `user@host.localhost`. I've used the mapping file `\/etc\/postfix\/generic` to get the emails sent out now as `monitoringuser@domain.com`, however when the email client receives the email, there is no longer a name attached to the email address. Originally, with the default configuration, emails would come in with the sender as this - `user ` Now when I recevied the emails, they come in with just the email address - `monitoringuser@domain.com` - there is no longer a name displayed. I've googled and looked at docs but can't seem to figure out the way to do this. Is there a way for postfix to fix that or append the name that I want ? Or is it up to the script calling `mail` to append a name to the sender ?"} {"id":"60114","title":"“Error: permission denied” error from Transmission Client","text":"When I try downloading files with Transmission I get: ![Error: Permission denied](http:\/\/i.stack.imgur.com\/9nAao.png) I've tried searching for this problem, and everyone always says to set permissions correctly, but I've done that: ![](http:\/\/i.stack.imgur.com\/OwqnT.png) This is running on a debian headless server and I did have it working until I moved the folders out of my home directory and into one of their own; ever since then I haven't been able to get it up and running, even in my home directory again. I've even purge removed it and installed it again, setting it all up following one of the countless number of guides step for step, and I have gotten nowhere. I'm not sure if `transmission-daemon -f` can help you guys to help me, but I thought what it outputs may be relevant because I saw \"transmission-daemon requiring authentication\": root@fileserver \/# transmission-daemon -f [19:09:48.940] Transmission 2.03 (11030) started (session.c:622) [19:09:48.940] RPC Server Adding address to whitelist: 127.0.0.1 (rpc-server.c:767) [19:09:48.940] RPC Server Adding address to whitelist: 192.168.0.* (rpc-server.c:767) [19:09:48.940] RPC Server Serving RPC and Web requests on port 9091 (rpc-server.c:940) [19:09:48.940] RPC Server Whitelist enabled (rpc-server.c:944) [19:09:48.940] RPC Server Password required (rpc-server.c:947) [19:09:48.940] Port Forwarding Stopped (port-forwarding.c:178) [19:09:48.940] DHT Generating new id (tr-dht.c:378) [19:09:48.940] Using settings from \"\/root\/.config\/transmission-daemon\" (daemon.c:443) [19:09:48.940] Saved \"\/root\/.config\/transmission-daemon\/settings.json\" (bencode.c:1651) [19:09:48.940] transmission-daemon requiring authentication (daemon.c:461) [19:09:48.940] Watching \"\/home\/Transmission\" for new .torrent files (daemon.c:473) [19:09:48.940] Using inotify to watch directory \"\/home\/Transmission\" (watch.c:72)"} {"id":"24848","title":"gcc: -pthread: No such file or directory","text":"Trying to compile following code in **_terminal_** i got `gcc: -pthread: No such file or directory`, what does this error means and how to eliminate it? **file name:** _window.c_ **code:** #include int main(int argc, char *argv[]) { GtkWidget *window; gtk_init(&argc, &argv); window = gtk_window_new(GTK_WINDOW_TOPLEVEL); gtk_widget_show(window); gtk_main(); return 0; } I tried to compile it with following parameters:- gcc -Wall -g window.c -o window `pkg-config --cflags gtk+-2.0` `pkg-config --libs gtk+-2.0`"} {"id":"2464","title":"timestamp, modification time, and created time of a file","text":"I just know that `ls -t` and `ls -f` give different sorting of files and subdirectories under a directory. * What are the differences between timestamp, modification time, and created time of a file? * How to get and change these kinds of information by commands? * In terms of what kind of information do people say a file is \"newer\" than the other? * What kinds of information's change will not make the file different? For example, I saw someone wrote: > By default, the rsync program only looks to see if the files are different > in size and timestamp. It doesn't care which file is newer, if it is > different, it gets overwritten. You can pass the '--update' flag to rsync > which will cause it to skip files on the destination if they are newer than > the file on the source, but only so long as they are the same type of file. > What this means is that if, for example, the source file is a regular file > and the destination is a symlink, the destination file will be overwritten, > regardless of timestamp. On a side note, does the file type here mean only regular file and simlink, not the type such as pdf, jpg, htm, txt etc?"} {"id":"2467","title":"archive files and directories before transfer","text":"I was wondering what is the advantage of making all the files and directories into an archive file for transfer, such as by `cpio`, instead of transferring them directly, such as by `cp`, `scp`?"} {"id":"117307","title":"Linux Mint - Blackscreen on installation","text":"Whenever I try to install Linux mint 10, the Start menu (install, install compatibility, reboot) comes on, but when I choose one of them, I get a blackscreen after the kernel is loaded. Why?"} {"id":"97220","title":"How to Replace Path in Search field using VIM","text":"I'm trying to replace this text in VIM Actual Path \/home\/omipenguin\/Servers\\ Information\/systemscript.sh\/sysinfo.txt with this new path \/home\/sysinfo I tried %s\/\\\/home\\\/omipenguin\\\/Servers\\ Information\\\/systemscript.sh\\\/sysinfo.txt\/\/home\/sysinfo\/g but VIM gives me `Pattern not Found`. Please advise, what is wrong?"} {"id":"97233","title":"Fixing a broken packet system (apt-get)","text":"After I made a system upgrade (apt-get upgrade) on a debian box, I get an error everytime i tries to use apt-get. Example: # apt-get -f install Reading package lists... Done Building dependency tree Reading state information... Done 0 upgraded, 0 newly installed, 0 to remove and 8 not upgraded. 1 not fully installed or removed. After this operation, 0 B of additional disk space will be used. Setting up initscripts (2.88dsf-41+deb7u1) ... insserv: Service killprocs has to be enabled to start service single insserv: exiting now! update-rc.d: error: insserv rejected the script header dpkg: error processing initscripts (--configure): subprocess installed post-installation script returned error exit status 1 Errors were encountered while processing: initscripts E: Sub-process \/usr\/bin\/dpkg returned an error code (1) I have tried to find a solution, but can't find anything that looks like this. First of all I have this packet which is \"not fully installed or removed\". But I can't find the command to locate it. Have tried: dpkg -l | grep rc But it list about 20 packets, so there must be a better way to find this packet. To fix the packet system I have tried normal procedures, like: apt-get clean && sudo apt-get autoremove apt-get -f install dpkg --configure -a The clean command is good, but the install command will fail with as shown above. In a desperate try, I tried to reinstall insserv (not sure it's the packet which is broken), but it fails the same way: # apt-get install --reinstall insserv Reading package lists... Done Building dependency tree Reading state information... Done 0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 8 not upgraded. 1 not fully installed or removed. Need to get 63.8 kB of archives. After this operation, 0 B of additional disk space will be used. Get:1 http:\/\/ftp.us.debian.org\/debian\/ wheezy\/main insserv armel 1.14.0-5 [63.8 kB] Fetched 63.8 kB in 0s (85.5 kB\/s) Setting up initscripts (2.88dsf-41+deb7u1) ... insserv: Service killprocs has to be enabled to start service single insserv: exiting now! update-rc.d: error: insserv rejected the script header dpkg: error processing initscripts (--configure): subprocess installed post-installation script returned error exit status 1 Errors were encountered while processing: initscripts E: Sub-process \/usr\/bin\/dpkg returned an error code (1) Hope some of you can help me fix the issue."} {"id":"107429","title":"= sign at the end of .sock files in the ls output","text":"I'm running the zsh shell in emacs. When I run `ls` I get a `=` at the end of `.sock` files. What does the `=` mean? Is it unique to unix sockets?"} {"id":"36995","title":"How reliable of using \"nameofmychoice=\"anyname\"\"","text":"For backup MySQL MyISAM database, I'm using: backupdb=siteone mysqldump -u root -pthepass --lock-tables --add-locks --disable-keys --skip-extended-insert --quick $backupdb > \/var\/www\/html\/db2.sql Even after long time using it, I still dont know what is the name of using `nameofmychoice=anyname`. After typing `backupdb=siteone` I need to know how long it will kept in memory? If I running many lines of command which takes very long time, do I need to type `backupdb=siteone` again and again from time to time to regenerate the alias? Is using this way really safe for almost anything? I'm worried of data loss since I'm dealing with database."} {"id":"37024","title":"How to open a port early in boot process to unlock LUKS via SSH","text":"I have a fully encrypted server running Debian 7 and have set up dropbear and busybox to unlock the LUKS container via SSH (as described in this tutorial and in this U&L answer). Unfortunately, whenever I try and SSH to the server (over the LAN) at reboot, I get a \"Connection refused\" error. I have tried `telnet` and `nmap` to the default port (22) and both say the port is closed. The server has a `ufw` rule to accept all traffic from the LAN: Anywhere ALLOW 192.168.1.0\/24 I have tried changing the port that dropbear listens on in `\/etc\/defaults\/dropbear` but `ssh` and `telnet` are still refused connections1. How can I ensure that a port is open at that stage in the boot process so that I can connect to unlock the LUKS container? Disabling the firewall makes no difference: `nmap` shows all ports still closed. ## Update 2\/14 I added `break=premount` to the kernel line and had a poke around in the initramfs. `dropbear` has started, but the network is _not_ up at that point. After exiting, the network comes up and boot continues until the prompt to unlock the LUKS device. At this point, the network _is_ up, and the host has been assigned the correct IP address, but port 22 is still closed. The IP line in `\/etc\/initramfs-tools\/intiramfs.conf` I am using is: export IP=192.168.1.200::192.168.1.1:255.255.255.0::eth0:off Consistent with the directions in `\/usr\/share\/doc\/cryptsetup\/README.remote.gz` I have tried just adding the device option, but that is not sufficient to bring the network up and obtain a dhcp lease."} {"id":"105483","title":"Compiling code from apue","text":"Just now I have began reading the book: Advanced Programming in the UNIX® Environment. I wanted to try running its first code example. I am running Scientific Linux 6.4. I downloaded the source code and as it says in its README, I ran `make` in the uncompressed file. I wrote the first program (a mock `ls` command) #include \".\/include\/apue.h\" #include int main(int argc, char *argv[]) { DIR *dp; struct dirent *dirp; if(argc!=2) err_quit(\"usage: test directory_name\"); if((dp=opendir(argv[1]))==NULL) err_sys(\"Can't open %s\", argv[1]); while((dirp=readdir(dp))!=NULL) printf(\"%s\\n\", dirp->d_name); closedir(dp); return 0; } and put it in the uncompressed file. As the book had advised I then ran: `gcc myls.c`. But I get this error: # gcc myls.c \/tmp\/ccWTWS2I.o: In function `main': test.c:(.text+0x20): undefined reference to `err_quit' test.c:(.text+0x5b): undefined reference to `err_sys' collect2: ld returned 1 exit status I wanted to know how I can fix this problem. I also want to be able to run a code I write in any directory, can anyone guide me on that too?"} {"id":"115689","title":"Fdisk cannot read size of this disk is 4.0 TB under RAID-0 enviroment","text":"I have server from OVH data center , I have Two SATA Hard Disk Drive , each Disk Size 2.0 T.B , I have RAID controller card but I convert the RAID-1 to RAID-0 through OVH Rescue mode and here is the result 1 volume is active, 2 physical disks are active Volume 0 is Bus 0 Target 0, Type IS (Integrated Striping) Volume Name: Volume WWID: 00953d9517ee4ae9 Volume State: optimal, enabled Volume Settings: write caching enabled Volume draws from Hot Spare Pools: 0 1 2 3 4 5 6 7 Volume Size 3815156 MB, Stripe Size 64 KB, 2 Members Member 0 is PhysDisk 1 (Bus 0 Target 2) Member 1 is PhysDisk 0 (Bus 0 Target 1) After I install OS through OVH Control panel , the capacity not showing the actual size of the two hard disk which it suppose to be 4.0 T.B but it shows only 2.0T.B , this is normal because the OVH installation using `fdisk` through the OS setup Here is the output from `fdisk -l` command WARNING: GPT (GUID Partition Table) detected on '\/dev\/sda'! The util fdisk doesn't support GPT. Use GNU Parted. WARNING: The size of this disk is 4.0 TB (4000481017856 bytes). DOS partition table format can not be used on drives for volumes larger than 2.2 TB (2199023255040 bytes). Use parted(1) and GUID partition table format (GPT). Disk \/dev\/sda: 4000.4 GB, 4000481017856 bytes 255 heads, 63 sectors\/track, 486364 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System \/dev\/sda1 1 267350 2147483647+ ee EFI GPT this is on `\/dev\/sda` drive and that contain the system and data, if I use to re-partition by parted to fix the size and GPT problem I have to delete the data then I install again through control panel then I will have the same problem , I don't have kvm or anything else to install the system by my custom partition I made through the rescue mode How can I solve this problem without format or delete the data on the hard disk by fixing the size and continue to partition the rest of space by using any program ?"} {"id":"102136","title":"xargs inside a for loop","text":"So we got most of it figured out but here's what happens. for i in $(arp |sort |awk '{print $1}'|grep IPADDRESS) do ssh USERNAME@$i \"ps -ef |grep X11|grep -v grep |awk '{print $2}'|xargs kill\" done kill: USERNAME: invalid process id I've SSH'd using the username I'm using for the loop and ran `ps -ef | grep X11| grep -v grep | awk '{print $2}'| xargs kill` just fine but it looks like xargs is picking up the username instead of whats being printed. Any thoughts?"} {"id":"66686","title":"Route SSH to host through interface","text":"Is it possible to route all outgoing requests for SSH (port 22) to `mydynamicdns.afraid.org` via `wlan0` instead of `eth0` when both are connected? Since my IP is dynamic, I would like to use a name instead of IP."} {"id":"78196","title":"How do I make www-data run vim command (and find plugins)","text":"I use the vimwiki plugin for note taking, and for those rare cases when I can't reach my home server over ssh, I use a simple html-form to update the textfiles. In vimwiki there is a command to export the textfiles to html-files and I want to trigger that command from the html-form. The setup: Lighttpd, a python script that calls a shell-script using os.system(). The shell script contains the following lines: #!\/bin\/bash vim -c \":e wiki\/index.wiki\" -c \":VimwikiAll2HTML\" -c \":q\" which should generate the html-files. But I get this output (in the web browser): wiki\/index.wiki\" [dos] 13L, 227C Error detected while processing command line: E492: Not an editor command: :VimwikiAll2HTML E138: Can't write viminfo file $HOME\/.viminfo! Tested to log in as www-data (after setting password) and ran the same line and it works as expected (i.e. as I want it to). Back to running the script from a web browser I also noticed that environment varibles (like $HOME) aren't set, so my guess is that I am missing some login-script but I can't get it right. What am I missing? Is there a better way to accomplish what I want to do? Solved: see sporticvs answer"} {"id":"113971","title":"Incrementing a variable each time the system boots up","text":"The idea is to initialize a variable and set it to 0. Then create a script that executes on boot and increments that variable by 1 each time the system boots up again. Sounds simple enough right?"} {"id":"43854","title":"Save entire process for continuation after reboot","text":"I developed an algorithm for a fairly hard problem in mathematics which is likely to need several months to finish. As I have limited resources only, I started this on my Ubuntu 12.04 (x86) laptop. Now I want to install some updates and actually restart the laptop (the \"please reboot\" message is just annoying). Is there a way to save an entire process including its allocated memory for continuation beyond a reboot? Here is some information about the process you might need. Please feel free to ask for further information if needed. * I called the process in a terminal with the command \"`.\/binary > .\/somefile &`\" or \"time .\/binary > .\/somefile &\", I cannot really remember. * It's printing some debug information to std::cerr (not very often). * It's currently using roughly 600.0 kiB and even though this will increase, it's unlikely to increase rapidly. * the process runs with normal priority * the kernel is 3.2.0-26-generic-pae, the cpu is an AMD, the operating system is Ubuntu 12.04 x86. * it runs since 9 days and 14 hours (so too long to cancel it ;-) )"} {"id":"113975","title":"configure gsm connection using nmcli","text":"I have a system without X display and I want to use `nmcli` to configure my cell modem to connect to a certain apn. I can get it going with this modem just fine on Ubuntu (with X) and I would like to achieve the same now on the command line. How can I setup the connection? so far I get this: # nmcli dev status ** (process:2379): WARNING **: Could not initialize NMClient \/org\/freedesktop\/NetworkManager: Permissions request failed: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.PolicyKit1 was not provided by any .service files DEVICE TYPE STATE ttyUSB1 gsm disconnected eth0 802-3-ethernet connected"} {"id":"113976","title":"Files missing from NTFS drive and drive is split into many","text":"Using kali linux 1.0 in dual boot with windows 8. I have an NTFS partition (D: on windows) I usually mount it on both OS. I face the following problem 1. cannot access some folders in NTFS partition. (unable to see them on linux but works fine with windows). I don't face any errors while mounting it. also my \/media directory shows 3 files with same name which represent my D: (ntfs drive m talking about) here is output of `ls` command in `\/media` directory root@code:\/media# ls 01CD1F0FE77B9960 01CD1F0FE77B9960__ cdrom0 usb usb1 01CD1F0FE77B9960_ cdrom truecrypt11 usb0 01CD1F0FE77B9960 is the NTFS partition. How can i get rid of this?"} {"id":"112088","title":"Stanford's StanfordCPPLib on Linux","text":"I'm using SUSE Linux 13.1 and self studying Stanford's CS 106B course. Here I have found the following `zip` file, cs106b-hw2-ngrams-starter-files.zip, and downloaded. ### Now questions 1. This libs are for Windows, so some changes will be needed to make them work correctly in Linux. What changes? 2. Where to put this folder, so that `gcc` compiler could automatically find this libs?"} {"id":"112089","title":"Why doesn't yum list anything?","text":"In a Kubuntu I installed yum. ~$ sudo apt-get install yum [sudo] password for jim: Reading package lists... Done Building dependency tree Reading state information... Done The following extra packages will be installed: debugedit liblua5.2-0 librpm3 librpmbuild3 librpmio3 librpmsign1 libsqlite0 python-libxml2 python-rpm python-sqlite python-sqlitecachec python-urlgrabber rpm rpm-common rpm2cpio Suggested packages: rpm-i18n python-sqlite-dbg alien elfutils The following NEW packages will be installed: debugedit liblua5.2-0 librpm3 librpmbuild3 librpmio3 librpmsign1 libsqlite0 python-libxml2 python-rpm python-sqlite python-sqlitecachec python-urlgrabber rpm rpm-common rpm2cpio yum 0 upgraded, 16 newly installed, 0 to remove and 320 not upgraded. Need to get 1965 kB of archives. After this operation, 7550 kB of additional disk space will be used. Do you want to continue [Y\/n]? Y Get:1 http:\/\/nl.archive.ubuntu.com\/ubuntu\/ saucy\/main liblua5.2-0 amd64 5.2.2-1 [95,7 kB] Get:2 http:\/\/nl.archive.ubuntu.com\/ubuntu\/ saucy\/main librpmio3 amd64 4.11.1-2 [80,8 kB] Get:3 http:\/\/nl.archive.ubuntu.com\/ubuntu\/ saucy\/main debugedit amd64 4.11.1-2 [16,9 kB] Get:4 http:\/\/nl.archive.ubuntu.com\/ubuntu\/ saucy\/main librpm3 amd64 4.11.1-2 [184 kB] Get:5 http:\/\/nl.archive.ubuntu.com\/ubuntu\/ saucy\/main librpmbuild3 amd64 4.11.1-2 [66,2 kB] Get:6 http:\/\/nl.archive.ubuntu.com\/ubuntu\/ saucy\/main librpmsign1 amd64 4.11.1-2 [9074 B] Get:7 http:\/\/nl.archive.ubuntu.com\/ubuntu\/ saucy\/universe libsqlite0 amd64 2.8.17-8fakesync1 [188 kB] Get:8 http:\/\/nl.archive.ubuntu.com\/ubuntu\/ saucy\/main python-libxml2 amd64 2.9.1+dfsg1-3ubuntu2 [192 kB] Get:9 http:\/\/nl.archive.ubuntu.com\/ubuntu\/ saucy\/universe python-sqlite amd64 1.0.1-9 [32,4 kB] Get:10 http:\/\/nl.archive.ubuntu.com\/ubuntu\/ saucy\/main python-urlgrabber all 3.9.1-4ubuntu2 [48,5 kB] Get:11 http:\/\/nl.archive.ubuntu.com\/ubuntu\/ saucy\/main rpm-common amd64 4.11.1-2 [25,1 kB] Get:12 http:\/\/nl.archive.ubuntu.com\/ubuntu\/ saucy\/main rpm2cpio amd64 4.11.1-2 [5740 B] Get:13 http:\/\/nl.archive.ubuntu.com\/ubuntu\/ saucy\/main rpm amd64 4.11.1-2 [135 kB] Get:14 http:\/\/nl.archive.ubuntu.com\/ubuntu\/ saucy\/universe python-rpm amd64 4.11.1-2 [43,0 kB] Get:15 http:\/\/nl.archive.ubuntu.com\/ubuntu\/ saucy\/universe python-sqlitecachec amd64 1.1.4-1 [21,4 kB] Get:16 http:\/\/nl.archive.ubuntu.com\/ubuntu\/ saucy\/universe yum all 3.4.3-2ubuntu1 [821 kB] Fetched 1965 kB in 1s (1537 kB\/s) Selecting previously unselected package liblua5.2-0:amd64. (Reading database ... 112109 files and directories currently installed.) Unpacking liblua5.2-0:amd64 (from ...\/liblua5.2-0_5.2.2-1_amd64.deb) ... Selecting previously unselected package librpmio3. Unpacking librpmio3 (from ...\/librpmio3_4.11.1-2_amd64.deb) ... Selecting previously unselected package debugedit. Unpacking debugedit (from ...\/debugedit_4.11.1-2_amd64.deb) ... Unpacking librpm3 (from ...\/librpm3_4.11.1-2_amd64.deb) ... Selecting previously unselected package librpmbuild3. Unpacking librpmbuild3 (from ...\/librpmbuild3_4.11.1-2_amd64.deb) ... Selecting previously unselected package librpmsign1. Unpacking librpmsign1 (from ...\/librpmsign1_4.11.1-2_amd64.deb) ... Selecting previously unselected package libsqlite0. Unpacking libsqlite0 (from ...\/libsqlite0_2.8.17-8fakesync1_amd64.deb) ... Selecting previously unselected package python-libxml2. Unpacking python-libxml2 (from ...\/python-libxml2_2.9.1+dfsg1-3ubuntu2_amd64.deb) ... Selecting previously unselected package python-sqlite. Unpacking python-sqlite (from ...\/python-sqlite_1.0.1-9_amd64.deb) ... Selecting previously unselected package python-urlgrabber. Unpacking python-urlgrabber (from ...\/python-urlgrabber_3.9.1-4ubuntu2_all.deb) ... Selecting previously unselected package rpm-common. Unpacking rpm-common (from ...\/rpm-common_4.11.1-2_amd64.deb) ... Selecting previously unselected package rpm2cpio. Unpacking rpm2cpio (from ...\/rpm2cpio_4.11.1-2_amd64.deb) ... Selecting previously unselected package rpm. Unpacking rpm (from ...\/rpm_4.11.1-2_amd64.deb) ... Selecting previously unselected package python-rpm. Unpacking python-rpm (from ...\/python-rpm_4.11.1-2_amd64.deb) ... Selecting previously unselected package python-sqlitecachec. Unpacking python-sqlitecachec (from ...\/python-sqlitecachec_1.1.4-1_amd64.deb) ... Selecting previously unselected package yum. Unpacking yum (from ...\/yum_3.4.3-2ubuntu1_all.deb) ... Processing triggers for man-db ... Setting up liblua5.2-0:amd64 (5.2.2-1) ... Setting up librpmio3 (4.11.1-2) ... Setting up debugedit (4.11.1-2) ... Setting up librpm3 (4.11.1-2) ... Setting up librpmbuild3 (4.11.1-2) ... Setting up librpmsign1 (4.11.1-2) ... Setting up libsqlite0 (2.8.17-8fakesync1) ... Setting up python-libxml2 (2.9.1+dfsg1-3ubuntu2) ... Setting up python-sqlite (1.0.1-9) ... Setting up python-urlgrabber (3.9.1-4ubuntu2) ... Setting up rpm-common (4.11.1-2) ... Setting up rpm2cpio (4.11.1-2) ... Setting up rpm (4.11.1-2) ... Setting up python-rpm (4.11.1-2) ... Setting up python-sqlitecachec (1.1.4-1) ... Setting up yum (3.4.3-2ubuntu1) ... Processing triggers for libc-bin ... But when I do a list nothing is output. Does yum list what yum installed? :~$ :~$ yum list installed :~$ But when I do: :~$ yum provides \/etc\/yum\/yum.conf No Matches found Still nothing found. Why does the yum does not list anything?"} {"id":"137714","title":"how to suspend other nonrelated processes to allow a proces in interest to occupy the CPU?","text":"Is it possible to * first find out what processes are necessary to run a process in interest, and * then suspend all other unrelated processes to allow the process in interest to use the CPU as much as possible * when the process in interest finishes running, resume the suspended processes? For example, a process in interest is djview Thanks."} {"id":"67237","title":"Help with understanding a regular expression","text":"I have this regular expression `\\\\\\\\..\\\\\\\\{3\\\\\\\\}$` I want to understand how this expression works to match a string. My thought is that it matches any 8 characters at the end of the line. Is that how this expression works? If so, I think something like this would match the string: `rs.efg$tu`"} {"id":"68571","title":"Show jobs count only if it is more than 0","text":"I have a `jobscount()` function: jobscount() { local stopped='$(jobs -s | wc -l | tr -d \" \")' local running='$(jobs -r | wc -l | tr -d \" \")' echo -n \"${running}r\/${stopped}s\" } I use this function in my `$PS1`: PS1=\" \\w $(jobscount) \\$ \" The only problem is if there is no background process running or there is no stopped jobs, this function uselessly occupies `$PS1` space. What I want is if either of the `stopped` or `running` value is more than `0`, **only then** it shows up."} {"id":"109958","title":"Bash Script To Find Debian Release Number from \/etc\/debian_version","text":"The following is what I'm currently using for testing the version of Debian. Instead of doing it this way, can I make it more succinct? #!\/bin\/bash VERSION=NONE if [ $(cat \/etc\/debian_version) == '7.3' ]; then VERSION=7 elif [ $(cat \/etc\/debian_version) == '7.2' ]; then VERSION=7 elif [ $(cat \/etc\/debian_version) == '7.1' ]; then VERSION=7 elif [ $(cat \/etc\/debian_version) == '7.0' ]; then VERSION=7 fi I know it's not the most attractive way of doing this. What I want, is to understand how to use the file at `\/etc\/debian_version` to read the version number before the `.` and ignore the number after. I tried using if [ $(cat \/etc\/debian_version) == '7.*' ]; then and I also tried if [ $(cat \/etc\/debian_version) == '7.2|7.1|7.0' ]; then But neither of these worked for me. I want to future proof my script so that if Debian 7.4 gets released, then I won't have to go back over all the scripts that rely on this and alter them I am also aware of the `lsb_release -a` showing me the relative information, I just don't know how to \"cut\" what I want from that and check that it is Debian 6 or 7. The original script, as you can imagine, is quite lengthy. Any other posts you can point me to, would also be appreciated with using the method of \"cutting\" apart the response to only section out the part that I want."} {"id":"1571","title":"Grabbing the extension in a file name","text":"How do I get the file extension from bash? Here's what I tried: filename=`basename $filepath` fileext=${filename##*.} By doing that I can get extension of `bz2` from the path `\/dir\/subdir\/file.bz2`, but I have a problem with the path `\/dir\/subdir\/file-1.0.tar.bz2`. I would prefer a solution using only bash without external programs if it is possible. To make my question clear, I was creating a bash script to extract any given archive just by a single command of `extract path_to_file`. How to extract the file is determined by the script by seeing its compression or archiving type, that could be .tar.gz, .gz, .bz2 etc. I think this should involve string manipulation, for example if I get the extension `.gz` then I should check whether it has the string `.tar` before `.gz` — if so, the extension should be `.tar.gz`."} {"id":"4278","title":"Ubuntu postfix installation error: trying to overwrite '\/usr\/sbin\/validlocale', which is also in package libc-bin 0:2.10.1-0ubuntu18","text":"I am trying to install Postfix on Ubuntu 10.04 using command `sudo apt-get install postfix` but there comes error as shown below: Preconfiguring packages ... (Reading database ... 164023 files and directories currently installed.) Preparing to replace locales 2.9+git20090617-3 (using ...\/locales_2.11.2-7_all.deb) ... Unpacking replacement locales ... dpkg: error processing \/var\/cache\/apt\/archives\/locales_2.11.2-7_all.deb (--unpack): trying to overwrite '\/usr\/sbin\/validlocale', which is also in package libc-bin 0:2.10.1-0ubuntu18 Processing triggers for man-db ... Errors were encountered while processing: \/var\/cache\/apt\/archives\/locales_2.11.2-7_all.deb E: Sub-process \/usr\/bin\/dpkg returned an error code (1) Please help me what to do"} {"id":"147474","title":"Fedora 20: Failed to start LSB: Bring up\/down networking","text":"I'm trying to restart my networking service in Fedora 20, and I get the following error: [dev@localhost das]$ sudo service network restart [sudo] password for dev: Restarting network (via systemctl): Job for network.service failed. See 'systemctl status network.service' and 'journalctl -xn' for details. [FAILED] [dev@localhost das]$ systemctl status network.service network.service - LSB: Bring up\/down networking Loaded: loaded (\/etc\/rc.d\/init.d\/network) Active: failed (Result: exit-code) since Wed 2014-07-30 11:26:17 CDT; 8min ago Jul 30 11:26:16 localhost.localdomain network[22542]: RTNETLINK answers: File exists Jul 30 11:26:16 localhost.localdomain network[22542]: RTNETLINK answers: File exists Jul 30 11:26:16 localhost.localdomain network[22542]: RTNETLINK answers: File exists Jul 30 11:26:16 localhost.localdomain network[22542]: RTNETLINK answers: File exists Jul 30 11:26:16 localhost.localdomain network[22542]: RTNETLINK answers: File exists Jul 30 11:26:16 localhost.localdomain network[22542]: RTNETLINK answers: File exists Jul 30 11:26:16 localhost.localdomain network[22542]: RTNETLINK answers: File exists Jul 30 11:26:17 localhost.localdomain systemd[1]: network.service: control process exited, code=exited status=1 Jul 30 11:26:17 localhost.localdomain systemd[1]: Failed to start LSB: Bring up\/down networking. Jul 30 11:26:17 localhost.localdomain systemd[1]: Unit network.service entered failed state [dev@localhost das]$ ll \/etc\/sysconfig\/network-scripts total 216 -rw-r--r--. 1 root root 254 Jan 14 2014 ifcfg-lo -rw-r--r--. 1 root root 319 Dec 23 2013 ifcfg-p2p1 lrwxrwxrwx. 1 root root 24 Jun 4 16:04 ifdown -> ..\/..\/..\/usr\/sbin\/ifdown -rwxr-xr-x. 1 root root 627 Jan 14 2014 ifdown-bnep -rwxr-xr-x. 1 root root 5553 Jan 14 2014 ifdown-eth -rwxr-xr-x. 1 root root 781 Jan 14 2014 ifdown-ippp -rwxr-xr-x. 1 root root 4141 Jan 14 2014 ifdown-ipv6 lrwxrwxrwx. 1 root root 11 Jun 4 16:04 ifdown-isdn -> ifdown-ippp -rwxr-xr-x. 1 root root 1642 Jan 14 2014 ifdown-post -rwxr-xr-x. 1 root root 1068 Jan 14 2014 ifdown-ppp -rwxr-xr-x. 1 root root 837 Jan 14 2014 ifdown-routes -rwxr-xr-x. 1 root root 1444 Jan 14 2014 ifdown-sit -rwxr-xr-x. 1 root root 1599 Mar 31 03:52 ifdown-Team -rwxr-xr-x. 1 root root 1556 Mar 31 03:52 ifdown-TeamPort -rwxr-xr-x. 1 root root 1462 Jan 14 2014 ifdown-tunnel lrwxrwxrwx. 1 root root 22 Jun 4 16:04 ifup -> ..\/..\/..\/usr\/sbin\/ifup -rwxr-xr-x. 1 root root 12449 Jan 14 2014 ifup-aliases -rwxr-xr-x. 1 root root 859 Jan 14 2014 ifup-bnep -rwxr-xr-x. 1 root root 10293 Jan 14 2014 ifup-eth -rwxr-xr-x. 1 root root 12039 Jan 14 2014 ifup-ippp -rwxr-xr-x. 1 root root 10430 Jan 14 2014 ifup-ipv6 -rwxr-xr-x. 1 root root 804 Jan 14 2014 ifup-ipx lrwxrwxrwx. 1 root root 9 Jun 4 16:04 ifup-isdn -> ifup-ippp -rwxr-xr-x. 1 root root 642 Jan 14 2014 ifup-plip -rwxr-xr-x. 1 root root 1043 Jan 14 2014 ifup-plusb -rwxr-xr-x. 1 root root 2609 Jan 14 2014 ifup-post -rwxr-xr-x. 1 root root 4154 Jan 14 2014 ifup-ppp -rwxr-xr-x. 1 root root 1925 Jan 14 2014 ifup-routes -rwxr-xr-x. 1 root root 3263 Jan 14 2014 ifup-sit -rwxr-xr-x. 1 root root 1755 Mar 31 03:52 ifup-Team -rwxr-xr-x. 1 root root 1876 Mar 31 03:52 ifup-TeamPort -rwxr-xr-x. 1 root root 2607 Jan 14 2014 ifup-tunnel -rwxr-xr-x. 1 root root 1621 Jan 14 2014 ifup-wireless -rwxr-xr-x. 1 root root 4623 Jan 14 2014 init.ipv6-global -rw-r--r--. 1 root root 13793 Jan 14 2014 network-functions -rw-r--r--. 1 root root 26134 Jan 14 2014 network-functions-ipv6"} {"id":"72295","title":"what is \"an invisible whitespace character that takes up space\"","text":"One can look up Unicode Characters with Regular Expressions. On Jan Goyvaerts website I found a RegExp whose meaning I don't understand : > `\\p{Zs}` or `\\p{Space_Separator}`: a whitespace character that is invisible, > but does take up space So I wonder if I got this right: a `Whitespace Character` * is the 'empty' space between two words, columns, lines, whatever * it's 'invisible' in so far as it contains nothing than the blank paper ⁄ screen * it 'takes up space' in so far as the place taken through it can't be occupied through a letter, symbol, anything comparable According to this I came to the following **questions** : * **are there ' _visible_ whitespace characters'** * **could a whitespace character ' _take no space up_ '** This would be quite the opposite of what is defined. Both make perfectly sense, but then both could describe the same, depending on the point of view: an empty space is visible through the absence of anything displayed there except the blank paper ⁄ screen but then it is invisible as there is nothing to see. At this point I sense a border with Philosophy: How does one measure the amount of Nothingness than through it's counterpart, or so."} {"id":"72297","title":"Grub does not fit the screen","text":"I have a problem with my grub installation. The screen is \"moved\" to the left a couple of pixels, which means that I cannot read the first 20 or so characters of the entries when I boot. I'm running: Grub 1.99.21-ubuntu (the system is a Kubuntu 12.04). My video card is a Radeon HD 5400, running @ 1920x1080. My monitor, if it makes a difference is a Samsung SyncMaster P2470HN . When the boot process start itself (with the kubuntu log) the screen fits normally. Also, my other terminals (TTY1-6) suffers from the same problems."} {"id":"132290","title":"git completion with zsh: filenames with spaces aren't being escaped properly","text":"Git completion: I'm having difficulty with git's filename autocompletions on my system. I'm using `zsh` (5.0.5) with `git` (1.9.3) on OS X (10.9.3). Both `zsh` and `git` have been installed via homebrew. (Full version output are at the bottom of the post.) `git`'s filename completion isn't inserting spaces like I expect. When I type the name of a file with a space in the name, the shell inserts the filename without spaces escaped. `zsh`'s built-in completion doesn't do this, but `git`'s does. Here's an example of what I'm seeing. I have a repository with a few files with spaces in their names. % ls -la test test four - latest.txt test three.txt test two The shell backslash escapes the filenames as expected when I use tab completion to insert the file name. % echo \"testing\" >> test autocompletes to this after hitting tab three times. % echo \"testing\" >> test\\ four\\ -\\ latest.txt ––– file test test\\ four\\ -\\ latest.txt test\\ three.txt test\\ two `git status` shows these filenames in quotes (it totally understands what's up): % git status --short M test M \"test four - latest.txt\" M \"test three.txt\" M \"test two\" but when I try to `git add` with tab autocompletion, it goes sideways. % git add test results in this after hitting tab three times: % git add test four - latest.txt test test four - latest.txt test three.txt test two I've tried regressing this a bit: my dotfiles are in version control, so I've tried `zsh 4.3.15`, `git 1.8.3`, and my dotfiles from a year ago, when I'm nearly certain this worked. Weirdly, this setup was still broken. I _have_ narrowed it down to the `_git` completion file that is being sourced from `\/usr\/local\/share\/zsh\/site-functions`: % echo $FPATH \/usr\/local\/share\/zsh\/site-functions:\/usr\/local\/Cellar\/zsh\/5.0.5\/share\/zsh\/functions % ls -l \/usr\/local\/share\/zsh\/site-functions _git@ -> ..\/..\/..\/Cellar\/git\/1.9.3\/share\/zsh\/site-functions\/_git _hg@ -> ..\/..\/..\/Cellar\/mercurial\/3.0\/share\/zsh\/site-functions\/_hg _j@ -> ..\/..\/..\/Cellar\/autojump\/21.7.1\/share\/zsh\/site-functions\/_j git-completion.bash@ -> ..\/..\/..\/Cellar\/git\/1.9.3\/share\/zsh\/site-functions\/git-completion.bash go@ -> ..\/..\/..\/Cellar\/go\/HEAD\/share\/zsh\/site-functions\/go If I manually change `$FPATH` before my `.zshrc` runs `compinit` (or simply remove the `\/usr\/local\/share\/zsh\/site-functions\/_git` symbolic link), then completions fall back to `zsh` and work as expected. The `zsh` completion without `_git`: % git add test hitting tab three times produces correct results: % git add test\\ four\\ -\\ latest.txt ––– modified file test test\\ four\\ -\\ latest.txt test\\ three.txt test\\ two Side note: I've tried removing the `git-completion.bash` link, and it just totally breaks things: % git add test produces this busted-ness: % git add test__git_zsh_bash_func:9: command not found: __git_aliased_command git add test ––– file test test\\ four\\ -\\ latest.txt test\\ three.txt test\\ two * * * I **really** want to get this working properly: the rest of the `_git` completions were great because they're more repo-aware than the `zsh` ones, but I need filenames with spaces or other special characters to be properly escaped. * * * Software versions: % zsh --version zsh 5.0.5 (x86_64-apple-darwin13.0.0) % git --version git version 1.9.3 % sw_vers ProductName: Mac OS X ProductVersion: 10.9.3 BuildVersion: 13D65 * * * I've uploaded the `_git` and `git-completion.bash` files: git-completion.bash and _git (renamed to `_git.sh` so CloudApp will make it viewable in the browser.)"} {"id":"79248","title":"What graphical launcher program can I use?","text":"I have the following setup: I am running Ubuntu on VirtualBox in a Windows Environment. I am using Xming launcher to start xterm from Ubuntu as a client from where I can launch other graphical programs. However, starting multiple programs from xterm with `&` means that the xterm window receives the output from the other applications and becomes very cluttered. Is there some other program I can run in the Ubuntu system that acts as a graphical launcher\/tray for other apps?"} {"id":"111858","title":"Randomizing the source port for new connections","text":"Generally whenever source port is selected by a network application, it is selected in a sequential manner among the free ports like 32000, 32001 and so on. I want to randomize the source port selection. I tried this using iptables as follows but this didnt help. Chain POSTROUTING (policy ACCEPT 462 packets, 31025 bytes) 743 44580 MASQUERADE tcp -- * !lo 0.0.0.0\/0 0.0.0.0\/0 masq ports: 32768-61000 random Can someone help me in solving this."} {"id":"87828","title":"Not able to run vnstat unless as root in debian 7","text":"So, I need to run this command: vnstat -tr 2 But as a user I just created, not as root, as root it works fine, but as a regular user I get this: Error: Unable to get interface \"eth0\" statistics. Error: Interface \"eth0\" not available, exiting. On Debian 6 there wasn't this restriction, how do I remove it? Sounds like a permissions problem."} {"id":"87829","title":"Difference between virtual interfaces with ifconfig and iproute2","text":"I am wondering what is the difference between: # ifconfig eth0:0 1.1.1.1\/24 and just # ip addr add 1.1.1.1\/24 dev eth0 Btw I cannot do # ip addr add 1.1.1.1\/24 dev eth0:0 RTNETLINK answers: File exists In `ip addr show` it appears differently : eth0: mtu 1500 qdisc pfifo_fast state UP qlen 1000 link\/ether 8c:ae:4c:fe:1f:75 brd ff:ff:ff:ff:ff:ff inet 1.1.1.1\/24 brd 1.1.1.255 scope global eth0:0 ---> with ifconfig inet 2.2.2.2\/24 scope global eth0 ----> with ip When should I prefer the first way and when should I prefer the second way? It seems more cool to"} {"id":"68410","title":"How to format USB drive in Linux Mint 14 with GUI?","text":"I'm new to Linux Mint and I've just installed Linux Mint 14. Now I need to format my USB drive, but I'm not getting any option to do that. Please suggest me anyone, how can I do that with a GUI?"} {"id":"148861","title":"Proper file system for an External Hard Drive to work well on Linux","text":"I have a External Hard Drive (EHD) I want to use to backup the data on my Linux laptop. I want to know how I should format my EHD for it to work correctly with Linux. Thanks."} {"id":"25921","title":"How can I run a specific command for each find result?","text":"How would one run a specific command for each file that was found by using the `find` command? For the purpose of the question lets say that I would simply like to delete each file found by `find`. I am unix\/linux noob so be gentle with me."} {"id":"23459","title":"grep caret appears to have no effect","text":"I was under the impression that a caret symbol means \"beginning of the line\" with Extended POSIX regular expressions. However, when I use it with grep it behaves unexpectedly. #grep --version GNU grep 2.5.4 ... I am using GNU grep 2.5.4 on Ubuntu 10.04 Lucid Lynx. I echo out a line ' hello', then pipe it to a grep that searches for \"zero-or- more white-space characters followed by the letter h\": #echo ' hello' | grep -E '[:space:]*h' hello grep finds it ok. If I add a caret to indicate that I only want the pattern to match \"zero-or- more white-space characters followed by the letter h\" \"at the beginning of the string\": #echo ' hello' | grep -E '^[:space:]*h' # No matches are found. I would expect the string to have matched because it begins with `white-space` followed by `h`. Why does this caret symbol prevent a match?"} {"id":"72434","title":"Will GNOME and GTK libs bloat up my KDE?","text":"I want to use Shutter. I installed it previously under Kubuntu and it needed a lot of libs. What bothered me most was that Kubuntu wanted me to restart, that is rare for OS's nowadays and in general means that something was added to startup procedures. So will these libs bloat my KDE up and get loaded even if I don't start Shutter? To be clear, as long as it's only disk space that not what I mean by bloat. Please take this more as a general question about installing GNOME apps on KDE and not so much about Shutter and the libs it needs. Maybe you can help me understand the technical background a bit better."} {"id":"140174","title":"Rebuilt kmod package not updating via `YUM` but is via `rpm`","text":"I have built a package with the following version: kmod-dahdi-linux 10:2.9.1.1-75_shmz65.1.11.2.6.32_431.el6.i686 Which should be an upgrade of the one installed on the system: kmod-dahdi-linux 0:2.9.0.1-72_centos6.2.6.32_431.el6.i686 when I do a `yum localupdate` I get the following: Resolving Dependencies --> Running transaction check ---> Package kmod-dahdi-linux.i686 0:2.9.0.1-72_centos6.2.6.32_431.el6.i686 will be updated ---> Package kmod-dahdi-linux.i686 10:2.9.1.1-75_shmz65.1.11.2.6.32_431.el6.i686 will be an update --> Finished Dependency Resolution But when it hits the transaction check, I get file conflicts like it's not updating the package, but installing it side-by-side, as seen here: file \/lib\/modules\/2.6.32-431.el6.i686\/dahdi\/dahdi.ko from install of kmod-dahdi-linux-10:2.9.1.1-75_shmz65.1.11.2.6.32_431.el6.i686.i686 conflicts with file from package kmod-dahdi-linux-2.9.0.1-72_centos6.2.6.32_431.el6.i686.i686 I've tried obsoletes for older versions, I've tried upping the Epoch (as you can see mine has an epoch of 10 now) When I do: rpm -Uvh kmod-dahdi-linux-2.9.1.1-75_shmz65.1.11.2.6.32_431.el6.i686.i686.rpm it upgrades properly. I've double checked the rpmversion shows as newer: # rpmdev-vercmp 0:2.9.0.1-72_centos6.2.6.32_431.el6.i686 10:2.9.1.1-75_shmz65.1.11.2.6.32_431.el6.i686 10:2.9.1.1-75_shmz65.1.11.2.6.32_431.el6.i686 is newer Any ideas? Additional information: I've re-tooled my RPM to have the exact same dist tag and it still fails. # yum localupdate kmod-dahdi-linux-2.9.1.1-11_centos6.2.6.32_431.el6.i686.i686.rpm Resolving Dependencies --> Running transaction check ---> Package kmod-dahdi-linux.i686 0:2.9.0.1-72_centos6.2.6.32_431.el6.i686 will be updated ---> Package kmod-dahdi-linux.i686 0:2.9.1.1-11_centos6.2.6.32_431.el6.i686 will be an update --> Finished Dependency Resolution Transaction Check Error: file \/lib\/modules\/2.6.32-431.el6.i686\/dahdi\/dahdi.ko from install of kmod-dahdi-linux-2.9.1.1-11_centos6.2.6.32_431.el6.i686.i686 conflicts with file from package kmod-dahdi-linux-2.9.0.1-72_centos6.2.6.32_431.el6.i686.i686"} {"id":"140176","title":"Built the kernel with NFS support but not getting \/dev\/nfs","text":"I'm trying to build kernel 3.13.9, fetched using `apt-get source`, and built in a clean `debootstrap` chroot (both host and chroot being installations of Ubuntu Trusty). My goal is to boot a diskless machine to a console over NFS. I ran `make menuconfig` and enabled 64-bit kernel, disabled debugging, and made sure I was doing a 64-bit build. In addition, I went to file systems->network file systems, and enabled the following: * Network File Systems * NFS Client Support The host has `nfs-kernel-server` installed, and an export set up for the directory that I would like to use as the root of the network-booted system. PXE boot happens OK, kernel and initrd are loaded, but after a long pause, I'm dumped to a busybox prompt, due to a root filesystem being missing. What could be the cause? (or, is more info needed?) **Edit:** I'm already passing `nfsroot`: LABEL linux KERNEL vmlinuz-3.13.9 APPEND root=\/dev\/nfs initrd=initrd.img-3.13.9 nfsroot=192.168.1.39:\/nfsroot,rw ip=dhcp rw"} {"id":"76950","title":"Automating tasks on a website on a headless server","text":"I want to automate a task which can only be done on a website (with prior login) on my debian server. There is no public API available, so I can't use one. Is there a way to do so? I thought about a text-based browser or something similar."} {"id":"76956","title":"Git commit from within a Makefile","text":"I have a Makefile for a Latex project I'm working on. Makefiles aren't my forte, but is there a way to do something like: make git \"My comment\" And have the makefile execute: git commit -m \"My comment\" git push origin master ?"} {"id":"73529","title":"How to display Discordian date?","text":"I am a strong believer in Discordianism. Yet most mostly I am confronted with the time measurement of pesky heathens. How do I know what date it really is?"} {"id":"131217","title":"How to remove duplicate lines with awk whilst keeping empty lines?","text":"Below `awk` command removes all duplicate lines as explained here: awk '!seen[$0]++' If the text contains empty lines, all but one empty line will be deleted. How can I keep all empty lines whilst deleting all non-empty duplicate lines, using only `awk`? Please, also include a brief explanation."} {"id":"10440","title":"Send duplicate packets over two Internet connections","text":"I need to duplicate an RTP stream over two different (non-reliable) Internet connections. On the receiver side, I will probably run a custom program that will use a buffer and rebuild the stream before using it. But I have some trouble in splitting the traffic over the two connections. I did some research and found that maybe `tc` (part of `iproute2`) could be what I need. Can anyone help me?"} {"id":"124014","title":"How to install man command for chef","text":"I want to see manual for `chef` with command `man knife-cookbook`. But it looks like manuals are not installed by default install `gem install chef`. I found the man page of `knife cookbook`. http:\/\/manned.org\/knife- cookbook\/061616e2 How can I install these manual pages to my local environments? Normally documents are automatically installed along with software itself. I never installed manual separately. I'm using `OS X 10.9.2`."} {"id":"121229","title":"Find all files that have been last modified on a specific day - like Monday?","text":"So I want to use `find` to return a list of all .html files in a given directory that have been last modified on a Monday. How can I do this?"} {"id":"121220","title":"virtmanager- Unable to locate libvirtd daemon","text":"I tried starting Virt-manager but get this error Unable to connect to libvirt. internal error: Unable to locate libvirtd daemon in \/usr\/sbin (to override, set $LIBVIRTD_PATH to the name of the libvirtd binary) Hi, I tried to start virtmanagerr (installed via mint software center) but get this? Libvirt URI is: qemu:\/\/\/system Traceback (most recent call last): File \"\/usr\/share\/virt-manager\/virtManager\/connection.py\", line 1027, in _open_thread self.vmm = self._try_open() File \"\/usr\/share\/virt-manager\/virtManager\/connection.py\", line 1009, in _try_open flags) File \"\/usr\/lib\/python2.7\/dist-packages\/libvirt.py\", line 102, in openAuth if ret is None:raise libvirtError('virConnectOpenAuth() failed') libvirtError: internal error: Unable to locate libvirtd daemon in \/usr\/sbin (to override, set $LIBVIRTD_PATH to the name of the libvirtd binary)"} {"id":"125155","title":"Compare two files for matching lines and store positive results","text":"I have two files. ### File 1: A0001 C001 B0003 C896 A0024 C234 . B1542 C231 . upto 28412 such lines ### File 2: A0001 A0024 B1542 . . and 12000 such lines. I want to compare File 2 against File 1 and store the matching lines from File 1. I tried Perl and Bash but none seems to be working. The latest thing I tried was something like this: for (@q) # after storing contents of second file in an array { $line =`cat File1 | grep $_`; #directly calling File 1 from bash print $line; } but it fails."} {"id":"71274","title":"Crash analysis and 4 levels of page table","text":"I am having xen 3.4.2 running with 15 vm (pv+hvm) on a host with 256 Gb RAM and 96 core CPU. But recently my host crashed on debug log its showing translating ffff83183fcb0000 with CR3 100ae42000 and 4 levels of page table. after so many similar lines its showing cannot translate address 0 < ffff830000000000 without cr3 From my understanding of xen pv is that, hypervisor gives pv direct access to physical RAM but hypervisor cross checks all the call to physical memory rather than using shadow pages. So it has less overhead in virtual memory to physical conversion,as its aware about actual mapping. But in case of HVM hypervisor needs to translate guests memory to physical ram. So can anyone explain me from above translation that its for hvm ram translation hypervisor is doing or will it happen in pv also? and on crash.log its showing (XEN) grant_table.c:1408:d0 dest domain 452 dying (XEN) p2m_pod_cache_get: Breaking up superpage. (XEN) mm.c:741:d421 Non-privileged (421) attempt to map I\/O space 00000000 (XEN) mm.c:741:d421 Non-privileged (421) attempt to map I\/O space 000000f0 (XEN) mm.c:741:d352 Non-privileged (352) attempt to map I\/O space 00000000 (XEN) mm.c:741:d352 Non-privileged (352) attempt to map I\/O space 000000f0 (XEN) mm.c:741:d249 Non-privileged (249) attempt to map I\/O space 00000000 (XEN) mm.c:741:d249 Non-privileged (249) attempt to map I\/O space 000000f0 (XEN) grant_table.c:1408:d0 dest domain 450 dying This is the second crash in a month. I have seen many system programming related questions here thats why i posted it here."} {"id":"141228","title":"Control + L not clearing screen","text":"When I try to clear my terminal screen on OSX: computer@ ~ () $ ^L And when I hit `Enter` after that it just shows: -bash: : command not found Any ideas on how this happens? My `.bash_profile`, `.profile`, and `.bashrc` are empty."} {"id":"85537","title":"How to hide someone else's directories from a user?","text":"I have several folders: \/home\/user1\/ -u user1 -G user1 \/home\/user2\/ -u user2 -G user2 \/home\/user3\/ -u user3 -G user3 I created three users user1, user2, user3. Each user has own group. Any user can see other account folder for a while but cannot open it. After user2 logged in using ssh he shouldn't see any folders downto its folder `\/home\/user2\/`. He should see only folders in `\/home\/user2\/`. How to set these permissions?"} {"id":"75601","title":"Tracing system call on Ubuntu 12.04","text":"The main task I have to carry out, is to trace the system call of processes in ubuntu 12.04 LTS. Problem is, I am unable to trace them continuously, i.e. as soon as they are added to the system, they should get traced. Is there any kind of signal or interrupt which can inform the user about a newly added process in the system?"} {"id":"138639","title":"How to use cURL commandline to download a file, for which the link is hidden(activates on-click only)","text":"I was referring to this question. However, I am wondering how to do the same with `curl`. So far, I have tried the following: curl -O output.rar --referer http:\/\/subs.sab.bz\/ 'http:\/\/subs.sab.bz\/index.php?s=ece2929c25861a7244025e1628e7ee5a&act=download&attach_id=75766' I also tried with `-e` switch, but it does not work for me. Can anyone help me out? Thanks in advance!!"} {"id":"38402","title":"Aliases and tmux","text":"Aliases defined in `.bash_aliases` and `.bashrc` don't work in `tmux`. Can this be changed in some configuration, so the aliases work under `tmux`?"} {"id":"149089","title":"How to enable\/disable a serial port?","text":"I need to disable and then enable a serial port for testing purposes on a Java program. Since the `man` page of `setserial` is stating: \" _Using UART type none will disable the port._ \", I use `sudo setserial \/dev\/ttyS4 uart none` to disable the port. This successfully disables the serial port. To enable the serial port again, I use `sudo setserial \/dev\/ttyS4 -a autoconfig` and the port is up as expected. After I've disabled the port, I do try to open the port using the Java gnu.io.CommPortIdentifier function. When I try to enable the port after the executing the `gnu.io.CommPortIdentifier` function, I get this output: $ sudo setserial \/dev\/ttyS4 -a autoconfig Cannot autoconfigure port: Device or resource busy How can I work around this problem? Is there a better way to enable\/disable the serial port? Or can I clear the list of requests made to the port? I obviously can't just kill the process, since my test is running in it."} {"id":"40539","title":"Recursively rename e-mail files from .txt to .eml","text":"Directory \"$d\" contains a few thousand e-mail files with the .txt extension. To open them in my e-mail client, I need to rename them to .eml Will this command rename them correctly: find \"${d}\" -type f -name '*.txt' | while read f; do mv -vn \"${f}\" \"${f%.*}\".eml; done or is there a better, more robust way to do this? I could not think of an elegant way of doing this using: -exec ...{}... \\;"} {"id":"71384","title":"Would someone please explain lspci -vv output?","text":"I have the following output from running `lspci -vv -s 00:00` on my single board computer running Linux. 07:05.0 RAID bus controller: Adaptec AAC-RAID (Rocket) (rev 03) Subsystem: Adaptec ASR-2230S + ASR-2230SLP PCI-X (Lancer) Control: I\/O- Mem+ BusMaster+ SpecCycle+ MemWINV+ VGASnoop- ParErr- Stepping- SERR+ FastB2B- Status: Cap+ 66MHz+ UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- SERR- Latency: 64 (250ns min, 250ns max), Cache Line Size: 64 bytes Interrupt: pin A routed to IRQ 74 Region 0: Memory at f7a00000 (64-bit, non-prefetchable) [size=2M] Region 2: Memory at f79ff000 (64-bit, non-prefetchable) [Remaining output truncated] The above is only example output and not exactly what I am getting but it contains the items of interest. I understand most of the output from the lspci command, but I would like someone to explain to me the lines that begin with **Region** ... What type of memory am I looking at here specified by the Region line? How might I access it? With that asked, I am trying to accomplish communication between two single board computers connected over the PCI bus. I should be able to talk directly. All there is a PCI arbiter running the bus. This is what I've accomplished so far... I created a Linux kernel module for outbound PCI traffic. Basically it maps all the way down from userspace (with a user space application) using the driver mmap implementation. I write to the location returned by mmap and I actually see the traffic with a bus analyzer! Now on the other single board computer I try read its sysfs resource for the PCI device but only see all FFs and no changes. Any advice or explanation on how all of this memory mapping occurs, involving PCI, would be greatly appreciated."} {"id":"117972","title":"Cross executing binaries","text":"I have a Linux machine that I own and administer (CLIENT). I have access to a UNIX server, with no administrative privileges at all (SERVER). Previously, I used to copy a lot of files from this server, processes them in my client, and then push them back to the server. Lately, I'm working remotely, and to move 5~10 Gb, many times a day; so this approach is not an option anymore. So what I want do is to: 1. ( **optional, if you have a better idea** ) transfer a binary (compiled to that Unix, I have most of then, but a reference to cross compile could be helpful) 2. run _my_ binaries against those files, on the SERVER (using their computing power, and memory, since the tasks are huge). 3. save the results on the server (with a redirection \"> file.txt\") 4. not leave ( **or even install** ) these apps on the server. How this kind of result could be accomplished? Below some additional back ground. On this specific server, there is a long process to request, and almost certainly not to be granted, authorization to install new programs. Believe-me I've tried. One of the questions taken into consideration for this request was \"how will this work be done without this software?\", to which my reply was \"I've been doing it on my workstation with copies of the files\", to which they replied \"so continue working that way.\" Since I have started these analysis by UNIX, the results are great for the main business; so demand is increasing. I've managed to maintain a solution scalable that is performing well. But the transfers are a big concern now. I stand to lose my ability to work from home if this analysis cannot be done anymore."} {"id":"70387","title":"Difference betwen grep pattern ^$ and ^","text":"I understand that grep matches all the blank lines for the pattern `^$`. But what does just `^` means. When I gave `grep '^' filename`. It matched all the lines. Also `grep '' filename` matched all the lines"} {"id":"36036","title":"Windows host shares doesn't get mount when I boot into Linux guest in vmware?","text":"I've enable network shares in vmware and I want to share a Windows folder with my Linux guest OS but I don't know where to look in my guest OS? In Linux I've looked into network shares and samba shares to no avail. My Linux is a standard installation of Suse 12.1."} {"id":"14388","title":"Are there any GUI's for Linux that doesn't use X11?","text":"Are there any GUI's for Linux that doesn't use X11? Since X has very poor security :O e.g.: Ubuntu, Fedora - what else are there? Goal: having a Desktop Environment without X. - what are the solutions? (e.g.: watch Flash with Google Chrome, Edit docs with LibreOffice, etc., not using text-based webbrowsers) Maybe with framebuffers? But how? :O"} {"id":"84662","title":"Driver for Canon i-SENSYS MF3010","text":"In the specifications for Canon i-SENSYS MF3010 http:\/\/www.canon- europe.com\/For_Home\/Product_Finder\/Multifunctionals\/Laser\/i-SENSYS_MF3010\/ it is mentioned the printer is compatible with GNU\/Linux. On the download page http:\/\/www.canon- europe.com\/Support\/Consumer_Products\/products\/Fax__Multifunctionals\/Laser\/LaserBase_MF_series\/i-SENSYS_MF3010.aspx?type=download&page=1 there is no driver for GNU\/Linux. Where do I find a driver?"} {"id":"77053","title":"apt installing more packages than specified as dependencies","text":"I was trying to install `texmaker` from the repository. For installing the `texlive` I followed the steps described here. For this the control file I used is this. It has the file texlive-binaries in it. Then I tried to install `texmaker` from `apt`. It has the dependency listed as # apt-cache depends texmaker texmaker Depends: libc6 Depends: libgcc1 Depends: libpoppler-qt4-3 Depends: libqt4-network Depends: libqt4-xml Depends: libqtcore4 Depends: libqtgui4 Depends: libqtwebkit4 Depends: libstdc++6 Depends: zlib1g Depends: texmaker-data Recommends: aspell Recommends: ghostscript Recommends: netpbm Recommends: psutils texlive-local Recommends: texlive-latex-extra texlive-local |Recommends: myspell-fr myspell-ru hunspell-an hunspell-ar hunspell-be hunspell-da hunspell-de-at hunspell-de-at-frami hunspell-de-ch hunspell-de-ch-frami hunspell-de-de hunspell-de-de-frami hunspell-en-ca hunspell-en-us hunspell-eu-es hunspell-fr hunspell-gl-es hunspell-hu hunspell-kk hunspell-ko hunspell-ne hunspell-ro hunspell-ru hunspell-se hunspell-sh hunspell-sr hunspell-sv-se hunspell-uz hunspell-vi myspell-et myspell-lv myspell-pl |Recommends: hunspell-de-de myspell-de-de |Recommends: myspell-de-de-oldspell myspell-fr myspell-ru hunspell-kk myspell-af myspell-bg myspell-ca myspell-cs myspell-da myspell-de-at myspell-de-ch myspell-de-de myspell-en-au myspell-en-gb myspell-en-us myspell-en-za myspell-eo myspell-es myspell-et myspell-fa myspell-fi myspell-fo myspell-fr-gut myspell-ga myspell-gd myspell-gv myspell-he myspell-hr myspell-hu myspell-hy myspell-it myspell-ku myspell-lt myspell-lv myspell-nb myspell-nl myspell-nn myspell-pl myspell-pt-br myspell-pt-pt myspell-sk myspell-sl myspell-sw myspell-th myspell-tl myspell-uk Recommends: hunspell-en-us Recommends: asymptote Recommends: ibus-qt4 But when I tried to install `texmaker` from `apt` is shows # apt-get install texmaker Reading package lists... Done Building dependency tree Reading state information... Done The following extra packages will be installed: asymptote asymptote-doc ed freeglut3 ibus-qt4 libgraphite3 libibus-qt1 libptexenc1 libqtwebkit4 libruby1.9.1 libsigsegv2 libyaml-0-2 python-imaging-tk ruby ruby1.9.1 tex-common texlive-binaries texlive-common texmaker-data Why is it so? I had no problem installing `tex-studio` and `texworks`."} {"id":"2300","title":"Getting information on a machine's hardware in Linux","text":"How can I check what hardware I have? (With BIOS version etc.)"} {"id":"33838","title":"listing all hardware details on Linux","text":"> **Possible Duplicate:** > checking hardware on linux I want to list all the hardware details about my system. To start with I've following things in my mind. `processor` `memory` `bios` `hba` I've got few details about processor like `processor: Current Speed, Max Speed, Family, Manufacturer, Version, No of CPU's` Can anybody expand the list for me of what other hardware details i need to figure out."} {"id":"64598","title":"How to find information about devices in Linux","text":"I want to find the following information for devices in Linux: * Bus speed (e.g. 66 MHz) * IRQ settings * Vendor identification * AGP rate (e.g. 1x, 2x, 4x) * MAC address I am only able find the last one by `\/sbin\/ifconfig | grep HWaddr` How can I find this information in Linux?"} {"id":"70926","title":"Unable to install the selected kernel","text":"I have problem with my DVD drive. It's corrupted and when I'm trying to install Ubuntu it stucks (even with the miniISO) I was able to successfully start the OS from system rescue CD. I'd like to have a possibility to copy minimum information from CD and instead of it download the most files from the internet because my DVD drive won't manage it and stucks. I can't use USB installation, my laptop doesn't support it. I succeeded according to this guide and downloaded netboot files. I copied files and directories to my `\/boot` directory on `\/dev\/sda1` partition and performed the steps in the guide. root=hd(0,1) linux \/boot\/linux initrd \/boot\/initrd.gz boot After the command `boot` in Grub and in the process of `installing the base system` I got this error Configuring linux-image-3.5.0-26-generic Unable to install the selected kernel An error was returned while trying to install the kernel into the target system. Kernel package: 'linux-generic'. Check \/var\/log\/syslog or see virtual console 4 for the details. \/var\/log\/syslog Did I something wrong? Can I repair this error?"} {"id":"29214","title":"Copy first n files in a different directory","text":"> **Possible Duplicate:** > How to move 100 files from a folder containing thousands? Is it possible to copy only the first 1000 files from a directory to another? Thanks in advance"} {"id":"41757","title":"How to remove mounted locations that have been added using the mount command?","text":"I've mounted few shared locations using the below command. mount -t cifs \/mnt\/systemfolder -o username=name,password=password \/\/10.10.1.1\/My-Shared-Folder A few incorrect locations* have been erroneously mounted while running this command. Now when I execute just the `mount` command, it lists all the right and wrong locations I've mounted. * * I have mounted the same location multiple times. How do I remove locations that show up from executing the `mount` command so that I can remove the incorrect ones I've mounted? The `umount` command does not help me remove the mounted location. Here's a screenshot showing the results to the `mount` and `umount` commands. ![enter image description here](http:\/\/i.stack.imgur.com\/k3GL6.png)"} {"id":"71032","title":"File owner must belong to file group?","text":"I have a rather simplistic understanding of file permissions on *nix systems. I understand that there is a file owner and file group, but is there a hard and fast rule on whether the said file owner _must_ belong to the file group also? Or put another way, can a file belong to a group that the owner is not a part of? If so (or if not), why? I'd like to increase my understanding... I can't seem to find anything that specifically talks about this out on the interwebs... I'm also open to some good reading material on the subject."} {"id":"71033","title":"Locate occasional CPU kernel hog","text":"I have a 2.6.35 PREEMPT kernel running on moderate-speed ARMv7 processor. About once every 100 - 125s, something causes the kernel to fail to process some audio-related drivers sufficiently quickly to avoid underruns. The hold- up are generally in the range 15-30ms, but can be very much longer. It is not clear whether the hold-up is entirely in-kernel or may relate to the scheduling of a user process running with real-time priority (SCHED_RR, 2). My guess is that there is a (at least one) driver that is not playing nice with preempt. Some strace output from the user process illustrates some aspect of both normal and abnormal behaviour, although I am not certain how to interpret the various time reports? Normal case: 0.000518 poll([{fd=10, events=POLLIN|POLLERR|POLLNVAL, revents=POLLIN}], 1, 3415) = 1 0.010202 poll([{fd=10, events=POLLIN|POLLERR|POLLNVAL}, {fd=6, events=POLLOUT|POLLERR|POLLNVAL, revents=POLLOUT}], 2, 3404) = 1 0.000585 poll([{fd=10, events=POLLIN|POLLERR|POLLNVAL}, {fd=6, events=POLLOUT|POLLERR|POLLNVAL, revents=POLLOUT}], 2, 3404) = 1 0.000302 poll([{fd=10, events=POLLIN|POLLERR|POLLNVAL, revents=POLLIN}], 1, 3404) = 1 0.010706 poll([{fd=10, events=POLLIN|POLLERR|POLLNVAL}, {fd=6, events=POLLOUT|POLLERR|POLLNVAL, revents=POLLOUT}], 2, 3393) = 1 0.000480 poll([{fd=10, events=POLLIN|POLLERR|POLLNVAL}, {fd=6, events=POLLOUT|POLLERR|POLLNVAL, revents=POLLOUT}], 2, 3392) = 1 No blocking occurs on the poll for output on fd6 and, when only fd10 is polled for input, a block of around 10ms occurs. This is reflected both in the report of the duration of the system call and the interval between system calls (they are consistent). Failure case (extreme example): 0.000305 poll([{fd=10, events=POLLIN|POLLERR|POLLNVAL, revents=POLLIN}], 1, 3543) = 1 0.010730 poll([{fd=10, events=POLLIN|POLLERR|POLLNVAL}, {fd=6, events=POLLOUT|POLLERR|POLLNVAL, revents=POLLOUT}], 2, 3533) = 1 0.000475 poll([{fd=10, events=POLLIN|POLLERR|POLLNVAL}, {fd=6, events=POLLOUT|POLLERR|POLLNVAL, revents=POLLOUT}], 2, 3532) = 1 0.000329 poll([{fd=10, events=POLLIN|POLLERR|POLLNVAL, revents=POLLIN}], 1, 3532) = 1 0.953349 poll([{fd=10, events=POLLIN|POLLERR|POLLNVAL}, {fd=6, events=POLLOUT|POLLERR|POLLNVAL, revents=POLLOUT|POLLERR}], 2, 2578) = 1 Notice in this case that, even though the second-last call is recorded as taking 10ms (normal), it is 953ms before the last call. What tools can I use to track down the culprit?"} {"id":"76561","title":"How can I find the correct name for my microphone and sound output using aplay or pacmd or something else, to apply in asound.conf?","text":"I need to write a default mic and default speaker output in the `asound.conf` config file. But I don't know exactly how I can find my external sound card or microphone device's name, so that on reboot or unplug\/plug I don't have to reconfigure it again. I tried to find them by using: sun@sun-To-be-filled-by-O-E-M:\/tmp$ pacmd dump | grep alsa_input set-source-volume alsa_input.pci-0000_00_1b.0.analog-stereo 0xddb set-source-mute alsa_input.pci-0000_00_1b.0.analog-stereo no suspend-source alsa_input.pci-0000_00_1b.0.analog-stereo yes set-source-volume alsa_input.usb-0d8c_C-Media_USB_Audio_Device-00-Device.analog-mono 0x9091 set-source-mute alsa_input.usb-0d8c_C-Media_USB_Audio_Device-00-Device.analog-mono no suspend-source alsa_input.usb-0d8c_C-Media_USB_Audio_Device-00-Device.analog-mono yes set-source-volume alsa_input.usb-046d_HD_Pro_Webcam_C920_8E9E4FCF-02-C920.analog-stereo 0xfffe set-source-mute alsa_input.usb-046d_HD_Pro_Webcam_C920_8E9E4FCF-02-C920.analog-stereo no suspend-source alsa_input.usb-046d_HD_Pro_Webcam_C920_8E9E4FCF-02-C920.analog-stereo yes set-default-source alsa_input.usb-046d_HD_Pro_Webcam_C920_8E9E4FCF-02-C920.analog-stereo or: sun@sun-To-be-filled-by-O-E-M:\/tmp$ aplay -l **** List of PLAYBACK Hardware Devices **** card 0: PCH [HDA Intel PCH], device 0: ALC892 Analog [ALC892 Analog] Subdevices: 1\/1 Subdevice #0: subdevice #0 card 0: PCH [HDA Intel PCH], device 1: ALC892 Digital [ALC892 Digital] Subdevices: 1\/1 Subdevice #0: subdevice #0 card 0: PCH [HDA Intel PCH], device 3: HDMI 0 [HDMI 0] Subdevices: 1\/1 Subdevice #0: subdevice #0 card 0: PCH [HDA Intel PCH], device 7: HDMI 1 [HDMI 1] Subdevices: 1\/1 Subdevice #0: subdevice #0 card 2: Device [C-Media USB Audio Device], device 0: USB Audio [USB Audio] Subdevices: 1\/1 Subdevice #0: subdevice #0 But it confused me. Which one is the name that I have to use when doing `sudo vim \/etc\/asound.conf`? From the information given above this device is my microphone: card 2: Device [C-Media USB Audio Device], device 0: USB Audio [USB Audio] Subdevices: 1\/1 Subdevice #0: subdevice #0 And from the above information this device is my audio output: card 0: PCH [HDA Intel PCH], device 3: HDMI 0 [HDMI 0] Subdevices: 1\/1 Subdevice #0: subdevice #0 How can I tell this in my `\/etc\/asound.conf`? I tried the following but it does not work: pcm.usb { type hw card C-Media USB Audio Device } pcm.!default { type asym playback.pcm { type plug slave.pcm \"dmix\" } capture.pcm { type plug slave.pcm \"usb\" } }"} {"id":"119112","title":"Named service won't start - seems to be caching errors","text":"When I try to restart \/ start the `named` service, it keeps failing. service named restart Results in:- Stopping named: [ OK ] Starting named: Error in named configuration: \/etc\/named.conf:2: missing ';' before '}' [FAILED] service named start Results in:- Starting named: Error in named configuration: \/etc\/named.conf:2: missing ';' before '}' [FAILED] The thing is, even if `named.conf` contains no syntax errors or even if the file doesn't exist at all, I'm still getting this error preventing me from starting the service. Currently trying with a `named.conf` containing the following:- options { listen-on port 53 { 127.0.0.1; }; }; And checking the syntax of `named.conf` using named-checkconf \/etc\/named.conf Results in no errors. Yet when starting the service, I still get the above error. I can't see any other errors in the logs relating to this and don't really know where to get to the bottom of this. Any ideas? (Even reverting back to the `named.conf` file that was in place before I stopped the service returns the same error now and this was previously running fine). Contents on `init.d\/named` can be seen at this pastebin. CentOS 6.4 - Linux version 2.6.32-358.6.2.el6.x86_64 (mockbuild@c6b8.bsys.dev.centos.org) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-3) (GCC) ) #1 SMP Thu May 16 20:59:36 UTC 2013 # Update bash -x \/etc\/init.d\/named start Snippet from results possibly of relevance? + echo 'Error in named configuration:' Error in named configuration: + echo '\/etc\/named.conf:2: missing '\\'';'\\'' before '\\''}'\\''' \/etc\/named.conf:2: missing ';' before '}' + failure + local rc=0 + '[' color '!=' verbose -a -z '' ']' + echo_failure + '[' color = color ']' + echo -en '\\033[60G' + echo -n '[' [+ '[' color = color ']' + echo -en '\\033[0;31m' + echo -n FAILED FAILED+ '[' color = color ']' + echo -en '\\033[0;39m' + echo -n ']' ]+ echo -ne '\\r' + return 1 + '[' -x \/bin\/plymouth ']' + \/bin\/plymouth --details + return 0 + echo"} {"id":"76566","title":"Where do I find a list of terminal key codes to remap shortcuts in bash?","text":"For example: \"\\e[1;5C\" \"\\e[Z\" \"\\e-1\\C-i\" I only know bits and pieces, like `\\e` stands for escape and `C-` for `Ctrl`, but what are these numbers (`1`) and letters (`Z`)? What are the `;`, `[` and `-` signs for? Is there only trial and error, or is there a complete list of bash key codes and an explanation of their syntax?"} {"id":"76568","title":"Problem in Joining RHEL with Windows 2008","text":"I configured Domain on my test machine (Win2k8) and domain name is **win2008ad.local** and computer name is win2k8. So the full name is **win2k8.win2008ad.local**. I installed packages on RHEL 5 related to winbind, Samba, and KRB After doing all the configurations when i run this command **net ads join -U administrator** it gives me this error ![enter image description here](http:\/\/i.stack.imgur.com\/esHGT.png) and **wbinfo -u** gives this error _Error Looking up Domain Users_ Contents of `\/etc\/security\/pam_winbind.conf`: # # pam_winbind configuration file # # \/etc\/security\/pam_winbind.conf # [global] # turn on debugging ;debug = yes # request a cached login if possible # (needs \"winbind offline logon = yes\" in smb.conf) ;cached_login = yes # authenticate using kerberos krb5_auth = yes # when using kerberos, request a \"FILE\" krb5 credential cache type # (leave empty to just do krb5 authentication but not have a ticket # afterwards) ;krb5_ccache_type = FILE # make successful authentication dependend on membership of one SID # (can also take a name) ;require_membership_of = Contents of `\/etc\/krb5.conf`: [root@rhmain ~]# cat \/etc\/krb5.conf [logging] default = FILE:\/var\/log\/krb5libs.log kdc = FILE:\/var\/log\/krb5kdc.log admin_server = FILE:\/var\/log\/kadmind.log [libdefaults] default_realm = WIN2008AD.LOCAL dns_lookup_realm = false dns_lookup_kdc = false ticket_lifetime = 24h forwardable = yes [realms] #EXAMPLE.COM = { #kdc = kerberos.example.com:88 #admin_server = kerberos.example.com:749 #default_domain = example.com WIN2008AD.LOCAL = { kdc = win2k8.win2008ad.local admin_server = win2k8.win2008ad.local } [domain_realm] #.example.com = EXAMPLE.COM #example.com = EXAMPLE.COM .win2k8.win2008ad.local = WIN2008AD.LOCAL [appdefaults] pam = { debug = false ticket_lifetime = 36000 renew_lifetime = 36000 forwardable = true krb4_convert = false } Contents of `\/etc\/hosts`: 10.20.20.221 win2k8.win2008ad.local winad Contents of `\/etc\/nsswitch`: passwd: files winbind shadow: files group: files winbind Contents of `\/etc\/pam.d\/system-auth`: auth required pam_env.so auth sufficient pam_winbind.so auth sufficient pam_unix.so nullok try_first_pass auth requisite pam_succeed_if.so uid >= 500 quiet auth required pam_deny.so account required pam_unix.so account required pam_winbind.so account sufficient pam_succeed_if.so uid < 500 quiet account required pam_permit.so password requisite pam_cracklib.so try_first_pass retry=3 password sufficient pam_winbind.so password sufficient pam_unix.so md5 shadow nullok try_first_pass use_authtok password required pam_deny.so session optional pam_keyinit.so revoke session required pam_limits.so session [success=1 default=ignore] pam_succeed_if.so service in crond quiet use_uid session required pam_unix.so And finally `\/etc\/samba\/smb.conf`: security = ads realm = WIN2008AD.LOCAL What am I missing?"} {"id":"15478","title":"Debian 6.0 and Intel \"Sandy Bridge\" (DH67CL) integrated video","text":"Is there a way to get the above to work - I have a quite recent desktop with the hardware and OS mentioned in the title. I was in a rush when first installing it, so I just grabbed an nvidia PCI-e adapter since the **Sandy Bridge** onboard video did not work out of the box (I think I only got VESA video in X)."} {"id":"6946","title":"gdm graphical login prompt problem (OpenSUSE 11.2)","text":"I'm trying to figure out why the graphical login prompt won't show up at the login page. I see the wallpaper just fine, but the graphical login prompt wont show up no matter how long I wait. So, In the console, I've done `init 3` to shut down gdm and then restarted it with `init 5`. The problem still persists. I downloaded and installed kdm and set it as the default display manager through editing `\/etc\/systemconfig\/displaymanager`. It worked fine, except that the main menu and many other items in the panels are gone. So I removed gdm with zypper and then reinstalled it again. I set the gdm as the default display manager and restarted gdm. The same problem shows up again. So I tried to bypass the login page entirely by enabling autologin. I put my username in the autologin section of `\/etc\/systemconfig\/displaymanager` and restarted gdm. No go, I still get the same problem. I'm thinking it mightn't be gdm related and that something else is interfering with gdm startup, but I'm stumped at this point. Any ideas?"} {"id":"86756","title":"Can't install software in Debian 6","text":"I installed `Debian 6 Squeez` on my virtual machine and I can't install software using `aptitude` or `apt-get`. This is my `sources.list` file: root@debian:\/etc\/apt# cat sources.list # # deb cdrom:[Debian GNU\/Linux 6.0.5 _Squeeze_ - Official i386 DVD Binary-1 20120512-13:45]\/ squeeze contrib main deb cdrom:[Debian GNU\/Linux 6.0.5 _Squeeze_ - Official i386 DVD Binary-1 20120512-13:45]\/ squeeze contrib main deb http:\/\/security.debian.org\/ squeeze\/updates main contrib deb-src http:\/\/security.debian.org\/ squeeze\/updates main contrib # squeeze-updates, previously known as 'volatile' # A network mirror was not selected during install. The following entries # are provided as examples, but you should amend them as appropriate # for your mirror of choice. # # deb http:\/\/ftp.debian.org\/debian\/ squeeze-updates main contrib # deb-src http:\/\/ftp.debian.org\/debian\/ squeeze-updates main contrib root@debian:\/etc\/apt# I tried commenting the `cdrom` lines, I also tried to add some sources I found on the net but none of them are working. Can anyone tell me why the default `sources.list` file doesn't have the appropriate configuration so I can easily `aptitude install lftp` for example? What can I do to install software from their repositories?"} {"id":"152019","title":"Problems with Dell Wireless 5570 HSPA+ Mobile Broadband card","text":"I've got a new Dell Latitude e7440, and a Dell Wireless 5570 HSPA+ mobile broadband card. I cannot get the broadband card to work. I can see the card: # lshw .... *-network DISABLED description: Ethernet interface physical id: 1 logical name: wwan0 serial: 46:51:4c:75:9d:ad capabilities: ethernet physical configuration: broadcast=yes driver=cdc_mbim driverversion=22-Aug-2005 firmware=CDC MBIM link=no multicast=yes And I can get rid of the DISABLED text: # ifconfig wwan0 up # ifconfig wwan0 wwan0 Link encap:Ethernet HWaddr 46:51:4c:75:9d:ad inet6 addr: fe80::4451:4cff:fe75:9dad\/64 Scope:Link UP BROADCAST RUNNING NOARP MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:11 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B) TX bytes:3937 (3.9 KB) # lshw .... *-network description: Ethernet interface physical id: 3 logical name: wwan0 serial: 46:51:4c:75:9d:ad capabilities: ethernet physical configuration: broadcast=yes driver=cdc_mbim driverversion=22-Aug-2005 firmware=CDC MBIM link=yes multicast=yes But I cannot _use_ the card in any way. * There's no `\/dev\/ttyUSBx` to which I could input AT commands. * I cannot see a mobile broadband connection in the Network manager. * tools like `mbim-network` simply say the connection to the modem failed My Dell BIOS version is `A10`, and from BIOS I can see the card. It's enabled and from that perspective there shouldn't be anything wrong with it. If I need to debug the driver, I'm willing to give that a try but I need some pointers on where to start. Any help is much appreciated Below is a list of debug output. Please ask for more in the comments if you think of anything that's helpful. * * * Here's `lsusb -v`: # lsusb -v Bus 002 Device 017: ID 413c:81a3 Dell Computer Corp. Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 2.00 bDeviceClass 0 (Defined at Interface level) bDeviceSubClass 0 bDeviceProtocol 0 bMaxPacketSize0 64 idVendor 0x413c Dell Computer Corp. idProduct 0x81a3 bcdDevice 0.06 iManufacturer 1 Sierra Wireless, Incorporated iProduct 2 Dell Wireless 5570 HSPA+ (42Mbps) Mobile Broadband Card iSerial 3 bNumConfigurations 2 Configuration Descriptor: bLength 9 bDescriptorType 2 wTotalLength 204 bNumInterfaces 4 bConfigurationValue 1 iConfiguration 0 bmAttributes 0xe0 Self Powered Remote Wakeup MaxPower 500mA Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 2 bAlternateSetting 0 bNumEndpoints 3 bInterfaceClass 255 Vendor Specific Class bInterfaceSubClass 0 bInterfaceProtocol 0 iInterface 0 ** UNRECOGNIZED: 05 24 00 10 01 ** UNRECOGNIZED: 05 24 01 00 00 ** UNRECOGNIZED: 04 24 02 02 ** UNRECOGNIZED: 05 24 06 00 00 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x82 EP 2 IN bmAttributes 3 Transfer Type Interrupt Synch Type None Usage Type Data wMaxPacketSize 0x000c 1x 12 bytes bInterval 9 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes 2 Transfer Type Bulk Synch Type None Usage Type Data wMaxPacketSize 0x0200 1x 512 bytes bInterval 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x01 EP 1 OUT bmAttributes 2 Transfer Type Bulk Synch Type None Usage Type Data wMaxPacketSize 0x0200 1x 512 bytes bInterval 0 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 3 bAlternateSetting 0 bNumEndpoints 3 bInterfaceClass 255 Vendor Specific Class bInterfaceSubClass 0 bInterfaceProtocol 0 iInterface 0 ** UNRECOGNIZED: 05 24 00 10 01 ** UNRECOGNIZED: 05 24 01 00 00 ** UNRECOGNIZED: 04 24 02 02 ** UNRECOGNIZED: 05 24 06 00 00 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x84 EP 4 IN bmAttributes 3 Transfer Type Interrupt Synch Type None Usage Type Data wMaxPacketSize 0x000c 1x 12 bytes bInterval 9 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x83 EP 3 IN bmAttributes 2 Transfer Type Bulk Synch Type None Usage Type Data wMaxPacketSize 0x0200 1x 512 bytes bInterval 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x02 EP 2 OUT bmAttributes 2 Transfer Type Bulk Synch Type None Usage Type Data wMaxPacketSize 0x0200 1x 512 bytes bInterval 0 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 8 bAlternateSetting 0 bNumEndpoints 3 bInterfaceClass 255 Vendor Specific Class bInterfaceSubClass 255 Vendor Specific Subclass bInterfaceProtocol 255 Vendor Specific Protocol iInterface 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x86 EP 6 IN bmAttributes 3 Transfer Type Interrupt Synch Type None Usage Type Data wMaxPacketSize 0x000a 1x 10 bytes bInterval 9 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x85 EP 5 IN bmAttributes 2 Transfer Type Bulk Synch Type None Usage Type Data wMaxPacketSize 0x0200 1x 512 bytes bInterval 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x03 EP 3 OUT bmAttributes 2 Transfer Type Bulk Synch Type None Usage Type Data wMaxPacketSize 0x0200 1x 512 bytes bInterval 0 ** UNRECOGNIZED: 2c ff 42 49 53 54 00 01 07 f5 40 f6 00 00 00 00 01 f7 c4 09 02 f8 c4 09 03 f9 88 13 04 fa 10 27 05 fb 10 27 06 fc c4 09 07 fd c4 09 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 0 bAlternateSetting 0 bNumEndpoints 2 bInterfaceClass 255 Vendor Specific Class bInterfaceSubClass 255 Vendor Specific Subclass bInterfaceProtocol 255 Vendor Specific Protocol iInterface 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x87 EP 7 IN bmAttributes 2 Transfer Type Bulk Synch Type None Usage Type Data wMaxPacketSize 0x0200 1x 512 bytes bInterval 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x04 EP 4 OUT bmAttributes 2 Transfer Type Bulk Synch Type None Usage Type Data wMaxPacketSize 0x0200 1x 512 bytes bInterval 0 Configuration Descriptor: bLength 9 bDescriptorType 2 wTotalLength 82 bNumInterfaces 2 bConfigurationValue 2 iConfiguration 0 bmAttributes 0xe0 Self Powered Remote Wakeup MaxPower 500mA Interface Association: bLength 8 bDescriptorType 11 bFirstInterface 12 bInterfaceCount 2 bFunctionClass 2 Communications bFunctionSubClass 14 bFunctionProtocol 0 iFunction 0 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 12 bAlternateSetting 0 bNumEndpoints 1 bInterfaceClass 2 Communications bInterfaceSubClass 14 bInterfaceProtocol 0 iInterface 0 CDC Header: bcdCDC 1.10 CDC MBIM: bcdMBIMVersion 1.00 wMaxControlMessage 4096 bNumberFilters 16 bMaxFilterSize 128 wMaxSegmentSize 4064 bmNetworkCapabilities 0x20 8-byte ntb input size Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x82 EP 2 IN bmAttributes 3 Transfer Type Interrupt Synch Type None Usage Type Data wMaxPacketSize 0x0040 1x 64 bytes bInterval 9 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 13 bAlternateSetting 0 bNumEndpoints 0 bInterfaceClass 10 CDC Data bInterfaceSubClass 0 Unused bInterfaceProtocol 2 iInterface 0 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 13 bAlternateSetting 1 bNumEndpoints 2 bInterfaceClass 10 CDC Data bInterfaceSubClass 0 Unused bInterfaceProtocol 2 iInterface 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes 2 Transfer Type Bulk Synch Type None Usage Type Data wMaxPacketSize 0x0200 1x 512 bytes bInterval 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x01 EP 1 OUT bmAttributes 2 Transfer Type Bulk Synch Type None Usage Type Data wMaxPacketSize 0x0200 1x 512 bytes bInterval 0 Device Qualifier (for other device speed): bLength 10 bDescriptorType 6 bcdUSB 2.00 bDeviceClass 0 (Defined at Interface level) bDeviceSubClass 0 bDeviceProtocol 0 bMaxPacketSize0 64 bNumConfigurations 2 Device Status: 0x0000 (Bus Powered) And the `usb-devices` output for the modem: # usb-devices T: Bus=02 Lev=01 Prnt=01 Port=06 Cnt=02 Dev#= 17 Spd=480 MxCh= 0 D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 2 P: Vendor=413c ProdID=81a3 Rev=00.06 S: Manufacturer=Sierra Wireless, Incorporated S: Product=Dell Wireless 5570 HSPA+ (42Mbps) Mobile Broadband Card C: #Ifs= 2 Cfg#= 2 Atr=e0 MxPwr=500mA \/usr\/bin\/usb-devices: line 79: printf: c: invalid number I: If#= 0 Alt= 0 #EPs= 1 Cls=02(commc) Sub=0e Prot=00 Driver=cdc_mbim \/usr\/bin\/usb-devices: line 79: printf: d: invalid number I: If#= 0 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim Here's the `rfkill`-information: # cat \/sys\/kernel\/debug\/dell_laptop\/rfkill status: 0x1015D Bit 0 : Hardware switch supported: 1 Bit 1 : Wifi locator supported: 0 Bit 2 : Wifi is supported: 1 Bit 3 : Bluetooth is supported: 1 Bit 4 : WWAN is supported: 1 Bit 5 : Wireless keyboard supported: 0 Bit 8 : Wifi is installed: 1 Bit 9 : Bluetooth is installed: 0 Bit 10: WWAN is installed: 0 Bit 16: Hardware switch is on: 1 Bit 17: Wifi is blocked: 0 Bit 18: Bluetooth is blocked: 0 Bit 19: WWAN is blocked: 0 hwswitch_state: 0x1F Bit 0 : Wifi controlled by switch: 1 Bit 1 : Bluetooth controlled by switch: 1 Bit 2 : WWAN controlled by switch: 1 Bit 7 : Wireless switch config locked: 0 Bit 8 : Wifi locator enabled: 0 Bit 15: Wifi locator setting locked: 0 This is what you can see via `dmesg` whenever the device is enabled: [ 2101.897753] usb 2-7: new high-speed USB device number 17 using xhci_hcd [ 2102.026467] usb 2-7: config 1 has an invalid interface number: 8 but max is 3 [ 2102.026480] usb 2-7: config 1 has no interface number 1 [ 2102.026926] usb 2-7: config 2 has an invalid interface number: 12 but max is 1 [ 2102.026930] usb 2-7: config 2 has an invalid interface number: 13 but max is 1 [ 2102.026941] usb 2-7: config 2 has an invalid interface number: 13 but max is 1 [ 2102.026942] usb 2-7: config 2 has no interface number 0 [ 2102.026943] usb 2-7: config 2 has no interface number 1 [ 2102.027618] usb 2-7: New USB device found, idVendor=413c, idProduct=81a3 [ 2102.027621] usb 2-7: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [ 2102.027623] usb 2-7: Product: Dell Wireless 5570 HSPA+ (42Mbps) Mobile Broadband Card [ 2102.027624] usb 2-7: Manufacturer: Sierra Wireless, Incorporated [ 2102.029821] cdc_mbim 2-7:2.12: cdc-wdm0: USB WDM device [ 2102.029954] cdc_mbim 2-7:2.12 wwan0: register 'cdc_mbim' at usb-0000:00:14.0-7, CDC MBIM, 46:51:4c:75:9d:ad `nmcli` output: # nmcli nm status RUNNING STATE WIFI-HARDWARE WIFI WWAN-HARDWARE WWAN running connected enabled enabled enabled enabled This is what I get when I try to start it with `mbim-network`: # mbim-network \/dev\/cdc-wdm0 start Querying subscriber ready status 'mbimcli -d \/dev\/cdc-wdm0 --query-subscriber-ready-status --no-close'... error: couldn't open the MbimDevice: Failure Querying registration state 'mbimcli -d \/dev\/cdc-wdm0 --query-registration-state --no-open= --no-close'... error: invalid transaction ID specified: Attaching to packet service with 'mbimcli -d \/dev\/cdc-wdm0 --attach-packet-service --no-open= --no-close'... error: invalid transaction ID specified: Starting network with 'mbimcli -d \/dev\/cdc-wdm0 --connect= --no-open= --no-close'... error: invalid transaction ID specified: Network start failed The driver should be OK, grepping for the vendor and product id combination from `modprobe` output: # modprobe -c | grep -i 413c.*81a3 alias usb:v413Cp81A3d*dc*dsc*dp*ic*isc*ip*in00* qcserial alias usb:v413Cp81A3d*dc*dsc*dp*ic*isc*ip*in02* qcserial alias usb:v413Cp81A3d*dc*dsc*dp*ic*isc*ip*in03* qcserial alias usb:v413Cp81A3d*dc*dsc*dp*ic*isc*ip*in08* qmi_wwan Here's my linux version. I'm running a modified kernel due to a multiheading docking station problem, but this modem issue occurs identically on the 3.13 kernel which was the default when I installed ubuntu 14.04. # uname -a Linux slartibartfast 3.15.0-rc8+ #5 SMP Mon Jul 21 14:18:58 EEST 2014 x86_64 x86_64 x86_64 GNU\/Linux Using `libqmi` and `qmicli`, I get some interaction with the modem, but still some fairly confusing error messages. I have not yet had time to look into this further. $ sudo qmicli -d \/dev\/cdc-wdm0 --verbose --wds-start-network= --client-no-release-cid [27 elo 2014, 12:41:16] [Debug] QMI Device at '\/dev\/cdc-wdm0' ready [27 elo 2014, 12:41:16] [Debug] [\/dev\/cdc-wdm0] Assuming service 'wds' is supported... [27 elo 2014, 12:41:16] [Debug] [\/dev\/cdc-wdm0] Allocating new client ID... [27 elo 2014, 12:41:16] [Debug] [\/dev\/cdc-wdm0] Sent message... <<<<<< RAW: <<<<<< length = 16 <<<<<< data = 01:0F:00:00:00:00:00:01:22:00:04:00:01:01:00:01 [27 elo 2014, 12:41:16] [Debug] [\/dev\/cdc-wdm0] Sent message (translated)... <<<<<< QMUX: <<<<<< length = 15 <<<<<< flags = 0x00 <<<<<< service = \"ctl\" <<<<<< client = 0 <<<<<< QMI: <<<<<< flags = \"none\" <<<<<< transaction = 1 <<<<<< tlv_length = 4 <<<<<< message = \"Allocate CID\" (0x0022) <<<<<< TLV: <<<<<< type = \"Service\" (0x01) <<<<<< length = 1 <<<<<< value = 01 <<<<<< translated = wds [27 elo 2014, 12:41:16] [Debug] [\/dev\/cdc-wdm0] Received message... >>>>>> RAW: >>>>>> length = 24 >>>>>> data = 01:17:00:80:00:00:01:01:22:00:0C:00:02:04:00:00:00:00:00:01:02:00:01:08 [27 elo 2014, 12:41:16] [Debug] [\/dev\/cdc-wdm0] Received message (translated)... >>>>>> QMUX: >>>>>> length = 23 >>>>>> flags = 0x80 >>>>>> service = \"ctl\" >>>>>> client = 0 >>>>>> QMI: >>>>>> flags = \"response\" >>>>>> transaction = 1 >>>>>> tlv_length = 12 >>>>>> message = \"Allocate CID\" (0x0022) >>>>>> TLV: >>>>>> type = \"Result\" (0x02) >>>>>> length = 4 >>>>>> value = 00:00:00:00 >>>>>> translated = SUCCESS >>>>>> TLV: >>>>>> type = \"Allocation Info\" (0x01) >>>>>> length = 2 >>>>>> value = 01:08 >>>>>> translated = [ service = 'wds' cid = '8' ] [27 elo 2014, 12:41:16] [Debug] [\/dev\/cdc-wdm0] Registered 'wds' (version unknown) client with ID '8' [27 elo 2014, 12:41:16] [Debug] Asynchronously starting network... [27 elo 2014, 12:41:16] [Debug] [\/dev\/cdc-wdm0] Sent message... <<<<<< RAW: <<<<<< length = 13 <<<<<< data = 01:0C:00:00:01:08:00:01:00:20:00:00:00 [27 elo 2014, 12:41:16] [Debug] [\/dev\/cdc-wdm0] Sent message (translated)... <<<<<< QMUX: <<<<<< length = 12 <<<<<< flags = 0x00 <<<<<< service = \"wds\" <<<<<< client = 8 <<<<<< QMI: <<<<<< flags = \"none\" <<<<<< transaction = 1 <<<<<< tlv_length = 0 <<<<<< message = \"Start Network\" (0x0020) [27 elo 2014, 12:41:16] [Debug] [\/dev\/cdc-wdm0] Received message... >>>>>> RAW: >>>>>> length = 32 >>>>>> data = 01:1F:00:80:01:08:02:01:00:20:00:13:00:02:04:00:01:00:0E:00:10:02:00:03:00:11:04:00:03:00:D1:07 [27 elo 2014, 12:41:16] [Debug] [\/dev\/cdc-wdm0] Received message (translated)... >>>>>> QMUX: >>>>>> length = 31 >>>>>> flags = 0x80 >>>>>> service = \"wds\" >>>>>> client = 8 >>>>>> QMI: >>>>>> flags = \"response\" >>>>>> transaction = 1 >>>>>> tlv_length = 19 >>>>>> message = \"Start Network\" (0x0020) >>>>>> TLV: >>>>>> type = \"Result\" (0x02) >>>>>> length = 4 >>>>>> value = 01:00:0E:00 >>>>>> translated = FAILURE: CallFailed >>>>>> TLV: >>>>>> type = \"Call End Reason\" (0x10) >>>>>> length = 2 >>>>>> value = 03:00 >>>>>> translated = generic-no-service >>>>>> TLV: >>>>>> type = \"Verbose Call End Reason\" (0x11) >>>>>> length = 4 >>>>>> value = 03:00:D1:07 >>>>>> translated = [ type = 'cm' reason = '2001' ] error: couldn't start network: QMI protocol error (14): 'CallFailed' call end reason (3): generic-no-service verbose call end reason (3,2001): [cm] no-service [\/dev\/cdc-wdm0] Client ID not released: Service: 'wds' CID: '8' [27 elo 2014, 12:41:16] [Debug] [\/dev\/cdc-wdm0] Unregistered 'wds' client with ID '8' [27 elo 2014, 12:41:16] [Debug] Client released I can also set my pin code with `qmcli`: # qmicli --dms-uim-verify-pin=PIN,xxxx -d \/dev\/cdc-wdm0 [\/dev\/cdc-wdm0] PIN verified successfully And get some information: # qmicli -d \/dev\/cdc-wdm0 --dms-get-manufacturer [\/dev\/cdc-wdm0] Device manufacturer retrieved: Manufacturer: 'Sierra Wireless, Incorporated' # qmicli -d \/dev\/cdc-wdm0 --dms-get-model [\/dev\/cdc-wdm0] Device model retrieved: Model: 'MC8805' # qmicli -d \/dev\/cdc-wdm0 --dms-get-capabilities [\/dev\/cdc-wdm0] Device capabilities retrieved: Max TX channel rate: '5742000' Max RX channel rate: '42200000' Data Service: 'non-simultaneous-cs-ps' SIM: 'supported' Networks: 'gsm, umts'"} {"id":"126507","title":"Bash script to remove user","text":"I need to create a Bash script to remove a user. We use RHEL version 4, 5, & 6. Lets say usernames are Ray4 & Ray6 & the script name is deal. Specific tasks for this script are: 1. Does the user exist ? 2. If user exists, backup \/homedirectory for this user, remove username and place in \/root\/DeletedUsers 3. If \/root\/DeletedUsers directory doesn't exist, create it. 4. If any firewall rules exist for this user, email me the results for those rules and on which nodes. 5. If this user exists in sudoers, don't delete, but comment out. This is what I have so far. I want to make sure this works, before I run it in RHN Satellite. After making the suggested changes. Here are the new errors I am getting now. [root@localhost bin]# .\/deal .\/deal: line 7: [[!: command not found Usage: userdel [options] LOGIN Options: -f, --force force removal of files, even if not owned by user -h, --help display this help message and exit -r, --remove remove home directory and mail spool -Z, --selinux-user remove SELinux user from SELinux user mapping Usage: userdel [options] LOGIN Options: -f, --force force removal of files, even if not owned by user -h, --help display this help message and exit -r, --remove remove home directory and mail spool -Z, --selinux-user remove SELinux user from SELinux user mapping Null message body; hope that's ok .\/deal: line 22: [: -me: binary operator expected This is source code: [root@localhost bin]# cat -n deal 1 #!\/bin\/bash 2 3 count=$(egrep -c Ray[46] \/etc\/passwd) 4 firewall=$(grep -c \"192.168.5.5\" \/etc\/sysconfig\/iptables) 5 doers=$(egrep -c Ray[46] \/etc\/sudoers) 6 7 if [[! -d \/root\/DeletedUsers]] 8 then mkdir \/root\/DeletedUsers 9 10 fi 11 12 cp -Rf \/home\/Ray[46] \/root\/DeletedUsers 13 userdel -rf Ray [4] 14 userdel -rf Ray [6] 15 16 if [ $firewall -ne 0 ] 17 18 then mail -s \"$firewallrulesexist\" emailaddress < \/dev\/null 19 20 fi 21 22 if [ $doers -me 0 ] 23 then sed ^Ray[46] \/#\/i 24 25 EOF 26 fi"} {"id":"92384","title":"How to empty a log file?","text":"Currently my log files get very big. Is there a command to empty the files without delete and restore it? It involves 2 command which is sometimes taking too long."} {"id":"40407","title":"Which Unix tool for Pixel-art -generation?","text":"I have had problems to generate pixel art for a game where units are of specific sizes such as 55x55 (not geometry but by pixels i.e. 55 pixels by 55 pixels). I have tried Gimp where I have misread many-times the sizes with the select tool -- it is irritating to get a bit too distorted size. Then I have used Inkscape that works actually quite good -- you generate the vector-image and select it and then you go to `\"Export to bitmap\"` where you can specify the size (this same feature is probably also in Blender, probably as easy). Anyway I am looking for something more powerful like having helper color- palettes easily or automatically-done perhaps like here with Gimp. I can find a variety of tools mentioning pixels but I hope you to point out the best before trying all of them. $ apt-cache search pixel|wc 99 861 6029 > **Perhaps related** > > 1. http:\/\/graphicdesign.stackexchange.com\/questions\/7860\/how-can-i-adjoin- > images-with-imagemagick-for-pixel-art > > 2. Some example with Photoshop here, create pixel art by reusing basic > things such as hands, hairs and bodies (create separate files for them). > > 3. A pixel-art competition here. > > 4. Using blender for generating stuff here programmatically. > >"} {"id":"126208","title":"How to actually test locale","text":"So I know what locale does. Sets the output format of certain programs depending on what country\/language you're in, for example 1000000 can be formatted like 1,000,000.00 1 000 000.00 1.000.000,00 and a variety of others on output. But is there a program to literally test this so that I could do `export LC_ALL=en_GB.utf8` vs `export LC_ALL=en_US.utf8` and observe different output?"} {"id":"136906","title":"Install pandas for python3 on Fedora 20","text":"The Fedora project lists a package called python3-pandas. When I enter `sudo yum install python3-pandas` I get the message `No package python3-pandas available.`. How can I install this package? I am accessing a Fedora 20 machine via ssh. `yum repolist`: repo id repo name fedora\/20\/x86_64 Fedora 20 - x86_64 rpmfusion-free\/20\/x86_64 RPM Fusion for Fedora 20 - Free rpmfusion-free-updates\/20\/x86_64 RPM Fusion for Fedora 20 - Free - Updates rpmfusion-nonfree\/20\/x86_64 RPM Fusion for Fedora 20 - Nonfree rpmfusion-nonfree-updates\/20\/x86_64 RPM Fusion for Fedora 20 - Nonfree - Updates updates\/20\/x86_64 Fedora 20 - x86_64 - Updates"} {"id":"73893","title":"Custom access\/launcher","text":"I'm not sure what to call what I want, so I'll just describe what I want to do. What I'm doing is setting up an old laptop, with gentoo, for my kids. I want to have some program on there that, with a password, gives access to do homework, to play games for 30 min, watch netflix for an hour, etc. I can't imagine that there already exists a program that can do that, but it would be less work for me if there was. So I will have to make this launcher program. My question is this, after I make such a program, how do I make it so this program is running at start up and no other programs can be ran from any menus or anything. I have not decided which window manager to use yet. Is there a lite window manager that would help me accomplish this task?"} {"id":"13737","title":"VMO Changes After Adding New RAM To AIX?","text":"We have a server at a client site running AIX 5.3, which we just up the RAM to 32GB, from initially 16GB (if I'm not mistaken). This server is our Application server running J2EE applications on top of Oracle Internet Application Server. Recently we encountered one of the batch jobs hitting out of memory error. From NMON I see that on average, there's 5GB of free memory available. `%MAXPERM` is set to '15' and `%MINPERM` is '5'. `lru_file_repage` is '0'. `%comp` is around '70' and `%numperm` is '15'. I would like to ask: 1. After adding real memory to the server, is there any additional changes we need to do to the VMO? 2. Is the `%MAXPERM` too low?"} {"id":"81408","title":"How can I figure out which pty's are from which qemu?","text":"I'm running qemu's like this: $ sudo qemu -boot d -m 1024 \\ -netdev tap,id=tap0 \\ -device virtio-net-pci,netdev=tap0,id=vth0 \\ -drive file=ubuntu.iso,media=cdrom,cache=none,if=ide \\ -monitor pty \\ -serial pty \\ -parallel none \\ -nographic When I check `\/dev\/pts\/`: $ sudo lsof +d \/dev\/pts\/ Qemu pty's do not show up, although they do work using for example: $ sudo screen \/dev\/pts\/8 How can I figure out which pty's are from which qemu?"} {"id":"11380","title":"Collapse repeating characters","text":"Is there a more Bashist way than `echo \"$PWD\/\/\" | sed -e 's#\/\/\\\\+#\/#g'` to replace repeating slashes with a single one? Thanks Steven D, now there's a fully working function to find the _longest common path of two or more paths_ : path_common."} {"id":"43279","title":"Disabling readahead with hdparm or POSIX_FADV_RANDOM","text":"From Linux kernel's doc the advice POSIX_FADV_RANDOM seems to disable readahead. But whent I disable Readhead using (sudo hdparm -A 0 \/dev\/sdb) I get huge degradation in performances; also noticed that read(2) seems to get split every 512k and acts as separate calls (Not sure about the reason, may be the max sector per request). So which option really disables the read-ahead? Does POSIX_FADV_RANDOM also disable OS caching, or shall I add a POSIX_FADV_DONTNEED."} {"id":"11389","title":"Dynamically reformatting man pages on terminal dimension changes","text":"One common workflow of mine is to open a manual page in a terminal, then another terminal in which to test things. The man page is formatted to the initial dimensions of the first terminal. When I now resize my windows (or have my WM do that for me automatically), there is either a gap to the right of the preformatted page, or lines wrap. At this point I usually `q`(uit) and `!!` (run again), which loses my position in the page. I assume the formatting process is quite CPU intensive, or maybe it stems from ancient times of fixed terminal sizes. The `less` pager dynamically reacts to terminal resize events, so it should be possible in theory. I tried perusing man pages, searching the Web, asking on IRC -- the whole lot -- but couldn't come up with anything. * Can I trigger reformatting from within or outside of the man utility? * Is there a version of the man utility that resizes the page dynamically? * Is there way to customize some part of the formatting\/display process to make it update on `SIGWINCH`?"} {"id":"43277","title":"Perl script, do cd on terminal","text":"In Script to change current directory (cd, pwd) it is shown how to run a bash script that changes terminal directory. But how do i run a perl script that runs a bash script that changes terminal directory?"} {"id":"43274","title":"Scientific Linux 6.3 hangs on suspend if using a samba share","text":"I have several notebooks running Scientific Linux 6.3. The suspend function is working quite well, except for one problem: When a notebook mounts a Samba share, plays a few videos through this share then the suspend function stops working, and the notebook suddenly needs _5_ minutes to suspend. Again, this problem only occurs if they watched videos over the samba share. **QUESTION** : WHY? does samba keeps something open and need a timeout of 5 minutes, just after the suspend function has been involved or what? Any suggestions on where to look to find out what's going on would be appreciated. Or a way for I could write a bash script to check when is the suspend button pressed so that I could do xy* thing to the machine. (*xy=anything that corrects this problem)"} {"id":"127159","title":"Remove last comma from a bash for loop generated string","text":"I am dealing with a situation where I need to create a comma separated list from an array into a heredoc and remove the last comma. I am using bash `for` piped into `sed` which is erasing all commas instead of the last one. A simplified example is as follows: x=$(for i in a b c; do echo \"${i}\",; done| sed 's\/,$\/\/') echo $x a b c Desired output: a, b, c Any suggestions appreciated."} {"id":"48579","title":"Why can rm remove read-only files?","text":"If I create a file and then change its permissions to `444` (read-only), how come `rm` can remove it? If I do this: echo test > test.txt chmod 444 test.txt rm test.txt ...`rm` will ask if I want to remove the write-protected file `test.txt`. I would have expected that `rm` can not remove such a file and that I would have to do a `chmod +w test.txt` first. If I do `rm -f test.txt` then `rm` will remove the file without even asking, even though it's read-only. Can anyone clarify? I'm using Ubuntu 12.04\/bash."} {"id":"137601","title":"Minimum file permissions to delete a file","text":"To delete a file in Linux: What minimal permissions do we need to set on it? What minimal permissions do we need to set on its parent directory?"} {"id":"19150","title":"Missed get command of FTP","text":"I am using AIX 7.1. I made some shell scripts8 and called \/bin\/bsh. Inside the script, I connect to a server via FTP and have many get commands because I would like to avoid the wildcard problem. I just declare every filename and get them one by one, for example: get PDF_02378230_20110609.PDF get PDF_02432482_20110609.PDF get PDF_02432565_20110609.PDF get PDF_02432573_20110609.PDF get PDF_02432581_20110609.PDF get PDF_02432599_20110609.PDF get PDF_02432607_20110609.PDF get PDF_02432615_20110609.PDF get PDF_02432623_20110609.PDF get PDF_02432649_20110609.PDF get PDF_02432656_20110609.PDF get PDF_02432672_20110609.PDF get PDF_02432755_20110609.PDF get PDF_02432763_20110609.PDF get PDF_02432821_20110609.PDF get PDF_02432920_20110609.PDF get PDF_02433175_20110609.PDF get PDF_02433266_20110609.PDF get PDF_02433290_20110609.PDF get PDF_02433308_20110609.PDF get PDF_02433373_20110609.PDF get PDF_02433399_20110609.PDF There could be up to 100000 files to be transfer in 1 shell scripts. I would run these shell scripts and let them ftp the files down. But in some shell script there are 1 or 2 missing files not been \"get\". For example, when I count the number of files, there might be 1 or 2 less files than the number of \"get\" command in the shell script. I cannot found an exception or error inside the log. The truth is, I cannot go through the whole log line by line because it is too long. But I have found which file was missing, and I tried to search the log file with the missing filename, and I cannot found any trace of that filename."} {"id":"116413","title":"Why is \"Asking all remaining processes to terminate\" failing during shutdown?","text":"I installed Debian 7. Sometimes when I quick X and type `sudo shutdown -h now`, it says, `Asking all remaining processes to terminate`, then after a few seconds, it prints a long list of processes, then it says that it failed to stop them, then the computer powers off. * The computer was only recently installed. * I have had the same distribution on this computer and on other computers, installed in the same manner, but never encountered this before. Is this problem serious? If so, what could be causing it?"} {"id":"1052","title":"Concern about logging in as root overrated?","text":"For personal linux on my personal notebooks, I've usually set my environment to **autologin as root** even under X or lower runlevels. I've found my workflow is very pleasant and fast, without any cumbersome need to type `su` or `sudo` or being asked by keyring or auth or something. So far I've never had any problem with it, so **why are most people freaking out about it?** Is the concern overrated? Of course this assumes the user knows what they are doing and doesn't really care about system reliability and security issues."} {"id":"52262","title":"autofs with sshfs not working anymore","text":"I just upgraded from Ubuntu 12.04 to 12.10. Before that I backed up my autofs config which worked fine. I appended the line from my old `\/etc\/auto.master` to the new one: +dir:\/etc\/auto.master.d +auto.master \/mnt \/etc\/auto.sshfs uid=1000,gid=1000,--timeout=30,--ghost,--verbose my `\/etc\/auto.sshfs` looks like this: mymount -fstype=fuse,rw,nodev,nonempty,noatime,allow_other,max_read=65536 :sshfs\\#myuser@mydomain:\/mnt\/mymount Trying this manually I got `Connetion reset by peer` so I added the option `IdentityFile=\/home\/myuser\/.ssh\/id_rsa`. Now this happens when I try to access `\/mnt` (both with manual and autofs): myuser@laptop \/mnt % la ls: cannot access mymount: No such file or directory total 4 drwxr-xr-x 3 root root 0 Oct 19 10:34 .\/ drwxr-xr-x 25 root root 4096 Oct 18 23:17 ..\/ d????????? ? ? ? ? ? mymount\/ The relevant entries from my `\/var\/log\/syslog` are this: Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: lookup(program): lookup for mymount failed Oct 19 00:17:56 laptop automount[1250]: failed to mount \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: failed to mount \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: failed to mount \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: failed to mount \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: failed to mount \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: failed to mount \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: failed to mount \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: failed to mount \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: failed to mount \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: failed to mount \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: failed to mount \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: failed to mount \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: failed to mount \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: failed to mount \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: failed to mount \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: failed to mount \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: failed to mount \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: failed to mount \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: failed to mount \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: failed to mount \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: failed to mount \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: failed to mount \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: failed to mount \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: failed to mount \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: failed to mount \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: failed to mount \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: failed to mount \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: failed to mount \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: failed to mount \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: failed to mount \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: failed to mount \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: failed to mount \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: failed to mount \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: failed to mount \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: failed to mount \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: failed to mount \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: failed to mount \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: failed to mount \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: failed to mount \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: failed to mount \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: failed to mount \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: failed to mount \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: failed to mount \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: failed to mount \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: failed to mount \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: failed to mount \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: failed to mount \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: failed to mount \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: failed to mount \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: failed to mount \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: failed to mount \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: failed to mount \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: failed to mount \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: failed to mount \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: failed to mount \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: failed to mount \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: failed to mount \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: failed to mount \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: failed to mount \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: failed to mount \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: failed to mount \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: failed to mount \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: failed to mount \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: failed to mount \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: failed to mount \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: failed to mount \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: failed to mount \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: failed to mount \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: failed to mount \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: failed to mount \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: failed to mount \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: failed to mount \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: failed to mount \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: failed to mount \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: failed to mount \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: failed to mount \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: failed to mount \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: failed to mount \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: failed to mount \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: failed to mount \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: failed to mount \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: failed to mount \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: failed to mount \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: failed to mount \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: failed to mount \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: failed to mount \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: failed to mount \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: failed to mount \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: failed to mount \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry \/mnt\/mymount Oct 19 00:17:56 laptop automount[1250]: failed to mount \/mnt\/mymount Oct 19 00:18:01 laptop automount[1250]: attempting to mount entry \/mnt\/.hidden Oct 19 00:18:01 laptop automount[1250]: lookup(program): lookup for .hidden failed Oct 19 00:18:01 laptop automount[1250]: failed to mount \/mnt\/.hidden Oct 19 00:18:03 laptop automount[1250]: attempting to mount entry \/mnt\/.hidden Oct 19 00:18:03 laptop automount[1250]: failed to mount \/mnt\/.hidden Oct 19 00:18:03 laptop automount[1250]: attempting to mount entry \/mnt\/.hidden Oct 19 00:18:03 laptop automount[1250]: failed to mount \/mnt\/.hidden Oct 19 00:18:24 laptop automount[1250]: attempting to mount entry \/mnt\/.hidden Oct 19 00:18:24 laptop automount[1250]: failed to mount \/mnt\/.hidden Oct 19 00:21:57 laptop automount[1250]: umount_autofs_indirect: ask umount returned busy \/mnt Oct 19 00:21:59 laptop automount[1250]: shut down path \/mnt Oct 19 00:21:59 laptop automount[3436]: mounted indirect on \/mnt with timeout 30, freq 8 seconds Oct 19 00:21:59 laptop automount[3436]: ghosting enabled I already checked the UID and GID and they match my user. SSH keys for my user are in place. I also tried to create `\/mnt\/mymount` manually but strangely it returns \"permissions denied\" even as root as long as autofs is running (guess it should be this way). Any ideas what might be wrong? There must by a configuration step I forgot which I did before."} {"id":"43180","title":"Where does gnome-session\/gnome-shell store its configuration?","text":"Long story short; I have a debian system that's been running the `unstable` tree for over a decade straight (through fire, flames, and multiple hardware upgrades, but that aside). However, a while ago while Debian was transitioning to gnome3 and the `gnome-shell` desktop there were a couple of hitches in the process, and one or another of those left my regular user with an unusable configuration -- `gnome-shell` starts up and immediately crashes. I tried setting up a completely blank new user, and everything runs fine for that one, so it's definitely an issue with a setting local to my main user somewhere... It's just that I have no idea where to start looking, and I don't want to blanket erase all configuration files because I kind of need the vast majority of them. So instead I'm looking to surgically remove all the configuration files and\/or options that pertain to `gnome-shell` and let it rebuild them from scratch when I start it, then work from there. **EDIT** : My bad, slight naming fail. The problem seems to be in `gnome- shell` rather than `gnome-session`."} {"id":"121303","title":"Why do I get dropped into a GRUB rescue console?","text":"I've been setting up my environment on a fedora 20 64bit, the last week. After a restart tonight I am unable to boot into my system. It boots into this terminal\/prompt and it says: [ Minimal bash-like editing is supported. For the first word, TAB lists possible completions of a device\/filename. ] grub> I've tried to rescue the system, with the dvd, but no luck. I'm a noob, and could really need some help on this. I have installed a lot of software and I would rather not have to do it for the third time this week, last crash was because I installed grub2 and made some configurations, to include xen hypervisor support in the bootup forgetting to turn \"Secure boot\" off in the bios. Can anyone tell me what to do? What I can do. EDIT: This is not a duplicate, I installed the system some days ago, and had a working grub, mount of drives and so on. **It was after changes(installing software, configuring the system) that I got dropped into this prompt** I used the other answer to find the solution, I didn't follow it in it's entirety."} {"id":"154070","title":"Does BitTorrent work in the background after quitting qBitTorrent?","text":"Recently I installed qBitTorrent so I could download some episodes of a Creative Commons-licensed TV series. I simply used `apt-get install qbittorrent`, ran `qbittorrent`, then added the torrent files, and pressed \"start\". I noticed that the series would take too long to download, so I quit qBitTorrent when it was at 10%. The next day, I launched qBitTorrent again, and was surprised to find the downloads complete. Either the 2.5 GBs downloaded within 3 seconds or something else occurred. Does BitTorrent continue to exchange files after starting the download in qBitTorrent and then quitting qBitTorrent?"} {"id":"152954","title":"How do I make Iceweasel\\Firefox only display images on specified sites?","text":"Summary: In Iceweasel (it's effectively Firefox), I want to block all images, but allow images on websites I specify. But the standard method to do this is not working. The way you're supposed to be able to do this is as follows. In Iceweasel, select Edit\/Preferences\/Content and UNCHECK LoadImagesAutomatically. Select Exceptions, enter a website name, select \"Allow\". Now, Iceweasel should display images for websites with the \"Allow\" designaton, but not for any other site. But images are NOT displayed on the \"Allowed\" sites. NO images are shown on any sites. And I've got the NoScript extension disabled. I have no other extensions. Am I doing something wrong? If I have to use a workround, I don't want an extension that just toggles images on and off. I want to have images blocked by default, and only allow them on sites I choose. Many thanks if you have a solution. Full Details: I'm using Iceweasel 10.0.4. Is this an Iceweasel bug? Is there a workround? CHECKING LoadImagesAutomatically does display images on all sites as you'd expect."} {"id":"45276","title":"Merge files using zipper method \/ late merge","text":"I am searching for a nice method of merging two or more files line by line using the zipper method (also called late merge). Assuming we have three files, the result should look like this: line1 file1 line1 file2 line1 file3 line2 file1 line2 file2 line2 file3 ... **EDIT** I wrote a little python script capable of doing this: #!\/usr\/bin\/python import sys, itertools fileList = [] for file in sys.argv[1:]: f = open(file, \"r\") fileList.append(f.read().split(\"\\n\")) for z in itertools.izip_longest(*fileList): print \"\\n\".join([i for i in z if i is not None]) I still wonder if there is any standard tool or a clever combination of them doing the same thing."} {"id":"58384","title":"How to implement a horizontal cat?","text":"Standard `cat` concatenates files line by line (row by row, if you will). I find myself needing a _horizontal_ `cat` command more and more often recently; i.e. a command that takes a list of files and concatenates them horizontally, column by column. So far I’ve used ad-hoc workarounds but I’d like to know if there exists a good solution for this. To clarify, consider the following comparison between `cat` and `hcat` of two files: $ cat a.dat 1.dat a b c d 1 2 3 4 $ hcat -s ' ' a.dat 1.dat a b 1 2 c d 3 4 (Unlike for `cat` we need to specify a separator since by convention UNIX files don’t have a column separator at the end.)"} {"id":"46009","title":"Editing a sequence of fields in vim","text":"I have a file like this: INSERT INTO `example` (`name`, `location`, `height`) VALUES ('A', '', ''), ('B', '', ''), ('C', '', ''); I want to fill in the middle set of quote marks (the ones under `location`) so that I end up with INSERT INTO `example` (`name`, `location`, `height`) VALUES ('A', 'one', ''), ('B', 'two', ''), ('C', 'three', ''); What's a good way to do that? Aligning the third column of quotes isn't necessary, but preferred."} {"id":"146206","title":"Why can't tar extract .zip files?","text":"I tried a majority of the formats (gzip, etc.) to extract a zip file with `tar`, and when I became frustrated enough to Google for it, I found no way to extract a zip file with `tar` and only recommendations to use `zip` or `unzip`. As a matter of fact, my Linux system doesn't even have a `zip` utility, but only `unzip` (leaving me to wonder why this is the main recommended option). Of course `unzip` worked, solving my problem, but why can't `tar` extract zip files? Perhaps I should instead be asking, what is the difference between zip and the compression methods supported by `tar`?"} {"id":"64294","title":"The NTFS partition is in an unsafe state","text":"I try to mount a NTFS partition in nautilus, and it refuse to mount it and suggests `resume and shutdown Windows fully (no hibernation or fast restarting)`, the problem is that I have already disabled fast restart and there is no options to hibernate in Windows 8."} {"id":"42636","title":"How to get text of a page using wget without html?","text":"If I try wget on a webpage, I am getting the page as html. Is it possible to retrieve only text of a file without associated html ? (This is required for me since some of the HTML pages contains c program is getting downloaded with html tags. I have to open it in browser and manually copy the text to make a .c file.)"} {"id":"101963","title":"What is the difference between DISPLAY :0 and :0.0?","text":"What is the difference between DISPLAY :0 and :0.0? On RedHat 5.8, I can right click the desktop to start a shell and DISPLAY will be \":0\". If I go to the Menu-System-Terminal to start a shell then DISPLAY will be \":0.0\". Can I always assume that these are really the same display? For example, if I VNC in to a machine on DISPLAY 33, can I assume that \":33.0\" and \":33\" are the same display with the same permissions?"} {"id":"86041","title":"Linux Mint Wifi","text":"I'm running Linux Mint 15 Xfce on a Compaq Presario desktop from 2009. I can't seem to get the wifi working. Rather than ask a general question, here's a simple question: If $ iwlist wlan0 scanning returns all the wireless networks available, that means that my wifi card is working? So, if that's true, then the problem is that I'm just not setting it up properly, isn't that so? I've tried to configure it using the tools that Mint provides -> Failure. I've tried to configure it the same way I configured my Slackware laptop -> Failure. ( My Slackware config parameters fail on Mint, even though it's the same network) Looking over 2 or 3 unanswered questions on this site, I can see that others have had similar problems. So, is it a mistake to try to set up a wireless connection on Mint by configuring files, rather than use their GUI wireless system (which seems not to work properly)? Does anyone know whether the Mint developers have set it up so that the usual Linux\/Unix way of doing things is disabled (to make things easier for the user, no doubt)."} {"id":"57986","title":"Pulseaudio rapidly switches ouputs at high volumes","text":"I'm using Pulseaudio. The image is of the Output Devices tab and shows the Port set to Analog Output. This is fine and works great. There's another option called Headphones but if you try and set the Port to Headphones it automatically switches back to Analog Output. This is also fine because I don't want to use that port The problem is that if the volume increases over 87% it automatically switches to Headphones port, which in turns auto switches back to Analog and back and forth quickly and forever making lots of clicking noises. Perhaps related to that \"Base\" marker on the volume control? No idea here, very strange behavior. ![enter image description here](http:\/\/i.stack.imgur.com\/2LJHv.png)"} {"id":"90006","title":"How do I reduce the size of locale-archive?","text":"I have a need to reduce the size of the `locale-archive` file on some of my RHEL6 systems. Here is that file on my system: [root@-dev-007 locale]# ls -l total 96800 -rw-r--r--. 1 root root 99158704 Sep 9 15:22 locale-archive -rw-r--r--. 1 root root 0 Jun 20 2012 locale-archive.tmpl So I did this ... [root@-dev-007 locale]# localedef --list | grep zh_CN zh_CN zh_CN.gb18030 zh_CN.gb2312 zh_CN.gbk zh_CN.utf8 ... so I figured I could get rid of `zh_CN` like so ... [root@-dev-007 locale]# localedef --delete-from-archive zh_CN ... and I can see `zh_CN` does not get listed anymore like so ... [root@-dev-007 locale]# localedef --list | grep zh_CN zh_CN.gb18030 zh_CN.gb2312 zh_CN.gbk zh_CN.utf8 ... but the size of the `locale-archive` does not get smaller ... [root@-dev-007 locale]# ls -l total 96800 -rw-r--r--. 1 root root 99158704 Sep 9 17:16 locale-archive -rw-r--r--. 1 root root 0 Jun 20 2012 locale-archive.tmpl ... is there something else I need to do?"} {"id":"63116","title":"Create Null Modem Pair linux","text":"I am looking to create virtual serial ports on Debian 6 squeeze. Basic requirements are: 1. be able to connect as if port was a real serial port( IE be able to set baud, stop bits etc) 2. com port pairs need to be persistent 3. com port pairs names must be static on reboot. I don't want to change code settings each time computer is rebooted I briefly tried socat today using `socat -d -d pty, raw, echo=1 pty, raw, echo=1` that successfully created `\/dev\/pts\/5` and `\/dev\/pts\/6` as a pair. However soon as I close the terminal running socat the pair is terminated. I am also wondering if tty0tty is an option? I have used com0com in the past with windows with great success. **My question is what is the best way to create a null modem pair so that I can simulate several com ports in Linux?**"} {"id":"9325","title":"The cursor to a match, edit, the cursor to the next match, edit -- like in a directory?","text":"Algorithmic blackout: 1. problem: find the files that match 2. problem: stack\/buffer the matches 3. move the cursor to the next file of the stack and thereby to the location of the match 4. repeat step 2 Things I have used earlier to tackle the issue. **Vi\/m: (the below works in an ubuntu server, perhaps configured by sysadmin but cannot get it work locally)** :grep -r \"[^|]*|[^|]*|[^|]*|.*\" * :cn :cn :bn **emacs:** `M-x grep Enter` and then to have `grep -r \"[^|]*|[^|]*|[^|]*|.*\" *` but now in mystery. How can you do the fast hierarchial edits? **shellesque:** then I once created a wild one-liner with some grep-xargs- something-things-vi but I am starting to smell reinventing-the-wheel. Sorry about the vim\/emacs juxtaposition but I don't care which tool you use, use the most convenient (xargs\/emacs\/vi\/m just examples)."} {"id":"8940","title":"What are the kernel, the \"GNU tools and utilities\", the shell and the Window Manager?","text":"Among the many components of a Linux system, I find myself confused (as a newbie) about what exactly is the kernel or what is GNU's part. I understand some basic concepts of this, but where is the line between a shell and the Window Manager?"} {"id":"21725","title":"Find out global zone Name once you logged into a NON global zone","text":"I understand in Unix Oracle-Solaris OS the `zoneadm list` command will easily show all the available zones. But if I am logged into a non global zone there is no easy way to get information about the global zone. I see the `arp` command can be of some help because it will return the NIC mac address. Then with the NIC mac address I can `arp` again to get all the machine name associated with that (NIC) mac address. This process sounds kind of intricate to me. Is there any better way to get that info?"} {"id":"48365","title":"Closing socket connection on running console application","text":"I am testing a chat bot and want to gracefully handle for times when the chat server isn't running so it can come back up when the service is available again. I have the programming handled. My question is how to test this when the downtimes are not reliable. Someone suggested \"Terminate the socket connection manually\". How would I do this? This is a console node.js running on Mountain Lion. Can I sever a connection to a server from a single application?"} {"id":"48360","title":"Is it possible to make KDE 4 look like Win98?","text":"I found settings which make windows look like in Win98, but cannot change taskbar colors and sizes. Default colors are breaking my eyes. Please, write instructions how to change taskbar and other components which significantly lower usability. Version of KDE is 4.8 and newer. EDIT: After applying Aya theme as xenoterracide suggested, taskbar looks as this: ![Aya taskbar](http:\/\/i.stack.imgur.com\/k2ggx.jpg). Is it a bug or colors indeed so crazy?"} {"id":"62866","title":"How can I prevent edited commands from overwriting the original? Or revert edits?","text":"Often I'll execute a command in bash, press the up arrow to retrieve it from history, edit it, and execute the edit. However, sometimes I'll decide to discard the edit and run a different command or something. This poses a problem because the edited command, which I didn't run, gets saved over top of the original history entry so I can no longer run the original with ease. For example, here's the end of my current history: 2132* svn cleanup && svn up --set-de 2133 history The first command was originally `svn cleanup && svn up --set-depth=infinity folder1 folder2`. Is there a way to disable overwrites or revert them to the original commands?"} {"id":"26975","title":"How to clear terminal completely?","text":"When we use `clear` command or `Ctrl`+`L` in terminal, it clears terminal but we can still scroll back to view the last used commands. Is there a way to completely clear the terminal?"} {"id":"49946","title":"is it possible to run job in foreground after user logout","text":"I have some job to run which need be attached to terminal (or in foreground). The job is run in remote servers, and needs keep running after the users logout. I am aware of vnc server, however, I want to know if there is any builtin tool in `redhat` that can work this out. (that is, I dont have sudo to install extra software)."} {"id":"49945","title":"Monitor mode wifi only seeing broadcast packets","text":"I have pretty much exhausted every link I have found on google regarding this topic, and I'd like some of the most experienced eyes on the problem, because something obscure must be going on. # Systems tested on: * VirtualBox 4.1.22 VM: Ubuntu 12.10 x64 * VirtualBox 4.1.22 VM: Ubuntu 10.04 x64 * VirtualBox 4.1.22 VM: Backtrack 5 r2 * VirtualBox 4.1.22 VM: Backtrack 5 r3 * Lenovo W530 laptop running Backtrack 5 r2 # Interface: Alfa AWUS036H - FCC ID UQ2AWUS036H (you can verify RTL8187L chipset at http:\/\/transition.fcc.gov\/oet\/ea\/fccid\/. Enter grantee code: UQ2, product code: AWUS036H, then clicking \"detail\" and then \"internal photos\"). # Problem description The problem is that while I'm running wlan0 in monitor mode, I only see broadcast packets (I see ARPs, DHCP transactions, beacons, and other random management and data packets that are being broadcast or multicast). This is the case in kismet, wireshark 1.2.x, 1.4.x, and 1.8.x, and my own packet reader program that uses libpcap. The clients that I have set up running pings and http traffic are connected to an open wireless g network. The computer I am sniffing from is not connected to any network. # Procedure I have tested more configurations than I can list, but I'll try to give a good idea of what I've done. The USB wireless card I listed (Alfa AWUS036H) is using the rtl8187 driver. Relevant commands and their outputs are listed below: # lsusb Bus 001 Device 009: ID 0bda:8187 Realtek Semiconductor Corp. RTL8187 Wireless Adapter Bus 001 Device 007: ID 80ee:0021 Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub # lsmod|grep 80211 mac80211 238928 1 rtl8187 cfg80211 148725 2 rtl8187,mac80211 I've made sure the wireless card is on channel 6, the same channel my open network is on. I have tried both putting wlan0 into monitor mode manually using: # ifconfig wlan0 down # iwconfig wlan0 mode monitor # iwconfig wlan0 channel 6 # ifconfig wlan0 up And also using airmon-ng to create a mon0 device: # airmon-ng start wlan0 6 Interface Chipset Driver wlan0 RTL8187 rtl8187 - [phy5] (monitor mode enabled on mon0) When using iwconfig, I can verify wlan0 is in monitor mode: wlan0 IEEE 802.11bg Mode:Monitor Frequency:2.437 GHz Tx-Power=27 dBm Retry long limit:7 RTS thr:off Fragment thr:off Power Management:off When I use iwconfig to put the card into monitor mode manually, I use the interface wlan0 in wireshark and kismet. When using airmon-ng to create a mon0 interface that is in monitor mode, I use mon0. In both cases, I get the same result: kismet and wireshark will see all the broadcast packets from the APs around me, but never any ICMP or HTTP traffic I'm creating from other clients in order to test. I am not associated or authenticated to any AP. I did this a few months ago at a workshop and it worked great; we saw tons of HTTP traffic flying around. For most of the same type of questions I've seen asked elsewhere, the problem had to do with the person being associated to a network or that they were on an encrypted network and weren't entering the key properly. I cannot find any issue with the setup or the device. Any ideas? Thanks for any help."} {"id":"9853","title":"Restricting an SSH\/SCP\/SFTP user to a directory","text":"Is there a simple way to restrict an SCP\/SFTP user to a directory? All methods that I've come across require me to set a chroot jail up by copying binaries, but I don't think that should be necessary."} {"id":"87442","title":"Create user who can only access one directory","text":"I would like to create a user that only has access to one folder and nothing else whatsoever. I have already created a user but he has access to other parts of the system according to corresponding file settings. I don't want him to have that, I want him only to have access to one folder and nothing else. Everything else should preferably be just invisible to him. Is it possible to create such a user,and if so, how do I go about doing that? p.s. Removing 'other' privileges of other users home directory goes a bit of the way towards this end. But this limited user still has access to all the base directories like \/etc and such. And he can still see other users home directory, even though he cant access them."} {"id":"115509","title":"How to allow user to only rsync\/download only one directory through SSH","text":"What I want to do is to give to user a simple script to run, that will sync some directory from my VPS to their machine, authentication would be done by using pubkey, and I would like to have control on what dirs what users can download. I know I can achieve that by using simply FTP, but it's not secure and I would rather rely on pubkey authentication rather than passwords, so I would like to use SSH. However I don't want to allow user to do anything more in shell than syncing that one specific directory. How to achieve that?"} {"id":"76305","title":"Install postgresql 9.2 on debian wheezy (on virtualbox)","text":"I have virtualbox with Debian Wheezy. I'm trying to install Postgresql 9.2 on it. When I trying do it by this instruction i have next: Reading package lists... Done Building dependency tree Reading state information... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation: The following packages have unmet dependencies: postgresql-9.2 : Depends: postgresql-common (>= 135~) but it is not going to be installed Depends: ssl-cert but it is not installable E: Unable to correct problems, you have held broken packages. When I try to install postgresql-common: apt-get install postgresql-common I got next: Reading package lists... Done Building dependency tree Reading state information... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation: The following packages have unmet dependencies: postgresql-common : Depends: ssl-cert (>= 1.0.11) but it is not installable E: Unable to correct problems, you have held broken packages When I try to install ssl-cert: apt-get install ssl-cert I got next: Reading package lists... Done Building dependency tree Reading state information... Done Package ssl-cert is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source E: Package 'ssl-cert' has no installation candidate I'm novice in Linux, please help me install Postgresql 9.2 There is my `sources.list` # # deb cdrom:[Debian GNU\/Linux 7.0.0 _Wheezy_ - Official i386 CD Binary-1 201305$ deb cdrom:[Debian GNU\/Linux 7.0.0 _Wheezy_ - Official i386 CD Binary-1 20130504$ deb http:\/\/security.debian.org\/ wheezy\/updates main deb-src http:\/\/security.debian.org\/ wheezy\/updates main # wheezy-updates, previously known as 'volatile' # A network mirror was not selected during install. The following entries # are provided as examples, but you should amend them as appropriate # for your mirror of choice. # # deb http:\/\/ftp.debian.org\/debian\/ wheezy-updates main # deb-src http:\/\/ftp.debian.org\/debian\/ wheezy-updates main"} {"id":"1992","title":"Script for ssh Agent Management: Is this adequate? Any bugs?","text":"The following is something I use to manage my ssh agent settings. #!\/bin\/echo \"Must source this:\" ## Ensure that ~\/.ssh\/env contains valid values unset SSH_AGENT_PID SSH_ENV_REFRESH [ -r ~\/.ssh\/env ] && . ~\/.ssh\/env [ -n \"$SSH_AGENT_PID\" ] || { # No env file (or it's badly corrupted: eval $(ssh-agent &>\/dev\/null) &> \/dev\/null SSH_ENV_REFRESH=1 } # Ping the agent process: kill -0 \"$SSH_AGENT_PID\" >& \/dev\/null || { # No process, so start a new one: eval $(ssh-agent &>\/dev\/null) &> \/dev\/null SSH_ENV_REFRESH=1 } ssh-add -l &> \/dev\/null [ \"$?\" -gt 1 ] && { # Process alive but unable to be contacted # for some reason (wedged\/defunct process, # or damaged\/corrupt UNIX domain socket node?) # So kill it: kill \"$SSH_AGENT_PID\" >& \/dev\/null # ... with extreme prejudice if necessary: kill -0 \"$SSH_AGENT_PID\" >& \/dev\/null \\ || kill kill -9 \"$SSH_AGENT_PID\" >& \/dev\/null # ... and start a new one eval $(ssh-agent &>\/dev\/null) &> \/dev\/null SSH_ENV_REFRESH=1 } [ -z \"$SSH_ENV_REFRESH\" ] || { # Over-write old env file: printenv | grep \"^SSH_A\" > ~\/.ssh\/env # Append export command: echo \"export SSH_AGENT_PID SSH_AUTH_SOCK\" >> ~\/.ssh\/env # Load the (null-passphrase) identites into the agent: ssh-add < \/dev\/null &> \/dev\/null } It's intended to be sourced (`. ~\/lib\/sshagent.sh`) from _~\/.bashrc_ or other login or shell start-up files ... or even cron jobs. It works for me but I'm hoping folks here will review it and offer suggestions about any corner cases that I'm missing. I used to only run it from ~\/.bash_login ... but then I'd find that, in some cases, my shells wouldn't pick up the settings (X display manager and I think remote ssh non-login sessions ... cases where ssh is called with a command). In some other cases the old settings would persist and not updated when an agent process was restarted (for whatever reason). So I run it in _~\/.bashrc_ and try to avoid any stray output ... as is recommended for _~\/.bashrc_ in general. So, are there any evident corner cases or bugs? Would this make sense for something like _\/etc\/bashrc_? Is it reasonably portable to other shells?"} {"id":"58182","title":"What does the term static variable mean in unix speak?","text":"From the section 2.7 of the book - The Linux programing Interface named **Process memory layout** : _Data_ is defined as the static variables used by the program. What is the significance of the word static here ? I am aware of what static variables are in Java but I can not relate that meaning in this context ."} {"id":"59854","title":"Discover MTU between me and destination IP","text":"In a case I can use only `UDP` and `ICMP` protocols, how can I discover, in bytes, the path MTU for packet transfer from my computer to a destination IP?"} {"id":"48098","title":"Hard drive writes freezing up Gnome","text":"I'm currently running Debian 6.0.5 on my white Macbook 2008 (4,1) and have recently noticed that when I download, move, or decompress a file, Gnome freezes up completely for at least 20 seconds. These freezes happen off and on until the file is done downloading. Oddly enough I can still use Compiz to switch between workspaces and move windows, but the windows aren't being redrawn. I did a lot of googling to see if I could find a solution to the problem, but not much turned up for my specific problem. I thought the problem might be related to me using a Seagate Momentus XT, as there seemed to be a lot of problems with that drive and linux in the past. It turns out that I'm using the updated firmware that was supposed to fix the linux problems the drive was having. If anyone has any ideas as to why this is happening and a potential fix to this problem, please let me know. I get this error in the syslog: Sep 13 16:54:23 Thunder-Pussy kernel: [ 5713.330686] ata3.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6 Sep 13 16:54:23 Thunder-Pussy kernel: [ 5713.330695] ata3.00: BMDMA stat 0x6 Sep 13 16:54:23 Thunder-Pussy kernel: [ 5713.330703] ata3.00: failed command: READ DMA EXT Sep 13 16:54:23 Thunder-Pussy kernel: [ 5713.330717] ata3.00: cmd 25\/00:00:80:64:b4\/00:01:2c:00:00\/e0 tag 0 dma 131072 in Sep 13 16:54:23 Thunder-Pussy kernel: [ 5713.330721] res 51\/84:60:20:65:b4\/84:00:2c:00:00\/e0 Emask 0x30 (host bus error) Sep 13 16:54:23 Thunder-Pussy kernel: [ 5713.330728] ata3.00: status: { DRDY ERR } Sep 13 16:54:23 Thunder-Pussy kernel: [ 5713.330734] ata3.00: error: { ICRC ABRT } Sep 13 16:54:23 Thunder-Pussy kernel: [ 5713.330757] ata3: soft resetting link Sep 13 16:54:23 Thunder-Pussy kernel: [ 5713.510690] ata3.00: configured for UDMA\/33 Sep 13 16:54:23 Thunder-Pussy kernel: [ 5713.510835] ata3: EH complete"} {"id":"151638","title":"How to disable systemd's \"Time has been changed\" message spam in \/var\/log\/syslog on Debian jessie?","text":"Due to combined use of Debian `jessie`, that uses `systemd` by default, and sdwdate (that uses Slow Clock Adjuster ( gh )), my system clock is frequently changed. As a result `\/var\/log\/syslog` gets endlessly spammed by. [...] Aug 22 13:06:15 host systemd[1]: Time has been changed Aug 22 13:06:16 host systemd[1]: Time has been changed Aug 22 13:06:16 host systemd[852]: Time has been changed Aug 22 13:06:17 host systemd[852]: Time has been changed Aug 22 13:06:17 host systemd[1]: Time has been changed Aug 22 13:06:18 host systemd[1]: Time has been changed [...] Running `sudo service rsyslog stop` stops the spam, but this is not a real solution. This was not an issue on Debian `wheezy` that used `sysvinit`. How can `systemd` be configured to not send the `Time has been changed` message to `\/var\/log\/syslog`?"} {"id":"28553","title":"How to read the local DNS cache contents?","text":"I know that on Windows I can issue `ipconfig \/displaydns` and I see the local DNS's cache content. How can I list the DNS's cache content in Linux? I would like to get as much as cross-distro solution as possible."} {"id":"58459","title":"extundelete does not finish its work","text":"I need to restore a file on sda7 so I remounted ro und startet extundelete manuel@P5KC:~\/recovery\/RECOVERED_FILES$ sudo extundelete --restore-all \/dev\/sda7 WARNING: Extended attributes are not restored. Loading filesystem metadata ... 688 groups loaded. Loading journal descriptors ... 18110 descriptors loaded. Writing output to directory RECOVERED_FILES\/ Searching for recoverable inodes in directory \/ ... 1554 recoverable inodes found. Looking through the directory structure for deleted files ... Unable to restore inode 2228446 (lost+found\/latex): No data found. But the directory `RECOVERED_FILES` is empty. Am I doing something wrong or is my data lost? Filesystem is ext4. At the end, logged in as su, I am even getting a segmentation fault. * * * Debian Wheezy 3.2.0-4-amd64"} {"id":"62242","title":"xmms2 cover art","text":"Does xmms2 have bindings either a Python API or a command line tool to find the album cover art of an MP3? _Related toxmms2 notification with album art under Awesome._"} {"id":"62247","title":"How do I know what service is running on a particular port in linux?","text":"I am trying to run weblogic server on my linux machine and I am getting the following error : ERROR: transport error 202: bind failed: Address already in use ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510) JDWP exit error AGENT_ERROR_TRANSPORT_INIT(197): No transports initialized [..\/..\/..\/src\/share\/back\/debugInit.c:690] FATAL ERROR in native method: JDWP No transports initialized, jvmtiError=AGENT_ERROR_TRANSPORT_INIT(197) I think that the error means that the debugger port which by default is 8453 is already held by some other service . How can I find out what service is runnning in a partcular port number ? P.S: I used `netstat` command but that shows all the services occupying all ports ..here I am interested in a particular port only."} {"id":"79008","title":"Git pull error libcurl.so.3 not found","text":"I have a php script to `git pull` from my github repository set up in my webservice hook urls like so: &1'); ?> When I open this script on the browser, I get this error: git-remote-https: error while loading shared libraries: libcurl.so.3: cannot open shared object file: No such file or directory I am on a godaddy server running CentOS release 5.9 and `uname -mrs` yields: Linux 2.6.18-348.3.1.el5PAE i686 When I tried doing : yum install curl I get an error that the command `yum` cannot be found. I seriously have no idea what's going on here because when I ssh into my server and do `git pull` from the terminal or run the script like `php myscript.php`, it works fine and all the changes are fetched. How are the dependencies changed when I run it in the browser? Any help is deeply appreciated."} {"id":"34208","title":"Is there a way to view a list of timestamp history of a document\/file via terminal\/command line?","text":"This seems like it's simple but for some reason, it's not: Problem: I've been writing a paper- not even a script...just an economics paper- over the last 3 months. I'm trying to determine how much time I've spent writing it, how many times I've saved the file and how much the document grew each change. Is there a command\/script to view this info? I'm not looking for exact changes, I'm just looking for the general file information. The only thing I can find is the most recent time the file was modified, but I can't find the information for the modifications before the most recent. Example of expected output: $ (elusive and mysterious command that is similar to stat -x) File: \"file\" Current Size: 1000 FileType: Regular File Mode: (0600\/-rw-------) Uid: ( 501\/user) Gid: ( 20\/ group) Device: 14,2 Inode: number Links: 1 Access: Wed Mar 14 19:50:00 2012 Modified: Fri Dec 23 01:22:40 2011 --Size: 1000 Modified: Wed Dec 21 11:42:21 2011 --Size: 920 Modified: Wed Dec 21 11:01:12 2011 --Size: 703 Modified: Wed Dec 21 10:11:01 2011 --Size: 100 Modified: Tue Dec 20 11:42:38 2011 --Size: 0 Change: Mon Feb 13 20:44:36 2012"} {"id":"59585","title":"File system compatible with all OSes?","text":"I use Linux and Mac OS X on a regular basis, and sometimes I have to use Windows. I need to use a flash drive on all three, and I need a filesystem that will work well on all of them. None of the ext's work on Mac or Windows, HFS+ doesn't work on Windows (or well on Linux), NTFS is read-only on Mac, and FAT sucks on all OSes. Is there a file system that would work reasonably well on all operating systems? I'd like it to work without drivers or additional installations, so it can be used on any computer."} {"id":"34203","title":"Getting Linux computer integrated with Windows domain","text":"I've tried to figure it out for several months, with no success. I have a Windows 2008R2 domain, and one Linux server (first it was Fedora 15, then 16, and now it's Centos 6.2). I am trying to make it member of the domain to the extent possible. Ideally, I would like to login and get authenticated against domain (say, login 'DOMAIN+john'). If not - at least be able to map directories through Samba with Windows credentials (better, map drives without specifying credentials, and just passing Windows credentials). I followed several articles, most closely this one; but still can't map the drive (as soon as I switch security from USER to ADS, I can't expand the server)... let alone login. I know I am close (eg., I am getting `pam_get_item returned a password` from winbind when I log in) - but pointers to something definitive would be great!"} {"id":"154387","title":"Meaning of @0 in a shell script","text":"I was looking at the script `\/etc\/init.d\/sudo` in my Ubuntu 14.04 Linux system. While reading the script, I found this statement : find \/var\/lib\/sudo -exec touch -d @0 '{}' \\; What is the meaning of `@0` here? What does the above statement do?"} {"id":"28693","title":"iSCSI and runaway log file","text":"I have a OpenVZ VPS running CentOS 5.7 that I've been using to get some sysadmin experience. I found a log file called brcm-iscsi.log in \/var\/log and it's getting big (140 MB). INFO [Sun Dec 18 20:15:42 2011]Initialize logger using log file: \/var\/log\/brcm-iscsi.log INFO [Sun Dec 18 20:15:42 2011]Started BRCM iSCSI stack: Ver 0.6.2.13 INFO [Sun Dec 18 20:15:42 2011]Build date: Fri Jul 22 01:19:02 EDT 2011 INFO [Sun Dec 18 20:15:42 2011]Running on sysname: 'Linux', release: '2.6.18-274.7.1.el5.028stab095.1', version '#1 SMP Mon Oct 24 20:49:24 MSD 2011' machine: 'i686' INFO [Sun Dec 18 20:15:42 2011]Initialize logger using log file: \/var\/log\/brcm-iscsi.log INFO [Sun Dec 18 20:15:42 2011]Started BRCM iSCSI stack: Ver 0.6.2.13 INFO [Sun Dec 18 20:15:42 2011]Build date: Fri Jul 22 01:19:02 EDT 2011 INFO [Sun Dec 18 20:15:42 2011]Running on sysname: 'Linux', release: '2.6.18-274.7.1.el5.028stab095.1', version '#1 SMP Mon Oct 24 20:49:24 MSD 2011' machine: 'i686' WARN [Sun Dec 18 20:15:42 2011]nic_utils Error when scanning path: \/sys\/class\/iscsi_host\/[No such file or directory] INFO [Sun Dec 18 20:15:42 2011]signal handling thread ready ERR [Sun Dec 18 20:15:42 2011]NIC_NL waiting binding to NETLINK_ISCSI socket ERR [Sun Dec 18 20:15:43 2011]NIC_NL waiting binding to NETLINK_ISCSI socket ERR [Sun Dec 18 20:15:44 2011]NIC_NL waiting binding to NETLINK_ISCSI socket And every second since then I've had that line. I don't quite understand what is going on, so I'm hoping someone could tell me how to fix the underlying problem rather than just deleting the log file. I did Google this and found http:\/\/drup.org\/brcm-iscsilog-filling-hard-drive which seems to just disable iSCSI and ignore any more errors. Is there a better\/safer\/preferable way of stopping this error logging? I don't know much about iSCSI - I get that it's a SAN protocol, but that's about it. I've certainly never setup any volumes outside of the disk space I got with my VPS. Could my VPS be relying on this in some way? I wouldn't want to trash it, although I'm getting quite practiced at reloading the VPS... I also wouldn't want to screw up anyone else's nodes. Thanks in advance for helping the n00b."} {"id":"72001","title":"How to update the version of gcc-c++ on Fedora?","text":"I have version 4.4.4 of `gcc` installed and would like to update to either a specific version or to the latest version. Here is what I have tried: sudo yum install gcc-c++ this tells me that `Package gcc-c++-4.4.4-10.fc12.i686 already installed and latest version` (not true, there is at least a version 4.8 available). Next I tried a specific version: sudo yum install gcc-c++-4.8.1 with the result of `No Package gcc-c++-4.8.1 available.`. At last I tried to update the package with sudo yum update gcc-c++ with the result `No Packages marked for Update`. So how the heck do I update the version of `gcc` and\/or `gcc-c++` to be able to compile projects with C++11?"} {"id":"148890","title":"How to disable SELinux without restart?","text":"I need to disable SELinux but cannot restart the machine i followed this link where i get bellow command setenforce 0 But agter running this command i checked for that sestatus SELinux status: enabled SELinuxfs mount: \/selinux Current mode: permissive Mode from config file: disabled Policy version: 24 Policy from config file: targeted Is there any other option?"} {"id":"76727","title":"`mv` has failed because of insufficient disk space, what now?","text":"I have tried to move a folder `A` from partition a to partition b as folder `B` with `mv`. Now the target file system was not big enough for all the data (I know I should have checked this first). Anyway, I continued by using `rsync -av` (what I should have done in the first place), as in What does mv do in case of errors? Then I used `diff -r A B` to check for changes between the folders and diff indeed observed differences in the target directory. Now I wonder whether I should just delete the target folder and start the rsync process at once or whether there is a way to get `rsync` copy everything."} {"id":"116109","title":"Slight change to command to compile C++ program causes error","text":"This morning , I was trying to compile a C++ program using the following command on the command line g++ -o foo.cpp foo I spend about an hour trying t to resolve why I kept getting undefined reference & multiple definition error till I realised that my command to compile was wrong and **it should be** g++ foo.cpp -o foo I am just wondering what is the difference in process between `g++ -o foo.cpp foo` and `g++ foo.cpp -o foo` . Why does placing the `-o` infront cause compilation error"} {"id":"91663","title":"s3fs complains about SSH key or SSL cert - how to fix?","text":"I downloaded and installed s3fs 1.73 on my Debian Wheezy system. The specific steps I took were, all as root: apt-get -u install build-essential libfuse-dev fuse-utils libcurl4-openssl-dev libxml2-dev mime-support .\/configure --prefix=\/usr\/local make make install The installation went well and I proceeded to create a file `\/usr\/local\/etc\/passwd-s3fs` with my credentials copied from past notes (I'm pretty sure those are correct). That file is mode 0600 owner 0:0. Piecing together from the example on the web page and the man page, I then try a simple mount as a proof of concept to make sure everything works: $ sudo -i # s3fs mybucketname \/mnt -o url=https:\/\/s3.amazonaws.com -o passwd_file=\/usr\/local\/etc\/passwd-s3fs In short: it doesn't. The mount point exists with reasonable permissions, and I get no error output from s3fs. However, nothing gets mounted on \/mnt, `mount` has no idea about anything of the sort, and if I try `umount` it says about the directory \"not mounted\". The system logs say `s3fs: ###curlCode: 51 msg: SSL peer certificate or SSH remote key was not OK`, but **how do I find out which SSL certificate it is talking about or in what way was it not OK?** Firefox has no complaints when I connect to that URL but also redirects me to https:\/\/aws.amazon.com\/s3\/. **How do I get s3fs to actually work?**"} {"id":"67740","title":"cd to a directory and execute many commands","text":"I have following script. #!\/bin\/bash mount \/dev\/sda6 \/mnt\/gentoo set +e cd \/mnt\/gentoo && mount -t proc none \/mnt\/gentoo\/proc \\ && mount --rbind \/dev \/mnt\/gentoo\/dev \\ && mount --rbind \/sys \/mnt\/gentoo\/sys \\ && chroot \/mnt\/gentoo \/bin\/bash \\ && source \/etc\/profile \\ && export PS1=\"(chroot)$PS1\" What I am trying to accomplish here is to change to a directory `\/mnt\/gentoo` and execute few commands. This works ok first time when none of the path were mounted. But if I run it after mounting has been successfully performed on some paths, it does not continue and stops on first failure. I want all commands to be executed even if mount is failing due to 'already mounted' error. How can I do this? Also is there a better way than combining all these commands together in one line?"} {"id":"67746","title":"Why can't I use strace with rsh?","text":"If I run rsh, it works, but prints some strange “Connection refused” messages at the beginning: $ rsh localhost pwd connect to address 127.0.0.1 port 544: Connection refused Trying krb4 rsh... connect to address 127.0.0.1 port 544: Connection refused trying normal rsh (\/usr\/bin\/rsh) \/home\/service But if I run rsh under strace, it doesn't connect to the server at all: $ strace -c rsh localhost ulimit -n connect to address 127.0.0.1 port 544: Connection refused Trying krb4 rsh... connect to address 127.0.0.1 port 544: Connection refused trying normal rsh (\/usr\/bin\/rsh) rcmd: socket: Permission denied % time seconds usecs\/call calls errors syscall ------ ----------- ----------- --------- --------- ---------------- 28.39 0.000113 2 58 read 27.64 0.000110 16 7 write 16.83 0.000067 1 47 open 15.33 0.000061 2 27 munmap 11.81 0.000047 1 80 mmap 0.00 0.000000 0 58 close 0.00 0.000000 0 1 stat 0.00 0.000000 0 45 fstat .......................................... .......................................... .......................................... Here is an extract from `strace rsh localhost ulimit -n`: connect(3, {sa_family=AF_INET, sin_port=htons(544), sin_addr=inet_addr(\"127.0.0.1\")}, 16) = -1 ECONNREFUSED (Connection refused) write(2, \"Connection refused\\n\", 19) = 19 connect(3, {sa_family=AF_INET, sin_port=htons(544), sin_addr=inet_addr(\"127.0.0.1\")}, 16) = -1 ECONNREFUSED (Connection refused) write(2, \"Connection refused\\n\", 19) = 19 **Questions** 1. What is causing `port 544: Connection refused`? 2. Why does it show the error `rcmd: socket: Permission denied`? It should show some integer value (the output of `ulimit -n` on the remote machine)."} {"id":"77238","title":"ssh-agent forwarding for a Vagrant VM","text":"I'm currently looking at setting up a Vagrant environment on my Mac machine, so that I can run `vagrant up` and it will then install `rbenv` and `ruby` and all I need. Then I have a Bash script that will fetch all my repos from github. The only thing is that my new vagrant vm has to now generate a ssh key and then link it to my Github account. This can be cumbersome. Especially since I would like to share my Vagrant file with all those that have access to our repos so that they could do the same. So I thought I could try forwarding my hosts ssh to the VM so that the VM can forward my host ssh to Github. Following this article: Githubs walkthrough, I set my hosts ssh config: Host localhost ForwardAgent yes and set in my vagrant file Vagrant.configure(\"2\") do |config| config.ssh.forward_agent = true ... end and when I log into my VM and run the following command I get this error: $ ssh -T git@github.com` Permission denied (publickey) Is there anyone that has tried a similar setup? The VM is a precise64 box. EDIT: **`env`** : vagrant@precise64:~$ env TERM=xterm-256color SHELL=\/bin\/bash SSH_CLIENT=10.0.2.2 53068 22 SSH_TTY=\/dev\/pts\/0 LC_ALL=en_US USER=vagrant LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36: RBENV_ROOT=\/opt\/rbenv SSH_AUTH_SOCK=\/tmp\/ssh-aDGJQD2812\/agent.2812 MAIL=\/var\/mail\/vagrant PATH=\/opt\/rbenv\/shims:\/opt\/rbenv\/bin:\/opt\/rbenv\/bin\/rbenv\/bin:\/usr\/local\/sbin:\/usr\/local\/bin:\/usr\/sbin:\/usr\/bin:\/sbin:\/bin:\/usr\/games:\/opt\/vagrant_ruby\/bin PWD=\/home\/vagrant SHLVL=1 HOME=\/home\/vagrant LOGNAME=vagrant SSH_CONNECTION=10.0.2.2 53068 10.0.2.15 22 LC_CTYPE=UTF-8 LESSOPEN=| \/usr\/bin\/lesspipe %s LESSCLOSE=\/usr\/bin\/lesspipe %s %s _=\/usr\/bin\/env"} {"id":"143677","title":"No password to run command as root for fixed command?","text":"Is it possible to define a rule in sudoers to allow one user to run one well defined command as root, without password or other authentication except being the right user? Are there alternatives to solve this (or something very similar)? Use suid permission bit? Maybe make use of ssh keys somehow?"} {"id":"94171","title":"fedora 19: unable to update or install - \"Could not resolve host...\"","text":"I cannot update as no mirror is found: [root@localhost ~]# yum update Loaded plugins: langpacks, refresh-packagekit Could not get metalink https:\/\/mirrors.fedoraproject.org\/metalink?repo=fedora-19&arch=i386 error was 14: curl#6 - \"Could not resolve host: mirrors.fedoraproject.org; Name or service not known\" http:\/\/www.mirrorservice.org\/sites\/dl.fedoraproject.org\/pub\/fedora\/linux\/releases\/19\/Everything\/i386\/os\/repodata\/repomd.xml: [Errno 14] curl#6 - \"Could not resolve host: www.mirrorservice.org; Name or service not known\" Trying other mirror. ftp:\/\/ftp.mirrorservice.org\/sites\/dl.fedoraproject.org\/pub\/fedora\/linux\/releases\/19\/Everything\/i386\/os\/repodata\/repomd.xml: [Errno 14] curl#6 - \"Could not resolve host: ftp.mirrorservice.org; Name or service not known\" Trying other mirror. I can ping this and every other address that fails: [root@localhost ~]# ping www.mirrorservice.org PING www.mirrorservice.org (212.219.56.184) 56(84) bytes of data. 64 bytes from www.mirrorservice.org (212.219.56.184): icmp_seq=1 ttl=50 time=19.6 ms 64 bytes from www.mirrorservice.org (212.219.56.184): icmp_seq=2 ttl=50 time=19.6 ms 64 bytes from www.mirrorservice.org (212.219.56.184): icmp_seq=3 ttl=50 time=19.7 ms 64 bytes from www.mirrorservice.org (212.219.56.184): icmp_seq=4 ttl=50 time=20.1 ms ^C --- www.mirrorservice.org ping statistics --- 4 packets transmitted, 4 received, 0% packet loss, time 3004ms rtt min\/avg\/max\/mdev = 19.607\/19.788\/20.104\/0.189 ms ### UPDATE #1 Here's the output from the following command: $ URLGRABBER_DEBUG=1,debug.log yum update"} {"id":"23618","title":"Gentoo Gnome 3.2 Wireless \"Connecting...\"","text":"I recently updated my Gentoo with GNOME 2.x to GNOME 3.2. My NetworkManager applet refuses to connect to my network; however, it does not give an error as it simply hangs as \"Connecting...\" I checked `\/var\/log\/messages` and it seems that NetworkManager is simply not performing Step 5 of 5 to connect to the network. I am given an IP Address lease when it completes step 4... But step 5 is never started."} {"id":"59326","title":"How to use \"fuser\" to get process list for nested folder while using with parent folder as argument?","text":"I am using `fuser` command to get the list of processes accessing a folder. However if the process is working on a file present in a inner folder, executing `fuser` command on the parent does not provide details of the process working on inner folder. Is there any way I can pull the process details of the inner folders as well while executing `fuser` on the parent? I am working with Solaris 5.8. Below is the code which I tried: ~: pwd \/home\/ah388 ~: ls sasuser.v91\/ ~: cd sasuser.v91\/ ~\/sasuser.v91: cat kk.sh while [ 1 ]; do echo \"\" > \/dev\/null done; ~\/sasuser.v91: .\/kk.sh & **[1] 15140** ~\/sasuser.v91: ls a\/ kk.sh* ~\/sasuser.v91: cd a ~\/sasuser.v91: ls kk.sh* ~\/sasuser.v91\/a: .\/kk.sh & **[2] 15271** ~\/sasuser.v91\/a: cd ~: fuser -u sasuser.v91 **sasuser.v91: 15140c(ah388880) --> What about 15271 Process** ~: jobs [1]- Running .\/kk.sh & (wd: ~\/sasuser.v91) [2]+ Running .\/kk.sh & (wd: ~\/sasuser.v91\/a)"} {"id":"61742","title":"sed edit text block: not greedy match","text":"I wish I can grab **the first** html comment in a file using sed. Using `'\/\/` and having more than one comment block it will match all the content between the first and the last comment block too! Any advice? Here a sample: Content The expected output should be: It should work with single line comments too. "} {"id":"129520","title":"stdin, stderr, redirection and logs","text":"Is there a difference between those two lines ? \/home\/user\/script.sh >> \/home\/user\/stdout_and_error.log 2>&1 \/home\/user\/script.sh 2>&1 >> \/home\/user\/stdout_and_error.log knowing that I would like to put the stdout and execution errors of the script in the log file. If there are no differences, what if I would like to log the logging itself?"} {"id":"74714","title":"zsh: Echoing every statement?","text":"I have an odd problem with zsh when I switch between shells in a particular way: ### Option 1 (works well): I start a `zsh` shell. I switch to `tcsh` with `\/bin\/tcsh`, and I switch back to `zsh` with `\/bin\/zsh` If I then run: > ls I get: .\/ ..\/ file1 file1 file3 ### Option 2 (problematic): I start a `zsh` shell. I switch to `tcsh` with: `exec env -i HOME=$HOME TERM=$TERM DISPLAY=$DISPLAY \/bin\/tcsh`. and I then switch back to `zsh` with `\/bin\/zsh`. If I then enter any commands, the `zsh` shell echoes the command and then the result. Using the same example as before: > ls 2;ls --color=yes -aF1;.\/ ..\/ file1 file2 file3 In other words, zsh shows `2;COMMAND 1;` and then the output, which is of course very different from what I was getting with **Option 1**. What's even more strange is that this only happens within `ansi-term` or `multi-term` terminals in Emacs, and not under `gnome-terminal`. What else can I do to diagnose the problem? Any thoughts on what may be causing this? # Update: My `.cshrc` prompt is set prompt = \"> \""} {"id":"74718","title":"Why does my Mountain Lion computer have Apache 2.2.22 shut down almost as soon as it starts?","text":"[Sun Apr 21 17:29:00 2013] [notice] caught SIGTERM, shutting down [Sun Apr 21 17:30:15 2013] [warn] Init: Session Cache is not configured [hint: SSLSessionCache] httpd: Could not reliably determine the server's fully qualified domain name, using Christoss-MacBook-Pro.local for ServerName [Sun Apr 21 17:30:16 2013] [notice] Digest: generating secret for digest authentication ... [Sun Apr 21 17:30:16 2013] [notice] Digest: done [Sun Apr 21 17:30:18 2013] [notice] Apache\/2.2.22 (Unix) DAV\/2 mod_ssl\/2.2.22 OpenSSL\/0.9.8r configured -- resuming normal operations [Sun Apr 21 17:31:06 2013] [error] [client ::1] File does not exist: \/Users\/jonathan\/project\/fathers\/public_html\/blajeny.com [Sun Apr 21 17:37:13 2013] [error] [client ::1] File does not exist: \/Users\/jonathan\/project\/fathers.tgz\/public_html\/ [Sun Apr 21 17:37:14 2013] [error] [client ::1] File does not exist: \/Users\/jonathan\/project\/fathers.tgz\/public_html\/favicon.ico [Sun Apr 21 17:44:41 2013] [notice] caught SIGTERM, shutting down I'm not completely sure how to parse this. I wouldn't expect the 404's to shut down the server. Is there anything that jumps out about what is wrong here?"} {"id":"73091","title":"List of packages managed by DKMS","text":"How do I get a list of packages (and their versions) managed by DKMS so I can easily add\/remove them?"} {"id":"92314","title":"RedHat RPM file collision","text":"Let's assume I have two RPM packages named _1.rpm_ and _2.rpm_. Both of them want to put a file _test_ into _\/usr\/bin_ , but both of them use a different version of _test_. Of course I would like to have both RPMs installed on the same machine. What would be official behavior of RedHat (let it be RHEL5) in described situation?"} {"id":"73097","title":"Linux Mint Taskbar and Icons are gone","text":"I have linux mint cinnamon 13. I installed it today. Well my problem is that my panel and my icons are gone. There is absolutely nothing but my desktop background. But I'm still able to switch to F1 + Ctrl + Alt. Also when I click on \"print\" on my keyboard it makes a photo but nothing pops up. So how can I get my taskbar, icons etc. back?"} {"id":"21016","title":"How to speed up X over SSH on a slow network connection?","text":"Are there any specific recommendations on speeding up X applications over ssh on a slow network connection? In this specific case, I am accessing a server located in west coast from a laptop in east coast and that too on a not too fast DSL connection. Any settings for ssh? Any tips in general?"} {"id":"149851","title":"Memory allocation for sparse array in awk","text":"I have searched but didnt reach to any conclusion that when i defined an sparse array does it reserve all the **contiguous memory** upto maximum index or it allocate the memory at that particular index only. array[100000]=\"ID1\" array[1001]=\"ID2\" Similarly when i do for loop for an array does it scan all the indexes where **array[i] exist** or It point only **defined array's index** for ex. 100000 & 1001. for(i in array){...} I have to store some value at specific index but i am afraid of memory allocation,so it become so much important for me to know,how does it actually allocate memory in case of sparse array,thanks."} {"id":"25612","title":"Wireless indicator light flashing for activity on laptop keyboard","text":"Here's wireless: $ lspci | grep -i wireless 0d:00.0 Network controller: Intel Corporation Centrino Wireless-N 1000 OS is Linux Mint 12, using gnome2\/compiz. I've got HP Pavilion dv7 899AW, sandybridge 915 chipset The problem is that the orange\/blue light for the wireless won't stop flashing. Probably flashing due to activity. I tried this fix, but it didn't work: http:\/\/ubuntuforums.org\/showthread.php?t=1699037&page=3 Also, the mute light stays permanently orange. Thanks."} {"id":"60838","title":"Saving a email as file in mutt?","text":"When I press `S` in mutt, it saves the mail to a mail folder format (`cur\/ tmp\/ new\/`), but I want a single file to be saved, just like how the attachment is saved, is that configurable?"} {"id":"143858","title":"sudo source: command not found","text":"I want to run this program as root. It activates a virtual environment and runs a python program in that virtual environment. The program looks like this $cat myfile.sh source \/pathto\/venv\/bin\/activate python \/pathto\/rsseater.py If I just run it as root I get $ sudo .\/myfile.sh .\/myfile.sh: 2: .\/myfile.sh: source: not found I found this but if I try to add `sudo -s` to the top of the file it seems to change the prompt to a # -- but the python does not run as expected. I'm not sure what the program is doing when I have sudo -s at the top of the file like that. How can I get this program to run as root?"} {"id":"106977","title":"How to securely download rpmfusion keys","text":"**The Actual Problem I am trying to solve** I am trying to automatically configure my fedora installations via salt to automatically have the rpmfusion repositories installed. In order to do this securely I need the gpg key so that packages can be verified before they are installed. However, I am unable to find a way to securely download rpmfusion's keys. For example, if I was making a google chrome repo I would have something like this. [google-chrome] name=google-chrome baseurl=http:\/\/dl.google.com\/linux\/chrome\/rpm\/stable\/x86_64 enabled=1 gpgcheck=1 gpgkey=https:\/\/dl-ssl.google.com\/linux\/linux_signing_key.pub However, for rpmfusion the closest thing I have is the following (Note this is untested): [rpmfusion-nonfree] name=RPM Fusion for Fedora $releasever - Nonfree mirrorlist=http:\/\/mirrors.rpmfusion.org\/mirrorlist?repo=nonfree-fedora-$releasever&arch=$basearch enabled=1 metadata_expire=7d gpgcheck=1 gpgkey=http:\/\/rpmfusion.org\/keys?action=AttachFile&do=get&target=RPM-GPG-KEY-rpmfusion-nonfree-fedora-$releasever However, note that I am download via an unencrypted channel (http instead of https). So my question is the following: Is there a way for me to securely download rpmfusion's public key?"} {"id":"106970","title":"Fedora 20 and windows 7 can't create partions","text":"I have installed Windows 7 SP1 in my laptop. I have 4 partitions: 1. System reserved (Primary partition): 100mb 2. C (Primary partition): 70GB 3. D (Logical partition): 150GB 4. E (Logical partition): 175GB I have 2 primary and one extended partition with 2 logical partitions. When I tried to install Fedora 20 automatic partition failed. And when I try to manually create partitions, I am only able to create one partition. When I try to create second partition it says \"not enough space\". I think it's the problem of partition table, since Windows only allows 3 primary partitions. But I have only 2 primary partitions, so it shouldn't be a problem. Any idea what’s happened?"} {"id":"153687","title":"How to download & install “heidisql” on linux?","text":"First time I am starting working on \"heidisql\". I want to download & install \"heidisql\" on Linux Mint. May anybody please provide me the link to download \"heidisql\" for Linux version & how to install? Actually after googling I am not getting proper result."} {"id":"139838","title":"How do I set the keyboard layout to something like us qwerty in Manjaro Linux?","text":"After a fresh installation of _Manjaro Linux_ and selecting _2 languages_ for the system, I can't access the us english layout anymore! I have selected the `Alt` + `Shift` in order to change layout but it doesn't work. I can't login, I have rebooted and the problem persists. How do I set the default us layout?"} {"id":"104651","title":"Able to connect to my dell printer but cannot print to it","text":"PC: Dell Inspiron Mini 10, Processor: Intel Atom dual core 1.6 GHz, RAM: 1GB, OS: Ubuntu 12.04 LTS 32 bit, Printer: Dell P713W So I tried to add the printer driver for my ubuntu from the following site. here I followed the instructions to the dot and completed installation. My computer can detect my printer over the network. Yet, when I try to print a test page from the computer, the print job fails on processing and stops. Here are the details. I tried pinging to my printer and they are connected together, and the printer works fine on my other computers in windows environment. What can I do to get my printer working in Ubuntu Linux? I can provide more details if requested."} {"id":"106219","title":"Copy files from a list to a folder","text":"I have a text file `abc.txt` and its contents are: \/lag\/cnn\/org\/one.txt \/lag\/cnn\/org\/two.txt \/lag\/cnn\/org\/three.txt If I use: $ tar -cvf allfiles.tar -T abc.txt I'm getting the tar of files in the list. Similarly is it possible to copy those files in `abc.txt` to a folder? I tried this: $ cp --files-from test1.txt .\/Folder But it is not working."} {"id":"134978","title":"Standard workflow to digitize magazines or books using OCR while minimizing file size?","text":"To scan books containing just text, black&white images and clear borders, the workflow I've been using is: * digitize the source using a camera or just a scanner * use `scantailor` * finally use `djvubind` to make a small (1-7 MB) djvu-file with ocr background This works fine. However if you have magazines or books containing lots of colors in the images, structural elements, backgrounds, or images which overlap the margins of the page, using scantailor (in mixed mode) becomes very difficult, and you have to proceed manually with every single page. So, what would be a good workflow in Linux to digitize such sources and get a small _djvu_ or _pdf_ file with ocr background?"} {"id":"122531","title":"How can Window Managers shutdown the computer?","text":"When logged in to a virtual shell as an unprivileged user and try to `shutdown`, `reboot`, `init 0` or `init 6` don't work. But if you're running a desktop environment, you can easily select its shutdown functionality. Why is that?"} {"id":"45042","title":"Server does not accept public key for ssh login without password","text":"> **Possible Duplicate:** > Why am I still getting a password prompt with ssh with public key > authentication? I have ssh access to two sever. One old one and one new one. For the old one I use the tutorial SSH login without password to login without typing the password every time. For the new machine I followed the tutorial again, but this time it is not working. I looked at the debug output from ssh (`-v` option) and it seems to me that the new server does not `accept` my public key. But I checked and bot `authorized_keys` are the same, I even used `md5sum`. What could be the problem and how could I fix this? **Debug output for old server where it does work (snippet):** debug1: Authentications that can continue: publickey,password debug1: Next authentication method: publickey debug1: Offering RSA public key: \/home\/NICK\/.ssh\/id_rsa debug1: Server accepts key: pkalg ssh-rsa blen 277 **Debug output for new server where it does not work (snippet):** debug1: Authentications that can continue: publickey,password debug1: Next authentication method: publickey debug1: Offering RSA public key: \/home\/NICK\/.ssh\/id_rsa debug1: Authentications that can continue: publickey,password debug1: Trying private key: \/home\/NICK\/.ssh\/id_dsa [ **UPDATE] Ownership of authorized_keys on remote** NICK@server-new:~\/.ssh$ ls -l total 4 -rwx------ 1 NICK NICK 404 2012-08-08 16:11 authorized_keys * * * **Complete debug output for the not working server:** OpenSSH_5.9p1 Debian-5ubuntu1, OpenSSL 1.0.1 14 Mar 2012 debug1: Reading configuration data \/home\/NICK\/.ssh\/config debug1: \/home\/NICK\/.ssh\/config line 1: Applying options for foo2 debug1: Reading configuration data \/etc\/ssh\/ssh_config debug1: \/etc\/ssh\/ssh_config line 19: Applying options for * debug1: Connecting to foo-serv2.cs.bar.it [XXX.XXX.XXX.XXX] port 22. debug1: Connection established. debug1: identity file \/home\/NICK\/.ssh\/id_rsa type 1 debug1: Checking blacklist file \/usr\/share\/ssh\/blacklist.RSA-2048 debug1: Checking blacklist file \/etc\/ssh\/blacklist.RSA-2048 debug1: identity file \/home\/NICK\/.ssh\/id_rsa-cert type -1 debug1: identity file \/home\/NICK\/.ssh\/id_dsa type -1 debug1: identity file \/home\/NICK\/.ssh\/id_dsa-cert type -1 debug1: identity file \/home\/NICK\/.ssh\/id_ecdsa type -1 debug1: identity file \/home\/NICK\/.ssh\/id_ecdsa-cert type -1 debug1: Remote protocol version 2.0, remote software version OpenSSH_5.5p1 Debian-4ubuntu6 debug1: match: OpenSSH_5.5p1 Debian-4ubuntu6 pat OpenSSH* debug1: Enabling compatibility mode for protocol 2.0 debug1: Local version string SSH-2.0-OpenSSH_5.9p1 Debian-5ubuntu1 debug1: SSH2_MSG_KEXINIT sent debug1: SSH2_MSG_KEXINIT received debug1: kex: server->client aes128-ctr hmac-md5 none debug1: kex: client->server aes128-ctr hmac-md5 none debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP debug1: SSH2_MSG_KEX_DH_GEX_INIT sent debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY debug1: Server host key: RSA XXX debug1: Host 'foo-serv2.cs.bar.it' is known and matches the RSA host key. debug1: Found key in \/home\/NICK\/.ssh\/known_hosts:34 debug1: ssh_rsa_verify: signature correct debug1: SSH2_MSG_NEWKEYS sent debug1: expecting SSH2_MSG_NEWKEYS debug1: SSH2_MSG_NEWKEYS received debug1: Roaming not allowed by server debug1: SSH2_MSG_SERVICE_REQUEST sent debug1: SSH2_MSG_SERVICE_ACCEPT received debug1: Authentications that can continue: publickey,password debug1: Next authentication method: publickey debug1: Offering RSA public key: \/home\/NICK\/.ssh\/id_rsa debug1: Authentications that can continue: publickey,password debug1: Trying private key: \/home\/NICK\/.ssh\/id_dsa debug1: Trying private key: \/home\/NICK\/.ssh\/id_ecdsa debug1: Next authentication method: password"} {"id":"36542","title":"Invoking cp from within BASH and using the -u option","text":"Is there a way to have `cp`'s `\\--update` option print files that did not copy because the source directory contained a newer version of the file?"} {"id":"36549","title":"configure dhcp client without accepting nameserver entries","text":"I am trying to configre my openSuSE 12.1 machine as DHCP client, but especially do not want it to set the name server entries to `\/etc\/resolv.conf` it has got from DHCP server. Can I do it on the client site without manually deleting the entries afterwards? On windows machines this is possible due to the setting > ( ) Obtain DNS server address automatically > > (O) User the following DNS server addresses: and then just leave the fields for Preferred and Alternate DNS server blank."} {"id":"31476","title":"Extracting a regex matched with 'sed' without printing the surrounding characters","text":"To all the 'sed' doctors out there: I have a seemingly trivial 'sed' question to which I have not been able to find a solution. How can you get 'sed' to exctract a regular expression it has matched in a line? In other words words, I want just the string corresponding to the regular expression with all the non-matching characters from the containing line stripped away. I tried using the back-reference feature like below regular expression to be isolated gets `inserted` here | v sed -n 's\/.*\\( \\).*\/\\1\/p this works for some expressions like sed -n 's\/.*\\(CONFIG_[a-zA-Z0-9_]*\\).*\/\\1\/p which neatly extracts all macro names starting with 'CONFIG_ ....' ( found in some '*.h' file ) and prints them all out line by line CONFIG_AT91_GPIO CONFIG_DRIVER_AT91EMAC . . CONFIG_USB_ATMEL CONFIG_USB_OHCI_NEW . e.t.c. BUT the above breaks down for something like sed -n 's\/.*\\([0-9][0-9]*\\).*\/\\1\/p this always returns single digits like 7 9 . . 6 rather than extracting a contigious number field such as. 8908078 89670890 . . . 23019 . e.t.c. P.S.: I would be grateful to feedback on how this is achieved in 'sed'. I know how to do this with 'grep' and 'awk' I would like to find out if my - albeit limited - understanding of 'sed' has holes in it and if there is way to do this in 'sed' which I have simply overlooked."} {"id":"43133","title":"Only return the matched string in sed","text":"> **Possible Duplicate:** > Extracting a regex matched with 'sed' without printing the surrounding > characters How do I make this only print `test`: echo \"atestb\" | sed -n 's\/\\(test\\)\/\\1\/p'"} {"id":"15679","title":"Wireless Connectivity and Fedora 15 Boot Up","text":"I'm currently running Fedora 15 and recently I've noticed that if I am in an area which does not have a wireless network or a secured wireless network which I cannot automatically connect to, Fedora 15 boots up very slowly, sometimes hanging on the screen with the Fedora logo. Is there a way to fix this?"} {"id":"107678","title":"Omit the target dir from find results","text":"How can I prevent `find` from returning the directory I use as the root to start searching from in the results? e.g.: $ find targetDir -name 'target*' targetDir\/target1 targetDir\/target2 targetDir\/subDir\/target3 instead of: $ find targetDir -name 'target*' targetDir targetDir\/target1 targetDir\/target2 targetDir\/subDir\/target3"} {"id":"24761","title":"Rename All Files with a Certain Name","text":"I'm trying to find certain files with the name \"stringx\" and replace the name (but not the extension) with \"stringy\". So basically for stringx.txt and stingx.cs, I'd want stringy.txt and stringy.cs. I've attempted to test my rename command regex using following, but it returns no results: rename -n 'stringx.\/s\/\\*$stringy.\/\\\/' stringx.* I'm running csh under Centos. I can see that my regex is probably not correct, but I can't see any results to verify this. I can see that there are files that are named stringx. with the following: find .\/ -name 'stringx.*'"} {"id":"114688","title":"bash replace part of string based on location","text":"Sorry I've looked around for a one line solution ( as bash offers ) to replace part of filename. Given that a folder has image sequence like ve2_sq021_sc001_v000.0101.jpg ve2_sq021_sc001_v000.0102.jpg ve2_sq021_sc001_v000.0103.jpg ve2_sq021_sc001_v000.0104.jpg Need to replace only v000 with v09 ( say ). How is it possible (throughout directory)."} {"id":"24107","title":"How can I rename a lot of files using a regex?","text":"I want to rename a lot of files on Mac OS X (10.7.2).. I don't have the perl package for the `rename` command. My files have names like \"T452-102456-0.png\" and I want to delete the \"-0\" part. I know I can do this action by writing my own php-cli script, but I would like to know of an easier and faster solution."} {"id":"145881","title":"How to rename file using substring of the same file name","text":"I want to rename my file with its substring.Because unfortunately renamed all the files in my server. _Now I want to remove suffix( .gz) of all the files including files in subdirectories also._ Below is avaliable files with extra `.gz`. # pwd \/usr\/apache-tomcat-6.0.36\/webapps\/rdnqa\/WEB-INF\/classes # ls META-INF jbpm.hibernate.cfg.xml.gz jbpm.jpdl.cfg.xml.gz jpdl-4.0.xsd.gz config jbpm.hibernate.cfg.xml.mirror.gz jbpm.mail.templates.xml.gz jpdl-4.2.xsd.gz ecnet jbpm.hibernate.cfg.xml.staging.gz jbpm.repository.hbm.xml.gz jpdl-4.3.xsd.gz hibernate.queries.hbm.xml.gz jbpm.history.hbm.xml.gz jbpm.task.hbm.xml.gz jpdl-4.4.xsd.gz jbpm.businesscalendar.cfg.xml.gz jbpm.identity.cfg.xml.gz jbpm.task.lifecycle.xml.gz labels jbpm.cfg.xml.gz jbpm.identity.hbm.xml.gz jbpm.tx.hibernate.cfg.xml.gz log4j.properties.gz jbpm.console.cfg.xml.gz jbpm.jboss.idm.cfg.xml.gz jbpm.tx.jta.cfg.xml.gz nohup.out.gz jbpm.default.cfg.xml.gz jbpm.jbossremote.cfg.xml.gz jbpm.tx.spring.cfg.xml.gz jbpm.default.scriptmanager.xml.gz jbpm.jobexecutor.cfg.xml.gz jbpm.variable.types.xml.gz jbpm.execution.hbm.xml.gz jbpm.jpdl.bindings.xml.gz jbpm.wire.bindings.xml.gz # cd ecnet # ls core jms rd util # cd core # ls util # cd util # pwd \/usr\/apache-tomcat-6.0.36\/webapps\/rdnqa\/WEB-INF\/classes\/ecnet\/core\/util # ls GridService.class.gz MDPDFXMLParser.class.gz PDFColumn.class.gz PDFXMLParser.class.gz GridService.java.gz MDPDFXMLParser.java.gz PDFColumn.java.gz PDFXMLParser.java.gz MDExcelXmlParser.class.gz MasterDetailsPrintWriter.class.gz PDFRow.class.gz RGBColor.class.gz MDExcelXmlParser.java.gz MasterDetailsPrintWriter.java.gz PDFRow.java.gz RGBColor.java.gz MDExcleWriter.class.gz PDFCell.class.gz PDFWriter.class.gz xml2excel MDExcleWriter.java.gz PDFCell.java.gz PDFWriter.java.gz #"} {"id":"122954","title":"Mass mv on files and changing filenames","text":"I want to change these filenames download (19).download ... download (27).download to download (19).html ... download (27).html I run unsuccessfully mv *.download *.html usage: mv [-f | -i | -n] [-v] source target mv [-f | -i | -n] [-v] source ... directory **How can you change the filename?** I think I need a regex here probably."} {"id":"74565","title":"Rename multiple files in UNix directory","text":"I have files in unix directory in below format using sed or some other commands. Owner.Env.File_010513_1200_ver1.expdp Owner.Env.File_010513_1200_ver2.expdp Owner.Env.File_010513_1200_ver3.expdp Owner.Env.File_010513_1200_ver4.expdp I want to rename these files in below format Owner.Env.File_100613_2300_ver1.expdp Owner.Env.File_100613_2300_ver2.expdp Owner.Env.File_100613_2300_ver3.expdp Owner.Env.File_100613_2300_ver4.expdp"} {"id":"29295","title":"rename multiple files with rename command?","text":"> **Possible Duplicate:** > How can I rename a lot of files using a regex? > Rename All Files with a Certain Name There are files with ORDER_EVENTS_SOMETHING_20120117.log ORDER_EVENTS_SOME2_20120117.log ORDER_EVENTS_CHARS_20120117.log and so on.. I need to rename them to ORDER_EVENTS_SOMETHING_20120113.log ORDER_EVENTS_SOME2_20120113.log and so on.. How can I do that?"} {"id":"122818","title":"How to rename multiple files","text":"I have files with names as, A2002185.h23v04.005.2007177004246.hdf A2002201.h23v04.005.2008288062542.hdf I want to rename them by deleting everything in the name after first dot (and have names as _A2002185.hdf_ , _A2002201.hdf_ ), how can I do that?"} {"id":"56902","title":"How do I rename multiple files","text":"> **Possible Duplicate:** > How can I rename a lot of files using a regex? I've got some files named abc-10.5.3.1-1.x86_64.rpm abc-compiler-10.5.3.1-1.x86_64.rpm abc-10.5.3.1-6.x86_64.rpm abc-compiler-10.5.3.1-6.x86_64.rpm I'd like to remove the minor version numbers (1-1 and 1-6) whenver the files are built. I can't figure out how to achieve this with the rename command on Redhat linux. The resulting filename should for example be: abc-10.5.3.x86_64.rpm The command doesn't take regular expressions."} {"id":"107671","title":"Command to prevent suspend while another command executes?","text":"Is there a command to prevent the suspending of a system while another command executes? For example; lets say I have an upload that I want to complete but it gets interrupted because of my machine suspending. Is there a command that I can use to execute another command that prevents my machine from sleeping until the command finishes?"} {"id":"78018","title":"LXDE: keybinding for single key not working","text":"I am trying to bind `lxterminal` to the `windows` key on my keyboard. The problem is, it only works for key kombination, such as `W-r`. But I would like to use `W` only. I have added the following in to the `` section of my `.config\/openbox\/lxde-rc.xml` true<\/enabled> LXterminal<\/name> <\/startupnotify> lxterminal<\/command> <\/action> <\/keybind> but this does not work. Can somebody please help? UPDATE: I have just realized, that `` refers to the `W` key (capital w), and not to the Windows key. This is illogical, because key combination `W-e` refers to `Windows key + e`."} {"id":"33996","title":"How to copy qemu raw images?","text":"I want to backup kvm virtual machines and copy machine's images another path or usb disk? How to copy \" qemu raw images\"?"} {"id":"78014","title":"How to copy data from Linux Server to Windows Server","text":"I need to copy from Linux server to Windows. To copy between Linux servers we can use multiple options like scp, or rsync but how to copy data if I have to copy on windows Server from Linux Server. And the size of the data is 2TB so the job should be running in Background. So that I have to close the terminal I can do it without stopping the process."} {"id":"31599","title":"Mint 12: synaptic package manager error","text":"Yesterday I had the same issue, I solved it by running sudo synaptic But today I don't know what's happening, if I run `gksu synaptic` or `gksudo synaptic` they don't do anything. If I go to root and execute these commands or execute `sudo synaptic`, I see: sudo synaptic No protocol specified (synaptic:32377): Gtk-WARNING **: cannot open display: :0.0 **EDIT: @Nunoxic** I'm working on my local computer. When I do `sudo apt-get update` some stuff will be updated and some some stuff will not be updated `E: Some index files failed to download. They have been ignored, or old ones used instead.` I ran `sudo apt-get update` 2 days ago. when i do `echo $DISPLAY` the output is `:0` **@Gilles** the output of `echo $XAUTHORITY` is nothing at all:) the output of `sudo env | sort` is COLORTERM=gnome-terminal DISPLAY=:0.0 HOME=\/root LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_COLLATE=en_US.UTF-8 LC_CTYPE=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 LOGNAME=root MAIL=\/var\/mail\/root PATH=\/usr\/local\/sbin:\/usr\/local\/bin:\/usr\/sbin:\/usr\/bin:\/sbin:\/bin:\/usr\/X11R6\/bin SHELL=\/bin\/bash SUDO_COMMAND=\/usr\/bin\/env SUDO_GID=0 SUDO_UID=0 SUDO_USER=root TERM=xterm USERNAME=root USER=root the output of `sudo xterm` is No protocol specified Warning: This program is an suid-root program or is being run by the root user. The full text of the error or warning message cannot be safely formatted in this environment. You may get a more descriptive message by running the program as a non-root user or by removing the suid bit on the executable. xterm Xt error: Can't open display: %s **EDIT** the output of `XAUTHORITY=~\/.Xauthority; sudo xterm` is No protocol specified Warning: This program is an suid-root program or is being run by the root user. The full text of the error or warning message cannot be safely formatted in this environment. You may get a more descriptive message by running the program as a non-root user or by removing the suid bit on the executable. xterm Xt error: Can't open display: %s the output of `sudo -s9999 strace xterm` is sudo: invalid option -- '9' usage: sudo -h | -K | -k | -L | -V usage: sudo -v [-AknS] [-g groupname|#gid] [-p prompt] [-u user name|#uid] usage: sudo -l[l] [-AknS] [-g groupname|#gid] [-p prompt] [-U user name] [-u user name|#uid] [-g groupname|#gid] [command] usage: sudo [-AbEHknPS] [-C fd] [-g groupname|#gid] [-p prompt] [-u user name|#uid] [-g groupname|#gid] [VAR=value] [-i|-s] [] usage: sudo -e [-AknS] [-C fd] [-g groupname|#gid] [-p prompt] [-u user name|#uid] file ..."} {"id":"31595","title":"Are kernel threads really kernel processes?","text":"I've read in many places that Linux creates a kernel thread for each user thread in a Java VM. (I see the term \"kernel thread\" used in two different ways: 1. a thread created to do core OS work and 2. a thread the OS is aware of and schedules to perform user work. I am talking about the latter type.) Is a kernel thread the same as a kernel process, since Linux processes support shared memory spaces between parent and child, or is it truly a different entity?"} {"id":"108843","title":"Linux: How does hard-linking to a directory work?","text":"I'm aware that Linux does not allow hard-linking to a directory. I read somewhere, 1. that this is to prevent unintentional loops (or graphs, instead of the more desirable tree structure) in the file-system. 2. that some *nix systems do allow the root user to hard-link to directories. So, if we are on one such system (that does allow hard-linking to a directory) and if we are the root user, then how is the parent directory entry, `..`, handled following the deletion of the (hard-link's) target and its parent? a (200) \\-- . (200) \\-- .. (100) \\-- b (300) | \\-- . (300) | \\-- .. (200) | \\-- c (400) | \\-- . (400) | \\-- .. (300) | \\-- d (500) | \\-- H (400) _(In the above figure, the numbers in the parentheses are the inode addresses.)_ If `a\/H` is an (attempted) hard-link to the directory `a\/b\/c`, then 1. What should be the reference count stored in the inode 400: 2, 3, or 4? In other words, does hard-linking to a directory increases the reference count of the target directory's inode by 1 or by 2? 2. If we delete `a\/b\/c`, the `.` and `..` entries in inode 400 continue to point to valid inodes 400 and 300, respectively. But what happens to the reference count stored in inode 400 if the directory tree `a\/b` is recursively deleted? Even if the inode 400 could be kept intact via a non-zero reference count (of either 1 or 2 - see the preceding question) in it, the inode address corresponding to `..` inside inode 400 would still become invalid! Thus, after the directory tree `b` stands deleted, if the user changes into the `a\/H` directory and then does a `cd ..` from there, what is supposed to happen? **Note:** If the default file-system on Linux (ext4) does not allow hard- linking to directories even by a root user, then I'd still be interested in knowing the answer to the above question for an inode-based file-system that does allow this feature."} {"id":"33520","title":"What distribution for light weight server?","text":"I'm planning on setting up a VM linux box. It needs to be as light weight as possible - no need for GUI. Requirements: * It will be connected to VPN * It will be running maintenance scripts on mysql server every night and schedule backups. (we have custom java programs that doing all that maintenance stuff). Preference: - Debian (due to Apt and ease of maintenance) - RH (same as above with RPMs) What I have found so far: LUbuntu and Puppy. (DSL doesn't seem to be maintained anymore?) EDIT: Puppy - not what I'm after. Just tried it, its awesome as a USB stick desktop. Not lightweight server. Questions: Has anyone had any experience with those or perhaps similar requirements? Are there any better linux distros that are made especially to be lightweight servers?"} {"id":"479","title":"Keep SSH Sessions running after disconnection","text":"I sometimes have long running processes that I want to kick off before going home, so I create a SSH session to the server to start the process, but then I want to close my laptop and go home and later, after dinner, I want to check on the process that I started before leaving work. How can I do that with SSH? My understanding is that if you break your SSH connection you will also break your login session on the server, therefore killing the long running process..."} {"id":"90446","title":"How to run script using SSH from remote computer and avoid its interruption if remote computer goes offline","text":"I have a remote Linux server and I use it to run some very long tasks using SSH. It works great, but, of course, if the connection dies for some reason, the task dies. Specifically, I'm running something like this: [myName@localStation]$ ssh john_doe@myRemoteServer Password: ***** [john_doe@remoteServer]$ .\/myVeryLongTask.script > myOutputLog.txt Is there a way to tweak the SSH connection in such a way that, if the network connection fails, the task keeps running?"} {"id":"5528","title":"How can I make a process I start during an SSH session run after the session has ended?","text":"> **Possible Duplicate:** > Keep SSH Sessions running after disconnection. I have a process which is basically a web-server, I start it during an SSH session. However, when I leave the session (by closing the PuTTY windows), it stops running and responding to requests. This is true even if I end the command with a `&`. With Apache, I don't have this problem, it comes with a stop, a start, and a restart script. I'd like to create something like that for this program. How can I start a process, so that it will continue running even after I end the SSH session I started it in? Also how can I set it to restart itself if it stops for some reason? Thanks!"} {"id":"89483","title":"Keeping a process running after putty or terminal has been closed","text":"I'm running a `node.js` server off of a raspbian (Debian) machine, and I'd like to start and stop the server remotely. This for me means using `putty` to access the shell, except when I close out of the `putty` terminal or it times out my server goes down with it, because I just execute my server in the foreground. So I'm wondering if there's a way to keep it going but still have a way to kill the process afterwards."} {"id":"94385","title":"Is there a mechanism to run a \"service\" by a non-root user?","text":"Is there a way I can have a continuously running, background process that can be controlled by me (a regular, non-root user)? All I need to be able to do is start, stop and restart the process. Monitoring by PID and sending SIGHUP or SIGINT for termination is fine. I'm okay with using a complicated bash script, it doesn't have to be something system-wide. Just for me. I also really need it to not stop when I log off from ssh. Is there a way I can do this in RHEL 6.4?"} {"id":"131897","title":"Keeping a process running on server even SSH is closed","text":"I am running long program on server, which is basically Jar file of java program. I want to keep this program running even if SSH terminal is closed, how I can keep this program running on server?"} {"id":"137523","title":"Can I use a shell or python script to execute commands in a chroot?","text":"I need: to make a shellscript which can chroot into a linux environment and run a command there. I am using: arch-chroot (on the arch linux livecd)"} {"id":"145387","title":"Can't connect to local MySQL server through socket '\/var\/run\/mysqld\/mysqld.sock' (2)","text":"When I try to start MySQL it says \"failed!\", so I try using `mysqladmin ping` and get the following: mysqladmin: connect to server at 'localhost' failed error: 'Can't connect to local MySQL server through socket '\/var\/run\/mysqld\/mysqld.sock' (2)' Check that mysqld is running and that the socket: '\/var\/run\/mysqld\/mysqld.sock' exists!\" Why is the `mysqld.sock` file missing from my directory? I've checked everywhere, but I can't find it."} {"id":"155105","title":"Yum regular expression or wildchard search?","text":"Fedora documentation says: > 5.2. Advanced Searches > > If you do not know the name of the package, use the search or provides > options. Alternatively, use wild cards or regular expressions with any yum > search option to broaden the search critieria. Well, at first I thought that this is simply wrong or outdated, since no known syntax of regular expressions would work with `yum search`, but then I found this: `yum search [cl-*]` for example. But it does something otherworldly. It finds things which have neither \"c\" nor \"l\" letters in the name or description. (What I wanted is to find all packages, whose names would be matched by `cl-.*` regexp. I also found few people suggesting to pipe yum results to `grep`, which, of course, solves the problem. But, just on principle, I want to find out what did the thing in the square brackets do. What if `yum` actually can search by regexp?"} {"id":"41571","title":"What is the difference between $* and $@?","text":"Consider the following code: foo () { echo $* } bar () { echo $@ } foo 1 2 3 4 bar 1 2 3 4 It outputs: > 1 2 3 4 > > 1 2 3 4 I am using Ksh88, but I am interested in other common shells as well. If you happen to know any particularity for specific shells, please do mention them. I found the follwing in the Ksh man page on Solaris: > The meaning of $* and $@ is identical when not quoted or when used as a > parameter assignment value or as a file name. However, when used as a > command argument, $* is equivalent to ``$1d$2d...'', where d is the first > character of the IFS variable, whereas $@ is equivalent to $1 $2 .... I tried modifying the `IFS` variable, but it doesn't modify the output. Maybe I'm doing something wrong?"} {"id":"55385","title":"Where to download Fedora 16","text":"I am having a really hard time finding a place to download Fedora 16 64 bit distribution are there still places that have links up for 16th version instead of 17? A Virtual image for VirtualBox would be good as well."} {"id":"91046","title":"Search for mail content with mutt","text":"Is it possible to use to search for specific mail content using built-in functionality of Mutt? Or, as last resort, how can I configure `grep` to be used in Mutt ? The documentation only mentions the `search` and `limit` functions, which only search headers."} {"id":"124452","title":"Arch Linux not picking up static DHCP lease from DD-WRT","text":"I have a Arch Linux system on my home network and its MAC address is setup in my Linksys running DD-WRT to receive a static lease. However, this system is not getting the static lease from the DD-WRT, but rather a random ip from the dynamic pool. I tried various things, like forcing a lease renewal, but to no avail. How should I go about troubleshooting this problem? Running Arch Linux 201404 with a wired connection. I am new to Arch, but been a long time Debian user, so the Arch `ip` toolset is not too familiar to me."} {"id":"82909","title":"GNU screen, tmux, dvtm - none work as ordinary user","text":"I bought cheapest vps for teamspeak hosting and I have strange issues with demonizing it's process. None of screen tmux and dvtm work for ordinary user, but they work witout a charm for root. As far as i know running server apps from root is not very wise. No errors are generated, I could not find any logs. screen -> instant [screen is terminating] dvtm -> instant hang, I need to reconnect ssh tmux -> this imageshack.us\/photo\/my-images\/39\/i59a.png\/ @edit ok, here's the sollution `chmod 666 \/dev\/ptmx`"} {"id":"115489","title":"\/sys\/class filesystem on Linux","text":"On Linux (Ubuntu 11.10 on a ARM processor in my case) I was looking for a way to measure CPU temperature. I found out that a cat \/sys\/class\/thermal\/thermal_zone0\/temp did the trick. Now I wonder: what is the \/sys\/class filesystem meant for?"} {"id":"129432","title":"VNC Server without X Window System","text":"Will a VNC server work without X Server installed? I know vnc works with X Server, but what about without it?"} {"id":"81908","title":"Print arguments to printf in no particular order","text":"How can I refer back to arguments to `coreutil`'s `printf` in no particular order? This is what I want to avoid: $ printf '%s %s %s %s %s %s %s' a c a c b c a a c a c b c a This is what I would like to do: $ printf '%s %s³ %s¹ %s³ %s² %s³ %¹' a b c a c a c b c a This is how to do it with Perl. perl -e 'printf (\"%s %3\\$s %1\\$s %3\\$s %2\\$s %3\\$s %1\\$s\\n\", 'a', 'b', 'c');' a c a c b c a Notice only four arguments are passed to `printf`."} {"id":"77049","title":"How do I change the screen font size when using a virtual terminal","text":"Using LDXE and Ubuntu, I can log into a virtual terminal via CTRL+ALT+F1. The text is far too small. How do I change the screen resolution to get a larger font?"} {"id":"105767","title":"Chromium OS Compiling Path","text":"![enter image description here](http:\/\/i.stack.imgur.com\/u4PzP.png) After following the steps at the Chromium OS Developer site, I would like to know how I could add the path to my .bashrc file so I could make it permanent? I am using Ubuntu 13.10"} {"id":"27352","title":"Update Linux Path permanently","text":"> **Possible Duplicate:** > How do I set a user environment variable? (permanently, not session) How can I permanently modify the PATH variable in Ubuntu? Is it possible to do it without modifying any files? I currently use `export PATH=${PATH}:\/usr\/local\/cuda\/bin` but each time I open a new terminal I have to type it again."} {"id":"42033","title":"Network Printing in Fedora","text":"I´m having problems setting up network printing in Fedora 16. In the printer setup box it says FirewallD is not running and gives a list of protocols that need to be enabled. I cannot find a FirewallD but have gone into Firewall and enabled the protocols. There is obviously something I´m missing. The printer is a Canon MP970 and is connected to a Windows machine. **Update: 4Nov12** Bought a new printer - same problem. This time I set it up properly as a network printer. Windows 7 and Ubuntu both find the printer and print fine. Fedora still complains FirewallD is not running. The new printer is a Canon MG6250. I have installed the drivers from RPM packages."} {"id":"42037","title":"Is openwrt difficult to use for a novice?","text":"**Background** I am very interested in openwrt, I like that it's open source and gives you complete, granular control over your router. I'm going to use my router for a home network (with a nas, htpc and desktop), so the functionality I'm looking for is pretty basic. I'm leaning towards openwrt (instead of ddwrt) because I've read that the code of ddwrt is rather messy compared to openwrt. **Problem** However, seeing the information online leads me to believe that it is not very easy to get started with, and that part of its use takes place on the command line. I am not a linux user (am going to be soon though), so I don't have a lot of experience with the command line. I love to learn new things, and am willing to expend some effort to get everything working, but am I biting off more than I can chew with openwrt as a novice? **Question** So my question is; is openwrt difficult to learn as a novice? Will it take a lot of time? Can anyone with experience in this area give me some feedback?"} {"id":"6689","title":"Prevent non-root user from formatting a partition","text":"Few days back I mistakenly formatted a partition on my external hard drive by clicking Format from the Context menu in Computer. I want to know that how can I prevent non-root user from being able to do so. At the same time I need the non-root user to be able to read and write on the partition. I use Fedora 14. Thanks."} {"id":"3037","title":"Is there an easy way to replace duplicate files with hardlinks?","text":"I'm looking for an easy way (a command or series of commands, probably involving `find`) to find duplicate files in two directories, and replace the files in one directory with hardlinks of the files in the other directory. Here's the situation: This is a file server which multiple people store audio files on, each user having their own folder. Sometimes multiple people have copies of the exact same audio files. Right now, these are duplicates. I'd like to make it so they're hardlinks, to save hard drive space."} {"id":"5123","title":"How to de-unzip, de-tar -xvf -- de-unarchive in a messy folder?","text":"Usually, I unarchive things by `$ mkdir newFolder; $ mv *.zip newFolder; $ cd newFolder; $unzip *.zip` but sometimes I get lazy and just do in an arbitrary folder `$ unzip *.zip` so time-to-time messing up with other content. Before you say that my brains are missing, I will list here some methods -- some archive version surely have crappy-flags while others more spartan, I am more interested about the latter but feel free to share any way. **Some ways to de-unarchive, are there others?** 1. `$ find . -anewer fileThatExistedBeforeUnarchieving -ok rm '{}' \\;` Weaknesses are that it lists the `*.zip` dirs, so you need to use slow `-ok`, slow with many `*.zip` matches and, for some reason, it does not seem to match everything extracted. 2. If small amount of extracted files, one-by-one, slow, cumbersome and error-prone. 3. When I want to make sure whether the content of the archieve is actually a folder, I sometimes check it with `$ unzip -l *.bsd`, works at least in obsd`s unzip-version. If you are referring to certain archiving tools, please, state them when appropriate. Keep it simple though -- I am more interested about the WAYS how you do it, rather than a single tool."} {"id":"25005","title":"Remove accidentally extracted files","text":"> **Possible Duplicate:** > How to de-unzip, de-tar -xvf -- de-unarchive in a messy folder? This is a pretty annoying occurrence. Sometimes, I download an archive (`tar.gz, tar.bz2, zip, rar, etc`) and run `tar xf [file]` (or similar) in the file's directory. In rare occasions, all the files extract in the current working directory instead of a sub-directory. This can lead to hundreds of files and hundreds of patterns that can't simply be removed using a pattern matching solution. Is there a way to get the file contents of an archive and then delete all files on that list in the current working directory?"} {"id":"24016","title":"How to undo an unrar?","text":"> **Possible Duplicate:** > How to de-unzip, de-tar -xvf -- de-unarchive in a messy folder? I just extracted a RAR archive that contained a lot of files in the base directory. Assuming that there were no filename collisions, what's the easiest way to remove the files just created? Parsing `unrar -l` seems troublesome due to filename variety."} {"id":"121384","title":"I'm trying to install steam on debian jessie\/sid but I'm getting unresolved dependencies","text":"I'm following the debian wiki on installing steam but I keep getting dependency issues. Debian tells me to edit my sources.list to: deb http:\/\/http.debian.net\/debian\/ jessie main contrib non-free My sources.list looks like this: Debian GNU\/Linux jessie\/sid \\n \\l # deb http:\/\/ftp.uk.debian.org\/debian\/ jessie main contrib non-free deb-src http:\/\/ftp.uk.debian.org\/debian\/ jessie main contrib non-free #deb http:\/\/ftp.uk.debian.org\/debian wheezy main #deb http:\/\/security.debian.org\/ wheezy\/updates main non-free #deb-src http:\/\/security.debian.org\/ wheezy\/updates main contrib non-free # wheezy-updates, previously known as 'volatile' #deb http:\/\/ftp.uk.debian.org\/debian\/ wheezy-updates main contrib non-free #deb-src http:\/\/ftp.uk.debian.org\/debian\/ wheezy-updates main contrib non-free My unresolved dependencies look like: Keep the following packages at their current version: 1) gcc-4.8-base:i386 [Not Installed] 2) libc6:i386 [Not Installed] 3) libc6-i686:i386 [Not Installed] 4) libdrm-intel1:i386 [Not Installed] 5) libdrm-nouveau2:i386 [Not Installed] 6) libdrm-radeon1:i386 [Not Installed] 7) libdrm2:i386 [Not Installed] 8) libelf1:i386 [Not Installed] 9) libexpat1:i386 [Not Installed] 10) libffi6:i386 [Not Installed] 11) libgcc1:i386 [Not Installed] 12) libgl1-mesa-dri:i386 [Not Installed] 13) libgl1-mesa-glx:i386 [Not Installed] 14) libglapi-mesa:i386 [Not Installed] 15) libllvm3.3:i386 [Not Installed] 16) libpciaccess0:i386 [Not Installed] 17) libstdc++6:i386 [Not Installed] 18) libtxc-dxtn-s2tc0:i386 [Not Installed] 19) libx11-6:i386 [Not Installed] 20) libx11-xcb1:i386 [Not Installed] 21) libxau6:i386 [Not Installed] 22) libxcb-dri2-0:i386 [Not Installed] 23) libxcb-glx0:i386 [Not Installed] 24) libxcb1:i386 [Not Installed] 25) libxdamage1:i386 [Not Installed] 26) libxdmcp6:i386 [Not Installed] 27) libxext6:i386 [Not Installed] 28) libxfixes3:i386 [Not Installed] 29) libxxf86vm1:i386 [Not Installed] 30) steam:i386 [Not Installed] 31) zlib1g:i386 [Not Installed] Leave the following dependencies unresolved: 32) libgl1-mesa-glx:i386 recommends libgl1-mesa-dri:i386 (>= 7.2) I think this could be something to do with `# dpkg --add-architecture i386` but nothing seems to happen when I run the command. Help appreciated. **Edit:** root@Wheezy:\/# apt-get install steam Reading package lists... Done Building dependency tree Reading state information... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation: The following packages have unmet dependencies: steam:i386 : Depends: libc6:i386 (>= 2.12) but it is not going to be installed Depends: libstdc++6:i386 (>= 4.3) but it is not going to be installed Depends: libx11-6:i386 but it is not going to be installed Depends: libgl1-mesa-dri:i386 but it is not going to be installed Depends: libgl1-mesa-glx:i386 but it is not going to be installed Depends: libtxc-dxtn-s2tc0:i386 but it is not going to be installed E: Unable to correct problems, you have held broken packages. **Edit:** root@Wheezy:\/# dpkg --print-architecture amd64 root@Wheezy:\/# dpkg --print-foreign-architectures i386 **Edit:** root@Wheezy:\/# apt-cache policy libc6:i386 libstdc++6:i386 libx11-6:i386 libgl1-mesa-dri:i386 libgl1-mesa-glx:i386 libtxc-dxtn-s2tc0:i386 steam:i386 libc6:i386: Installed: (none) Candidate: 2.18-4 Version table: 2.18-4 0 500 http:\/\/ftp.uk.debian.org\/debian\/ jessie\/main i386 Packages libstdc++6:i386: Installed: (none) Candidate: 4.8.2-16 Version table: 4.8.2-16 0 500 http:\/\/ftp.uk.debian.org\/debian\/ jessie\/main i386 Packages libx11-6:i386: Installed: (none) Candidate: 2:1.6.2-1 Version table: 2:1.6.2-1 0 500 http:\/\/ftp.uk.debian.org\/debian\/ jessie\/main i386 Packages libgl1-mesa-dri:i386: Installed: (none) Candidate: 9.2.2-1 Version table: 9.2.2-1 0 500 http:\/\/ftp.uk.debian.org\/debian\/ jessie\/main i386 Packages libgl1-mesa-glx:i386: Installed: (none) Candidate: 9.2.2-1 Version table: 9.2.2-1 0 500 http:\/\/ftp.uk.debian.org\/debian\/ jessie\/main i386 Packages libtxc-dxtn-s2tc0:i386: Installed: (none) Candidate: 0~git20131104-1.1 Version table: 0~git20131104-1.1 0 500 http:\/\/ftp.uk.debian.org\/debian\/ jessie\/main i386 Packages steam:i386: Installed: (none) Candidate: 1.0.0.45-1 Version table: 1.0.0.45-1 0 500 http:\/\/ftp.uk.debian.org\/debian\/ jessie\/non-free i386 Packages root@Wheezy:\/# **Edit:** root@Wheezy:\/# apt-cache policy Package files: 100 \/var\/lib\/dpkg\/status release a=now 500 http:\/\/ftp.uk.debian.org\/debian\/ jessie\/non-free Translation-en 500 http:\/\/ftp.uk.debian.org\/debian\/ jessie\/main Translation-en 500 http:\/\/ftp.uk.debian.org\/debian\/ jessie\/contrib Translation-en 500 http:\/\/ftp.uk.debian.org\/debian\/ jessie\/non-free i386 Packages release o=Debian,a=testing,n=jessie,l=Debian,c=non-free origin ftp.uk.debian.org 500 http:\/\/ftp.uk.debian.org\/debian\/ jessie\/contrib i386 Packages release o=Debian,a=testing,n=jessie,l=Debian,c=contrib origin ftp.uk.debian.org 500 http:\/\/ftp.uk.debian.org\/debian\/ jessie\/main i386 Packages release o=Debian,a=testing,n=jessie,l=Debian,c=main origin ftp.uk.debian.org 500 http:\/\/ftp.uk.debian.org\/debian\/ jessie\/non-free amd64 Packages release o=Debian,a=testing,n=jessie,l=Debian,c=non-free origin ftp.uk.debian.org 500 http:\/\/ftp.uk.debian.org\/debian\/ jessie\/contrib amd64 Packages release o=Debian,a=testing,n=jessie,l=Debian,c=contrib origin ftp.uk.debian.org 500 http:\/\/ftp.uk.debian.org\/debian\/ jessie\/main amd64 Packages release o=Debian,a=testing,n=jessie,l=Debian,c=main origin ftp.uk.debian.org Pinned packages:"} {"id":"10168","title":"Mass .flac --> .mp3 transcoding: How to write a shell script that preserves ID3 tag information?","text":"In recent weeks I've gone from a fairly 'hands-on' approach to .flac --> .mp3 transcoding, to one that's far more 'set & forget'. The first step was to stop using a GUI front end (Audacity with a LAME plug- in) and instead use the method I outlined here. The second step was to find a bash shell script that would tell that command loop to work recursively, allowing directories with many subdirectories containing .flac files to be transcoded in one simple step. That answer was provided by a user at askubuntu.com. Now I wish to learn how to further refine things so that ID3 tag information is preserved. The methods linked to above strip ID3 tag data, leaving the bare minimum (i.e. only the title field remains). Can anyone teach me how to write such a shell script? Many thanks in advance. * * * The shell script has been updated thus: #!\/bin\/bash file=\"$1\" flac -cd \"$file\" | lame --preset fast extreme - \"${file%.flac}.mp3\" id3cp \"$file\" \"${file%.flac}.mp3\" Doing `find . -name '*.flac' -exec ~\/bin\/flac2mp3 '{}' \\;` in ~\/Desktop\/stack gives the following output: 01 - Amon Tobin - Chomp Samba.flac: done LAME 3.98.4 64bits (http:\/\/www.mp3dev.org\/) Using polyphase lowpass filter, transition band: 19383 Hz - 19916 Hz Encoding to .\/01 - Amon Tobin - Chomp Samba.mp3 Encoding as 44.1 kHz j-stereo MPEG-1 Layer III VBR(q=0) Parsing .\/01 - Amon Tobin - Chomp Samba.flac: done. Copying to .\/01 - Amon Tobin - Chomp Samba.mp3: done `id3info` for the original .flac and resultant .mp3 gives, respectively: *** Tag information for 01 - Amon Tobin - Chomp Samba.flac (i.e. nothing); *** Tag information for 01 - Amon Tobin - Chomp Samba.mp3 *** mp3 info MPEG1\/layer III Bitrate: 128KBps Frequency: 44KHz The .flac definitely has tag information. I can verify this by opening up EasyTAG. EasyTAG refers to this as 'FLAC Vorbis Tag' but 'ID3 Tag' for the .mp3. Is this the problem?"} {"id":"14880","title":"Rip an audio CD 1:1","text":"Is there a way to rip an audio CD to an ISO9660 file? I've tried simple things like `dd` in the past and it hasn't worked. I'd like to essentially have a mirror image of exactly what's on the disk, not even necessarily a folder of WAV files. I do understand that I could rip the CD to WAV files or even FLAC files, but is there a way to just duplicate the disc to one file, so I could extract WAVs or FLACs from it later on? The idea is to be able to make a virtually identical copy of the source media."} {"id":"95939","title":"How exactly do I create a sed script and use it to edit a file?","text":"I know how to edit a file using sed one step at a time, but how would I create an actual sed script and then use it on the file to do the same things that the individual sed commands would do? For example these 3 sed commands: > sed -i '4i\\ ' baconFile > > sed -i 's\/,\/\\t\\t\/' baconFile > > sed -i 's\/,\/ \/' baconFile"} {"id":"45264","title":"Grub fails after install it on my macbook pro","text":"I'm trying to install Archlinux on my macbook in dual boot mode. I part the disk that way : \/dev\/sda1 -> EFI \/dev\/sda2 ->MacOS \/dev\/sda3 -> \/boot \/dev\/sda4 -> \/ \/dev\/sda5 -> \/home As i read in the docs i don't install grub on my MBR, i put it in sda3 - the boot partition. I did it with a Ubuntu Live Cd and the command : sudo grub- install --boot-directory=\/media\/boot_partition \/dev\/sda3 --force When i reboot my mac i can choose the Linux partition with rEFIT. But it only show the GRUB minimal bash... grub> I tried to fix it up, but nothing really works."} {"id":"45269","title":"Regarding the server distributions","text":"I am confused as to what defines a \"server\" distribution against a normal, desktop distribution. What I mean is that if you wanted a corporate server, you might be able to pick just about any linux distro and go, however for some reasons to which I appear to be oblivious to, you might want to roll with `SUSE Enterprise, or RED HAT Enterprise`. Why would someone want to choose a specific server distribution? Is it because of the support offered by the companies behind them? Is it that these companies often include proprietary tools in their distros, not normally found in others, to give them an edge? Is it something else? Please help me clarify things in my mind. Thank you in advance."} {"id":"85706","title":"Why can't pgrep find scripts started via env?","text":"For example: $ cat foo.sh #!\/usr\/bin\/env bash while true; do sleep 1 ; done $ .\/foo.sh & $ pgrep foo.sh $ Contrast with: $ cat bar.sh #!\/bin\/bash while true; do sleep 1 ; done $ .\/bar.sh & $ pgrep bar.sh 21202 The process started by `env bash` shows up in the output of `ps aux` as: terdon 4203 0.0 0.0 26676 6340 pts\/3 S 17:23 0:00 \/bin\/bash while the one started with `\/bin\/bash` shows as terdon 9374 0.0 0.0 12828 1392 pts\/3 S 17:27 0:00 \/bin\/bash .\/bar.sh which probably explains why it the first is not being caught by `pgrep`. So, questions are: * Why does the name of the script not show up when called through `env`? * Does `pgrep` simply parse the output of `ps`? * Is there any way around this so that `pgrep` can show me scripts started via `env`?"} {"id":"80953","title":"change shell in Solaris\/SunOS for your user only wihtout access to \/etc\/passwd","text":"How do I set the shell in Solaris\/SunOS for my user only, without access to `\/etc\/passwd` or any other `su` stuff? It should thereafter work both for interactive `ssh` (1) and `ssh` when you send commands (2). `uname -a` says `SunOS ... 5.10 Generic_148889-04 i86pc i386 i86pc` **Edit in response to comments and answers** There is no `chsh`. I can't do `\/usr\/bin\/passwd -e` - permission denied. The default shell is bash. I would like zsh. I already tried to set the `SHELL` environment variable manually, and start the shell manually in the `.profile` file, only this doesn't work for my **second case** (2): `ssh user@host command` will run `command` in bash. As compared to getting my preferred shell when I login, it is minor, so the workaround is certainly worth mentioning, only, my intention with this question was to get it right the right way. Because it just relates to one user, I thought it was doable without involving the SA, but now I'm less certain. (But any workaround that solves (1) and (2) is cool, for sure.)"} {"id":"44138","title":"Replacing Mac OSX with Linux Distro, or FreeBSD","text":"I have a Macbook Pro 8,2 and really want to make the switch to something a little less stubborn and a little more flexible than the proprietary Mac OS X. I am a bit frustrated with MacPorts lately and Homebrew. I also would like to make the transition to a tiling window manager such as Awesome, RatPoison, or Xmonad. In the past I have had problems getting the Mac's wireless card working as well as setting up the EFI installer to boot to GRUB or LILO. So, I am curious if anyone here has had any experiences with running a Linux Distro like Slackware, Archlinux, Debian or a Unix OS such as FreeBSD on their MacBook Pro."} {"id":"84252","title":"How to start a service automatically, when Ubuntu starts?","text":"I am using Ubuntu 12.04 and want to have a service starting, when the system is booted normally. As 'service' I understand some code, for example cd my_directory; my_command -host 0.0.0.0 -port 1234 -arg x that just should be running as if it has been started on the command line. There are services to be started as normal user, but also services to be started as root (in fact, it is not required the services to be run on user level). I also require to configure the behavior when a 'service' stops. I want them to be restarted in my case, with the same argument, in a specified directory. All of the services should be started automatically when the system is started normally, i.e. if the power switch is pressed. No other action should be required. There are some documents spread on the internet, but they all confuse me. They talk about `init`, `init.d`, `rc.d`, but I never saw a simple-to-follow step- by-step instruction to easily as a service using e.g. upstart. If this is easy, I would appreciate if those steps are given here."} {"id":"84254","title":"Running Open Vas via KALI Linux","text":"We would like to run open-vas penentration test on a remote server and would no like to install it on the remote machine. Thus we have setup a Kali Linux Live machine for this purpose. So we first went into open-vas setup and towards the end we capture as below. sent 1953267 bytes received 3317820 bytes 71715.47 bytes\/sec total size is 159182950 speedup is 30.20 [i] Checking dir: ok [i] Checking MD5 checksum: ok Stopping OpenVAS Manager: openvasmd. Stopping OpenVAS Scanner: openvassd. All plugins loaded Starting OpenVAS Scanner: openvassd. Starting OpenVAS Manager: openvasmd. Restarting OpenVAS Administrator: openvasad. Restarting Greenbone Security Assistant: gsad. Enter password: ad main:MESSAGE:30553:2002-01-01 00h34.24 UTC: No rules file provided, the new user will have no restrictions. ad main:MESSAGE:30553:2002-01-01 00h34.24 UTC: User admin has been successfully created. Next went to setup openvas-gsd I try to login but then I read at the site it says this \"Note: that the scan engine must have OMP support enabled for the given port for a successful connection? What should I do here?"} {"id":"1606","title":"dash compatibility to bash","text":"Wikipedia says that `dash` executes faster than `bash`. My question is, if I set `\/bin\/sh` to `dash`, will all scripts that use `\/bin\/sh` in their shebang line that was intended for `bash` work under `dash`?"} {"id":"134787","title":"How to set the tab name to an alias hostname of the remote host I'm connected to?","text":"As you might know, by default, the hostname of an AWS instance is something like `ip-12-34-56-78.us-west-2.compute.internal`, so when I ssh to this host, the tab name is changed to `root@ip-12-34-56-78` (a bit of difficult for me to identify which is which). Since I have the following in the `~\/.ssh\/config`: Host mail.domain.com Hostname 1.2.3.4 User root Host web.domain.com Hostname 5.6.7.8 User root I'm wondering that is there any way to change the tab name to the \"alias\" hostname of the remote host I'm connected to (instead of the \"real\" hostname): ![iTerm tab title when ssh](http:\/\/i.stack.imgur.com\/DfWwp.png) * * * My current `PS1` settings: PS1='[\\u@\\h \\W$(__git_ps1 \" (%s)\")]\\$ ' I have tried to add a ssh wrapper into `~\/.bashrc`: ssh() { echo -ne \"\\033]0;${@: -1}\\007\" exec ssh $@ } then `. ~\/.bashrc` and test by running `ssh web.domain.com`: * while **connecting** : the tab name is changed to `web.domain.com`, as expected * when **connected** : it is overwritten with `root@ip-5-6-7-8` Why? Is there something related to `PS1` here? * * * **UPDATE Fri Jun 6 21:58:04 ICT 2014** There is something quite strange going on: looks like this only happened with AWS instance. With other hosts, the tab name remain after logging in. `PS1` on the AWS instance: # echo $PS1 [\\u@\\h \\W]\\$ `PS1` on the other hosts: ~ echo $PS1 \\[\\]\\[\\][\\[\\]\\t\\[\\]] \\u\\[\\]@\\[\\]\\h\\[\\]\\[\\]:\\[\\]\\w\\[\\] \\[\\] I also have tried to set the `PS1` variable on the AWS to the value of working host but it didn't help."} {"id":"134783","title":"My Red Hat 6.4 goes once more in sleep after wake up","text":"When I wake up my Red Hat 6.4 desktop it goes into sleep mode once again and when I restart my machine it never restarts again, after a shutdown just the LED lights are on so in this case I have to down the power and once again have to restart my PC. And one more when I shutdown or restart network configuration from `\/etc\/resolv.conf` clean out and I have to make entry in this file after every shutdown."} {"id":"40304","title":"fprintd-enroll works with right-index finger only","text":"When I try any other finger with: %> fprintd-enroll left-index-finger Using device \/net\/reactivated\/Fprint\/Device\/0 failed to claim device: Not Authorized: net.reactivated.fprint.device.setusername It doesn't work for me; But if I don't specify finger (which uses right-index by default): %> fprintd-enroll Using device \/net\/reactivated\/Fprint\/Device\/0 Enrolling right index finger. It works Running on Arch Linux , and packages installed from aur: fprintd 0.4.1-4 libfprint 0.4.0-3 **UPDATE** %> fprintd-enroll -f left-index-finger Using device \/net\/reactivated\/Fprint\/Device\/0 Enrolling right index finger."} {"id":"46621","title":"What process created this window with no PID associated?","text":"> **Possible Duplicate:** > What process created this X11 window? I need to kill a process that spawned a window which seems to have no PID associated with it. At least that is what xdotool says: ~$ xdotool getwindowpid 79691780 window 79691780 has no pid associated with it. `wmctrl -lp` prints `0x04c00004 0 0 N\/A Window name` `xprop _NET_WM_PID` says `_NET_WM_PID: not found.` The solutions in What process created this X11 window? don't work. I'm out of ideas, is there really now way of telling which process owns this window?"} {"id":"45885","title":"How to install KDE on Debian 6?","text":"I have GNOME 2.30.2 that came with my default Debian installation. I have the following Debian installation: Distributor ID: Debian Description: Debian GNU\/Linux 6.0.5 (squeeze) Release: 6.0.5 Codename: squeeze I want to install some other desktop environment. What is the procedure for installing KDE or Xfce on Debian 6?"} {"id":"94814","title":"Arch Linux install doesn't boot","text":"I've got Arch Linux mostly installed, and I seem to have installed GRUB with no problem. My partition table looks like this: cgdisk 0.8.7 Disk Drive: \/dev\/sda Size: 625142448, 298.1 GiB Part. # Size Partition Type Partition Name ------------------------------------------------------------------ 1007.0 KiB free space 1 15.0 GiB Linux filesystem root 2 1007.0 KiB BIOS boot partition bios 17.0 KiB free space 3 283.1 GiB Linux filesystem home After partitioning my drive like this, I ran: root@archiso ~ # arch-chroot \/mnt \/bin\/zsh root@archiso [02:19:45] [\/] -> # grub-install --target=i386-pc --recheck \/dev\/sda Installation finished. No error reported. However, when I boot, I get GRUB _ The underscore blinks, but I can't type anything. I still have access to the Arch installation by using the original install disk and `chroot`ing into it, but obviously I don't want to do this every time I start up my laptop. What could possibly be preventing me from booting properly? I've made sure my partitions conform to what the GRUB page says I need, but to no avail. For reference, I'm using the Arch Beginner's Guide and I've chronicled the epic story of how I spent my Saturday on my wiki."} {"id":"94810","title":"How do I drop to a shell after exiting a command I started by scripting tmux?","text":"I'm following this tutorial for scripting the creation of tmux windows. tmux new-window t $SESSION:0 -k -n MAIN 'cd ~\/main\/ && perl -Ilib myapp' sometimes I kill myapp after I've started tmux, I want to drop back to a shell in that directory, but instead this kills the window entirely. What is the best way to fix this? I think at least one answer involves running a shell and having that shell run commands, but I'm not sure on the best way to accomplish that."} {"id":"109466","title":"Linux Source Routing with one gateway","text":"I've a Linux box which have IP 10.1.1.100\/24 on eth0 with gateway 10.1.1.1 and as well as 20.1.1.1 on eth0:1 and 20.1.1.2 on eth0:2 . Is there any way that I could communicate to a remote machine having IP 192.168.1.1 using 20.1.1.1 or 20.1.1.2 ? I've only one gateway and one physical interface to out my traffic however 20.1.1.2 is accessible from 192.168.1.1 but traffic out only from 10.1.1.100 when I try to communicate to 192.168.1.1 from my server. Linux Box ( eth0 IP: 10.1.1.100 GW: 10.1.1.1 \"eth0:1 20.1.1.2\") ------- | Internet | ------ RemoteMachine ( eth0 IP: 192.168.1.1 ) in the above example I've public IPs on both local and remote machines so therefore remote machine can communicate to 20.1.1.2 using same gateway of 10.1.1.100 which is 10.1.1.1 I want to get some services from remote machine using IP 20.1.1.2 but when i try to communicate to remote machine IP 10.1.1.100 goes out to communicate to it. Regards,"} {"id":"134003","title":"Python3 error “no module named bluetooth” on Linux Mint","text":"I am trying to connect my Lenovo S10E to a Nintendo Wiimote via bluetooth. I am using a simple Python script, reproduced below. I am calling it from the Linux Mint (version 16, \"Petra\") command line using `python3 find_wii.py` My goal is to connect a wiimote to Mint, then output MIDI (eventually). I am using Python due to its cross-platform advantages. Script: import bluetooth target_name = \"Nintendo RVL-CNT-01\" target_address = \"00:1C:BE:29:75:7F\" nearby_devices = bluetooth.discover_devices() for bdaddr in nearby_devices: if target_name == bluetooth.lookup_name( bdaddr ): target_address = bdaddr break if target_address is not None: print(\"found target bluetooth device with address \"), target_address else: print(\"could not find target bluetooth device nearby\") I am receiving the error Traceback (most recent call last): File \"find_wii.py\", line 1, in import bluetooth ImportError: No module named 'bluetooth' I have installed bluez and python wrappings for it (`sudo aptitude install python-bluez`). I have upgraded my system (`sudo apt-get update`, `sudo apt- get upgrade`). I did consulted Google, and the only official bugs I could find are here and here, and neither of the answers worked for me. How can I get the Bluetooth module to work with Mint? [Note: Question cross-posted to stackoverflow]"} {"id":"89714","title":"Easy way to determine virtualization technology","text":"I have command line access to a Linux machine which may or may not be virtualized. I want to determine what kind of virtualization technology it runs on, if any (VMWare, VirtualBox, KVM, OpenVZ, Xen, ). This isn't a hostile environment: I'm not trying to work against a VM that is trying to disguise itself, I'm diagnosing a flaky server that I know little about. More precisely, I'm helping someone diagnose the issue, I'm not sitting at the helm. So I have to convey instructions like “copy-paste this command” and not “poke around `\/proc` somewhere”. Ideally, it would be something like `lshw`: an easily-installable (if not preinstalled) command that does the poking around and prints out relevant information. What's the easiest way of determining what virtualization technology this system may be a guest of? I'd appreciate if proposals mentioned which technologies (including bare hardware) can be conclusively detected and which can be conclusively eliminated. I'm mostly interested in Linux, but if it also works for other unices that's nice."} {"id":"94643","title":"Indentifying a linux container","text":"Is there a simple way to identifying a linux container?, just like with a xenserver vm you can input the command uname -a and the result contains the word \"xen\". Linux hostname 2.6.18-348.6.1.el5xen #1 SMP Tue May 21 16:10:52 EDT 2013 x86_64 x86_64 x86_64 GNU\/Linux So is there a command or particular function to do this? Thanks!"} {"id":"95953","title":"How to find out which virtualisation technology is used on Linux VPS server?","text":"I have access to some Debian Linux vps servers, however I cannot access their controls panel directly: only server administrator himself can do that. Is there any way to find out what visualization technology is used on server from inside VPS? I need it only to know which kernel header package should I install (xen, openvz or any other)."} {"id":"91229","title":"How to check which hypervisor is used from my VM?","text":"So I'm running a VM somewhere and want to know what hypervisor the host is running. Any way to check whether it's running KVM or in a container? The vm is running Ubuntu"} {"id":"118791","title":"Run one screensaver across multiple monitors","text":"Is there a way to make `xscreensaver` run a single screen saver across the whole X display, ignoring Xinerama\/XRANDR geometry? I have three monitors appearing as a single X screen on one X display. XRANDR provides information about where each physical monitor starts and ends on the single X screen. `xscreensaver` uses this to either run a different screen saver on each monitor, or to run the same screen saver three times, once for each monitor. I would like to change this so that only one screen saver is run, and it spans all three monitors (i.e. it takes up the entire X screen.) This way animations in the screen saver will be free to roam from one monitor to the next. Is this possible?"} {"id":"29129","title":"Unmounting HTC device takes forever","text":"Not sure if should post this on Android SE because I don't think this is directly related to the Android OS. On my system I manually `mount` and `umount` my HTC device with these options in `\/etc\/fstab`: UUID=3465-3762 \/mnt\/htc auto gid=100,umask=002,noauto,user,rw,exec 0 0 This works fine when modifying small amounts of data on the SD card, but whenever I copy e.g. a couple of music albums encoded in FLAC from another device - unmounting the SD card seems to take forever: $ time umount \/mnt\/htc\/ real 1m17.195s user 0m0.000s sys 0m0.237s Is this time proportional to the amount of data modified? Should it take this long to unmount it anyway?"} {"id":"7349","title":"Youtube Videos become Choppy When Maximised [Ubuntu Maverick]","text":"I just installed 32-bit Ubuntu Maverick 10 Stable everything is working fine, The system spec's are as below: 3 Ghz Intel DG101 512 MB RAM 80 GB HDD 256 MB Ati Radeon Xpress the only problem is when the Youtube videos are maximized they consume allot of CPU plus video bacomes slower and choppy..... What to do? I have FireFox and installed the FlashPlayer 10 also. But no luck...Any Ideas how to fix? The videos work absolutely good in XP in same computer..... I have tried Google Chrome also but no luck in that also.... Any answer 'll be appreciated."} {"id":"119123","title":"How do I make sure that a script is run exclusively?","text":"So I have a bash scripts that does some things (pull from github, delete folders .. etc ..) pretty basic stuff. I usually run it whenever I need a new version of the web app on the server. The thing is there isn't anything that stopping this script from running simultaneously by different people (almost all developers connect to this server and they execute the same command). So far, it didn't happen that the script is run by more than 1 developer at a time. How do I make sure that this script cannot be run if it's already running by another user? Folder locking or checking if the script is running by another user (is this doable?) something else? All users that can run this script are sudoers. EDIT: Well after checking my colleagues turns out that not all of them are using the script .. some of them are executing the commands by hand so I need to lock the folder itself."} {"id":"120314","title":"lockfile-progs utilities usage","text":"**There isanother question that is related, but it is actually different, because I'm asking why the behavior of lockfile-create & lockfile-touch is different to the current contents of the manual page.** I have this script to learn and understand the lockfile-progs utilities. I've tested it and works good. But, I find the lines related to lockfile-touch unnecessary. My script only needs to launch one xterm instance on one machine per user. I will do the right thing removing the lockfile-touch lines? Someone knows if I will have some trouble with the modified script? #!\/bin\/bash function atexit { kill $LOCKFILE_TOUCH_PID lockfile-remove $DOTLOCK_FILENAME echo atexit! exit } DOTLOCK_FILENAME=\/tmp\/xterm-one-instance-$UID lockfile-create --retry 0 --use-pid $DOTLOCK_FILENAME || exit lockfile-touch $DOTLOCK_FILENAME & LOCKFILE_TOUCH_PID=$! echo lockfile-touch running, PID=$LOCKFILE_TOUCH_PID trap atexit EXIT HUP INT TERM xterm My modified script: #!\/bin\/bash function atexit { lockfile-remove $DOTLOCK_FILENAME echo atexit! exit } DOTLOCK_FILENAME=\/tmp\/xterm-one-instance-$UID lockfile-create --retry 0 --use-pid $DOTLOCK_FILENAME || exit trap atexit EXIT HUP INT TERM xterm still prevents another xterm instance after 5m 33s. I found this behavior confusing after reading in the manual page that I need touch the lock file every five minutes."} {"id":"117641","title":"Extend Linux partition in Dual boot with Windows without losing data?","text":"I've the following partitions on my hard drive (copied from Gparted): ![](http:\/\/i.stack.imgur.com\/6thI1.png) As you can see: * **ext4 Linux HOME** partition * THEN ==> **windows (8.1) ntfs** partition * THEN ==> **178 GB of UNUSED space** (I got it by resizing **from the end** ntfs partition) The problem here is that it seems **I can't free space BEFORE ntfs partition** to make free space to **extend ext4 home partition** because this would mean moving ntfs start sector, i.e. , (maybe?) corrupt Windows boot. Any suggestion? How should I do to pass from the situation shown in the image above to ext4 partition with about 100 GB space?"} {"id":"117471","title":"Embedded Linux Power Failure Issues","text":"Many routers run a Linux OS and abrupt power failure can happen. Considering this - how do they handle the possibility of file system corruption caused by a power failure? If they make the system read only, how are you able to change settings?"} {"id":"16618","title":"awk expand window to 500% for two numbers from column file","text":"I've got a file with two columns corresponding to start-end ranges like this: awk '{print $2\"-\"$3}' file.txt 91082802-91082990 94018177-94018321 146945732-146945949 88701397-88701594 80922510-80922643 28800551-28800680 23612818-23613016 69178478-69178630 107524531-107524669 73153734-73154149 [...] I would like to expand the start-end ranges to up to 500%, except if the range goes beyond a certain value, N=1000. If the start-end range is already above N=1000, I want to rewrite the start-end to a n=1000 window around the centre. How can I do that with an awk\/bash one-liner?"} {"id":"7544","title":"Improving OpenOffice speed","text":"I'm looking for some tips and tricks on how to improve the performance of OpenOffice on my desktop. Any ideas, tutorials or articles on this? Thanks in advance!"} {"id":"51905","title":"Typing in Chromium's\/Chrome's Omnibox crashes browser","text":"Very often, when I type something in Omnibox (address-bar), Chromium\/Chrome crashes. W\/ crash I mean that it freezes and refuses to any signals (mouse, keyboard etc.). This is what got printed out to terminal (if browser is spawned through it): Failed to open VDPAU backend libvdpau_nvidia.so: cannot open shared object file: No such file or directory I'm using Arch Linux and all system is up to date. Also, I'm dealing w\/ this problem for like few weeks now... so it can't be tempory bug in any package because I have upgraded browser and other related packages too. Also, I have tried to downgrade packages as well — it sadly doesn't help. On system w\/ almost the same configuration all works and browser has never crashed even once. I'm using Awesome WM, if it matters somehow, but problem persisted also when I was using Xmonad. It seems that Firefox works, but I would like to keep using Chromium or Chrome. P.S. If any other logs are needed, please tell me in the comments and I will update the question."} {"id":"150298","title":"How is whonix blocking UDP traffic (except udp-dns related traffic)?","text":"I want to know how whonix manages to block unwanted UDP-Traffic i.e. all UDP- traffic but DNS related udp traffic. I looked at the iptable rules both in the Workstation and Gateway. There are no iptable rules in the Workstation. So the Workstation doesn't seem to block UDP-Traffic. However, there are many ip- table rules in the Gateway. I went through the iptable rules of the Gateway one-by-one but I couldn't find any udp-related blocking rule either. So, how is this udp-traffic blocked?"} {"id":"65192","title":"How to wait for a subprocess used for I\/O redirection?","text":"Consider the following snippet of Bash script: exec 3> >(sleep 1; echo \"$BASHPID: here\") do-something-interesting exec 3>&- wait $! echo \"$BASHPID: there\" When executed, it produces: a.sh: line 4: wait: pid 1001 is not a child of this shell 1000: there 1001: here How can I modify the `wait` line so that it actually waits for the termination of `1001`? In other words, I can I change the script so that the output becomes: 1001: here 1000: there"} {"id":"153923","title":"Archlinux ARM Rasperry Pi login buffer display and decryption fail","text":"I have put the Archlinux Arm on my SD card and the first time I have done this it was all correct and worked well but I had to \"reinstall\" everything for several reason. So now I am doing the same steps as before but I getting a weird \"problems\". When I first started everything seems normal than I update the system and install \"sudo mkinitcpio rsync\". When I now reboot it and see the login screen it looks like this: alarmpi login: [ 14.9646851 smsc95xx 1-1.1:1 eth0 link up, 100Mbps, full-dupley, lpa 0x41E1 And I have to first press Enter to login and when I wait a bit some new lines appear they look like the following one: [ 602.262297] bcm2708_fb_blank blank_mode=1 I want to encrypt a part of my SD card and I have followed this https:\/\/gist.github.com\/pezz\/5310082 instructions which worked the first time just fine, as I am having a German keboard I need to use \"keyboard keymap encrypt\" in the mkinitcpio.conf file, but I have not able to decrypt it, it is always returned that there is no such key, although I am preatty sure I am doing the same steps as before when it has worked quite well and nicely. So, I have made a test, I have used the word \"root\" as my keyphase for my encryption. This works and I can boot but if I am using the following key: \"Xö&(4n=%YF3Ü!BN\" it does not work. Could anybody give me a hint why? Are there any characheters I am not allowed to use, although I am using the German keyboard layout de-latin1 an I do load keymap after keyboard, so the needed keyboardmaps should be loaded correctly, although it should have worked I have tested this with the keyphrase \"y\" which was on the right place as y and z poition are exchanged on US and Germany keyboard layouts. Also when I need to open the encrypted volume after I have created it the key works. I am looking forward to hear from you. :-) King regards, Greeneco"} {"id":"153920","title":"How does sudo decide whether a command is only executable by sudoers with ALL rights?","text":"I just wondered why on a Debian system with sudo installed a default user can execute `ls` but not `ifconfig` since the binaries do have the same rights: -rwxr-xr-x 1 root root 114032 Jan 26 2013 \/bin\/ls -rwxr-xr-x 1 root root 72296 Sep 7 2012 \/sbin\/ifconfig So I suppose there must be some kind of database or policy that tells the system who's allowed to execute a command and who is not, but where do I find it? It can't be `\/etc\/sudoers` since in that file one only defines who is a root sudoer and who is not just like that: %admin ALL=(ALL) ALL john ALL=\/usr\/sbin\/useradd, \/usr\/sbin\/userdel, \/usr\/bin\/passwd So `john` wouldn't be able to execute `\/sbin\/ifconfig`, but how does the system know he's not allowed?"} {"id":"120714","title":"Equivalent of memmove on files: copy a range of bytes to an earlier position","text":"What is an equivalent of memmove on files with the same input and output file, which works with large files? `dd` works when I move the file contents towards the right, but not if I move the contents left, since there's no handling of overlap. `ddrescue` has a reverse copy, but refuses to work on the same input & output file."} {"id":"64828","title":"Can't install 32 bit gstreamer-ffmpeg normally, library can't find other 32 bit libs","text":"I'm on Ubuntu 12.04 64 bits and I'm trying to get a game (GTA SA) working in wine, but it keeps crashing. After reading error logs it seems I needed some 32 bit versions of gstreamer, probably to play the intro video. I already have `ia32-libs`, because I read somewhere I will need that in order to run 32 bit software. I first tried: sudo apt-get install gstreamer0.10-ffmpeg:i386 Which returns: gstreamer0.10-ffmpeg:i386 : Depends: libavcodec53:i386 (>= 4:0.7.3-1) but it is not going to be installed or libavcodec-extra-53:i386 (>= 4:0.7.3-1) but it is not going to be installed And it also depends on libavformat, libpostproc and libswscale with about the same error. So I kept searching and found a nice tool, getlibs, which allows you to install 32 bit libraries. I think it just places them in the `\/usr\/lib32` directory, which probably isn't the best way to do this, but I tried it anyway. So I installed the 32 bit libraries with getlibs which wine was complaining about. Now I got different errors, basically the 32 bit library is referencing other libraries which it now can't find. For example one of the errors says: Failed to load plugin '\/usr\/lib32\/gstreamer-0.10\/libgstffmpeg.so': libavformat.so.53: cannot open shared object file: No such file or directory So my initial thought was correct, since it now uses the 32 bit version. Now I was trying to figure it out with ldd to see where the library references other libraries: # This one is fine ldd \/usr\/lib\/gstreamer-0.10\/libgstffmpeg.so | grep avformat libavformat.so.53 => \/usr\/lib\/x86_64-linux-gnu\/libavformat.so.53 (0x00007f8314181000) # This one isn't ldd \/usr\/lib32\/gstreamer-0.10\/libgstffmpeg.so | grep avformat libavformat.so.53 => not found So indeed, libgstffmpeg.so can't find the correct libavformat.so. I tried installing the 32 bit version of libavformat with getlibs again, which placed it in `\/usr\/lib32\/i386-linux-gnu\/libavformat.so`. But ldd still tells me it can't find libavformat. Then I tried to make a symbolic link in the same directory but named it `libavformat.so.53` and even made a symlink to `\/usr\/lib\/i386-linux-gnu\/libavformat.so.53', but both give me the same error. Now I am sure this really isn't the correct way to go, but I didn't know the right way to do it. So what is the correct way to do this, or does gstreamer0.10-ffmpeg simply doesn't have 32 bit or multilib support? And how can I find out what the directory is, where libgstffmpeg (or any library I guess) checks for it's 32 bit libs it is referencing?"} {"id":"65441","title":"Is it a bad idea to not have a swap partition on an embedded linux setup?","text":"I have a small embedded linux kernel and file system created via buildroot that is installed onto a compact flash drive running on an x86 board. I am using an initramfs (due to power loss concerns) but mounting a small number of directories on ext3 partitions on the CF drive for data that has to be persistent. However, recently I have been reading about swap partitions and their uses and as my current setup does not employ a swap partition at all. I am wondering if this is safe? I do not anticipate that the applications running on the device will be using a great deal of memory but is it better to create a swap partition regardless? I am very conscious of the limited writes that can be made to CF devices so if it is not vital then I would prefer not to use a swap partition. What would be the worst case scenario if I go ahead without a swap partition?"} {"id":"150744","title":"Fluxbox, bbkeys and java","text":"I have installed `bbkeys` so I could choose a window when `ALT-TAB`ed, but the java applications are not amoung the selectable. Is there anything special that needs to be done for a java app to be amoung the selectable applications?"} {"id":"116594","title":"How do I run a script just before halt using LSB headers on Raspbian","text":"I'm building a shutdown button for my Raspberry pi, and for that I have a python script that needs to change a GPIO pin on my Raspberry Pi just before the system runs the halt script. Now Raspbian uses LSB headers to determine the order in which scripts are run at shutdown, but I can't for the life of me figure out what to put in the header so that the script will run AFTER everything except \/etc\/init.d\/halt has run. The problem right now is that the script runs too soon (it always installs at K01xx), thus cutting the power before all other services have shut down properly. I tried setting a custom priority as described in the guide here: http:\/\/www.debuntu.org\/how-to-managing-services-with-update-rc-d\/, but that does nothing as the command just says \"using dependency based boot sequencing\", with the end result being the same as before. I tried manually renaming the K01xx script in \/etc\/rc0.d to K09xx, so that it would be the last one before the halt command in the directory. But that had no effect either. Any suggestions? My init.d script: #! \/bin\/sh ### BEGIN INIT INFO # Provides: shutdown # Required-Start: # Required-Stop: # Default-Start: 2 3 4 5 # Default-Stop: 0 # Short-Description: Detect shutdown button ### END INIT INFO PATH=\/sbin:\/usr\/sbin:\/bin:\/usr\/bin . \/lib\/init\/vars.sh . \/lib\/lsb\/init-functions do_start() { if [ -x \/home\/pi\/bin\/shutdown.py ]; then [ \"$VERBOSE\" != no ] && log_begin_msg \"Starting listening for shutdown button\" python \/home\/pi\/bin\/shutdown.py & ES=$? [ \"$VERBOSE\" != no ] && log_end_msg $ES return $ES fi } do_stop() { if [ -x \/home\/pi\/bin\/shutdown_pin.py ]; then [ \"$VERBOSE\" != no ] && log_begin_msg \"Lowering pin for complete shutdown\" python \/home\/pi\/bin\/shutdown_pin.py ES=$? [ \"$VERBOSE\" != no ] && log_end_msg $ES fi } case \"$1\" in start) do_start ;; restart|reload|force-reload) echo \"Error: argument '$1' not supported\" >&2 exit 3 ;; stop) do_stop ;; *) echo \"Usage: $0 start|stop\" >&2 exit 3 ;; esac"} {"id":"116597","title":"contents of xp cd is not visible","text":"I'm using Ubuntu 13.04. I want to take an ISO copy of XP installation CD but when I insert CD it's seen as empty CD. Is there any way to access the content of CD?"} {"id":"116591","title":"Why am I getting apparmor error messages in the syslog about NTP and LDAP?","text":"On my newly installed Ubuntu 12.04 machine, with `ntp` and `slapd` installed, the following messages appear in `\/var\/log\/syslog` at regular intervals: Feb 23 18:54:07 my-host kernel: [ 24.610703] type=1400 audit(1393181647.872:15): apparmor=\"DENIED\" operation=\"open\" parent=1 profile=\"\/usr\/sbin\/ntpd\" name=\"\/etc\/ldap\/ldap.conf\" pid=1526 comm=\"ntpd\" requested_mask=\"r\" denied_mask=\"r\" fsuid=0 ouid=0 I've searched, but can't find any info on what may be causing these messages and how to fix the problem. Can anyone shed any light on what's causing this and what to do about it?"} {"id":"2213","title":"copy recursively except hidden directory","text":"How do I copy recursively like `cp -rf *`, but excluding hidden directories (directories starting with .) and their contents?"} {"id":"2212","title":"Why do Unix-heads say \"minus\"?","text":"A couple of weeks ago I attended a talk on Git by someone who seemed to be from a Windows background. I say \"seemed to be\" because he kept saying \"dash\" when referring to command-line options. I then recalled something that I found curious in my early days of learning Linux; that is, when referring to options, the resident Unix-heads always said \"minus\". That is: rm -rf \/var\/tmp\/bogus\/junk Would be said \"arr em minus arr ef\" as opposed to \"arr em dash arr ef\". Why is this?"} {"id":"97676","title":"How to find the driver (module) associated with a device on Linux?","text":"On Linux, given: * a device, for example `\/dev\/sda`, * and its major and minor numbers, for example `8, 0`, how can I know which module \/ driver is \"driving\" it? Can I dig into `\/sys` or `\/proc` to discover that?"} {"id":"97773","title":"Meaning of the following linux commands","text":"cat \"$1\" > \/tmp\/file.$$ 2>\/tmp\/file0.$$ grep \"*\" \/tmp\/file.$$ >\/tmp\/file0.$$ I understood that in the `cat` command, if an error occurs, the error will be shown in `file0.$$` and if it does not, then contents will be shown in `file.$$`. What I don't understand is what `$1` is. Also what is happening in the `grep` command."} {"id":"46210","title":"Understanding different Linux Distros","text":"I'm having a little bit of confusion when understanding linux based OS's. When I download the newest version of Mint and Ubuntu, aren't they the \"same\" at their core (kernel)? It just seems that they have different GUI's? Isn't a GUI technically just a program that runs on startup of a computer? Same as with windows (dos is the core but explorer.exe is the gui). Is anyone able to explain this? With the sudo apt-get command can't I install Ubuntu from a mint Terminal? I know that this is a mess of questions, but hopefully someone can clarify the differences between multiple distros before the GUI appears, and then after the GUI appears."} {"id":"97771","title":"mysql USER unclear about what can be dropped?","text":"When `show databases` there is the `information_schema` below it listing my created databases but what is 'USER' and 'mysql' listed in there? I don't know if ages ago I made a mistake and created them or if they are default listings which reveal something?"} {"id":"131674","title":"How to save “text\/pdf” PDF files on the disk from an incoming mail in Mutt","text":"I receive emails with PDF attachments that have the MIME type \"text\/pdf\". This is obviously not good, but some mail clients are doing that... The problem is that saving such an attachment in Mutt leads to a file on the disk that cannot be opened by a PDF viewer. The file size is indeed different by a few bytes from what it should be. How can I save such attachments?"} {"id":"19425","title":"How can I diagnose and repair missing drive space?","text":"I have a small ext3 `\/` partition on a 2T drive which appears to have a discrepancy in its free space. How can I determine what is causing it and how it can be fixed. After trying everything I could think of, I forced a fsck on boot which didn't have any affect. I have other systems configured identically which don't exhibit this condition. # df -h \/ Filesystem Size Used Avail Use% Mounted on \/dev\/sda1 9.7G 8.9G 318M 97% \/ # du -shx --max-depth 1 \/ 5.2G \/ # lsof | awk 'BEGIN {t=0} \/(deleted)\/ {t+=$7} END {print t}' 0 # tune4fs -l \/dev\/sda1 | grep -E 'state|Free|Reserve|size|Inode' Filesystem features: has_journal ext_attr resize_inode dir_index filetype needs_recovery sparse_super large_file Filesystem state: clean Inode count: 2621440 Reserved block count: 131029 Free blocks: 212317 Free inodes: 2487281 Block size: 4096 Fragment size: 4096 Reserved GDT blocks: 639 Inodes per group: 32768 Inode blocks per group: 1024 Reserved blocks uid: 0 (user root) Reserved blocks gid: 0 (group root) Inode size: 128 **Edit:** `fsck` says the partition is 2% non-contiguous. For comparison to `du` above (sparseness): # du -hxs --apparent-size \/ 4.9G \/"} {"id":"123058","title":"How do I determine where DNS requests fail in the TCP stack?","text":"I have the networking setup described here: Why is this static route not taking effect? Currently, I can ping my DNS server but all DNS requests fail: ~$ ping 130.35.249.52 PING 130.35.249.52 (130.35.249.52) 56(84) bytes of data. 64 bytes from 130.35.249.52: icmp_seq=1 ttl=57 time=105 ms 64 bytes from 130.35.249.52: icmp_seq=2 ttl=57 time=111 ms ^C --- 130.35.249.52 ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 1000ms rtt min\/avg\/max\/mdev = 105.604\/108.388\/111.172\/2.784 ms ~$ nslookup oracle.com 130.35.249.52 ;; connection timed out; no servers could be reached I can think of no good reason for this, because Ubuntu is (to my knowledge) not running a firewall. However, Ubuntu is virtualized, so I hope that it isn't something wrong with the way that its VirtualBox host is set up."} {"id":"25662","title":"Creating a Linux distribution that only runs one application","text":"> **Possible Duplicate:** > How can I build a custom distribution for running a simple web browser? Is it possible to create a Linux distribution that only runs one application? For example, I want it to just run a browser, and not support any other applications. How can I do that?"} {"id":"96356","title":"Need small distro without a desktop or windows manager, just to run a single graphical app","text":"I am looking for some help on this from a linux expert. I am very novice when it comes to linux so I am hoping someone can help out. I need a small distro, that is stable. I don't need a full X server or window manager, I only need it to run one single application with a basic UI that consists of a viewport. I would like for the distro to be as small as possible. 700 mb or less would be ideal. Is their a base distro of ubuntu or similar that I can add whatever I need to it from the command line. Which basically is the kernel and some way of graphical output. I was thinking of putting Direct FB on it to render the application. Can anyone help me out here? Even a live distro would work."} {"id":"52768","title":"rkhunter warns about chkconfig","text":"I ran `rkhunter` and received the following warnings in its output: $ rkhunter --update $ rkhunter -c ... ... ... Performing file properties checks \/sbin\/chkconfig [ Warning ] In the `\/var\/log\/rkhunter.log`, it shows this message: Warning: The command '\/sbin\/chkconfig' has been replaced by a script: \/sbin\/chkconfig: Perl script, ASCII text executable Though I am on a Debian system and am aware of `update-rc.d`, I occasionally use `chkconfig` to configure services. What does this warning mean? How serious is this?"} {"id":"42777","title":"How to run this in sudo?","text":"I have this line that I execute from php `sudo -u db2inst1 -s -- \"\/opt\/ibm\/db2\/current\/bin\/db2 connect to PLC; \/opt\/ibm\/db2\/current\/bin\/db2 \\\"update EDU.contact set MOBILE_PHONE = '123'\\\"\"` it works fine on Sudo version **1.7.2**. Now I got new server with `SUSE Linux Enterprise Server 11 (x86_64)`. There was no sudo so I installed it from repository (Sudo version **1.6.9p17** ) But know the above syntax doesn't work. It throws `bin\/bash: \/opt\/ibm\/db2\/current\/bin\/db2 connect to PLC; \/opt\/ibm\/db2\/current\/bin\/db2 \"update EDU.contact set MOBILE_PHONE = '123'\": No such file or directory` Any idea how I can make this work? If I run `\/opt\/ibm\/db2\/current\/bin\/db2 connect to PLC; \/opt\/ibm\/db2\/current\/bin\/db2 \"update EDU.contact set MOBILE_PHONE = '123'\"` under db2inst1 account everythings work just fine."} {"id":"80544","title":"Download the Complete Linux Kernel Collection","text":"I am wanting to download EVERY version of the Linux kernel as source code, Debian files, and RPM files. Where can I find a single site where I can download them all at once? If that is not possible, I know I can get the source code for every kernel here (https:\/\/www.kernel.org\/pub\/linux\/kernel\/), but I need the .deb and .rpm files as well."} {"id":"27493","title":"What's the best way to count the number of files in a directory?","text":"If parsing the output of `ls` is dangerous because it can break on some funky characters (spaces, `\\n`, ... ), what's the best way to know the number of files in a directory? I usualy rely on `find` to avoid this parsing, but similarly, `find mydir | wc -l` will break for the same reasons. I'm working on Solaris right now, but I'm looking for a answer as portable across different unices and different shells as possible."} {"id":"125323","title":"Grub error 15 (file not found)","text":"I'm trying to fix a problem with a new installation. I'm running this existing distro (Ubuntu) from `\/dev\/sdb` with a new OS, Gentoo, installed on `\/dev\/sda`. I'm glad I took the trouble of setting these up on different disks because I can't boot into the new OS. All I get is grub error 15 \"File not found\". It also gives the UUID which I have verified is correct: sudo blkid \/dev\/sda1: LABEL=\"boot\" UUID=\"b891774a-0b2d-4ab4-bcfa-23a11a97cae5\" TYPE=\"ext2\" \/dev\/sda2: UUID=\"fc34999a-e85d-4c7b-8775-30510eb4c396\" TYPE=\"swap\" \/dev\/sda3: LABEL=\"main\" UUID=\"65a90a0d-a651-4215-8552-0c1859ab61dd\" TYPE=\"ext4\" The menu.lst (on `\/dev\/sdb`) for the new OS is title Gentoo Linux 3.10.7-r1 uuid b891774a-0b2d-4ab4-bcfa-23a11a97cae5 #root (hd0,0) kernel \/kernel-3.10.7-gentoo root=UUID=65a90a0d-a651-4215-8552-0c1859ab61dd I also tried kernel \/boot\/kernel-3.10.7-gentoo root=UUID=65a90a0d-a651-4215-8552-0c1859ab61dd but since the UUID goes directly to the boot partition I think this is wrong. The kernel should be correct; if I mount `dev\/sda1` and `ls` I see grub kernel-3.10.7-gentoo Any ideas what I'm doing wrong? It might be very basic; I've only been using Linux for a few years and never Gentoo except for a few days in a `chroot`. * * * I should mention I also have grub2 installed on `dev\/sda1` though I don't get as far there: it just shows the grub 'command line'."} {"id":"122827","title":"mailx and HP-UX to RedHat migration","text":"We are migrating some servers from HP-UX to Linux RedHat, and we have to migrate about 100 shell scripts that are referencing \/usr\/bin\/mailx (instead of \/bin\/mailx on Linux). We'd like to change all the 100 scripts (from \/usr\/bin\/mailx to \/bin\/mailx) only if this is the last option. Are there better ways of doing this? P.S.: our system administrators don't want to create a symbolic lynk \"\/usr\/bin\/mailx\" pointing to \/bin\/mailx (I didn't understand why, actually). Thanks in advance."} {"id":"122823","title":"Changed background on Kali Linux and now desktop is buggy","text":"I have been running the latest version of Kali Linux for about a month now. I got tired of seeing the default Kali Linux login screen, so I looked up how to change it. The answer I found said: > Go to `\/roor\/usr\/share\/images` and then delete the image file labeled > `login-desktop.png` and replace it with a png image of your choice. > > After which change the replacement image name to `login-desktop.png` and > reboot. I did exactly as recommended, but when I rebooted the desktop environment was odd. There was no toolbar on the top or bottom, and windows were missing the default bar on them with Minimize, Maximize, and Close buttons. What happened?"} {"id":"45749","title":"Archbang look on Archlinux","text":"I installed archlinux but I want to get the look and feel of Archbang. Is there a way to find the config files or scripts for Archbang? http:\/\/bbs.archbang.org\/viewtopic.php?id=2501 gives a list of packages but I also want the resources and quick ref of key bindings in the background, menus, default application and other things I don't know about. The reason I don't want to install Archbang is because I want to follow the Arch Way. the reason I want Archbang config files is because people already thought about usability and solved that problem for me. I like their solution."} {"id":"63095","title":"bind backslash to a non-standard keyboard key","text":"I am using a swiss apple keyboard at the moment. This keyboard requires some unreasonable finger acrobatics to type a backslash (shift+right alt+7). I'd like to bind the backslash to another key combination, specifically shift+4, which right now produces a \"ç\" which I never need. Has anybody done something like that? I don't have any idea how to do that and I have not found any help yet. I use Linux mint xcfe. Thanks in advance for your help."} {"id":"9286","title":"Are certain parts of startup scripts necessary or just good practice?","text":"I'm currently exploring creating a startup script in the form of a system process located in the \/etc\/init.d\/ on my Fedora 14 Linux installation. It sounds like the following two lines are bare minimum requirements? #!\/bin\/bash # chkconfig: 345 85 15 (however on this one I've seen different combos) What's the purpose of these lines? Is there a good resource that would help me understand how to better create these and other header lines for such a file?"} {"id":"126664","title":"\/proc\/pid\/maps addresses (and converting them)","text":"When looking at the memory maps in \/proc\/pid\/maps, we can see different length addresses 00400000-0042e000 r-xp 00000000 fb:01 268953 \/bin\/nano 0062e000-0062f000 r--p 0002e000 fb:01 268953 \/bin\/nano 0062f000-00630000 rw-p 0002f000 fb:01 268953 \/bin\/nano 0081e000-00906000 rw-p 00000000 00:00 0 [heap] 7f8313e5c000-7f8314109000 rw-p 00000000 fb:01 2399989 \/usr\/share\/misc\/magic.mgc 7f8314109000-7f83142ce000 r--p 00000000 fb:01 2759354 \/usr\/lib64\/locale\/locale-archive 7f83142ce000-7f83142d1000 r-xp 00000000 fb:01 1457046 \/lib64\/libdl-2.17.so 7f83142d1000-7f83144d0000 ---p 00003000 fb:01 1457046 \/lib64\/libdl-2.17.so We have addresses with 8 digits length like: * 00400000-0042e000 And ones with 12 digits length (last 3 digits are always 0): * 7f8313e5c000-7f8314109000 My question is, why are those addresses formated this way, and can i convert them to 8 digits length?"} {"id":"109505","title":"Virtualbox user home directory","text":"I have a tiny problem. I want to avoid VirtualBox from creating `\/home\/$USER\/.VirtualBox` directory and create another directory like `\/home\/$USER\/DIR` instead to put the log files etc there. I tried to export `$VBOX_USER_HOME` variable in my `.bashrc` so it is set in my shell and also used the `vboxmanage setproperty machinefolder \/home\/amin\/DIR` command but VirtualBox still creates `.VirtualBox` directory under `\/home\/$USER`. Is there any other way to achive this or am I doing something wrong here?"} {"id":"53412","title":"changing the partition of a linux","text":"I have a ubuntu system as a virtual system on Virtual Box. It uses VHD as its hard disk. I manged to change the size of VHD using VHD resizer, now I want to expand the partition on vhd so it uses the expanded size. How can I do this?"} {"id":"63320","title":"Bandwidth, CPU & Memory stats returned in single line from terminal","text":"I'm trying to create a simple monitoring system that will show a graph of sales that is linked entirely to data of bandwidth, CPU and Memory stats as they relate to sales. So if I sale 1 widget per 5 seconds, that will be contingent upon my bandwidth etc being above a certain threshold. So I've formulated a way to do the graph but I'm just having a time getting the stats. I can use any of a number of monitoring systems but I just need 1 line for bandwidth, CPU Usage, and Memory Usage once per second. I made a python script that gets all the IP information from all interfaces. But for if I had a script I could run from terminal that simply output a single line I could just pipe that to a file and then access the file to run my real time graph. So for network I can use: $ ifconfig I pipe it into a json file for easy reference. I can use: $ free -m for memory which I suppose I can pipe into a file as well Then I could use: $ cat \/proc\/loadavg for CPU and again pipe that. Is there an easier way to do this? So that I receive a single line for each command and can easily (more importantly quickly) send that information via Javascript or HTML5 FileReader to the graphing solution?"} {"id":"63328","title":"Is it possible to store ssh connection in bash script instead of $(ssh user@ip command) every time?","text":"I think that the code that I already have is not very efficient as it has to connect each time to the same machine and execute a command. Code: tmp=$(ssh -nq $USER@$IP \"$COMMAND\" 2>> $LOG) tmp1=$(ssh -nq $USER@$IP \"$COMMAND1\" 2>> $LOG) tmp2=$(ssh -nq $USER@$IP \"$COMMAND2\" 2>> $LOG) tmp3=$(ssh -nq $USER@$IP \"$COMMAND3\" 2>> $LOG) Where `$COMMAND` in most of the cases is some kind of `grep`. Can I somehow store the ssh connection or refactor the code so it won't connect each time to the machine ?"} {"id":"147228","title":"How to properly start and stop shell script in linux, busybox?","text":"I am trying to write a small shell script that would send some commands to my tv set from my set top box that has busybox on it. The problem is that it generates huge amount of zombie processes, and when I try to killall, I kill also some audio processes, that should not be killed... Here are my scripts: tvstart.sh #!\/bin\/sh echo \"ka 1 01\" > \/dev\/ttyUSB0 read -t 5 response < \/dev\/ttyUSB0 echo \"xb 1 70\" > \/dev\/ttyUSB0 read -t 2 response < \/dev\/ttyUSB0 echo \"kf 1 32\" > \/dev\/ttyUSB0 read -t 2 response < \/dev\/ttyUSB0 echo \"km 1 01\" > \/dev\/ttyUSB0 #killall sh tvstop.sh #!\/bin\/sh echo \"ka 1 00\" > \/dev\/ttyUSB0 #killall sh And I call them like this(part of the script): case \"$1\" in led-on) echo 3 > \/sys\/class\/leds\/mag-front-led\/mode nohup sh \/home\/default\/tvstop.sh & ;; led-off) echo 2 > \/sys\/class\/leds\/mag-front-led\/mode nohup sh \/home\/default\/tvstart.sh & ;; So, how do I terminate them properly? this is how zombies looks like: 3637 root Z [sh] 3660 root Z [sh] 3696 root Z [sh] 3719 root Z [sh] 3751 root Z [sh] 3766 root Z [sh] 3798 root Z [sh] 3829 root Z [sh] 3913 root Z [sh] 3984 root Z [sh] 4489 root 6960 S sshd: root@pts\/0 4533 root 2704 S -sh 10478 root Z [sh] 10516 root Z [sh] 10574 root Z [sh] 10597 root Z [sh] 10630 root Z [sh] 10737 root Z [sh] 11072 root Z [sh] 11103 root Z [sh] 11413 root Z [sh] 11436 root Z [sh] 11457 root DW [STVID.InjecterT] 11458 root SW [STVID[0].MPEG2P] 11459 root DW [tfm_89287480] 11460 root SW [STVID[0].Produc] 11461 root SW [STVID[0].Displa] 11462 root SW [STVID[0].ErrorR] 11477 root Z [sh] 11500 root Z [sh] 11525 root Z [sh] 11548 root Z [sh] 11581 root Z [sh] 11605 root Z [sh] 11638 root Z [sh] 11661 root Z [sh] 11688 root Z [sh] 19185 root 2704 R ps"} {"id":"149647","title":"\"Couldn't resolve host\" when downloading Fedora 16 packages","text":"I'm using `yum` to install `make`, I am getting the following error. I tried all solutions from similar questions but the issue remains. http:\/\/download.fedoraproject.org\/pub\/fedora\/linux\/releases\/16\/Everything\/i386\/os\/repodata\/repomd.xml: [Errno 14] curl#6 - \"Couldn't resolve host\" Trying other mirror"} {"id":"115108","title":"Arch Linux OpenVPN DNS-Problem","text":"I can´t successfully connect with OpenVPN or maybe I´ll connect successfully and something is wrong with my network-settings... this is the Output of OpenVPN while connecting: Thu Feb 13 23:21:13 2014 OpenVPN 2.3.2 x86_64-unknown-linux-gnu [SSL (OpenSSL)] [LZO] [EPOLL] [eurephia] [MH] [IPv6] built on Nov 13 2013 Thu Feb 13 23:21:13 2014 WARNING: file '\/home\/mak\/openvpn-config\/mkirchweger.p12' is group or others accessible Thu Feb 13 23:21:13 2014 Attempting to establish TCP connection with [AF_INET]83.164.xxx.xx:xxxx [nonblock] Thu Feb 13 23:21:14 2014 TCP connection established with [AF_INET]83.164.xxx.xx:xxxx Thu Feb 13 23:21:14 2014 TCPv4_CLIENT link local: [undef] Thu Feb 13 23:21:14 2014 TCPv4_CLIENT link remote: [AF_INET]83.164.xxx.xx:xxxx Thu Feb 13 23:21:14 2014 [bricks.softpoint.at] Peer Connection Initiated with [AF_INET]83.164.xxx.xx:xxxx Thu Feb 13 23:21:17 2014 TUN\/TAP device tun0 opened Thu Feb 13 23:21:17 2014 do_ifconfig, tt->ipv6=0, tt->did_ifconfig_ipv6_setup=0 Thu Feb 13 23:21:17 2014 \/usr\/bin\/ip link set dev tun0 up mtu 1500 Thu Feb 13 23:21:17 2014 \/usr\/bin\/ip addr add dev tun0 local 10.10.x.xx peer 10.10.x.xx Thu Feb 13 23:21:19 2014 Initialization Sequence Completed **UPDATE:** I´m pretty sure it as an DNS-Issue, ping via IP works but Hostnames can´t be resolved..."} {"id":"50264","title":"How to fix bash or auto run \/bin\/bash on SSH login","text":"When logging in as `root` at my server everything works fine, but when I log in as `myusername` the bash is not working correctly. The line starts with: $ instead of myusername@myserver:~$ and all specials keys like the arrow keys, tab keys, etc. won't work. When I type `bin\/bash` it works again, but I'd like to fix the problem or auto run `bin\/bash` on login. How can I fix this?"} {"id":"26723","title":"Print odd-numbered lines, print even-numbered lines","text":"I want to print the odd-numbered and even-numbered lines from files. I found this shell script which makes use of echo. #!\/bin\/bash # Write a shell script that, given a file name as the argument will write # the even numbered line to a file with name evenfile and odd numbered lines # in a text file called oddfile. # ------------------------------------------------------------------------- # Copyright (c) 2001 nixCraft project # This script is licensed under GNU GPL version 2.0 or above # ------------------------------------------------------------------------- # This script is part of nixCraft shell script collection (NSSC) # Visit http:\/\/bash.cyberciti.biz\/ for more information. # ------------------------------------------------------------------------- file=$1 counter=0 eout=\"evenfile.$$\" # even file name oout=\"oddfile.$$\" # odd file name if [ $# -eq 0 ] then echo \"$(basename $0) file\" exit 1 fi if [ ! -f $file ] then echo \"$file not a file\" exit 2 fi while read line do # find out odd or even line number isEvenNo=$( expr $counter % 2 ) if [ $isEvenNo -ne 0 ] then # even match echo $line >> $eout else # odd match echo $line >> $oout fi # increase counter by 1 (( counter ++ )) done < $file echo \"Even file - $eout\" echo \"Odd file - $oout\" But isn't there a way to do it in one line? _Yes, use awk,_ I read. Even-numbered lines: awk 'NR % 2' filename odd-numbered lines: awk 'NR % 2 == 1' filename But it doesn't work for me. Both produce the same output, according to diff. When compared to the original file, they are both indeed half as long, and they both contain the odd-numbered lines. Am I doing something wrong?"} {"id":"24377","title":"Bash vi mode configuration to default to command mode","text":"Is it possible to configure bash vi mode so that initially it is in **command** mode instead on **insert** mode? I find that I have to press `Esc` far too much. It seems that there is possibility to specify this in zsh, but I have not found a way to do this in bash\/readline."} {"id":"77345","title":"Making two drives show as one on debian?","text":"I rented a server from a provider and they won't install RAID0 without an additional fee. So I'm trying to figure out how to link these two drives so that my programs that are installed on the hard disk will see the space from the second drive. This is how it's setup: `df -h`: Filesystem Size Used Avail Use% Mounted on rootfs 139G 93G 39G 71% \/ udev 10M 0 10M 0% \/dev tmpfs 599M 208K 599M 1% \/run \/dev\/disk\/by-uuid\/e7a9cc0e-9caa-4d33-b60f-... 139G 93G 39G 71% \/ tmpfs 5.0M 0 5.0M 0% \/run\/lock tmpfs 2.7G 0 2.7G 0% \/run\/shm \/dev\/sda1 961M 36M 877M 4% \/boot \/dev\/sda5 139G 93G 39G 71% \/media\/hd `fdisk -l`: Disk \/dev\/sda: 160.0 GB, 160000000000 bytes 255 heads, 63 sectors\/track, 19452 cylinders, total 312500000 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical\/physical): 512 bytes \/ 512 bytes I\/O size (minimum\/optimal): 512 bytes \/ 512 bytes Disk identifier: 0x00066abb Device Boot Start End Blocks Id System \/dev\/sda1 * 2048 2000895 999424 83 Linux \/dev\/sda2 2002942 312498175 155247617 5 Extended \/dev\/sda5 2002944 296499199 147248128 83 Linux \/dev\/sda6 296501248 312498175 7998464 82 Linux swap \/ Solaris Disk \/dev\/sdb: 160.0 GB, 160000000000 bytes 58 heads, 29 sectors\/track, 185790 cylinders, total 312500000 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical\/physical): 512 bytes \/ 512 bytes I\/O size (minimum\/optimal): 512 bytes \/ 512 bytes Disk identifier: 0x00088a99 Device Boot Start End Blocks Id System \/dev\/sdb1 2048 312499999 156248976 83 Linux I did my best with my n00bness to mount the 2nd drive. Does anyone know what I need to do to make the drives show up as one?"} {"id":"67956","title":"Using symbolic links and git to manage build versions","text":"In general I follow the following workflow when I build any program (e.g. `emacs`, `tmux`, etc.) \/home\/opt\/[name of the program]\/builds\/[version]\/ bin lib share For example for a program like `tmux` I have the following: \/my_local_opt\/tmux\/builds\/1.7.-227\/ bin lib share I then create sym links in `\/home\/bin\/` pointing to the the specific builds that I have, and I never have to touch my `PATH` variable, since I fix it to include `\/home\/bin`. E.g. For the example above, I would * Create a sym link: from: `\/home\/bin\/tmux` to: `\/my_local_opt\/tmux\/builds\/1.7.-227\/bin\/tmux` * Have `PATH` only include `\/home\/bin` However, I am not sure I can follow a similar approach for the `man` (`MANPATH`) and `lib` (`LD_LIBRARY_PATH`) paths. 1. For example, after I build `tmux` I notice that it creates: > `.. \/share\/man\/man1\/tmux.1` so I tried creating a symlink to this file from a place like `\/home\/share` and then fixing `MANPATH` to include this path. But when I typed `man tmux` it didn't work (it said \"`No manual entry for tmux`\"). Why? 2. How about `lib`? I thought I could perhaps fix `LD_LIBRARY_PATH` to a specific directory for each program, and then use sym links to control which version gets included. Would this be a good idea? More generally, is it a good idea to manage versions in a system using sym links? In the long run I am hoping to leave the sym links in a git repository to keep track of multiple configurations. In case it helps, I don't have admin privileges in the machine where I build software, so I am hoping to use this as a way easily organize and manage my builds (without having to constantly edit my environment variables holding paths)"} {"id":"111372","title":"how to get tornado 211g (ACX111) working in mint 13 xfce?","text":"I have mint 13 xfce installed on my thinkpad r31. For this laptop, I have a Tornado 211g pcmcia wireless adapter. This is not installed automatically in Mint and I am searching for a way to get this card working. How Can I achieve this? I have the windows XP drivers and have added these using ndiswrapper but so far, nothing has happened. in terminal, I have typed _lspci_ which returned my wireless adapter as an ACX111 chipset."} {"id":"50191","title":"Piped input to nano","text":"Why does `ls | nano -` open the editor in Ubuntu but close the editor and save a file to `-.save` in CentOS? How can I get nano in CentOS to remain open when reading stdin?"} {"id":"50194","title":"Need advice on using Wireshark + aircrack-ng","text":"I am making acquiantance with wireless security and attacks and was told to run some tests with aircrack-ng and wireshark. So I installed both of them and ran airmon to switch wi-fi card to monitor mode: `sudo airmon-ng start ra0` (this is my DWA-140 usb wi-fi adapter) The wi-fi adapter seems to have restarted after that. Gues that's ok. Still it gave some warnings on processes that might interfere with normal work like `network manager, dhclient` and a few more. I tried to stop them, but they seem to restart all the time. After that I ran wireshark as a superuser, chose the ra0 adapter and tried to sniff the test open network. I have my PC connected to it (via dwa-140) and an HTC phone and some stranger PCs. Wireshark runs on my PC. The problem is that when I login to `%sitename%` with a PC browser, I can see the cookies sent to it in Wireshark. But when I do the same thing with an Opera Mobile browser on my HTC (`Turbo` option disabled), there is nothing detected. I know that stranger PCs are also sending data to `%sitename%`, but I see nothing from them as well. Actually I see a lot of packets from stranger PCs, but not the ones I need. I'd like to know what I'm doing wrong. Will be thankful for any advice. P.S. This runs on Ubuntu 12.04.1"} {"id":"50198","title":"Reformatting a large number of XML files","text":"I'm manipulating a large number of XML files scattered throughout a nested directory structure. I tried the following (which almost works): $ find . -name \"*.xml\" -type f | xargs -- xmllint --format The problem is this generates the formatted XML output on the screen, but doesn't change the file. How can I change this command so that the actual file contents are changed? Thanks!"} {"id":"28713","title":"Why does mapping cause arrow keys to fail in vim?","text":"When I do inoremap `^ in vim, the next time I switch to insert mode (after using `Esc`) the arrow keys fail to move the cursor (they insert letters instead). Why does that happen? * * * **Edit** : It is possible to remap `Esc` and still retain working arrow keys?"} {"id":"28710","title":"Can't insert rt2800usb module: Invalid argument","text":"I just got an ASUS N13 USB wireless dongle, and unfortunately it's not detected and I can't load it with modprobe: $ sudo modprobe rt2800usb WARNING: All config files need .conf: \/etc\/modprobe.d\/blacklist, it will be ignored in a future release. WARNING: Error inserting rt2x00usb (\/lib\/modules\/3.0.0-14-generic\/kernel\/drivers\/net\/wireless\/rt2x00\/rt2x00usb.ko): Invalid argument WARNING: Error inserting crc_ccitt (\/lib\/modules\/3.0.0-14-generic\/kernel\/lib\/crc-ccitt.ko): Invalid argument WARNING: Error inserting rt2800lib (\/lib\/modules\/3.0.0-14-generic\/kernel\/drivers\/net\/wireless\/rt2x00\/rt2800lib.ko): Invalid argument FATAL: Error inserting rt2800usb (\/lib\/modules\/3.0.0-14-generic\/kernel\/drivers\/net\/wireless\/rt2x00\/rt2800usb.ko): Invalid argument What's the problem here? I read that this works usually out of the box with Ubuntu 11.10? What can I do to fix this? Is there a package I can reinstall to try and fix things?"} {"id":"28719","title":"slow samba seek performance","text":"I am using FreeBSD 9.0 RC3 (PCBSD distro) with samba 3.4.14. I am trying to access portions of several large (4 - 10 GB) files over samba using seek commands, and I am seeing that calls to the front of the file are returning very quickly, but calls to near the end of the file are taking 15+ seconds to respond. It is as if the OS has to read the entire file up to the position I am seeking to. The file system is ZFS v28 on a 5 drive Z2 configuration. Are there any parameters governing seek? When I host these files on a Windows Server 2008 R2 box, I am not seeing any of these issues. ![Disk Mark Performance](http:\/\/i.stack.imgur.com\/9Uf0f.png) I've attached my results from crystaldiskmark over the network as well."} {"id":"94597","title":"Checking the order of items in a shell environment variable","text":"I am wanting to check that a certain directories always appear after other directories in an environment variable. List items are separated by a colon, as with the PATH variable. This is not simply for bash, but for a few different shells. The problem is, I'm not sure how to check the order of items in a list using standard unix utilities. What would be a starting point? edit: An example would be $LIST=\/test:\/bin\/test:\/etc\/test:\/nan\/:\/var I would want to test for example that any directory path that had the word test in it was prior in the list to a directory that did not. What I want to do is small enough that I can hardcode the directories, so a dynamic solution is not necessary."} {"id":"72641","title":"Is there a way to convert IE favourites to bookmark.htm format?","text":"After switching from Windows to Linux, I am left with a favourite directory containing subfolders and `.url` files, each file containing a few lines of text that look like this: [DEFAULT] BASEURL=http:\/\/www.example.com\/faq.html [InternetShortcut] URL=http:\/\/www.example.com\/faq.html Modified=70E5E788C3B9C9010A Since I do not have internet explorer installed on my Linux system, it is not possible for me to import the bookmarks directly to my current Firefox browser. I was wondering if there is a quick way to extract the URL from all the `.url` files, together with the filenames to generate a `.htm` file which I can import to any modern browser."} {"id":"430","title":"autologin console as root on fedora","text":"Can someone help to autologin in console text mode as root in fedora, usually I can do using script like this : `\/sbin\/autologin.sh`: #!\/bin\/bash 0<\/dev\/$1 1>\/dev\/$1 2>&1 cat \/etc\/issue shift exec $* and on `\/etc\/inittab` do login by calling that script 1:2345:respawn:\/sbin\/autologin.sh tty1 login -f root .. .. now i can't do that, since fedora use \/etc\/init\/tty.conf : stop on runlevel [016] respawn instance $TTY exec \/sbin\/mingetty $TTY *I know its dangerous to autologin and moreover as root, but I don't care, I don't care about security"} {"id":"92291","title":"Parsing the headers of sequence file","text":"I have a multiple sequence file as >abc|d017961 sequence1...... >cdf|rhtdm9 sequence2...... >ijm|smthr12 sequence3...... >abc|d011wejr sequence4...... >stg|eethwe77 sequence5...... I want to edit the file and want the result file as >abc_ABC__d017961 sequence1...... >cdf_CDF__rhtdm9 sequence2...... >ijm_IJM__smthr12 sequence3...... >abc_ABC__d011wejr sequence4...... >stg_STG__eethwe77 sequence5......"} {"id":"91477","title":"How can I make a Puppet module that fixes time?","text":"I have written a Puppet module that corrects the time via NTP, but this only works on server with a small NTP offset. There are sometimes server with a time offset higher than 10 minutes for various reasons. I want to make a Puppet module that runs exec \"service ntpd stop; ntpdate ntp3.domain.local; service ntpd start\" when the ntp offset is too high, to forcably correct the time. How can I see if the NTP offset is too high in order to tell Puppet to run this command? Or are there better solutions?"} {"id":"73110","title":"ixgbe: increase rx performance","text":"I have an Intel 82598EB 10GBE NIC. I need to receive traffic without packet loss. Data rate is 4-5 Gbps, packet size is 1500-9600 bytes. I had already configured smb and irq affinity. I also tried to use packets socket ( PF_PACKET ). None of this helped. Small losses is always present. Now I am planning to compile kernel with disabling any configuration settings that increase the size of sk_buff and disabling IOMMU. What are other ways to improve rx performance?"} {"id":"145157","title":"How to disconnect a server from LDAP","text":"I have a Fedora server configured for LDAP. However, the LDAP server is gone, and now I'm unable to SSH into it. I've rebooted the server into single-user mode, brought up eth0 and started sshd, but when I try and ssh into it, the connection times out and the server reports \"nss_ldap: could not search LDAP server server is unavailable\". How do I completely purge LDAP from the system and disconnect it from any external LDAP dependency? I've ran `yum remove openldap-servers nss-pam-ldapd` and deleted common ldap conf scripts, but still sshd blocks all connections because it can't validate them against a non-existent LDAP server."} {"id":"35475","title":"Free Matlab equivalent for Linux","text":"My collaborators are using Matlab to do some simulations. Is there an open source alternative I could use on Linux to run these scripts? It would need to be fairly closely compatible with the (1) matlab language (2) the *.fig files - saved plots."} {"id":"74692","title":"What's the easiest way to decrypt a disk partition?","text":"I made a mistake of encrypting the entire LVM physical volume (contains both home, root, and swap) when installing a CentOS 6.4 (2.6.32-358.6.1.el6.x86_64) box. I soon came to realize that moving files takes a horrendous amount of time due to `kcryptd` running at 90% of CPU and that encryption was not really necessary as it's just a home server containing no crucial data. However, I already configured it and installed loads of packages, tuned it as far as power management goes, and set up all the services. Is there any way to remove the encryption without having to re-install the whole thing and go through the configuration all over again? I'd love an option that would take less than 30 mins but I'm not sure one exists. Also, if anyone has any recommendations on how to make `kcryptd` more easy to use, let me know. **Edit 1** ~]# fdisk -l \/dev\/sda Disk \/dev\/sda: 160.0 GB, 160041885696 bytes 255 heads, 63 sectors\/track, 19457 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical\/physical): 512 bytes \/ 512 bytes I\/O size (minimum\/optimal): 512 bytes \/ 512 bytes Disk identifier: 0x000078c9 Device Boot Start End Blocks Id System \/dev\/sda1 * 1 64 512000 83 Linux Partition 1 does not end on cylinder boundary. \/dev\/sda2 64 19458 155777024 83 Linux ~]# dmsetup ls vg_centos-lv_home (253:3) vg_centos-lv_swap (253:2) vg_centos-lv_root (253:1) luks-2ffcc00c-6d6e-401c-a32c-9c82995ad372 (253:0) ~]# pvdisplay --- Physical volume --- PV Name \/dev\/mapper\/luks-2ffcc00c-6d6e-401c-a32c-9c82995ad372 VG Name vg_centos PV Size 148.56 GiB \/ not usable 4.00 MiB Allocatable yes (but full) PE Size 4.00 MiB Total PE 38030 Free PE 0 Allocated PE 38030 PV UUID euUB66-TP3M-ffKp-WhF5-vKI5-obqK-0qKoyZ **Edit 2** ~]# df -h \/ \/home \/boot Filesystem Size Used Avail Use% Mounted on \/dev\/mapper\/vg_centos-lv_root 50G 2.3G 45G 5% \/ \/dev\/mapper\/vg_centos-lv_home 94G 1.3G 88G 2% \/home \/dev\/sda1 485M 53M 408M 12% \/boot"} {"id":"110966","title":"Which packages from slackware's X category do I need for a minimal X installation?","text":"I would like to set up Slackware 14.1 with a minimal package count. I already know which packages from A, AP, and N that I need for a minimal install with no X. But I have no idea which packages from the X category that I need and which ones are just unnecessary. Please don't tell me that I should just install everything. I've done that and it works but I end up with hundreds of packages I don't need."} {"id":"65835","title":"htop reporting much higher memory usage than free or top","text":"The following three outputs were taken essentially simultaneously: top: top - 02:54:36 up 2 days, 13:50, 3 users, load average: 0.05, 0.05, 0.09 Tasks: 181 total, 1 running, 179 sleeping, 0 stopped, 1 zombie %Cpu(s): 2.5 us, 0.8 sy, 0.0 ni, 96.6 id, 0.1 wa, 0.0 hi, 0.0 si, 0.0 st KiB Mem: 16158632 total, 11234480 used, 4924152 free, 844 buffers KiB Swap: 16777212 total, 0 used, 16777212 free, 10640832 cached free -h: total used free shared buffers cached Mem: 15G 10G 4.7G 0B 844K 10G -\/+ buffers\/cache: 578M 14G Swap: 15G 0B 15G htop: ![htop](http:\/\/i.stack.imgur.com\/AVrWm.jpg) free and top seem to agree. In top there is 11234480 KiB used, subtracting 10640832 KiB cached gives 579.7 MiB, which is pretty close to what free reports under used +\/- buffers\/cache. However htop is reporting 1836 (MiB) used, which is neither here nor there as far as I can see. Where does this difference come from? htop is clearly not including the cached data, but it is still reporting more than three times the memory usage of free or top. I am aware that there are many similar questions, but I haven't come across one that explains this discrepancy (the confusion usually seems to be only the with\/without cache counting). Edit: I should mention that I am running openSUSE, and I see the same kind of discrepancy in both version 12.2 and 12.3 RC1. Edit2: The included version of htop is 1.0.1. I have also compiled version 1.0.2 from source and see the same discrepancy then as well."} {"id":"65837","title":"libpam-ck-connector causing apt-get to fail","text":"I used `apt-get autoremove` on my Debian server and now `apt-get` won't install or remove anything as it keeps trying but failing to remove `libpam- ck-connector`. When trying to install anything… for example, `apt-get install php5` (Reading database ... 28566 files and directories currently installed.) Removing libpam-ck-connector:armhf ... dpkg: error processing libpam-ck-connector:armhf (--remove): unable to securely remove '\/usr\/share\/doc\/libpam-ck-connector\/changelog.gz': Not a directory Errors were encountered while processing: libpam-ck-connector:armhf E: Sub-process \/usr\/bin\/dpkg returned an error code (1) I tried to run `apt-get install libpam-ck-connector` and got this… libpam-ck-connector is already the newest version. libpam-ck-connector set to manually installed. The following NEW packages will be installed: libck-connector0 0 upgraded, 1 newly installed, 0 to remove and 86 not upgraded. 1 not fully installed or removed. Need to get 0 B\/117 kB of archives. After this operation, 96.3 kB of additional disk space will be used. Selecting previously unselected package libck-connector0:armhf. (Reading database ... 28560 files and directories currently installed.) Unpacking libck-connector0:armhf (from ...\/libck-connector0_0.4.5-3.1_armhf.deb ) ... Setting up libck-connector0:armhf (0.4.5-3.1) ... dpkg: error processing libpam-ck-connector:armhf (--configure): package libpam-ck-connector:armhf is not ready for configuration cannot configure (current status `half-installed') Errors were encountered while processing: libpam-ck-connector:armhf E: Sub-process \/usr\/bin\/dpkg returned an error code (1) Any ideas on how to work around this?"} {"id":"65836","title":"init.d script causes boot hang","text":"I successfully installed a script to automatically launch in \/etc\/init.d on my new Raspberry Pi. Unfortunately, it is a node.js app that never returns, and therefore hangs the device during boot (this is on Debian). Yes, I'm an idiot. Is there a secret handshake I can do during boot to prevent it from running my init.d script so I can get to login and a shell to fix it?"} {"id":"25401","title":"How to create a bootable USB stick with Debian Squeeze","text":"Using Ubuntu, I want to install Debian Squeeze on my PC with a bootable USB stick. I found this tutorial: Plug the usb key in order to find the device location: $ df -k \/dev\/sdb 244476 217968 26508 90% \/media\/xxx It shows that `\/dev\/sdb` is my usb key. Then I unmount it # umount \/dev\/sdb Download these two files: # cd \/tmp\/ # wget http:\/\/people.debian.org\/~joeyh\/d-i\/images\/daily\/hd-media\/boot.img.gz # wget http:\/\/cdimage.debian.org\/cdimage\/daily-builds\/daily\/arch-latest\/i386\/iso-cd\/debian-testing-i386-netinst.iso Copy the first on the stick (it has to be umounted): # zcat boot.img.gz > \/dev\/sdb Then mount the stick and copy `debian-testing-i386-netinst.iso` onto it: # mount \/dev\/sdb \/mnt\/ # cp \/tmp\/debian-testing-i386-netinst.iso \/mnt\/ # umount \/mnt\/ The USB key is now ready. Plug it on the computer to install, select in the BIOS USB for first boot device and start the Debian Squeeze installation. In the step : # cp \/tmp\/debian-testing-i386-netinst.iso \/mnt\/ the ISO file is _just copied_ , not _extracted_ - Is this correct?"} {"id":"32295","title":"How do I stop Apache from running as root?","text":"New on the job, small place, and the security stuff just landed on my desk. I was hired to be a front-end developer. Happy to learn new things, but never had to do sysadmin stuff before. I started digging and it appears that apache, the site, and everything is running on root. There are no other groups or users. ACK! What steps should I take to change this? I know that this is a big no-no... Bonus points if anyone can please point me to a good basic 101 tutorial on apache\/php security."} {"id":"98734","title":"w3m displays inline images in konsole, but not yakuake","text":"I've tested this on two different systems (with TERM set to `xterm-256color`) and got the same result. Nothing in the config files seems relevant. Is there a major difference in these terminal emulators that I'm not aware of? Also, is any thorough documentation available for either of them? They seem to come with no `man` pages. I found the konsole handbook, but it is very basic."} {"id":"75873","title":"DHCP configuration for iPXE","text":"Is there a way to configure the DHCP process in iPXE? In particular, I want to configure the DHCP Discover message **sent by iPXE** , so that the message issued by iPXE includes more options in Parameter Request List (Option 55) for the server to replied with. Currently, only a restricted subset of options are requested, but I want more."} {"id":"32125","title":"pwd not being set correctly in zsh prompt","text":"If I type this in my PROMPT in my `.zshrc` file: PROMPT=\"`pwd` >\" I expect that it will print the current working directory. However, `pwd` always prints `\/Users\/kevin`. Why doesn't it show my current working directory? (I know that there is a function called `%~` that will set it for you. I'm curious why this doesn't work though, this is a simpler case of something more advanced that I'm trying to do)."} {"id":"56096","title":"How to install ubuntu ultimate edition using Wubi?","text":"I had some trouble installing Ultimate Edition 2.9 on my friend's computer using Wubi. Wubi just doesn't accept installation and gives only 2 options - 'Demo & Install' and 'Learn more'. Tried searching the internet for a solution but couldn't find anything. Is it Wubi's fault or is it not designed to give support for UE? If latter, what is the alternative to it (without actually giving UE a seperate partition)."} {"id":"101873","title":"Check a range of IP addresses to see if a host is active","text":"I need to write a bash shell script that will check a range of IP addresses to see if a host is “alive” at that address.I also need to list the IP numbers of those that are “alive”, and provide a summary showing the number of “alive” and “not alive” IP addresses. The range of addresses will all be in a “Class C” network. I'm having problems figuring out how to pass through each arg and get it pinging each individual address within the range. Below is a sample run of the script I intend to create. $ programName 192.168.42 18 22 Checking: 192.168.42.18 19 20 21 22 Live hosts: 192.168.42.21 192.168.42.22 There were: 2 alive hosts 3 not alive hosts found through the use of 'ping'."} {"id":"101874","title":"Script is stuck saying 1 response with 2 available: Math related","text":"I have a script that tells the user the square footage of 2 rooms based on user input. I think I have that part done right. The problem I have is that I need to have the script say which room is bigger and no matter how I try to rebuild the end of the script I get both responses, 1 of the responses which is wrong unless the user is lucky, or I get no response. How do I change this part of the script to get the correct output? I'll have the rest of the script as a reply to this for those that want to skip over the working part along with the question I've been given. Also this is a homework assignment from my Intro to Unix class that I've spent way to much time on trying to figure out so the correction has to be somewhat beginner-ish. if [ $R1z -ge $R2z] then echo Room 1 is bigger else echo Room 2 is bigger fi All of the code: echo Enter the length of room 1 read R1x echo Enter the width of room 1 read R1y echo Enter the length of room 1 read R2x echo Enter the width of room 2 read R2y expr $R1x \\* $R1y read R1z expr $R2x \\* $R2y read R2z if [ $R1z -ge $R2z] then echo Room 1 is bigger else echo Room 2 is bigger fi"} {"id":"57325","title":"Are there any pitfalls to overriding ls?","text":"Is there anything to watch out for if you wanted to override `ls`? Is there a more reliable way of getting pagination out of `ls`? For example: function ls() { command ls -hp $@ | more; }"} {"id":"57326","title":"add members of wheel group, sudo access","text":"On Fedora15, following this wiki, I added a user to wheel group, which is already in the sudoer config file. but still I get not-a-sudoer error prompt. Should I specifically name every member of a group in sudoer file to be able to sudo with that user?"} {"id":"84019","title":"PF and types of NAT(Network Address Translation)","text":"As you know, at least 3 types of `NAT` are used. Of course i need to two types of them.`DNAT` and `SNAT`. `DNAT` : hiding server behind `NAT`, `SNAT` : hiding your client behind `NAT`. **Question:** I read a quick tutorial of `PF filrewall`, but didn't distinguish `DNAT` and `SNAT` in `PF Firewall`. How can i define ruleset as `DNAT` and `SNAT`?"} {"id":"4980","title":"renaming a fat16 volume","text":"What's the easiest way to rename (change the volume label of) a fat16 volume (e.g. on a USB drive) from linux? It seems like `mlabel` from the `mtools` package is meant to do this, but the documentation is not geared to rapid assimilation."} {"id":"4982","title":"Is it possible to run KVM over a qemu emulated powerpc architecture","text":"I understand that qemu uses binary translation to emulate machines, so irrespective of the underlying architecture, it can provide emulation. And, KVM uses Hardware Virtualization technique to make this process faster. Thus, KVM requires VT support from underlying architectures (which x86 processor provides). I have emulated powerpc architecture with qemu over x86 architecture. My question is whether it is possible to run KVM over this powerpc architecture."} {"id":"153205","title":"Confused about the purpose of MESA with proprietary nVidia drivers","text":"Since a MESA upgrade today (10.2.5-1 -> 10.2.6-1 in Debian Sid, which is _unbearable_ lately, keep away), I noticed 3D-dependant applications complaining about missing the software rasterizer `swraster` - `compiz` (standalone) won't even start any any more, glxgears is extremely choppy etc. Aside from the usual \"fun\" fixing this that I'm already in the middle of (pointers welcome, downgrading didn't work), this demonstrated me once again that I don't understand how 3D rendering works on Linux. So, my question is: Why is MESA even interacting with this - and why do I even need it installed? Isn't it a free implementation of the same things the proprietary nVidia drivers provide as well? Shouldn't any 3D use by X11 go directly to the proprietary drivers' APIs? On the project's site itself, they specify that they either interact with open source drivers (`nouveau` in this case, which doesn't support my card), or do things in software, which I obviously do not want. My nVidia drivers were installed through sgfxi, i. e. not from Debian's packaging system, but I don't think this would make a difference - for instance, libcairo2 rigidly specifies it needs MESA, period. (And also, why do I need to ask these question to simply run a 3D application...) If this is what's happening, it would explain why my performance in 3D games is so absolutely frustrating, but I somehow can't believe that things are _this_ counterintuitive..."} {"id":"71405","title":"What is a sure fire way to find all files and\/or path that contains 2 keywords?","text":"I was doing a find . -iname '*sitesearch*' | grep demo because I know the file should be `some\/path\/SiteSearch\/demo\/SiteSearch.html`, but it turned out a person put the file in as `some\/path\/SiteSearch\/demo\/index.html`, so the file cannot be found. Is there a better way to do the search? Such as for this case, if I do find . -iname '*demo*' | grep -i sitesearch it would have found it. But I don't want to always THINK what possibility it is and figure out what pattern to use. I just want a way that whenever the file and path have both of these 2 keywords, then print it out. For example, if there is a way to `ls` all files will the full path on each line, then we can do ls --some-flags | grep -i demo | grep -i sitesearch or maybe another way \/ better way."} {"id":"113626","title":"Maximum password length","text":"Is there a maximum password length on unix systems? If so, what is that limit and is it distribution dependent?"} {"id":"30563","title":"24 hour crash course in ZFS... some final questions","text":"Due to various circumstances I've given myself a crash course on the ZFS file sytem. I need some help getting comfortable with the unknowns. Whatever those are. Data: * Running www.zfsonlinux.org on CentOS 6.2 * I have an array with 12x2TB sata disks. * I created a raidz2 pool and a couple zfs file systems inside that. * Performance is better than I expected. (How often do you get to say that?) Some questions: * What type of maintenance should I schedule? I have read that doing a \"zpool scrub\" is advised. At what interval would you run this? Is there anything else to do? * Is there any performance monitoring other than \"zpool iostat\" - snmp? * I need to be alerted by email or similar about disk failures, etc.... What are my options?"} {"id":"30568","title":"How to check and block processes connecting to internet directly?","text":"Is there a way to find which processes in my system are getting connected to net automatically. Is there a way to select and block net access of some processes permanently? I use mint 11. I use a USB datacard."} {"id":"76753","title":"pulse-audio does not recognise my Logitech mic and my Webcam mic","text":"I use the (great) AK5370 microphone for Skype, but it is not recognized by my archlinux i86_64. It also fails to recognize the mic on my Logitech Webcam (PTZ, which I do not use). Both are connected through the monitor's built-in hub, and both work through hubs an another system. Both work on the same hardware with Ubuntu and Windows. Here they are on lsusb… ~]# lsusb Bus 001 Device 002: ID 03f0:2524 Hewlett-Packard LP3065 30\" Monitor Hub Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 001 Device 003: ID 1532:001c Razer USA, Ltd RZ01-0036 Optical Gaming Mouse [Abyssus] Bus 001 Device 004: ID 04ca:002a Lite-On Technology Corp. Bus 001 Device 005: ID 0556:0001 Asahi Kasei Microsystems Co., Ltd AK5370 I\/F A\/D Converter Bus 001 Device 006: ID 046d:08cc Logitech, Inc. Mic (PTZ) But not on aplay's list-devices... ]$ aplay --list-devices **** List of PLAYBACK Hardware Devices **** card 0: NVidia [HDA NVidia], device 0: ALC1200 Analog [ALC1200 Analog] Subdevices: 0\/1 Subdevice #0: subdevice #0 card 0: NVidia [HDA NVidia], device 3: ALC1200 Digital [ALC1200 Digital] Subdevices: 1\/1 Subdevice #0: subdevice #0 card 1: NVidia_1 [HDA NVidia], device 3: HDMI 0 [HDMI 0] Subdevices: 1\/1 Subdevice #0: subdevice #0 card 1: NVidia_1 [HDA NVidia], device 7: HDMI 0 [HDMI 0] Subdevices: 1\/1 Subdevice #0: subdevice #0 card 1: NVidia_1 [HDA NVidia], device 8: HDMI 0 [HDMI 0] Subdevices: 1\/1 Subdevice #0: subdevice #0 card 1: NVidia_1 [HDA NVidia], device 9: HDMI 0 [HDMI 0] Subdevices: 1\/1 Subdevice #0: subdevice #0 card 2: NVidia_2 [HDA NVidia], device 3: HDMI 0 [HDMI 0] Subdevices: 1\/1 Subdevice #0: subdevice #0 card 2: NVidia_2 [HDA NVidia], device 7: HDMI 0 [HDMI 0] Subdevices: 1\/1 Subdevice #0: subdevice #0 card 2: NVidia_2 [HDA NVidia], device 8: HDMI 0 [HDMI 0] Subdevices: 1\/1 Subdevice #0: subdevice #0 card 2: NVidia_2 [HDA NVidia], device 9: HDMI 0 [HDMI 0] Subdevices: 1\/1 note: card0 mobo card1&2 nvidia graphics (not used) PulseAudio Volume Control reports \"No input device available\". No problem with these devices on other systems Alas... pulseaudio 3.0-3 pavucontrol 2.0-1 skype 4.2.0.11-1 alsa-lib 1.0.27.1-1 * * * Note: the webcam (UVC) with the min (PTZ) is recognized and works. * * * Per _Ignacio Vazquez-Abrams_... (thanks) ~]$ lsmod | grep '^snd' | column -t snd_usb_audio 112569 0 snd_usbmidi_lib 18931 1 snd_usb_audio snd_rawmidi 18742 1 snd_usbmidi_lib snd_seq_device 5180 1 snd_rawmidi snd_hda_codec_hdmi 29298 8 snd_hda_codec_realtek 30893 1 snd_hda_intel 35816 4 snd_hda_codec 145704 3 snd_hda_codec_realtek,snd_hda_codec_hdmi,snd_hda_intel snd_hwdep 6364 2 snd_usb_audio,snd_hda_codec snd_pcm 76860 4 snd_usb_audio,snd_hda_codec_hdmi,snd_hda_codec,snd_hda_intel snd_page_alloc 7330 2 snd_pcm,snd_hda_intel snd_timer 18687 1 snd_pcm snd 58893 19 snd_hda_codec_realtek,snd_usb_audio,snd_hwdep,snd_timer,snd_hda_codec_hdmi,snd_pcm,snd_rawmidi,snd_usbmidi_lib,snd_hda_codec,snd_hda_intel,snd_seq_device And in addition... ]# ls -l \/dev\/snd total 0 drwxr-xr-x 2 root root 100 May 24 10:07 by-path crw-rw----+ 1 root audio 116, 8 May 24 10:07 controlC0 crw-rw----+ 1 root audio 116, 17 May 24 10:07 controlC1 crw-rw----+ 1 root audio 116, 26 May 24 10:07 controlC2 crw-rw----+ 1 root audio 116, 7 May 24 10:07 hwC0D0 crw-rw----+ 1 root audio 116, 16 May 24 10:07 hwC1D0 crw-rw----+ 1 root audio 116, 15 May 24 10:07 hwC1D1 crw-rw----+ 1 root audio 116, 14 May 24 10:07 hwC1D2 crw-rw----+ 1 root audio 116, 13 May 24 10:07 hwC1D3 crw-rw----+ 1 root audio 116, 25 May 24 10:07 hwC2D0 crw-rw----+ 1 root audio 116, 24 May 24 10:07 hwC2D1 crw-rw----+ 1 root audio 116, 23 May 24 10:07 hwC2D2 crw-rw----+ 1 root audio 116, 22 May 24 10:07 hwC2D3 crw-rw----+ 1 root audio 116, 6 May 24 10:07 pcmC0D0c crw-rw----+ 1 root audio 116, 5 May 24 14:51 pcmC0D0p crw-rw----+ 1 root audio 116, 2 May 24 10:07 pcmC0D2c crw-rw----+ 1 root audio 116, 4 May 24 10:07 pcmC0D3c crw-rw----+ 1 root audio 116, 3 May 24 10:07 pcmC0D3p crw-rw----+ 1 root audio 116, 12 May 24 10:07 pcmC1D3p crw-rw----+ 1 root audio 116, 11 May 24 10:07 pcmC1D7p crw-rw----+ 1 root audio 116, 10 May 24 10:07 pcmC1D8p crw-rw----+ 1 root audio 116, 9 May 24 10:07 pcmC1D9p crw-rw----+ 1 root audio 116, 21 May 24 10:07 pcmC2D3p crw-rw----+ 1 root audio 116, 20 May 24 10:07 pcmC2D7p crw-rw----+ 1 root audio 116, 19 May 24 10:07 pcmC2D8p crw-rw----+ 1 root audio 116, 18 May 24 10:07 pcmC2D9p crw-rw---- 1 root audio 116, 1 May 24 10:06 seq crw-rw----+ 1 root audio 116, 33 May 24 10:07 timer"} {"id":"154309","title":"How to fix Mint 16 Desktop crash\/freeze after adding second toolbar and enabling\/disabling monitor?","text":"My operating system is Mint 16, forgot what flavor, probably KDE. My desktop crashed after I connected a second monitor, added a second toolbar to the second monitor and then disable the monitor, and then rebooted. After I rebooted, my desktop is now frozen, with a fuzzy blank toolbar. I forgot what the command is to open up the terminal outside of the desktop environment. The last time this happened to me, my friend explained to me that two desktops were running at the same time and a \"watcher\" program was disabling the second desktop environment while a \"checker\" was re-enabling the second desktop environment at the speed of the computer clock. My conky reports a 100% CPU usage, though I forgot to check the name of the top running programs. The power block was reporting 95 watts continuous. How do I fix my Mint 16 Desktop crash\/freeze after adding a second toolbar and enabling\/disabling monitor?"} {"id":"13498","title":"openSUSE Linux Kiosk Setup","text":"Working on setting up a kiosk with openSUSE, where users can only view a single webpage. Obviously open to any Linux distro. Also would prefer to use Gnome. I'm wanting only Firefox to be available (which will be displaying a local webpage), a link on the desktop and the home page to open full screen when booted up and logged in automatically. Just interested in some guidance, or if there are any tools that could be used to 'lock down' the system. Thanks!"} {"id":"60299","title":"How to determine which sd* is usb?","text":"> **Possible Duplicate:** > How to know if \/dev\/sdX is a connected USB or HDD? The output of `ls \/dev\/sd*` on my system is - sda sda1 sda2 sda3 sda4 sda5 sda6 sda7 sdb sdc sdc1 sdc2 How should I determine which drive is which?"} {"id":"18189","title":"Find FreeBSD ports that depend on another port","text":"I have a headless FreeBSD server where some port has installed tons of X11-related packages. I would like to find out what these ports are so I can get rid of the unwanted X-related packages. Is there a way to figure this out?"} {"id":"47492","title":"What is the best way to find a list of several strings within a large text file","text":"The short, general question is: In Unix\/Linux, what is the best way to find a list of several (about 150) strings within a large text file? I am asking this to all Unix\/Linux experts as a general question, in the hopes that I can find a solution that pertains to my particular case: I have a feeling this is going to take a little tinkering. I have a large text file (actually, an MVS dataset) on an IBM Unix System Services (USS) machine-- I believe it is somewhere around 6GB. I also have a list of about 150 5-character identifiers in the format AAAAA that I need to find within this file-- that is, I'd like to extract rows from the file that contain any one of the 150 the specific identifers that I am looking for. The format of each line in the large file is: 00000000000A00000000000000000AAAAA\\n where 0 represents a digit, and A represents an alphanumeric character. The string that I'm searching for is always at the end of the row. Working with datasets seems to be a little awkward in USS, and I am not able to copy it over into the Unix environment because it is too large. The standard Unix utilities don't all operate on datasets (dd for example); however sed, awk, and grep seem to work to some degree (although the command line switches seem to be a bit different). I can grep the dataset as follows: cat \"\/\/'MVS.DATASET'\" | grep -e\"LOOKFOR1\" -e\"LOOKFOR2\" -e\"LOOKFOR3\" > output_to_file.txt However, it won't allow me to grep for all 150 items on one line; I could split it up and run it several times, but I feel like there should a better way. I tried using a sed script as follows, but I don't know sed at all, and I got an error that said \"garbage after command\". I saved the following in a file sed-script.txt: s\/AAA01\/&\/p s\/AAA30\/&\/p s\/AAA10\/&\/p ... etc ... and then ran `sed -f sed-script.txt \"\/\/'MVS.DATASET'\"` Again, this failed with \"sed: FSUM7294 garbage after command\". So, 1. How would one normally tackle this problem in the \"average\" Unix environment, and 2. Do you have any specific insights to this particular case?"} {"id":"18187","title":"Select code block in vim","text":"Given a code like this: 588 while ($linecounter > 0) { 589 $token = \" \"; 590 while ($token != PHP_EOL) { 591 if (fseek($handle, $pos, SEEK_END) == -1) { 592 $beginning = true; 593 break; 594 } 595 $token = fgetc($handle); 596 $pos--; 597 } 598 $linecounter--; 599 if ($beginning) { 600 rewind($handle); 601 } 602 } The cursor is at the character `=` in the line 590. Which is the most efficient way to select the code block: 1. lines 590-597 2. lines 591-596 (just the inner part)"} {"id":"18181","title":"Why can't I sed two [or more..] empty lines to one empty line?","text":"Why can't I sed two [or more..] empty lines to one empty line? What is the trick? echo -e \"hello\\n\\n\\nhello2\" | sed 's\/^$\\n^$\/\\n\/g' hello hello2"} {"id":"130682","title":"What is the :0 terminal in the who command's output?","text":"When I type `who` in my console terminal, I get the following output: hubert :0 2014-05-16 21:40 (:0) hubert pts\/0 2014-05-16 21:46 (:0) From `info who` I know that both `:0` and `pts\/0` should name instances of the terminal. It is clear to me what `pts\/0` means but I have no idea how to interpret the first line of the output. What is even more confusing, when I type who `hubert :0`, I get: hubert pts\/0 2014-05-16 21:46 (:0)"} {"id":"137225","title":"Dovecot: Corrupted index cache file","text":"I received following error message in `\/var\/mail\/mail.err`: Jun 14 00:03:42 max dovecot: IMAP(bernhard): Corrupted index cache file \/home\/bernhard\/Mail\/.indexes\/.imap\/INBOX\/dovecot.index.cache: Broken virtual size for mail UID 5618 What is the preferred way to restore the index?"} {"id":"83092","title":"debootstrap error in Ubuntu 13.04 raring","text":"I'm trying to create a file system in Ubuntu with the command: sudo debootstrap --foreign --no-check-gpg --include=ca-certificates --arch=armhf testing rootfs http:\/\/debian.raspbian.com\/debian but it got the following error: \/usr\/sbin\/debootstrap: 1294: \/usr\/sbin\/debootstrap: cannot create \/home\/...\/rootfs\/test-dev-null: Permission denied E: Cannot install into target '\/home\/...\/rootfs' mounted with noexec or nodev can anyone help me here?"} {"id":"83091","title":"vaio grub removal after default windows setup","text":"After installing default factory windows xp from VAIO VGN-NR, and hence removing the Ubuntu on its hard drive, the grub does not allow the windows to boot up properly, giving the prompt: \"no such partition\" and grub rescue appears. The Windows can not be recovered by rescue mode, since the administrator password of newly installed default windows (from hidden drive on the laptop) is not known to me. Booting up with live-Ubuntu and trying to erase the MBR did not help a bit. dd if=\/dev\/null of=\/dev\/sdX bs=446 count=1 I can simply install another windows on it, fixmbr and fixboot it and re- install the original factory windows. But I'm not like that. I want to find a way through, not around. Any suggestion?"} {"id":"83096","title":"What is the difference between `\/sbin\/ip route` and `\/sbin\/route`?","text":"Linux comes with two utilities * `\/sbin\/route` * `\/sbin\/ip route` What is the difference between the two and what is the rule of thumb to use when you decide which one of the two you should use? I know they're both documented in two separate locations, * `man 8 route` * `man 8 ip-route`"} {"id":"132050","title":"XBMC crash after selecting \"play\". Ubuntu 14.04 and 13.0 gotham. Link to crashlog","text":"I have a brand new machine with fresh install of Ubuntu 14.04 and I'm trying to run Gotham 13.0 on it. I've already added the restricted multimedia codecs (just in case) to Ubuntu. sudo apt-get install ubuntu-restricted-extras As well as Unrestricted LibavCodec sudo apt-get install libavcodec-extra My graphics is AMD\/ATI Tahiti (Radeon HD 7970) with a core i7. Here's the XBMC crashlog: http:\/\/xbmclogs.com\/show.php?id=209365 Here's what's happening: I just download the appropriate PPA's etc. through the XBMC wiki. sudo add-apt-repository ppa:team-xbmc sudo apt-get update sudo apt-get install xbmc The first time I installed it on this machine, I went through installed Fusion and ran the Hub wizard Template\/Setup. Everythings seems good, but when I select Al Jazeera, for example, I click \"watch live\", and then I get the \"working\" scroll in the bottom right for few seconds, and then the entire program force closes. The same happens with \" The Daily Show\" \"Youtube\" \"UsTv Now\" etc. I completly uninstalled XBMC sudo apt-get purge xbmc xbmc-standalone and started over. This time only installing one add on and trying it out. Still I get the same results. The music add-ons work though. I have this posted a few days on XBMC forums, and no replies yet. I'm not sure if this is an Ubuntu or XBMC issue ,at this point. ![enter image description here](http:\/\/i.stack.imgur.com\/7y0qj.png)"} {"id":"136574","title":"hydra verification before stopping","text":"I am getting false positives when I try a penetration test on my local service with `hydra`: hydra -l admin -x 1:8:1 -t 1 -f -vV 127.0.0.1 http-form-post '\/login.php:username=^USER^&password=^PASS^:Bad password' I guess due to the fast rate of requests sometimes my server doesn't deliver the whole page and the part with \"Bad password\" is missing, so hydra thinks the password worked. Is there a way to tell hydra to verify the password and try it several times with success before stopping the whole pentest? * * * A solution I could imagine: you could write a loop somehow, that stores away the hydra.restore file often, and then if a solution is found try again with that solution and if it doesn't work start over at the point in the wordlist where you stopped - unfortunately the restore file is gone as soon as a solution seems to be found"} {"id":"154306","title":"How to use awk through multiple files?","text":"I want a solution for the general case (N folder) I'm using awk to process a file and extract its content and put it in a variable then echo it: This is the file: H1 H2 H3 H4 H5 H6 H7 H8 H9 not important not not This is the code: $value1=awk '\/H1\/ { print $1}' file $value2=awk '\/H1\/ { print $2}' file $value3=awk '\/H1\/ { print $3}' file echo $value1 echo $value2 echo $value3 I get the result: H1 H2 H3 My question if I have multiple files with the same format (not the exact content, the same format) with the file and which is located in different folders but the same name: \/folder1 file \/folder2 file \/folder3 file How can I echo the first 3 values of the H1 line but from each file in those folders so I get 9 results?"} {"id":"132059","title":"Can the \/home folder in Linux contain anything else but user folders?","text":"Can the \/home folder contain anything else but user folders? I have a folder I want to share between Windows and Arch - can it go in the home folder under a name not belonging to any existing user? E.g. \/home |-\/james (my home folder) |-\/shared (folder I want to share)"} {"id":"33492","title":"Fedora 15: em1 recently dissapeared and hostapd no longer serves internet to wirelessly connected devices","text":"I have a laptop running hostapd, phpd, and mysql. This laptop uses an Ethernet connection to connect to the internet and acts as a wireless access point for my workplace's wifi devices. After installing some software and reconnecting my Ethernet elsewhere, my \"em1\" device is no longer present and wirelessly connected devices can no longer reach the internet. The software I recently installed is: pptp, pptpd, and updated some fedora libraries. I have also recently moved my desk and laptop to another location and thus had to reconnect the Ethernet elsewhere. Wifi devices no longer have access to the internet. Wirelessly connected devices are able to successfully log into the laptop, showing full strength, correct SSID, and uses the proper password. However, when I tried to connect to a site like google, the request times out. The device \"em1\" also no longer appears on my machine. Running: `# ifup em1` will give me the following output: `ERROR : [\/etc\/sysconfig\/network- scripts\/ifup-eth] Device em1 does not seem to be present, delaying initialization.` And running: `# dhclient em1` has the following output: `Cannot find device \"em1\"` When I run `# dmesg|grep renamed`, I get the following: `renamed network interface eth0 to p4p1`. I've tried to connect to the internet through p4p1 and was successful. However, my wireless devices connected to my laptop are no longer able to connect to the internet. I have uninstalled pptp and pptpd using `# yum erase ...` but the problem still persists. To install pptp I used: `# yum install pptp` To install pptpd I did the following: # rpm -Uvh http:\/\/poptop.sourceforge.net\/yum\/stable\/fc15\/pptp-release-current.noarch.rpm # yum install pptpd To update my fedora libraries I used: # yum check-update # yum update EDIT: Running `# route` produces the following results: Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface default 10.11.200.1 0.0.0.0 UG 0 0 0 p4p1 10.11.200.0 * 255.255.252.0 U 0 0 0 p4p1 172.16.100.0 * 255.255.255.0 U 0 0 0 wlan0"} {"id":"6533","title":"Is there an easy way to update information in known_hosts when you know that a hosts key has changed?","text":"If a host's operating system has been re-installed and had its public key regenerated sshing to it will of course fail because the new key doesn't match the old one. Is there an easier way to tell ssh that you know that the host's key has changed and that you want it to be updated. I think it feels a bit error-prone to use a text editor or something like sed to remove the offending line."} {"id":"14116","title":"gksudo not caching credentials","text":"I've built a shell script for mounting ISO images in Nautilus, and it worked fine in earlier versions of Ubuntu. One of the many problems encountered in 11.04 is that `gksudo` doesn't seem to cache the credentials - There are three commands in the script which need to be run as root, but now for every command I get prompted for a password. Sudo privileges are cached when using plain `sudo`, so why not with `gksudo`?"} {"id":"6538","title":"xorg memory leaks","text":"On my desktop Xorg leaks a lot of memory. I use to let this machine on for days (weeks, months ...), but about once a week I'm forced to restart xorg, because it is taking too much memory. Am I the only one affected by this issue? Why does this is happen? Is it xorg to be _bugged_ , or is it something else (maybe some xorg modules)? Can I do anything to avoid it? * * * Some more infos: I'm on ArchLinux, kernel 2.6.36, nvidia drivers 260.19.36, gnome 2.32.1. Anyway I've got this issue from a lot of time, like more than one year. * * * Here is how the Xorg process is shown by top after about 9 days of uptime... PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 1591 root 20 0 278m 229m 9364 S 2 11.8 244:38.73 Xorg I've got only a few open windows. 229MB of resident memory looks like a lot to me (and it will keep growing with time). As soon as I reboot Xorg I'll also add process stats at the beginning of its life. * * * Here is as soon as my Gnome desktop gets up: PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 1573 root 20 0 89508 43m 11m S 1 2.2 0:03.53 Xorg"} {"id":"92798","title":"How to turn my linux laptop into wireless repeater?","text":"**I need to use my laptop to extend the range of my wireless router.** I have a Samsung laptop with FEdora19 installed (but those should be irrelevant for a good answer). My wireless card supports master mode (`iw list` listing includes `AP` mode). The card is: 01:00.0 Network controller: Qualcomm Atheros AR9485 Wireless Network Adapter (rev 01) I am trying to follow this resource link, but am getting errors, and my knowledge is too limited to get me through the errors. [sci@localhost ~]$ su -c \"iwconfig wlp1s0 mode master\" Password: Error for wireless request \"Set Mode\" (8B06) : SET failed on device wlp1s0 ; Invalid argument. Following the Atheros specific advice at the middle of the page: modprobe: FATAL: Module ath_pci not found. I am very surprised that the procedure is not trivial, and that a dedicated application doesn't exist. How should I approach this? Further reading is in order, if it is focused on the problem at hand!"} {"id":"133904","title":"How to get list of urls from a URL recursively with filtering","text":"I want to get list of URLs that contains `vimeo.com` from a web site recursively by a command , so that I can pipe it to vimeo_downloader.sh. I prefer to use `wget`, but also I'm happy with other options. ### Example `index.html` 01<\/a> 02<\/a> 03<\/a> 04<\/a> 05<\/a> 06<\/a> `01.html` ... ... src=\"\/\/player.vimeo.com\/video\/xxxxxxxxxx?api=1\" ... ... Likewise `02.html` to `06.html` have a vimeo's URL. How to get all vimeo URLs from `01~06.html`?"} {"id":"96436","title":"copying specific files in directory","text":"I am trying to copy some of the files in a directory. The directory contains following files my current directory is ~\/certificate\/ drwxrwxr-x 2 ubuntu ubuntu 4096 Oct 16 11:58 apache -rw-rw-r-- 1 ubuntu ubuntu 5812 Oct 16 11:20 apache.keystore -rw-rw-r-- 1 ubuntu ubuntu 1079 Oct 16 08:31 csr.txt -rwxr-xr-x 1 ubuntu ubuntu 36626564 Oct 16 10:08 my.war drwxrwxr-x 2 ubuntu ubuntu 4096 Oct 16 09:39 tomcat -rw-rw-r-- 1 ubuntu ubuntu 6164 Oct 16 09:31 tomcat.keystore I want to copy all files to ~\/certs\/ except my.war. I have tried following command without success. I do not want to move my.war out of the folder even temporarily. cp -r ~\/certificate\/(?!m)* ~\/cert\/. Please help me with suitable regular expression or any other tool."} {"id":"88182","title":"SNAT with network alias IP RHEL 5.5","text":"I have Rehat Enterprise Linux Server Release 5.5(Tikanga) with two interfaces as below * eth0: with public IP as xxx.xx.64.118 * eth0:0: with public IP as xxx.xx.116.19 * eth1: with private IP as 172.16.23.2 By default my iptable POSTROUTING chain rule is as below: Chain POSTROUTING (policy ACCEPT) target prot opt source destination MASQUERADE all -- 0.0.0.0\/0 0.0.0.0\/0 which means it has NAT IP as IP of eth0. Now I want a specific host computer(172.16.23.6), connected to eth1, to have source IP as that of eth0:0 (ie. xxx.xx.116.19) while connecting to internet. So I added a rule as below iptables -t nat -A POSTROUTING -s 172.16.23.6 -o eth0 -j SNAT --to-source xxx.xx.116.19 Which added new rule above MASQUERADE as show : Chain POSTROUTING (policy ACCEPT) target prot opt source destination SNAT all -- 172.16.23.6 0.0.0.0\/0 to:xxx.xx.116.19 MASQUERADE all -- 0.0.0.0\/0 0.0.0.0\/0 After what I supposed was that the host having IP 172.16.23.6 would have public IP xxx.xx.116.19 when connecting to the internet(checked via whatismyip.com). But it still shows the public IP of eth0(xxx.xx.64.118). The same worked well for Ubuntu. Can anybody please suggest what is the problem ?"} {"id":"131501","title":"Printer is not recognized by CUPS","text":"I have a printer (Product code: PRP-085, Vendor BIRCH), I'm using Fedora 20 KDE (also tested on Ubuntu 13. 10) and CUPS 1. 7. 2 My issue is printer is not recognized by CUPS, the output of `lpinfo -v` is: network ipps network lpd network beh direct hp network http network https network ipp network socket network smb direct hpfax network bjnp I have tried some guides in https:\/\/wiki.archlinux.org\/index.php\/CUPS#Device_node_permissions. I can not find anyways to recognize this device."} {"id":"53189","title":"How a piped shell programs balance their output\/input rates?","text":"> **Possible Duplicate:** > Bash while loop and reading from pipe I come from web programming background, and find myself interested in one peculiarity of using a local shell. I understand that when a program reads from file, it can read at whatever rate's necessary. But I'm curious to know, how does it work when a program gets other program's input piped in and can't process it in realtime? A good example would be video encoding. Suppose I point a decoder to video file, then it's output gets piped in as encoder's input. The total size of decoded video is more than ram+swap, so I guess there's no way to have it buffered altogether. I found about read and write calls to stdin and stdout, but I'm interested to know what actually happens when this example's encoder can't cope with all the data at once. Does it somehow informs the decoder about desired rate? Does decoder program needs to be specifically prepared for such a signal and modify it's processing speed accordingly? If not, how does it all gets balanced in the end?"} {"id":"86069","title":"Where should I keep personal files so they are safe across system re-installs?","text":"I want to make sure that at the next system installation\/restoration my files are not lost. Using tweakers I can change Window's default folders (e.g. move \"My documents\" from C: drive to D:). Right now I have Linux Mint 15 Mate installed on partition `\/` and the rest of HDD mounted to `\/home`. Is this right approach? If yes, how can I move default folders to this partition? If no, what is the best approach?"} {"id":"111110","title":"Log-me-in on Angstrom","text":"Has anyone got Log-me-in Hamachi running on the Angstrom distribution? When I attempt to install it, it tells me I need the lsb package. I googled it and found that it is a package you can get rpm packages for. I tried to install the rpm packages, but obviously on Angstrom they don't work. I then tried to install `rpm2cpio` by installing `busybox` using `opkg`, but `busybox` on `opkg` does not have the program!"} {"id":"86061","title":"How to know why server keeps restarting?","text":"It seems that my server keeps restarting. I want to know why. How can I know when the last time server was rebooted and why? root pts\/0 139.193.156.125 Thu Aug 8 21:10 still logged in reboot system boot 2.6.32-358.11.1. Thu Aug 8 20:38 - 21:11 (00:33) reboot system boot 2.6.32-358.11.1. Thu Aug 8 20:15 - 21:11 (00:56) reboot system boot 2.6.32-358.11.1. Thu Aug 8 19:16 - 21:11 (01:55) reboot system boot 2.6.32-358.11.1. Thu Aug 8 18:56 - 21:11 (02:14) reboot system boot 2.6.32-358.11.1. Thu Aug 8 18:24 - 21:11 (02:47) root pts\/1 139.193.156.125 Thu Aug 8 18:16 - crash (00:07) root pts\/0 195.254.135.181 Thu Aug 8 18:10 - crash (00:13) reboot system boot 2.6.32-358.11.1. Thu Aug 8 17:52 - 21:11 (03:19) root pts\/0 195.254.135.181 Thu Aug 8 17:38 - crash (00:13) reboot system boot 2.6.32-358.11.1. Thu Aug 8 17:08 - 21:11 (04:02) reboot system boot 2.6.32-358.11.1. Thu Aug 8 16:58 - 21:11 (04:12) reboot system boot 2.6.32-358.11.1. Thu Aug 8 16:45 - 21:11 (04:26) reboot system boot 2.6.32-358.11.1. Thu Aug 8 16:35 - 21:11 (04:36) reboot system boot 2.6.32-358.11.1. Thu Aug 8 16:27 - 21:11 (04:44) reboot system boot 2.6.32-358.11.1. Thu Aug 8 15:59 - 21:11 (05:12) reboot system boot 2.6.32-358.11.1. Thu Aug 8 06:15 - 21:11 (14:56) root pts\/1 208.74.121.102 Wed Aug 7 06:03 - 06:04 (00:00) root pts\/1 208.74.121.102 Tue Aug 6 15:34 - 17:40 (02:05) root pts\/0 139.193.156.125 Tue Aug 6 11:28 - 04:40 (1+17:11) In Linux is there ANY WAY to know why the system rebooted? Specifically did high load cause it? If not that then What?"} {"id":"111113","title":"Mail queue keep growing","text":"My server keeps running short on inodes due the mail queue getting crazy. First, I assumed I had `postfix` not configured properly, so I switched it off. But, it happened again, last time I did it I had : # postsuper -d ALL postsuper: Deleted: 375122 messages While I could put a cron to run this every morning, that does not seem to be the optimal solution. What could be the cause of such a behaviour? How can I prevent this too happen?"} {"id":"115417","title":"GTK Frontend for locate","text":"I am a heavy user of the `locate` tool, which is part of the `findutils` package. It's fine to use it on command line, but sometimes I would also like to search for a file (as fast as with `locate`) within my Xfce 4.10 desktop. Is there any nice GTK frontend (or a panel applet) for the `locate` command?"} {"id":"115411","title":"Switch between tabs (panels) in Mint","text":"How to switch between tabs (panels) in any window (i.e. setting windows for keyboard) in Linux Mint? I use `Ctrl`+`Tab` in Windows."} {"id":"46235","title":"How does reverse SSH tunneling work?","text":"As I understand this, firewalls (assuming default settings) deny all incoming traffic that has no prior corresponding outgoing traffic. Based on Reversing an ssh connection and SSH Tunneling Made Easy, reverse SSH tunneling can be used to get around pesky firewall restrictions. I would like to execute shell commands on a remote machine. The remote machine has its own firewall and is behind an additional firewall (router). It has an IP address like 192.168.1.126 (or something similar). I am not behind a firewall and I know the remote machine's IP address as seen from the Internet (not the 192.168.... address). Additionally, I can ask someone to execute `ssh (something)` as root on the remote machine first. Could anyone explain me, step by step, how reverse SSH tunneling works to get around the firewalls (local and remote machines' firewalls and the additional firewall between them)? What is the role of the switches (-R, -f, -L, -N)?"} {"id":"133986","title":"SSH: connect through intermediary server in just one step (through forwarded port)","text":"Related question: initiate ssh connection from server to client I have intermediary server with public IP (let it be `SERVER`), and I need to establish connection between two computers (`A` and `B`) without public IP, through this intermediary server. So, to connect from `A` to `B`, I can now do this: B$ ssh -N -R 2222:localhost:22 server_user@SERVER and now, from `A`, I can connect to `B` in two steps: A$ ssh server_user@SERVER SERVER$ ssh -p 2222 b_user@localhost Or in one line, but there are two steps anyway: A$ ssh -t server_user@SERVER \"ssh -p 2222 b_user@localhost\" But, I can't connect in just one step, like this: A$ ssh -p 2222 b_user@SERVER ssh: connect to host SERVER port 2222: Connection refused Why is this, and how to make it work? Note: I don't have any firewall at the `SERVER`, so it should accept incoming connection at port `2222`, it seems."} {"id":"19620","title":"ssh port forward to access my home machine from anywhere","text":"http:\/\/serverfault.com\/questions\/303937\/how-to-make-freebsd-box-accessible- from-internet I want to understand this whole process of `port forwarding`. I read so many things but failing to understand the very basic concept of port forwarding it self. What I have: > a freebsd server sitting at my home. > netgear router This is what I am trying to achieve: > to be able to access freebsd server from a windows machine over internet to > be able to open a webbrowser and access internet. > > > I also want to access this freebsd box from a ubuntu machine that I have. It will be great if someone can please help me. **Edit:0** here is the netgear router setup that I did for portforwarding. ![netgear port forwarding](http:\/\/i.stack.imgur.com\/KiPhu.png)"} {"id":"82299","title":"Accessing Apache server over the Internet","text":"I'm trying to access my Apache server over the Internet. When I use my external IP to connect from a different system, my router's welcome page is displayed. How can I access the server?"} {"id":"98726","title":"Reverse connection to SSH server","text":"Machine A is connected to the internet and is behind firewall so it cannot receive incoming connections. Machine B is open to the internet. I want to be able to type commands into B and have them execute on A. Except it is A that has to reach out to B to establish the connection before B can send it commands. Can this be done running SSHd on A and plain SSH client on B or do I need a combination of SSHd and SSH client on A (client to establish reverse tunnel pointing to SSHd)."} {"id":"115897","title":"What's ssh port forwarding and what's the difference between ssh local and remote port forwarding","text":"I feel confused about ssh port forwarding and the difference between ssh local and remote port forwarding. Could you please explain them in detail and with examples? Thanks!"} {"id":"120164","title":"Boot Menu Fedora and Window 7","text":"I have install Fedora 20 before, a few days ago , I just install Window 7, and now I can not boot to Fedora because I don't have a boot menu. Is there anyway to recover the Fedora boot menu, is there any free software to do it without using the Fedora CD to recover it."} {"id":"147624","title":"wget files by pattern only from specified directories recursively","text":"I need to download on an hourly basis (sometimes more frequently), files which are being written in segments of 24 hours. The files I am interested in are in specific subdirectories which I am trying to specify with `-I list` but this doesn't work for some reason. If I don't specify directories the files I need download fine with the `-A acclist` option but I end up with lots of empty directories that are being created because they exist on the host. my current line reads: wget -np -nH --cut-dirs=X -c -N -r -l 0 \\ -I \/dir1,\/dir2,...,\/some_dir -A acclist \\ http:\/\/hostname\/X_sub_directories\/ How do I download **only** the files I want and create **only** the directory hierarchy for those files?"} {"id":"19634","title":"Linux equivalent for Windows Startup","text":"**Is there any way to add an application\/script to the Linux startup so every time the system is on it executes** [i'm looking for some automated way, user should not add this by cron job or something like that]. Yeah you are right, i want to create a little cute virus :) and also want to know if it is possible."} {"id":"94501","title":"Unable to login to Linux box running Xfce using LXDM login manager","text":"I am running a Linux box with the `LXDM` login manager and Xfce as my desktop environment. Every time I login, this is the screen I get: ![enter image description here](http:\/\/i.stack.imgur.com\/mh0Nh.png) If I enter the right password, the system logs me in without any problems. But if I enter the wrong password, after a few seconds, this is what I get: ![enter image description here](http:\/\/i.stack.imgur.com\/78GEG.png) Because of this, I end up rebooting the whole machine so that I can get the input box to enter the correct password. Could someone please tell me how I might solve this issue? Or at least point me in the right direction?"} {"id":"19633","title":"Which header defines the macro that specifies the machine architecture?","text":"_Shorter version of question:_ Which C header contains the macro that corresponds to the machine architecture of the system (e.g., `__x86_64__`, `__ia64__`, `__mips__`?) _Longer version of question:_ I'd like to run the ganglia monitoring tools on a Tilera-based system that runs Linux. Ganglia doesn't currently have support for Tilera. To get this to work, I ned to modify a C function called machine_type_func that returns the machine architecture. The body of this function is determined at compile-time, it looks like this: g_val_t machine_type_func ( void ) { g_val_t val; #ifdef __i386__ snprintf(val.str, MAX_G_STRING_SIZE, \"x86\"); #endif #ifdef __x86_64__ snprintf(val.str, MAX_G_STRING_SIZE, \"x86_64\"); #endif ... return val; } I need to add the appropriate line for Tilera, but I don't know the name of the macro that specifies a Tilera-based system. I'm guessing this macro is defined in one of the standard Linux headers, but I don't know which one to look in."} {"id":"17571","title":"Vim markers and macros","text":"Is there a way to make a macro operate up to a marker? I know if I do `5@a` my macro will operate on 5 lines. Example: set marker with `mc` record a macro with `qa` ... now what? Obviously `'c@a` just moves the cursor to the marker at c. I've tried buffers, `\"b'c`, but that just goes to the marker. I'm probably missing something very basic or just looking in the wrong places."} {"id":"17574","title":"Is there a maximum size to the bash history file?","text":"Can I increase the size of the command history in bash? Note that I use a Red Hat Linux computer in the undergraduate astrophysics department here (so I don't get that many privileges)."} {"id":"13402","title":"Disable \/net ghosting for autofs5","text":"I recently have been trying out Arch Linux. It seems that their autofs has a usability bug, although I confess that I'm new enough to Arch that I may be missing something horribly obvious. I want autofs to automagically mount hosts under `\/net` like it has always done. Traditionally it used `\/etc\/auto.net` to accomplish this, however it seems that they've done away with this and now you simply use the following line: \/net -hosts --timeout=60 Fine and dandy, most things seem to work. However, under Arch it seems that ghosting is enabled by default. This is a bad thing, because it uses my hosts file which only contains aliases of my local host (which is NOT running an NFS server, mind you). As a result, I get all kinds of errors about being unable to mount these hosts _every time_ I run an `ls` in `\/net`. Notice: I'm not using `\\--ghost`, and yet it enables it by default. Arch confirms this on their wiki. This is extremely annoying, how do I _disable_ ghosting? Google has failed me horribly, any insight is appreciated. Thanks."} {"id":"41952","title":"How to enable WIFI on VMWare Fedora 12? (It's detecting and working fine on Windows 7)","text":"I am new to Linux. I have Fedora 12 running on my VMware. I am unable to see any options to enable WIFI connection on Fedora. When I am accessing Internet through WIFI and its working perfectly fine on Windows 7 (on which VMware is running on). Am I missing something here? Can someone help me out with this!"} {"id":"41957","title":"How to define a `bc` function for later use?","text":"I've always found `bc` kind of mysterious and intriguing. It was one of _the_ original Unix programs. And it's a programming language unto itself. So I gladly take any chance I can find to use it. Since bc doesn't seem to include a factorial function, I want to define one like so: define fact(x) { if (x>1) { return (x * fact(x-1)) } return (1) } But... I can't then reuse that, can I? I'd want to be able to do something like me@home$ bc <<< \"1\/fact(937)\""} {"id":"77113","title":"What does .\/ mean?","text":"I'm having a hard time getting what `.\/` does. In the Linux Essentials books, it asks me in an exercise to delete a file named `-file`. After googling, I found that I need to do `rm .\/-file` but I don't get why!"} {"id":"46457","title":"Upstart: How to run a \"stop\" before stopping other services?","text":"I recently found out about the upstart \"service starter\" that Ubuntu is using and that is (apparently) the future to start\/stop jobs in Linux. It's pretty new to me (I was used to the old SysV system of putting scripts in `\/etc\/rc[X].d\/`) and I don't know if it's possible to stop a service (call the service with the \"`stop`\" parameter, although the parameter doesn't seem to matter that much anymore) before other services are stopped. I want to run a small script that informs a remote server that the machine is shutting down. I need to run that script before the `dbus` and the `network` services are taken down. Is there any way of doing it with Upstart? Or... better said, what is the way of doing that through Upstart `.conf` files? (I'm sure there's a way, I just don't know it)"} {"id":"46451","title":"ssh-agent not starting in OpenSuSE desktop","text":"It seems that ssh-agent is not starting on my OpenSuSE system. When I run `pgrep -fl ssh-agent`, the result is blank. On my Linux Mint laptop, I get `1785 \/usr\/bin\/ssh-agent \/usr\/bin\/dbus-launch --exit-with-session x-session- manager`. How do I fix this? Can anyone with OpenSuSE check to see if it's not started up by default, or if I maybe messed something up? ### things tried... I've tried adding the following to `.xinitrc`, if test -S \"$SSH_AUTH_SOCK\" -a -x \"$SSH_ASKPASS\"; then ssh-add < \/dev\/null fi and my `.xsession` file contains, ssh-agent { ssh-add & startkde } but neither of these things seems to do anything. Thanks in advance!!"} {"id":"140263","title":"Is there some way to make alias expansion work inside if...fi on Bash?","text":"Check this script: #!\/bin\/bash if true;then alias WeirdTest='uptime';shopt -s expand_aliases WeirdTest fi WeirdTest The first time `WeirdTest` is executed it says \"command not found\"."} {"id":"100936","title":"phpmyadmin in linux installation","text":"I am trying to install **Request Tracker** tool in my **RHEL 5.6** machine.I am following the instructions as mentioned in this link. However, I am facing couple of issues. The first issue is in the below step. I have some dependency issues for php files. # yum install rpm* nmap expect vsftpd net-snmp* ntp* subversion subversion-devel mysql mysql-server mysql-devel screen perl-Crypt- PasswdMD5 graphviz php-xml php-cli php-mhash php-ldap php-devel php-pdo php-imap php-readline php-ncurses php-soap php-snmp php-common php-mcrypt php-odbc php-mbstring php-gd php-bcmath php php-xmlrpc php-pear php-mysql php-dba mod_perl-devel mod_auth_mysql mod_perl mod_authz_ldap gd gd-devel gd-progs gcc* -- exclude=gcc-java* -- exclude=gcc4-java phpmyadmin mod_fcgid perl-GD perl-GnuPG-Interface perl-GraphViz perl-YAM So, I tried to do the below command. yum install php When I do the above command, I received the below message. Package matching php-5.1.6-40.el5_9.i386 already installed. Checking for update. Nothing to do So, as per the tutorial link, I needed **phpmyadmin**. So, I used the below command. It gave me the below output. Error: Missing Dependency: php-api = 20041225 is needed by package php-mcrypt-5.1.6-5.el5.i386 (epel) Error: Missing Dependency: php-common = 5.1.6-40.el5_9 is needed by package php-gd-5.1.6-40.el5_9.i386 (rhel-i386-server-5) If I try to install the missing dependencies, **php-common** using yum command, I receive the below message. Package matching php-common-5.1.6-40.el5_9.i386 already installed. Checking for update. If I try to install the missing dependency, **php-api** using yum command, I receive the below message. php53-common-5.3.3-21.el5.i386 from rhel-i386-server-5 has depsolving problems --> php53-common conflicts with php-common How can I install the phpmyadmin so that I can continue with the installation of Request tracker tool?"} {"id":"46459","title":"Install another PHP version. Fedora 17","text":"How can I install another PHP version? I have php 5.4.5 for now, but I need the version 5.3.15 running too. How can I perform this on Fedora 17? Without using a Virtual Machine?"} {"id":"20601","title":"Is there any web browser that uses keybinding apart from uzbl?","text":"I have just found out about uzbl but for some reason it crashes with segmentation fault when I log into gmail (Arch). I don't have the time nor the knowledge of dealing with this segmentation fault so I have thought about using another browser of that type. Are there any? Thanks."} {"id":"20600","title":"Should I put application into \/usr\/local or \/usr\/local\/share?","text":"What are the \"standards\" -- should I put application (not just binary, but entire distribution) to \/usr\/local or \/usr\/local\/share. For example scala or weka -- it contains examples, binaries, libraries, and so on. So it would be \/usr\/local\/scala-2.9.1 or \/usr\/local\/share\/scala-2.9.1 Since I am the only admin it is not a big deal for me, but I prefer to using something which is widely used, not with my own customs. **Important:** I am not asking about cases, where you should split app into \/usr\/local\/bin, \/usr\/local\/lib and so on. Rather I am asking about case when you have to keep one main directory for entire application."} {"id":"101043","title":"Linker error: \/usr\/bin\/ld: cannot find -lgcc_s","text":"I am trying to compile `symlinks` (tar.gz-file), which is a very small tool with one line for compilation: gcc -Wall -Wstrict-prototypes -O2 -N -s -o symlinks symlinks.c which gives the error .... \/usr\/bin\/ld: cannot find -lgcc_s \/usr\/bin\/ld: cannot find -lgcc_s collect2: ld returned 1 exit status The output of \/sbin\/ldconfig -p | grep libgcc is libgcc_s.so.1 (libc6) => \/lib\/i386-linux-gnu\/libgcc_s.so.1 and trying to include the mentioned directory directly gcc -Wall -Wstrict-prototypes -L \/lib\/i386-linux-gnu\/ -O2 -N -s -o symlinks symlinks.c produces the same error. Three questions: 1. Why does it not work with the first command, as the lib seems to be in the search path 2. Why does including the path itself does not help 3. How to fix this?"} {"id":"118969","title":"A shell-like environment for binary processing","text":"This question came to me a couple of times before, now in response to the question Loop through binary data chunks from stdin in Bash Answers given in http:\/\/stackoverflow.com\/questions\/993434\/what-language-is-to-binary-as-perl- is-to-text were also not satisfactory. I'm looking for a scripting environment suited specifically to handle I\/O with binary files. I know I can use one of the fully-fledged programming languages (c\/Python\/...) but they have an enormous initialization and coding overhead (allocation and fread\/fwrite in c, bitstrings in Python...) not to mention they are less suited for scripting (calling other applications from it). Perl is no better with its `unpack` functions, string-oriented operation and goofy syntax. Something like `od`, but as a language. What I expect: 1. set or change endianness with a single switch\/command. 2. simple specification of requested type (something like extending bash `read var` with `int32 var`, `float var` etc.). 3. handling of binary through pipes, skipping of specified number of bytes. 4. standard scripting flow control (for\/if\/...) that we are used to. I'd like to process raw data (photography, scientific data, unknown and poorly documented formats) with the same ease and insight that you get when inspecting ASCII files. I'm using `c` now, but it's not optimal for ad-hoc scripting, and can't be interactive. Does anyone know a tool like that? No clicky GUI software, please, it needs to work over ssh, from other scripts and so on. \"Does not exist\" is an acceptable, but depressing answer."} {"id":"146035","title":"Different between `ulimit -e` and `renice`?","text":"I would like to run a backup script in low CPU and disk I\/O. Is there any different between this: #!\/bin\/bash ulimit -e 19 ionice -c3 -p $$ and this: #!\/bin\/bash ionice -c3 -p $$ renice -n 19 -p $$"} {"id":"101044","title":"present users a login prompt? \/bin\/login? getty?","text":"I have a service that execs a command when a user connects to it through a socket, and redirects everything it receives to the executed program. It works ok with shells like bash, giving the user a remote shell. Instead of forking bash or sh, I'd like to run something that asks for user and password, like `\/bin\/login` Is that the correct command to run? Isn't there anything that a non-root service could use to do the same? I thinks `getty` calls `\/bin\/login`, but can I just run it as a user? I guess I could install telnetd and redirect to `telnet localhost` but I'd rather not run a telnet server."} {"id":"116019","title":"Why are rules not combining in an ssh config file?","text":"It seems like the following would work as expected, i.e., that the second rule, having a hostname that matches the first rule, would apply it. Host *.hostname.com User myuser IdentityFile ~\/.ssh\/myidentity Host blah HostName complicated.hostname.com However typing `ssh blah` only applies the second rule (and not the user or identity file of the first one). I have two questions: 1. Why is this happening? 2. Is it possible to (simply) do what I am trying to do?"} {"id":"46985","title":"Home folder structure in Ubuntu 12.04.1?","text":"Long story short, i just accidentally deleted my entire home folder. Thankfully it seems like the hidden files are still there. I'm not sure, but aren't all of the folders within the home folder (Desktop, Downloads and whatever else is in there) empty by default? If that is the case, could some super nice person just name all of the files located in the home folder so that i can rebuild it? Thanks a bunch in advance"} {"id":"46988","title":"Return value of commands when using stdin?","text":"Imaging I am executing the following command: echo \"root:mypass\" | chpasswd How can I get the return code \/ error code returned by chpasswd? Is that possible in this case at all? I tried RET = `echo \"root:mypass\" | chpasswd` but this gives me only \"command not found\"?"} {"id":"128772","title":"Persistent folder missing from home folder, despite correct password and no errors","text":"Tails 1.0 on stick 1. Password entered correctly on login screen for persistent storage (otherwise it would complain.) Booting from another (older) Tails stick, stick 2, can unlock and mount stick 1's persistent storage just fine and see all files. So why when I boot from stick 1 and enter the password correctly, does the Persistent folder not appear in the home folder (not in file browser GUI nor `sudo ls -a ~\/`)? There's no error or anything, so why might it be missing?"} {"id":"134063","title":"Cant detach\/ kill xm console on node server","text":"please advice, why I cant attach console from xm command? > [root@vm ~]# xm console vm104 > Another console has already been attached to guest"} {"id":"44580","title":"Monitoring interface changes with udev, especially if a route is set","text":"Is there a way to monitor interface up\/downs, especially to check if a route is setup or removed, with udev?"} {"id":"44585","title":"Issue with degraded raid5 after power outage","text":"I have a raid5 that consists of 8 disks. After a power outage mdadm tells me that the raid is degraded. Here is the output: \/dev\/md0: Version : 0.90 Creation Time : Sat Jul 10 09:08:28 2010 Raid Level : raid5 Array Size : 13674601472 (13041.12 GiB 14002.79 GB) Used Dev Size : 1953514496 (1863.02 GiB 2000.40 GB) Raid Devices : 8 Total Devices : 7 Preferred Minor : 0 Persistence : Superblock is persistent Update Time : Thu Aug 2 18:42:05 2012 State : clean, degraded Active Devices : 7 Working Devices : 7 Failed Devices : 0 Spare Devices : 0 Layout : left-symmetric Chunk Size : 64K UUID : 09dd4536:a6153f6b:f1f4aaa9:53aab85a Events : 0.9189750 Number Major Minor RaidDevice State 0 8 0 0 active sync \/dev\/sda 1 8 16 1 active sync \/dev\/sdb 2 8 96 2 active sync \/dev\/sdg 3 8 112 3 active sync \/dev\/sdh 4 8 32 4 active sync \/dev\/sdc 5 8 48 5 active sync \/dev\/sdd 6 8 64 6 active sync \/dev\/sde 7 0 0 7 removed So \/dev\/sdf is missing. So I tried to get some infos about this drive. smartctl does not report any issues and `fdisk -l` lists it as expected. Lastly I tried `mdadm -E \/dev\/sdf` and I get this output: \/dev\/sdf: Magic : a92b4efc Version : 0.90.00 UUID : 09dd4536:a6153f6b:f1f4aaa9:53aab85a Creation Time : Sat Jul 10 09:08:28 2010 Raid Level : raid5 Used Dev Size : 1953514496 (1863.02 GiB 2000.40 GB) Array Size : 13674601472 (13041.12 GiB 14002.79 GB) Raid Devices : 8 Total Devices : 8 Preferred Minor : 0 Update Time : Wed Mar 28 17:19:58 2012 State : clean Active Devices : 8 Working Devices : 8 Failed Devices : 0 Spare Devices : 0 Checksum : afeeecc7 - correct Events : 9081618 Layout : left-symmetric Chunk Size : 64K Number Major Minor RaidDevice State this 7 8 112 7 active sync \/dev\/sdh 0 0 8 0 0 active sync \/dev\/sda 1 1 8 16 1 active sync \/dev\/sdb 2 2 8 32 2 active sync \/dev\/sdc 3 3 8 48 3 active sync \/dev\/sdd 4 4 8 64 4 active sync \/dev\/sde 5 5 8 80 5 active sync \/dev\/sdf 6 6 8 96 6 active sync \/dev\/sdg 7 7 8 112 7 active sync \/dev\/sdh What is the issue here? Should I replace `sdf` or is this repairable? **Update** I also had look at `dmesg` and I get this: [ 9.289086] md: kicking non-fresh sdf from array! [ 9.289090] md: unbind [ 9.296541] md: export_rdev(sdf)"} {"id":"70415","title":"Backtrack mp3 problem","text":"I've installed Backtrack but I can't figure out how to play mp3files. I've installed ubuntu-restricted-extras,lame, libmp3lame but still won't work(I have Rhythmbox player, I've also tried Amarok). Any ideas?"} {"id":"134629","title":"Apply item replacement inside enumerate in Perl regex?","text":"Data 7. Masi is the same as \\begin{enumerate} A B ABC ha lorem \\end{enumerate} 1. ABC is \\begin{enumerate} P B Lorem maam \\end{enumerate} which I want to be 7. Masi is the same as \\begin{enumerate} \\item A \\item B \\item ABC ha lorem \\end{enumerate} 1. ABC is \\begin{enumerate} \\item P \\item B \\item Lorem maam \\end{enumerate} My startup regex is based on this answer > > perl -000pe > s\/\\n\/\\n\\\\begin{enumerate}\\n [A-Za-z1-9]* \\end{enumerate}\/ > ... [problem here!] > masi.tex > where * -000 : activate Perl's paragraph mode, this causes \"lines\" to be defined by two consecutive newlines (\\n\\n), so that each of your questions is treated as a single line. * -pe : read each line of the input file and print it (-p) after applying the script passed as -e. I want to replace the beginning of each new line inside the match with `\\item`. My pseudocode for **problem here code** > s\/\\n\/\\item \/g to apply things inside enumerate environment. How"} {"id":"38808","title":"Why is cd not a program?","text":"I've always wondered why `cd` isn't a program, but never managed to find the answer. Anyone know why this is the case?"} {"id":"116955","title":"where is `cd` located?","text":"In a bash sub shell I get the following error when running cd sudo: cd: command not found This is expected because I don't have a path. Usually to work around this I just provide the full path like so: (\/usr\/local\/bin\/foo) Much to my surprise, `cd` does not appear to be in any of the normal places. which cd whereis cd ls \/bin | grep cd By comparison, `ls` is right where I would expect. which ls \/bin\/ls Where is the `cd` command located? And why is different from all the other commands? **Update** Another interesting tidbit, cd does not show up in `hash` hash 0 \/bin\/ls 2 \/usr\/bin\/find 2 \/sbin\/ip 1 \/usr\/bin\/updatedb 1 \/usr\/bin\/apt-get"} {"id":"123457","title":"What happens when we type a simple command on shell?","text":"I have a simple doubt on execution of a simple command. As per my understanding, when we type a command such as `ls` on interactive shell, 1. Shell interpretes the command. 2. Shell creates a child process and excecutes the command on the child process. 3. Shell waits for the child process's completion. If my understanding is correct, a simple command we typed on shell prompt is executed on a child process and the command' result does not affect current shell's enviroment. If so, what about built-in commands like `cd`? If `cd` is executed on a child process and can not affect current shell's enviroment, how the current shell's working directory can be changed?"} {"id":"145512","title":"Allow non-root unmodifiable sofware to bind to ports 80 & 443","text":"The company I'm in uses the Java Secure Application Manager to \"secure\" non- internal connections their webmail and electronic collaboration software. Aside from using expired certificates, and missing the permissions JAR File Manifest Attributes, the sofware runs fine, except it needs to bind to ports 80 and 443, which means to run it, i need to be running the Icedtea plugin in Firefox running as root. Is there anyway i can let this application access to those ports without needing to run it as root. (For security reasons)."} {"id":"121648","title":"Debian - How to find out if a package is multiarchified? Dependency changes as bug report","text":"I'm using Debian Wheezy 64bit and wine is only existing in a 32bit version. So I added multiarch support. But when I want to install winetricks it's dependencies are `depends on wine | wine-unstable` and not `depends on wine | wine-unstable | wine:i386` So, aptitude suggests to install the dummy 64bit package or to not install winetricks... which doesn't make a lot of sense :) So, I wonder if I have to report a bug because winetricks' dependencies are wrong. For me it seems like that, but I would expect that bug report already to be written. How do I find out if a package has already been multiarchified? Will this issue be solved by only adding the `| wine:i386` in the package informations? Shall I write a bug report in such cases?"} {"id":"123645","title":"Update Linux 10 Mint Julia to 13 Maya","text":"Everytime I try to `apt-get update` it comes up with the following: > Err http:\/\/archive.ubuntu.com Precise\/main amd64 Packages > 404 Not Found [IP: 91.189.91.14 80] > Err http:\/\/archive.ubuntu.com Precise\/restricted amd64 Packages > 404 Not Found [IP: 91.189.91.14 80] What am I doing wrong?"} {"id":"15941","title":"Debian 6: media keys in gnome-settings-daemon don't work","text":"I am running a minimal Debian 6 x86_64 setup with `pulseaudio`, `alsa` and `gnome-settings-daemon`. Whenever I press a media key, `gnome-settings-daemon` spits the following out to `stderr`: ** (gnome-settings-daemon:4205): CRITICAL **: acme_volume_get_volume: assertion `acme_volume_open(self)' failed How can I avoid this issue?"} {"id":"64004","title":"Sorting by one column then the","text":"Say i have a output file with following: 010513 08:04 ROUTER1 192.168.1.1 68.130.5.10 HIT(1) 010513 08:04 ROUTER1 172.168.1.1 28.130.5.10 HIT(1) 010513 08:04 ROUTER1 122.168.1.1 168.130.5.10 HIT(1) 010513 08:04 ROUTER1 192.168.1.1 18.130.5.10 HIT(1) 010513 08:04 ROUTER1 152.168.1.1 58.130.5.10 HIT(1) 010513 08:04 ROUTER1 142.168.1.1 10.130.5.10 HIT(1) I'm trying to sort with the 4th column followed by 5th and having highlighted colors would work too as my true output file has about 20 columns. Tried using various grep | sort commands and having difficulty getting this to work without running my result file a few times. I dont script so I am sure there is one out there but thought I would ask if there are a combo command\/variables I can try."} {"id":"81381","title":"Removing second colon","text":"Trying to create a simple script that lists mass mailing by the queue number that appears in \/var\/log\/maillog. I'm starting off with this: [root@ditirdlns01 ~]# lsMails(){ grep -i \"$1-bounces@xxx.edu\" \/var\/log\/maillog | cut -f1-2,4 -d: ;} [root@ditirdlns01 ~]# Which yields: [root@ditirdlns01 ~]# lsMails systems Jul 1 15:12: AF649479A Jul 1 15:14: 024682F59 Jul 1 15:14: 067A447B9 Jul 1 15:14: 0A3EA479A Jul 1 15:14: 0DCBE5010 Jul 1 15:21: 97DAB2F59 Jul 1 15:24: D1D9B2F59 Which is perfectly alright except I want to get rid of the second colon (which in the log is what separates the minute from second, obviously. I actually don't want the second to be visible to users so cropping it out works for me). I tried piping it through sed looking for a colon preceded by a number with a space afterwards but I get identical results as before: [root@ditirdlns01 ~]# lsMails(){ grep -i \"$1-bounces@xxx.edu\" \/var\/log\/maillog | cut -f1-2,4 -d: | sed 's\/([0-9]):\\s+\/ \/g';} [root@ditirdlns01 ~]# lsMails systems Jul 1 15:12: AF649479A Jul 1 15:14: 024682F59 Jul 1 15:14: 067A447B9 Jul 1 15:14: 0A3EA479A Jul 1 15:14: 0DCBE5010 Jul 1 15:21: 97DAB2F59 Jul 1 15:24: D1D9B2F59 My specific question is: Why is `([0-9])` not matching a digit without including it in the result?"} {"id":"69030","title":"\/etc\/ld.so.conf doesn't contain \/usr\/lib","text":"I am using `pkg-config` to help supply the correct libs during c++ compilation. As I understand it, it searches in directories supplied by `\/etc\/ld.so.conf`. My `ld.so.conf` references the following lib locations via an include directive pointing to `\/etc\/ld.so.conf.d\/*.conf`: \/usr\/local\/lib \/lib\/x86_64-linux-gnu \/usr\/lib\/x86_64-linux-gnu Problem is the library I need is under `\/usr\/lib` by default. Can I just add in this path to `\/etc\/ld.so.conf` myself or move the library or what is the recommended practice?"} {"id":"155142","title":"How can I cat the contents of files found using find into a single file?","text":"I managed to shoot myself where it hurts (really bad) by reformatting a partition that held valuable data. Of course it was not intentional, but it happened. However, I managed to use `testdisk` and `photorec` to recover most of the data. So now I have all that data distributed over almost 25,000 directories. Most of the files are .txt files, while the rest are image files. There are more than 300 .txt files in each directory. I can `grep` or use `find` to extract certain strings from the .txt files and output them to a file. For example, here's a line that I've used to verify that my data is in the recovered files: find .\/recup*\/ -name '*.txt' -print | xargs grep -i \"searchPattern\" I can output \"searchPattern\" to a file, but that just gives me that pattern. Here's what I really would like to accomplish: Go through all the files and look for a specific string. If that string is found in a file, cat ALL the contents of that file to an output file. If the pattern is found in more than one file, append the contents of subsequent files to that output file. Note that I just don't want to output the pattern I'm searching for, but ALL the contents of the file in which the patterns is found. I think this is doable, but I just don't know how to grab all the contents of a file after grepping a specific pattern from it."} {"id":"126034","title":"Forward Only Email Server","text":"I have a custom domain (I'll use the real domains cause I'm desperate at this point :) ) www.grantorino.io, and I want to forward all email addresses sent to yehiasalam@grantorino.io to yehia.asalam@gmail.com. I followed the logical steps but I can't seem to get it right. This is what I did so far: 1. Map the MX record to the grantorino server, ![dig](http:\/\/i.stack.imgur.com\/PeF5l.png) a dig command shows that the mx have no problems, and that mail.grantorino.io maps correctly to my server. 2. Next step is allowing port 25 on the firewall settings, so it's now open to accept TCP connections from port 25![Webmin Firewall Settings](http:\/\/i.stack.imgur.com\/Jds1P.png) 3. Make Sendmail forward any mails from yehiasalam@grantorino.io to yehia.asalam@gmail.com. I started with allowing the virtuser feature, an excerpt from sendmail.mc FEATURE('virtusertable', 'hash -o \/etc\/mail\/virtusertable.db')dnl 4. The virtusertable I added yehiasalam@grantorino.io yehia.asalam@gmail.com and compiled using `makemap hasg virtusertable.db < virtusertable` 1. Also in the access file I added Connect:grantorino.io RELAY and compiled using `makemap hash access < access.db` 1. Finally in the sendmail.c I changed the DEAMON_OPTIONS line to DAEMON_OPTIONS(`Family=inet, Name=MTA-v4, Port=smtp')dnl Thats pretty much it. I'm not sure whether I should do something more. The problem right now is that I'm not getting any emails forwarded. This is the tail of maillog, after a couple of minutes of sending an email to yehiasalam@grantorino.io. As you can see I'm not getting any activity at all. Please advise.![enter image description here](http:\/\/i.stack.imgur.com\/gcsVi.png)"} {"id":"103532","title":"Skype does not appear in panel (elementaryOS 0.2)","text":"I had removed skype panel icon with this method : http:\/\/askubuntu.com\/questions\/7479\/how-can-i-remove-the-skype-panel-icon-in- ubuntu-12-04-and-earlier\/118979#118979 It worked fine, and I was using skype-wrapper to have skype in my messaging menu.. Then skype-wrapper has stopped working and I wanted to have my skype icon back.. I have reinstalled sni-qt (I never removed it but anyway I did reinstall it.) and I have reinstalled skype too (following this link :http:\/\/askubuntu.com\/questions\/68616\/i-installed-sni-qt-and-there-is-no- indicator-for-skype-how-do-i-fix-this) but it didn't do anything.. (I will add that I don't need to whitelist it in dconf editor because I'm using elementaryOS Luna 2.0 and doesn't have a whitelist but a blacklist (which I have checked)) What package sould I add or update ? I tried to update QT libraries unsuccessfully.. Cheers! ElementaryOS 2.0 Luna, based on Ubuntu 12.04"} {"id":"122564","title":"Installing Elementary Isis beta","text":"How can I install Elementary OS Isis Beta? I tried to made a bootable stick using the latest iso builds but for some reason I cannot login. Having elementary OS installed on my machine, how can I update every day to the latest build? I want to update to elementary OS Isis and to be up-to-date even it is unstable."} {"id":"52692","title":"How do I delete a partial package in OpenBSD","text":"While upgrading, I tried to add a package that was already there and due to some error, a partial package got created - partial-gnutls. When I try to delete this partial package, I get these errors: File \/usr\/local\/share\/locale\/cs\/LC_MESSAGES\/pkg.qX9SMkCPZb does not exist File \/usr\/local\/share\/locale\/de\/LC_MESSAGES\/pkg.Dfpr8PbT3X does not exist File \/usr\/local\/share\/locale\/en@boldquot\/LC_MESSAGES\/pkg.wIH7fQJbhK does not exist File \/usr\/local\/share\/locale\/en@quot\/LC_MESSAGES\/pkg.c8llMmPSGl does not exist Read failed: Input\/output error at \/usr\/libdata\/perl5\/OpenBSD\/md5.pm line 59 I checked the source code. It is some coe that adds a file into some data structure (most probably, it is finding out which files to delete) and it fails to do so because the file is no longer there. How do I get rid of this partial package?"} {"id":"61073","title":"What does this syntax mean \"${i%.avi}.mp4\"","text":"> **Possible Duplicate:** > How do ${0##*\/} and ${0%\/*} work? I have encountered this type of syntax somewhere on the web : for i in *.avi do ffmpeg -i \"$i\" \"${i%.avi}.mp4\" done how does this `\"${i%.avi}.mp4\"` and how can I use it ?"} {"id":"8662","title":"Selecting the right GRUB","text":"I've just installed Backtrack on my harddrive (got one), i also got Fedora and Windows 7. However, now i get the Backtrack-GRUB instead of my Fedora GRUB. How do i change that? I got a sda5 containing my Fedora GRUB so it should be easy to 'rewire' - i don't know how tho."} {"id":"17897","title":"What OS should I install on old Sun Blade 1000 \/ Sun Blade 2000 workstations, and how should I do it?","text":"I was given some nice old Sun UNIX workstations, Sun Blade 1000 and Sun Blade 2000. These are UltraSparc machines running Solaris 8 (which, with regard to all questions below, is useless because the former owner could not provide me with any passwords). I'd like to get them running again, and because I don't like computers on \"static display\", would prefer having some typical software on them. So, 1. what OS and application software would you suggest? I'm not too interested in 100% \"historical\" accuracy, but would like something that lends itself to demonstrating a \"typical UNIX workstation\". Bonus points if the OS you suggest can still be used to compile some useful modern software from source (like Chromium) without having to create an entire build environment from scratch. 2. How do I even boot these machines from a CD? Searching around some forums gives me the impression that I need a special Sun keyboard in order to press \"Stop-A\" during boot... can this be done on a regular PC-style keyboard?"} {"id":"146661","title":"Changing the date format of auth.log","text":"I was looking to change the date format in which `auth.log` logs information. I could not find a way to do it. Is there a method to do this? My system uses rsyslog."} {"id":"126691","title":"Tracking my shell path in Emacs","text":"Not a long time ago, I found the following precious snippet that allows Emacs to track my current directory on any `ansi-term` buffer. More specifically, if I `cd ` from within a terminal inside Emacs, and I then press `C-x C-f`, Emacs will run `find-file` from `` directly, which is very, very handy. if [ -n \"$INSIDE_EMACS\" ]; then chpwd() { print -P \"\\033AnSiTc %d\" } print -P \"\\033AnSiTu %n\" print -P \"\\033AnSiTc %d\" fi However, the above trick doesn't work if I `ssh` to a remote machine from the shell. Ideally in this case, if I press `C-x C-f` Emacs should recognize that I have sshed to some machine, and use tramp to run `find-file` on the corresponding machine and remote path. This takes me to the following two questions: 1. How and why does the snippet above work? 2. How can I extend it so that it can also track my remote paths after I ssh into another machine?"} {"id":"66842","title":"Linux kernel development for multi core architecture","text":"I am working on a project adapting system software like the Linux kernel. I read one paper titled \"Experience on Comparison of Operating Systems Scalability on the Multi-core Architecture\" that tells how to detect bottlenecks using benchmarking. I am following their experimental approach and am able to generate a profiling report using the profile tool, but I am not able to detect bottlenecks from this profiling report. Basically, I am not able to explore the no-vmlinux part, and I am not able to find those functions related to bottlenecks. Also I am not able to use `lockstat.txt` as there is no file in `\/proc\/sys\/kernel\/lock_stat`."} {"id":"52385","title":"What is the difference between .\/script and . .\/script?","text":"> **Possible Duplicate:** > Using ‘.’ to execute files in bash I was trying to figure out how to export my environmental via script instead of changing my .bashrc file. I found this old useful post that said: > Variables can only be exported to subordinate processes, you can't pass them > back up to the parent. If you really want your script to affect the parent > shell's environment, run the script as > > > . .\/yourprogram > I just want to know what the difference is between `. .\/script` and `.\/script`? When I look at it, they booth mean to me, run the script from the current directory?"} {"id":"65634","title":"Difference between \". myscript\" and \".\/myscript\"","text":"I am confused by \"one only dot - space - shell script name\" (like `. myshellscript`) and \"path to shell script\" (like `.\/myshellscript`) commands. What for they are? I noticed the command `. myshellscript` executes shell script even with -rw-rw-r--. But `.\/myshellscript` doesn't. So I am confused."} {"id":"1136","title":"Batch renaming files","text":"I have a directory full of images: image0001.png image0002.png image0003.png ... And I would like a one-liner to rename them to (say). 0001.png 0002.png 0003.png ... How do I do this?"} {"id":"114414","title":"Batch renaming of files","text":"I have a directory full of images: DSCN4749.JPG DSCN4750.JPG DSCN4892.JPG ... And I would like a one-liner to rename them to (say). dscn4749.jpg dscn4750.jpg dscn4892.jpg ... How do I do this? Alternatives\/extenstions\/caveats * I want to recurse * The directory contains a mix of file types I only want to rename DSCN*.JPG files. * bash solution * perl solution * zsh solution * I want a new directory tree with hard links existing files. * I want to change name more than just a case change eg dscn5555.JPG to 05555.jpg ..."} {"id":"56799","title":"Bash Globbing Variable Substitution?","text":"> **Possible Duplicate:** > Batch renaming files I want to rename files using their existing name as a base for the new one. So if I can `ls` these files with ls blue*+(.png) I'd want to rename them something like mv blue$(*)+(.png) $(1).png except that doesn't work obviously. Is there syntax for these kind of variables in bash globbing or is there an easier way?"} {"id":"114340","title":"Append to the name of each file in directory","text":"How to append “.backup” to the name of each file in your current directory?"} {"id":"81657","title":"batch rename file names including spaces and patterns","text":"I would like to rename a bunch of files which are named in a general form of, `text1 text2 [firstname.lastname] text3 ... textn.ext` I want to remove the text `[firstname.lastname]` from the name of a file. To simplify the task, assume that `[firstname.lastname]` is a fixed first and last name for all the files. I use Ubuntu 12.04, and I tried the following command, `$ find . -name \"*.ext\" -print | xargs sed -i 's\/[firstname.lastname]\/\/g'` but it doesn't work."} {"id":"155029","title":"How to remove a specific string from file name","text":"I have a report running in UNIX and creating a file named `xxxx_ddmmyy_hhmm_zzzzzz.txt`. I need to remove the `zzzzzz` from the file name. How do I do it?"} {"id":"49115","title":"batch rename a few files","text":"> **Possible Duplicate:** > Batch renaming files I have some files that I wish to rename in a single command. The files are names thus. I want the E S Posthumus bit removed from the names and also the 01, 02 ...etc at the start of each file. How do I remove that?"} {"id":"77230","title":"Phusion Passenger not working with Apache while installing redmine","text":"I am trying to install redmine (which is a ruby app ) in my arch system. But I am not able to fire up the app as it gives me the error for phusion passenger. ![enter image description here](http:\/\/i.stack.imgur.com\/as0Ko.jpg)"} {"id":"118183","title":"Which is the real PATH variable","text":"On my office computer it seems like I've have two PATH variables. > $path : This is delimited by \" \" (Space) > > $PATH : This is delimited by \":\" (Colon) Though when I update one, the other one gets updated as well. Is this the normal behavior in Linux or is there something wierd going on in my machine? Should I keep them both, or delete one of them? **Edit:** I'm using csh, I found this because some of my colleagues were updating the \"path\" variable, while others did it with \"PATH\". Though I deleted all occurences of updating \"PATH\" in my .cshrc, it still appears when I try to echo them."} {"id":"155230","title":"Redirect SSH user server side","text":"I know that I can create shortcuts for specific users\/servers on the client side via `~\/.ssh\/config` or `\/etc\/ssh\/ssh_config`, but I would like to do something similar but on the server side. That is, when I issue on the client: ssh pub@name.server.top I am actually chrooted to \/home\/jon\/pub on `name.server.top` where I will use sftp. In `\/etc\/ssh\/sshd_config` I have seen examples as the following: Subsystem sftp internal-sftp Match user pub ChrootDirectory %h ForceCommand internal-sftp AllowTcpForwarding no Will also the following work? ChrootDirectory \/home\/jon\/pub Is it possible to create the `pub` as a sort of virtual user? That is, the remote user logs as `pub` and his public key is in `\/home\/jon\/.ssh\/authorized_keys`, so without the hassle of creating a separate `\/home\/pub\/.ssh\/authorized_keys` or the `\/home\/pub` directory at all."} {"id":"155238","title":"Find files in multiple directories taken from list in a file?","text":"FreeBSD 9.2 RELEASE p2 I have a file `dirs.txt`. In this file is a new line separated directory list like so: \/etc \/home \/home\/goods\/ I need to first find in all directory's files which have names like \"good\" or contain string \"(NODES_'TASK')\" and then copy all these files into the directory `\/tmp`. I think must be something like: $ find $fromDirs.txt -type f -name 'good' | \\ grep -lr '\\(NODES_\\'TASK\\'\\)' $fromDirs.txt | > \/tmp"} {"id":"25173","title":"How can I wrap text at a certain column size?","text":"I know that I can use something like `cat test.txt | pr -w 80` to wrap lines to 80 characters wide, but that puts a lot of space on the top and bottom of the printed lines and it does not work right on some systems What's the best way to force a text file with long lines to be wrapped at a certain width? Bonus points if you can keep it from breaking words."} {"id":"69112","title":"How can I use variables when doing a sed?","text":"I want to do: cat update_via_sed.sh | sed 's\/old_name\/new_name\/' > new_update_via_sed.sh in my program. But I want to use variables, e.g. old_run='old_name_952' new_run='old_name_953' I have tried using them but the substitution doesn't happen (no error). I have tried: cat update_via_sed.sh | sed 's\/old_run\/new_run\/' cat update_via_sed.sh | sed 's\/$old_run\/$new_run\/' cat update_via_sed.sh | sed 's\/${old_run}\/${new_run}\/'"} {"id":"57127","title":"How to make sense of an iptables chain configuration","text":"This is about how to make sense of the _chains_ found in the `iptables` default configuration on a typical home router running OpenWrt (a stripped down Linux for router devices), but which ultimately may not be specific to that particular system. Let's focus on the `INPUT` main chain here, and disregard `FORWARD` and `OUTPUT` from the same _table_, as well as `PREROUTING` and `POSTROUTING` from the `nat` table. Doing an `iptables -L -t filter` shows a large number of rules. I have rearranged the output below to make it less intimidating, and in an attempt to pinpoint the parts that hamper my understanding. There are three built-in chains in the `filter` table, which appear at the top of the output. (I specified `-v` because I find it less confusing.) Chain INPUT (policy ACCEPT 0 packets, 0 bytes) pkts bytes target prot opt in out source destination 1260 133K ACCEPT all -- any any anywhere anywhere ctstate RELATED,ESTABLISHED 8 544 ACCEPT all -- lo any anywhere anywhere 787 41632 syn_flood tcp -- any any anywhere anywhere tcp flags:FIN,SYN,RST,ACK\/SYN 13012 1249K input_rule all -- any any anywhere anywhere 13012 1249K input all -- any any anywhere anywhere Chain FORWARD … # not considering this chain here Chain OUTPUT … # not considering either As you can see, I snipped the chains referenced from `FORWARD` and `OUTPUT` in order to focus on `INPUT`. (I could have chosen any of the other two as they are built up in a similiar manner.) `INPUT` has a policy of `ACCEPT`, and it specifies five rules. The first three ones are clear to me. First, accept stuff that is \"established\" or \"related\". (For example, accept the response from an HTTP or DNS request I made.) Seconds, accept everything going to the loopback device (`127.0.0.1`). (This may only come from localhost itself, and I do want that to work. Wouldn't make sense otherwise.) Third, have a synflood protection. (Which protects against a certain kind of attack.) Chain syn_flood (1 references) pkts bytes target prot opt in out source destination 787 41632 RETURN tcp -- any any anywhere anywhere tcp flags:FIN,SYN,RST,ACK\/SYN limit: avg 25\/sec burst 50 0 0 DROP all -- any any anywhere anywhere But then, there are two rules branching into two chains called `input` and `input_rule`, and the question is, why are there two of them, and which one are you supposed to use for what? Let's drill down the jump stack of those rules. Chain input_rule (1 references) pkts bytes target prot opt in out source destination There's nothing in here yet. It is meant for me to add rules. But what kind of rules? Chain input (1 references) pkts bytes target prot opt in out source destination 6315 482K zone_lan all -- br-lan any anywhere anywhere 6697 767K zone_wan all -- pppoe-wan any anywhere anywhere Okay, this one does have stuff, jumping further down into LAN and WAN, which makes sense for a home router. Chain zone_lan (1 references) pkts bytes target prot opt in out source destination 6315 482K input_lan all -- any any anywhere anywhere 6315 482K zone_lan_ACCEPT all -- any any anywhere anywhere Chain zone_wan (1 references) pkts bytes target prot opt in out source destination 0 0 ACCEPT udp -- any any anywhere anywhere udp dpt:bootpc 0 0 ACCEPT icmp -- any any anywhere anywhere icmp echo-request 6697 767K input_wan all -- any any anywhere anywhere 6697 767K zone_wan_REJECT all -- any any anywhere anywhere As you can see, each one of those rules jumps further down the stack to more user-defined rules. Chain input_lan (1 references) pkts bytes target prot opt in out source destination Chain zone_lan_ACCEPT (2 references) pkts bytes target prot opt in out source destination 4 1322 ACCEPT all -- any br-lan anywhere anywhere 6315 482K ACCEPT all -- br-lan any anywhere anywhere What is the purpose of `input_lan`? The other one is probably to accept packets, but it makes me wonder … the policy for `INPUT` is `ACCEPT`, so why repeat `ACCEPT` here? Now, input from WAN. If you scroll up you can see that some UDP and ICMP stuff is accepted. This is for DHCP and, basically, `ping`. That much is clear. What is less clear, again, is the partially empty stuff following those rules: Chain input_wan (1 references) pkts bytes target prot opt in out source destination Same question as for `input_lan`. Chain zone_wan_REJECT (2 references) pkts bytes target prot opt in out source destination 0 0 reject all -- any pppoe-wan anywhere anywhere 6697 767K reject all -- pppoe-wan any anywhere anywhere Okay, that is input from WAN (not established or related), and yes, we probably want to reject it, and now there are two kinds of rejection here, one closing the socket (`tcp-reset`) for TCP connection attempts, and another one via ICMP reply (`icmp-port-unreachable`) for ICMP messages (think `ping`). Chain reject (5 references) pkts bytes target prot opt in out source destination 595 31817 REJECT tcp -- any any anywhere anywhere reject-with tcp-reset 4858 582K REJECT all -- any any anywhere anywhere reject-with icmp-port-unreachable This last one is a catch-all. So nothing will get accepted here. Finally, here's a list of other chains found in the `filter` table that aren't referenced from the built-in `INPUT` chain in the `net` table. Just for completeness, and to see that they seem to have analogous constructs. # other chains, not reached from the INPUT chain, so truncated and moved here Chain forward (1 references) Chain forwarding_lan (1 references) Chain forwarding_rule (1 references) Chain forwarding_wan (1 references) Chain nat_reflection_fwd (1 references) Chain output (1 references) Chain output_rule (1 references) Chain reject (5 references) Chain zone_lan_DROP (0 references) Chain zone_lan_REJECT (1 references) Chain zone_lan_forward (1 references) Chain zone_wan_ACCEPT (2 references) Chain zone_wan_DROP (0 references) Chain zone_wan_forward (1 references) So, well. Sorry for this long post. There were a couple questions along the way. I don't know how to put this in an easier or shorter way. This `iptables` configuration is not exactly easy to grasp because there are unclear details spread about here and there. Hope you can clarify this and explain the underlying rationale. Thanks for your attention."} {"id":"150463","title":"How do I add a screenshot for my package?","text":"I created a repository with `reprepro` and it is working fine, but I would like to add the \"images\" to the packages when they are displayed with some package manager such as synaptic. At first, i was having problems with change-logs too, but when asking for a change-log the following message is displayed `URI was: http:\/\/foo\/pool\/main\/7\/7zrecover\/7zrecover_2.6_all.changelog` So I understood that I needed to create that URL in order to call the change- log. I did it and it worked. I wanted to use the same method to call the image of the package, but when the error is displayed the URL is not shown so I don't have any idea of what URL is being requested. I've also been doing Internet researches but I just get dumb stuff or packages! Open synaptic and select any package. Then you will see that in the package description there are two buttons \"Get Screenshoot\" and \"Get Changelog\". I would like to make work the \"Get Screenshoot\" button of my packages."} {"id":"14368","title":"Difference between POSIX, Single UNIX Specification, and Open Group Base Specifications?","text":"What are the differences between POSIX, the Single UNIX Specification, and the Open Group Base Specifications? I think their purpose is for determining if an OS is Unix?"} {"id":"16300","title":"Who's got the other end of this unix socketpair?","text":"**I want to determine what process has the other end of a unix socket, that was created with`socketpair()`.** I have a program `parent` which creates a `socketpair(AF_UNIX, SOCK_STREAM, 0, fds)`, and `fork()`s. The parent process closes `fds[1]` and keeps `fds[0]` to communicate. The child does the opposite, `close(fds[0]); s=fds[1]`. Then the child `exec()`s another program, `child1`. The two can communicate back and forth via this socketpair. Now, let's say I know who `parent` is, but I want to figure out who `child1` is. How do I do this? There are several tools at my disposal, but none can tell me which process is on the other end of the socket. ### lsof `lsof -c progname` lists the open files for all processes named `progname`. When I execute `lsof -c parent -c child1` I see the following (unrelated entries removed): jonathon@jrr-suse113:\/proc\/net> lsof -c server -c child COMMAND PID USER FD TYPE DEVICE SIZE\/OFF NODE NAME server 12923 jonathon 0u CHR 136,3 0t0 6 \/dev\/pts\/3 server 12923 jonathon 1u CHR 136,3 0t0 6 \/dev\/pts\/3 server 12923 jonathon 2u CHR 136,3 0t0 6 \/dev\/pts\/3 server 12923 jonathon 3u unix 0xf67b8440 0t0 32721 socket child 12924 jonathon 0u CHR 136,3 0t0 6 \/dev\/pts\/3 child 12924 jonathon 1u CHR 136,3 0t0 6 \/dev\/pts\/3 child 12924 jonathon 2u CHR 136,3 0t0 6 \/dev\/pts\/3 child 12924 jonathon 3u unix 0xf42ff4c0 0t0 32722 socket So I see the file descriptors for stdin\/out\/err, as well as my socket (which has been `dup2`'d to #3 for the child as well). Additionally, we see the socket device numbers in hex, and node (inode). Yet there is nothing that tells me these two are connected (which they definitely are.) ### \/proc\/xxx\/fd This simply shows me the open file descriptors and what they point to. No surprises here. jonathon@jrr-suse113:\/> ls -l \/proc\/`pidof server`\/fd total 0 lrwx------ 1 jonathon users 64 2011-07-08 17:58 0 -> \/dev\/pts\/3 lrwx------ 1 jonathon users 64 2011-07-08 17:58 1 -> \/dev\/pts\/3 lrwx------ 1 jonathon users 64 2011-07-08 17:58 2 -> \/dev\/pts\/3 lrwx------ 1 jonathon users 64 2011-07-08 17:58 3 -> socket:[32721] ### \/proc\/net\/unix This also doesn't show me anything that `lsof` doesn't (probably because these are where it gets its information.) Num RefCount Protocol Flags Type St Inode Path f42ff4c0: 00000003 00000000 00000000 0001 03 32722 f67b8440: 00000003 00000000 00000000 0001 03 32721 So basically, I can see the two sockets, and everything about them, but cannot tell that they are connected. Before you ask why I want to see this, consider the case where there are 40 different children processes running. I am trying to then determine which FD in the parent is communicating with which child process."} {"id":"60197","title":"fwui.log error while running this script","text":"I run this bash script in order to put all the files with the following format dated today in the same folder. for example here I want `2012-12-17_083213` to be my folder and then inside it I have the `.log` and `.log_stats` and etc with this name inside it? But I am not able to get the script working. For example, if I try everything up until `dir=$(echo $i | awk '{split($1,a,\"_\"); print a[1]}');` And then to test it, I did echo $dir, and that displays the following: `fwui.log` I searched and understood its about locks in the db but how to solve it? This is the script: #!\/bin\/bash tosend=\"\" for i in *.log; do dir=$(echo $i | awk '{split($1,a,\"_\"); print a[1]}'); if [ ! -d $dir ]; then mkdir $dir; fi; cp $i $dir; tosend=\"$tosend\\n$dir\" done for i in $(echo -e $tosend | uniq);do echo Compressing $i tar -zcvf $i.tar.gz $i scp $i.tar.gz user@server done and this is the file formats: 2012-12-17_083213_1.log 2012-12-17_083213_1.log_stats 2012-12-17_083213_1.logaccount_ptr 2012-12-17_083213_1.loginitial_ptr 2012-12-17_083213_1.logptr 2012-12-17_093049_2.log 2012-12-17_093049_2.log_stats 2012-12-17_093049_2.logaccount_ptr 2012-12-17_093049_2.loginitial_ptr 2012-12-17_093049_2.logptr"} {"id":"120528","title":"How to define similar bash function at once","text":"I have these functions in `~\/.bashrc`: function guard() { if [ -e 'Gemfile' ]; then bundle exec guard \"$@\" else command guard \"$@\" fi } function rspec() { if [ -e 'Gemfile' ]; then bundle exec rspec \"$@\" else command rspec \"$@\" fi } function rake() { if [ -e 'Gemfile' ]; then bundle exec rake \"$@\" else command rake \"$@\" fi } As you see these functions are very similar. I want to define these 3 functions at once. Is there a way to make it? _environment_ bash --version GNU bash, version 3.2.51(1)-release (x86_64-apple-darwin13)"} {"id":"150979","title":"How install xfce >= 4.10 from backports repository in debian","text":"I am working in Debian 7 64bits with xfce 4.8 ![enter image description here](http:\/\/i.stack.imgur.com\/bhaxG.jpg) But in backports repository I found xfce 4.10.1 ![enter image description here](http:\/\/i.stack.imgur.com\/fgb4F.jpg) and I added this line in my sources.list: deb http:\/\/ftp.debian.org\/debian\/ wheezy-backports main contrib non-free but when I upgrade I do not see that can be updated. ![enter image description here](http:\/\/i.stack.imgur.com\/NDPDH.jpg) Then, how I can upgrade xfce 4.8 to 4.10 cleanly with backports? without tricks like adding repo of debian 8 testing or others. Greetings."} {"id":"63428","title":"Startx failing in FreeBSD","text":"I've install gnome2, xorg, and xinit (should xorg have done that for me?), and startx yields: \"xinit: unable to run server \"\/usr\/local\/bin\/X\": No such file or directory\" I checked in the directory, and startx, xpath, and xinit are all there Am I still missing dependencies? If so, which ones? Both the gnome2 and x11 installations took a lifetime and a half so I thought they got everything..."} {"id":"109103","title":"Not able to install GRUB (grub legacy) on flash drive!","text":"I'm following this tutorial of Dedoimedo to install GRUB on USB flash drive. Though this tutorial doesn't talk of installing in pen drive but I though it can be used here even. [ Minimal BASH-like line editing is supported. For the first word, TAB lists possible command completions. Anywhere else TAB lists the possible completions of a device\/filename. ] grub> find \/grub\/stage1 (hd0,4) grub> root (hd0,4) grub> setup (hd1) Checking if \"\/boot\/grub\/stage1\" exists... no Checking if \"\/grub\/stage1\" exists... yes Checking if \"\/grub\/stage2\" exists... yes Checking if \"\/grub\/e2fs_stage1_5\" exists... yes Running \"embed \/grub\/e2fs_stage1_5 (hd1)\"... 21 sectors are embedded. succeeded Running \"install \/grub\/stage1 d (hd1) (hd1)1+21 p (hd0,4)\/grub\/stage2 \/grub\/me nu.lst\"... succeeded Done. grub> Still I don't see anything in the flash drive. Also when I rebooted my laptop setting USB flash drive to boot, it didn't boot from my USB. Please throw some light on this. [I have seen sites (pendrivelinux.com) http:\/\/www.pendrivelinux.com\/install- grub2-on-usb-from-ubuntu-linux\/ where it talks on installing on USB but I want to know why my method isn't working]"} {"id":"1850","title":"Emacs sync w\/ Google Calendar and Contacts?","text":"Is there a way to use Emacs to sync with Google Calendar and Google Contacts, ideally keeping a local copy so I can access them offline?"} {"id":"3961","title":"How to understand what's taking up space?","text":"I'm looking for a linux alternative to WinDirStat. I would like to know what is taking up space on my hard drives. A program that works on console and doesn't require a UI is preferred ."} {"id":"81026","title":"Init script partially launches java app","text":"I have a java application that I manage to execute by hand. The application normally opens several ports for local communications (7180 => 7183). Port 7182 serves as a web console and allows me to quickly check that everything went fine. java -cp $ARCHIVES -Djava.security.policy=$POLICY -Dconfigfile=$CONFIG_FILE $CLASS As soon as I put this in an init script, the ports are not open but the app somehow manages to start with the following message: 'Dead or echo port not responding'. Here is the start-stop-daemon line in my init script: start-stop-daemon --start --chuid thomas --quiet --make-pidfile --pidfile $PIDFILE --exec $DAEMON -- \\ $DAEMON_ARGS \\ What difference between manual execution and scripted execution could explain that the app is half started? * * * As an additionnal information, the application is SIPS Office Server (payment solution)."} {"id":"81022","title":"How can I see moved lines in a file comparison with vimdiff \/ diff?","text":"Moved lines are frequently annotated as deletes and adds but they can be shown as moved-from and moved-to instead. Like in this screenshot of Notepad++. ![Notepad++ diff'ing moved lines](http:\/\/i.stack.imgur.com\/jF26O.png)"} {"id":"6345","title":"How can I get distribution name and version number in a simple shell script?","text":"I'm working on a simple bash script that should be able to run on Ubuntu and CentOS distributions (support for Debian and Fedora\/RHEL would be a plus) and I need to know the name and version of the distribution the script is running (in order to trigger specific actions, for instance the creation of repositories). So far what I've got is this: OS=$(awk '\/DISTRIB_ID=\/' \/etc\/*-release | sed 's\/DISTRIB_ID=\/\/' | tr '[:upper:]' '[:lower:]') ARCH=$(uname -m | sed 's\/x86_\/\/;s\/i[3-6]86\/32\/') VERSION=$(awk '\/DISTRIB_RELEASE=\/' \/etc\/*-release | sed 's\/DISTRIB_RELEASE=\/\/' | sed 's\/[.]0\/.\/') if [ -z \"$OS\" ]; then OS=$(awk '{print $1}' \/etc\/*-release | tr '[:upper:]' '[:lower:]') fi if [ -z \"$VERSION\" ]; then VERSION=$(awk '{print $3}' \/etc\/*-release) fi echo $OS echo $ARCH echo $VERSION This _seems_ to work, returning `ubuntu` or `centos` (I haven't tried others) as the release name however, I have a feeling that there must be an easier, more reliable way of finding this out... No? It doesn't work for RedHat. \/etc\/redhat-release contains : Redhat Linux Entreprise release 5.5 So, the version is not the third word, you'd better use : OS_MAJOR_VERSION=`sed -rn 's\/.*([0-9])\\.[0-9].*\/\\1\/p' \/etc\/redhat-release` OS_MINOR_VERSION=`sed -rn 's\/.*[0-9].([0-9]).*\/\\1\/p' \/etc\/redhat-release` echo \"RedHat\/CentOS $OS_MAJOR_VERSION.$OS_MINOR_VERSION\""} {"id":"129409","title":"find action not working for specific search","text":"I'm trying to use the `find` command to list the size of a certain set of files but am getting no output. The command I use is: find POD -type f -name *.mp3 -or -name *.ogg -ls Which produces no output. While: find POD -type f -name *.mp3 -or -name *.ogg does produce output, I've also tried the actions: -printf \"%p %k KB\\n\" -exec ls -ls '{}' \\; -print0 but all of these give no output. When I use any of these actions with a different expression e.g.: find . -maxdepth 1 -type f -printf \"%p %k KB\\n\" I also get the expected output. Does anybody have any idea what the problem is? I'm running: Linux irimi 3.10.37-1-MANJARO #1 SMP Mon Apr 14 20:56:29 UTC 2014 x86_64 GNU\/Linux aka an up to date Manjaro linux distribution. The shell I use is: `\/bin\/bash` version `4.3.8(1)-release`. The content of my `SHELLOPTS` environment variable is: braceexpand:emacs:hashall:histexpand:history:interactive-comments:monitor my `BASHOPTS` environment variable is: cdspell:checkwinsize:cmdhist:complete_fullquote:dotglob:expand_aliases:extglob:extquote:force_fignore:histappend:hostcomplete:interactive_comments:nocaseglob:progcomp:promptvars:sourcepath Again any help on trying to debug this would be very much appreciated."} {"id":"43539","title":"What do the flags in \/proc\/cpuinfo mean?","text":"How can I tell whether my processor has a particular feature? (64-bit instruction set, hardware-assisted virtualization, cryptographic accelerators, etc.) I know that the file `\/proc\/cpuinfo` contains this information, in the `flags` line, but what do all these cryptic abbreviations mean? For example, given the following extract from `\/proc\/cpuinfo`, do I have a 64-bit CPU? Do I have hardware virtualization? model name : Intel(R) Core(TM)2 Duo CPU E8400 @ 3.00GHz … flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx lm constant_tsc arch_perfmon pebs bts rep_good aperfmperf pni dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm sse4_1 lahf_lm tpr_shadow vnmi flexpriority"} {"id":"16387","title":"256 color in real console","text":"I have in my .bashrc export TERM=xterm-256color but this cause blinking all colored text (ls --color, in vim etc.) in real console (CTRL + ALT + F1) . So is there any possibility to recognize in which console I am (real or virtual) so I can export TERM variable with valid value? [EDIT] I found alternative solution only: for vim user (in .vimrc) set t_Co=256 or for xterm in .Xdefaults (after that xrdb -load .Xdefaults) XTerm*termName: xterm-256color or for screen (.screenrc) term screen-256color"} {"id":"98970","title":"How to force Thunar to remember sort order for different folders?","text":"I want all the files in my Downloads folder to be sorted by modification date, but all other folders, and files in other partitions to be sorted by name. How can I make Thunar to remember the sort order for different folders?"} {"id":"60730","title":"How to install parted?","text":"root@host [\/]# parted -bash: parted: command not found I am using CentOS. Looks like I simply have to yum it first or something. How would I do so?"} {"id":"107641","title":"Centos 6.3 on Oracle VirtualBox 4.3.6 GUI flickering after startup","text":"My CentOS 6.3 installation in Oracle Virtual Box 4.3.6 was working fine until this morning when the UI would not startup properly and started flickering. ![image 1](http:\/\/s30.postimg.org\/9f3z18jup\/Cent_OS63.png) In the UI there is a white box (3x2 size) that flickers (was not able to capture it) continuously. I am able to login to the system using ssh using IP from another machine and I see all files are intact... not sure why the UI is not materializing properly. I even changed display memory in VirtualBox settings to 128MB but to no avail. Please help me to resolve this. I dont want to re-install the Centos again (setting up system again is quite a step). The below is the VirtualBox's log: 00:01:01.045427 AIOMgr: Endpoint for file 'E:\\VirtualBox\\VDI\\CentOS63.vdi' (flags 000c0723) created successfully 00:01:01.079417 Changing the VM state from 'RESUMING' to 'RUNNING'. 00:01:02.559869 AIOMgr: Preparing flush failed with VERR_NOT_SUPPORTED, disabling async flushes 00:01:03.828410 Changing the VM state from 'RUNNING' to 'SUSPENDING'. 00:01:03.857120 PDMR3Suspend: after 28 ms, 1 loops: 1 async tasks - ahci\/0 00:01:03.888235 AIOMgr: Endpoint for file 'E:\\VirtualBox\\VDI\\CentOS63.vdi' (flags 000c0781) created successfully 00:01:03.979697 PDMR3Suspend: 151 237 774 ns run time 00:01:03.979715 Changing the VM state from 'SUSPENDING' to 'SUSPENDED'. 00:01:05.724688 Changing the VM state from 'SUSPENDED' to 'RESUMING'. 00:01:05.725398 AIOMgr: Endpoint for file 'E:\\VirtualBox\\VDI\\CentOS63.vdi' (flags 000c0723) created successfully 00:01:05.760108 Changing the VM state from 'RESUMING' to 'RUNNING'. 00:01:09.391589 AIOMgr: Preparing flush failed with VERR_NOT_SUPPORTED, disabling async flushes 00:01:40.621357 Changing the VM state from 'RUNNING' to 'SUSPENDING'. 00:01:40.623377 AIOMgr: Endpoint for file 'E:\\VirtualBox\\VDI\\CentOS63.vdi' (flags 000c0781) created successfully 00:01:40.664968 PDMR3Suspend: 43 513 184 ns run time 00:01:40.664986 Changing the VM state from 'SUSPENDING' to 'SUSPENDED'. 00:01:43.567279 Changing the VM state from 'SUSPENDED' to 'RESUMING'. 00:01:43.567908 AIOMgr: Endpoint for file 'E:\\VirtualBox\\VDI\\CentOS63.vdi' (flags 000c0723) created successfully 00:01:43.601704 Changing the VM state from 'RESUMING' to 'RUNNING'. 00:01:44.142130 AIOMgr: Preparing flush failed with VERR_NOT_SUPPORTED, disabling async flushes .. more... 00:46:49.034055 AIOMgr: Endpoint for file 'E:\\VirtualBox\\VDI\\CentOS63.vdi' (flags 000c0723) created successfully 00:46:49.067998 Changing the VM state from 'RESUMING' to 'RUNNING'. 00:46:49.354161 AIOMgr: Preparing flush failed with VERR_NOT_SUPPORTED, disabling async flushes 00:48:27.339663 Guest Additions capability report: (0x4 -> 0x0) seamless: no, hostWindowMapping: no, graphics: no 00:48:27.348469 Display::handleDisplayResize(): uScreenId = 0, pvVRAM=0000000000000000 w=720 h=400 bpp=0 cbLine=0x0, flags=0x1 00:48:41.643962 OHCI: USB Reset 00:48:41.774693 Entering S5 power state (power down) 00:48:41.774768 Changing the VM state from 'RUNNING' to 'POWERING_OFF'."} {"id":"94623","title":"Reusing a variable","text":"I was breaking my head for a day still not successful. I have this script: #!\/bin\/ksh fname=$1 for batchname in $(grep -i \"Processing batch\" $fname | cut -d \"'\" -f2) do Batch_state=`grep -c -i \"Batch '$batchname' was successful\" $fname` if [[ \"$Batch_state\" -ge 1 ]];then { S_Time=`awk '\/[0-9]_[0-9].*successful\/{getline;getline;getline;print}' $fname | awk '{print $2}'` E_Time=`awk '\/[0-9]_[0-9].*successful\/{getline;getline;getline;getline;print}' $fname | awk '{print $2}'` echo -e $batchname\"\\t\"$S_Time\"\\t\"$E_Time } else { echo $batchname encountered an error } fi done Output this code is producing: 02_1231324 14:29:04 15:29:11 14:32:19 15:33:11 79_3097935 14:29:04 15:29:11 14:32:19 15:33:11 Desired Output: 02_1231324 14:29:04 14:32:19 79_3097935 15:29:11 15:33:11 Sample Input: 2013\/06\/11 14:29:04 <0999> (725102) Creating batch '02_1231324.0'... 2013\/06\/11 14:29:04 <0999> (725102) Batch '02_1231324' was successful 2013\/06\/11 14:29:04 <0999> (725102) TMR:Child ZERO, 160 Docs 320 Pgs 3874 KByts Tot 0.42 WAL 0.10 WALIO 0.15 IO 0.03 secs 2013\/06\/11 14:29:04 <0999> (725102) Processing batch '02_1231324' 2013\/06\/11 14:32:19 <0999> (725102) Total in batch: 160 documents using 4 KBytes 2013\/06\/11 15:29:11 <0999> (725102) Creating batch '79_3097935.0'... 2013\/06\/11 15:29:11 <0999> (725102) Batch '79_3097935' was successful 2013\/06\/11 15:29:11 <0999> (725102) TMR:Child ZERO, 160 Docs 320 Pgs 3874 KByts Tot 0.42 WAL 0.10 WALIO 0.15 IO 0.03 secs 2013\/06\/11 15:29:11 <0999> (725102) Processing batch '79_3097935' 2013\/06\/11 15:33:11 <0999> (725102) Total in batch: 160 documents using 4 KBytes TMR:Child ZERO, 160 Docs 320 Pgs 3874 KByts Tot 0.42 WAL 0.10 WALIO 0.15 IO 0.03 secs 2013\/06\/11 13:26:57 <0999> (725102) Processing batch '12_2013162201' 2013\/06\/11 13:26:57 <0999> (725102) Total in batch: 160 documents using 4 KBytes So, what is wrong with my script? How can I get the desired output?"} {"id":"90714","title":"\\uFFFD character in directory name","text":"I have a lot of directories with a \\uFFFD (65533) character in it. The problem is that I can't really access this directory because of this character. For example I got a directory with the name: `Foo�o` (� == `\\uFFFD`) 1. `ls Foo�o` is not working (so `tab` is always showing the only possible file but it will never complete it 'cause it's not working) 2. `ls Foo*` is working The problem is that I can't use the 2. way because there might be other directories starting with the same characters. So the actual question is if there's a way to escape a character like this. So I'm searching for a working version of this: `ls Foo\\uFFFDo` <= not working"} {"id":"90717","title":"Space left on Linux RAM\/TMP,FS","text":"Recently I have come to believe a number of unusual occurrences that have happened while running a Parted Magic Live CD, are the result of running out of space on the RAM based filesystem, namely: * Folder contents disappearing, only to reappear later * `Mount-gtk` not showing single mounted drive\/not allowing unmount (While bash `mount` commands function normally) * Firefox freezing, then seemingly freezing the GUI. * My Firefox session recovering as if the browser crashes at each clean close * Loosing last x minutes of Firefox session history * Sound\/clipboard redirection intermittently not working in `rdesktop` * `Conky` crashing periodically ...Not despite the SpaceFM warning of no space to store state data **AND** some of these problems disappearing only after moving some files off the filesystem. Problem being, I am not sure how to (at least) keep an eye on the \"space\" left of the filesystem (Note: There is no entry for the `\/` partition in the output of `df`, `fdisk -l` or `mount`), let alone (assuming I am right that the filesystem space not being relative to the system memory, that I had been monitoring with `conky`) how to go about increasing the sizing ?at boot time? Help? P.S Thought it most appropriate to tag this question with parted-magic, ramfs (or tmpfs... Not sure how to identify which one is in use) and low-disk-space like tags, but alas there doesn't appear to be any of them. If the community doesn't want to create one\/all, please feel free to suggest other tags that others feel are appropriate."} {"id":"58346","title":"Automatically printing images with added captions","text":"I have a lot of scanned images and images\/photos I'm working on with multiple versions. When I print them (using various programs), all I get is the image and, often, it's difficult to tell which image came from which file. This is particularly frustrating with my (27K) photos when I have a print and want another copy and can't find it. (The photos are in KPhotoAlbum, so I can find the minority that I have actually tagged correctly.) What I would like is a utility that would print a bunch of images (e.g. doit *.jpg) and include an automatic (program generated) caption (hopefully configurable) with something like the full path of the file in it. gnome- photo-printer would be perfect if it had an option to print the full paths of the images with them. I need this while projects are in progress and for cleaning up afterwards. This is not for \"final\" images. It would be cool (and economical) if I could also specify the print size of the image because, often, smaller \"thumbnail\" images may be enough for organizing\/cleaning up and they would save a bunch of time, paper, and ink\/toner. I know I could manually create a document with an embedded picture in something like LO writer, but that would be totally manual (at least with my level of expertise) and thus very slow. It would be particularly nice to have the caption \"outside\" the picture so it would not interfere with the content and so I could control the background and font colors for readability. * * * I figured out (in principle) how to build something like this in bash using convert a couple of times along with composite (both from ImageMagick), but it's fairly convoluted and I'm hoping for something simpler."} {"id":"58566","title":"Problems installing Arch Linux: cannot mount the installation media","text":"> **Possible Duplicate:** > mounting problem during installation of archlinux on dell xps one I am trying to install Arch Linux on my Acer Aspire 4830tg, but I keep running into problems. I am trying to install Arch off a USB stick and I got the iso image using Bittorrent. I am also trying to install it alongside of Windows 8 (which is already installed). When I boot into Arch linux I get this error :: Mounting '\/dev\/disk\/by-label\/ARCH_201212' to 'run\/archiso\/bootmnt' Waiting 30 seconds for device \/dev\/disk\/by-label\/ARCH_201212 ... ERROR: '\/dev\/disk\/by-label\/ARCH_201212' device did not show up after 30 seconds... Falling back to interactive prompt You can try to fix the problem manually, log out when you are finished sh: can't access tty; job control turned off So I know that it will work if I run it on a virtual machine but whenever I try to install it on my laptop I keep getting this error."} {"id":"27350","title":"Why can't a normal user `chown` a file?","text":"Why is the `chown` command root-only? Why can't non-root users use chown to give away files they own?"} {"id":"95867","title":"file owner not able to renounce the ownership to root? But root can!","text":"I logged in as username 'ravbholua' I created a file `bb` as below: ravbholua@ravi:~\/Pictures$ echo>bb ravbholua@ravi:~\/Pictures$ ll total 12 drwxr-xr-x 2 ravbholua sudo 4096 Oct 13 11:18 .\/ drwxr-xr-x 23 root sudo 4096 Oct 13 11:03 ..\/ -rw-r--r-- 1 ravbholua sudo 1 Oct 13 11:18 bb ravbholua@ravi:~\/Pictures$ Please note the owner of `bb` is me (ravbholua). But I am not able to renounce the ownership to root. ravbholua@ravi:~\/Pictures$ chown root bb chown: changing ownership of 'bb': Operation not permitted ravbholua@ravi:~\/Pictures$ But root can change the ownership of my file. ravbholua@ravi:~\/Pictures$ ll total 12 drwxr-xr-x 2 ravbholua sudo 4096 Oct 13 11:18 .\/ drwxr-xr-x 23 root sudo 4096 Oct 13 11:03 ..\/ -rw-r--r-- 1 root sudo 1 Oct 13 11:18 bb ravbholua@ravi:~\/Pictures$ I am working on Ubuntu13.04 Earlier when I had worked on Fedora9, there the file owner was able to change the ownership. I think linux Operating System allows the file owner to do so."} {"id":"119229","title":"can not chown a file from my $user to another $user","text":"I am on slackware64 v14.0 and I have file that belongs to me: -rwxrwxr-x+ 1 nass shares 137934 Mar 7 00:06 myfile.csv* I am a member of the \"shares\" group. The folder that contains `myfile` looks like this drwxrwsr-x+ 12 nass shares 4096 Mar 12 04:54 winmx\/ I now want to give ownership of this file to another user of this pc. The other user is also a member of the shares group. However, chown otheruser myfile.csv does not do the trick. I get a chown: changing ownership of 'myfile.csv': Operation not permitted I had recently asked a similar question about `gid`, but this is not the same problem. How can I solve this ?"} {"id":"58340","title":"Find all folders in a directory with the same content","text":"In Ubuntu, is there any to find duplicate folders in a directory (i. e., folders with the same content)? I think there are already some command-line tools available for finding duplicate files (such as fdupes), but I want to find duplicate folders instead. That is, find folders which match in terms of the contents of the files they contain (though the filenames and other metadata might differ)."} {"id":"9196","title":"Find a file in the path without \"which\"?","text":"I am (somehow) able to run a script: $ assemble.sh file ... [output] But `which` can't find it: $ which assemble.sh which: no assemble.sh in (\/s\/std\/bin:\/usr\/afsws\/bin:\/opt\/SUNWspro\/bin:\/usr\/ccs\/bin:\/usr\/ucb:\/bin:\/usr\/bin:\/usr\/stat\/bin:\/usr\/X11R6\/bin:. 1. How is this possible? 2. How can I find where this file is? I'm using bash."} {"id":"104919","title":"Reconfiguring GNOME keyring daemon","text":"I have a really strange problem when using GNOME keyring daemon. I had an old SSH key which I've now retired and started using a new, stronger keyfile. However, every time I attempt to SSH into one of my servers, SSH tells me Agent admitted failure to sign using the key. Permission denied (publickey). fatal: The remote end hung up unexpectedly I'm pretty sure that the keyring daemon is trying to use my old key for some strange reason. How can I reconfigure the keyring daemon to delete any knowledge of my old key?"} {"id":"62779","title":"Emulating a file","text":"I have certain application that opens a file with given path (presumably with `fopen` or derivative), reads the file, possibly writes to it and closes it. I have no control over this application other than specifying the path. What I am trying to do is 'emulate' a file within the local filesystem to pass it to the application. That is, I want the file to appear as an ordinary file in the filesystem, however the streams are redirected to another application that handles them correctly and outputs appropriate data. Essentially, I want to create a pseudo-device, except that it is not a device at all. Is this doable at all? How would I approach this problem?"} {"id":"143864","title":"Monitor all login attempts","text":"Few weeks ago I thought it would be a good idea to write a script to send me an email whenever some user logs in into my server. So I came with a perfectly working script `notifyLogin.sh`, then I decided to call it from each user's `.bash_login` script. But I discovered that someone could log in in my server using `ssh` `-t` switch to select an available shell. For example: ssh user@myserver -t sh This way, `.bash_login` does not execute, neither does `\/etc\/profile`. Is there any way to call `notifyLogin.sh` independent of shell type at log in? (It should always work)"} {"id":"42173","title":"IP of localhost","text":"How does a Linux instance determine its IP address? That is, not the 127.0.0.1. Is this stored in file or does ifconfig somehow calculate it at every invocation? I managed to solve it just to show I made an effort, but it is not anything I'd put in a serious application: sudo ifconfig | head -n 2 | tail -n 1 | tr -s \" \" | tr \" \" \":\" | cut -d\":\" -f 4"} {"id":"80384","title":"Closing lid on Crunchbang","text":"I'm running Crunchbang on a laptop. I can't seem to find an option to toggle if the laptop goes to sleep when the lid closes. There are certain times where I want to put the laptop away or close it but still have it do some crunching on some long running task. Is there a place to toggle this option?"} {"id":"79791","title":"Moving folders used wrong syntax and lost them","text":"I thought I was being smart trying to move a folder to one level up by going: mv folder .newfolder and neglecting to even put: mv folder .newfolder\/folder and anyway it didn't put up an error but the folders have vanished. Where could they be I wonder?"} {"id":"30817","title":"Arch Linux makepkg failed on compressing package","text":"I just reinstalled Arch Linux 2010.05 on VPS, and sudo pacman -Syu But when I try to install anything from AUR, makepkg failed on ==> Tidying install... -> Purging unwanted files... -> Compressing man and info pages... -> Stripping unneeded symbols from binaries and libraries... ==> Creating package... -> Generating .PKGINFO file... -> Compressing package... bsdtar: FIEMAP failed: Invalid argument bsdtar: FIEMAP failed: Invalid argument bsdtar: FIEMAP failed: Invalid argument ==> Leaving fakeroot environment."} {"id":"30816","title":"Why FOSS 3d performs so badly, compared to proprietary. Trying to understand","text":"I know this is not the best question, I'm just trying to understand what needs improvement. I just read a Phoronix article, which compared the FOSS radeon drivers a 5 years old FGLRX catalyst. As you would expect FGLRX was multiple times faster, even the feature set was not completely implemented. The big question, not answered in the article, was why? I noticed FGLRX brings its own libGL, does Nvidia do this also? I know hardware registers are not always completely known, and yadda yadda... I still suspect that mesa is not a strong performer. What needs to be done to reach remotely close to catalyst speed? What projects need help? Which ones need to be completely ditched?"} {"id":"30812","title":"Trying to run oprofile on ubuntu kernel but cannot find vmlinux file","text":"I am trying to run oprofile on my ubuntu host but cannot find the vmlinux file. The set up sfor oprofile needs this file: As given here : http:\/\/oprofile.sourceforge.net\/doc\/overview.html#getting- started opcontrol --vmlinux=\/boot\/vmlinux-`uname -r` What should I do so that I can profile the ubuntu kernel. I am using 2.6.32-34-generic-pae (uname -r)"} {"id":"73838","title":"`cp` permission denied when copy a file owned by `root`","text":"I have a folder `udp_folder2` d------r-T 41 root root 4096 Apr 26 21:17 udp_folder2 when I'm with user other than `root`, I can't `cp -r` it into a new folder it says: Permission denied why? and how can I copy it with a user other than `root`"} {"id":"31149","title":"How to find Nautilus wastebasket in the file system","text":"It looks like I can get to the waste-basket through nautilus, but when I look at the location given by properties, I see \"trash:\/\/\/\". But I can't \"cd trash:\/\/\/\". Where is the waste-basket? And in general, if I can find a file in nautilus, how do I get there from terminal? I've had some similar issues in the past with mounted media as well, so a general answer would be greatly appreciated. In case it is relevant, I'm using PinguyOS."} {"id":"114952","title":"What are alternative tools for searching files in full content?","text":"I realized that most of the text related tools I use, grep\/egrep\/awk\/sed are line-oriented. I guess that is a simplified approach to search in files but I was wondering if there is another set of tools operating on file level that I am not aware. So are there other tools that search over the full contents of a file without using the line mode?"} {"id":"10408","title":"How to run a fresh version of AIX in a Virtual Machine with a Linux host?","text":"I need to learn about AIX, and I only have a laptop with Fedora 14\/VirtualBox on it. Is there any chance that I could run an AIX guest in my VirtualBox? My laptop has an Intel(R) Core(TM)2 Duo CPU T7100 @ 1.80GHz, and I read that it only runs on RISC architecture. So there's no way I can run it on my laptop?"} {"id":"131748","title":"Search for a Value only in one column w.o using awk, sed, or perl","text":"I have a file that looks like this : Marketing Ranjit Singh FULLEagles Dean Johnson Marketing Ken Whillans FULLEagles Karen Thompson Sales Peter RobertsonPARTGolden TigersRich Gardener President Sandeep Jain CONTWimps Ken Whillans Operations John Thompson PARTHawks Cher Operations Cher CONTVegans Karen Patel Sales John Jacobs FULLHawks Davinder Singh Finance Dean Johnson FULLVegans Sandeep Jain EngineeringKaren Thompson PARTVegans John Thompson IT Rich Gardener FULLGolden TigersPeter Robertson IT Karen Patel FULLWimps Ranjit Singh I want to use a grep command to search for \"John\" in the 2nd column w.o searching the last column, but for every \"John\" in the 2nd column, I want the output of the last column. The end result should look like this : John Thompson Cher John Jacobs Davinder Singh Dean Johnson Sandeep Jain"} {"id":"35397","title":"Script that uses MySQL query to automatically remove output","text":"I have this query that outputs updates older than 7 days from a database. How would I make a script that takes the MySQL statement and puts it into a script to be executed by cron. echo \"select name, reported_at from nodes where reported_at < curdate() -7;\" | mysql dashboard Sample output: name reported_at xadf.edu 2012-03-21 14:39:02 xadf.edu 2012-03-22 15:30:01 adsfsadf.edu 2012-03-14 14:40:02 ekdahlj.edu 2012-03-23 03:40:04 adfasdf.net 2012-03-21 14:42:02 eqrsdr.edu 2012-03-15 14:42:02 qwerwfva.edu 2012-03-13 14:42:03 qerqwer.edu 2012-03-23 14:40:01 adfasde.edu 2012-03-05 17:42:03 bsfdgs.edu 2012-03-23 15:20:01 adfadsf.edu 2012-03-23 14:43:01"} {"id":"107320","title":"Wordpress won't recognize the MySQL database","text":"I want to install Wordpress on Archlinux but I have this error: > Your PHP installation appears to be missing the MySQL extension which is > required by WordPress. I un-commented this line in `\/etc\/php\/php.ini`: ; ... or under UNIX: ; extension=msql.so ; but this error is not fixed. how can I fix this error?"} {"id":"61452","title":"Please explain the output of the ls -all command","text":"This is one of the many similar lines from the output from ls -all lrwxrwxrwx 1 subhrcho dba 25 Dec 6 01:36 beam-server.jpr -> .ade_path\/beam-server.jpr What does the above signify ? I am specially interested in `.ade_path` ? What does the dot(.) signify here ?"} {"id":"123530","title":"Can I safely read a file that is appended to by another process?","text":"If process A copies files to some location loc and process B regularly copies the files from loc to some other location, can B read a file that is currently in the process of being copied to loc by A? I'm using Ubuntu Linux 12.04 if that's important. * * * Background information: I want to continuously backup a PostgreSQL cluster. PostgreSQL provides WAL archiving for that. It works by having the database call a script that copies a completed WAL file to some backup location. I want another process to regularly copy the backed up WAL files to another server. If a WAL file is currently being copied by the database, can the second process still read the file without running into some EOF condition before the file is copied as a whole? In other words: Can I do the following with no synchronization between A and B? A B cp pg_xlog\/some_wal_file \/backup\/ scp \/backup\/* user@remote-machine:\/backups\/"} {"id":"131293","title":"IPtables on ubuntu 12.04","text":"I've problem with iptables on ubuntu 12.4. I type `ufw status`, it show result `Status: inactive` but I type `iptbles -L -nv`, it still shows many rules, and these rules are running. I can't understand."} {"id":"24651","title":"Linux distributions for ARM processors","text":"Are there any Linux distributions (Other than Backtrack and Android) available for ARM processors? specifically ARM 11 (SE Xperia X8)"} {"id":"151257","title":"Reserve memory for a program","text":"Is it at all possible to set aside say 50MB of memory so that in an emergency where something uses all my memory or loads the CPU I could open a terminal, find the offending process, and kill it?"} {"id":"38955","title":"Argument list too long for ls","text":"I get the following error when trying to `ls *.txt | wc -l` a directory that contains many files: -bash: \/bin\/ls: Argument list too long Does the threshold of this \"Argument list\" dependent on distro or computer's spec? Usually, I'd pipe the result of such big result to some other commands (`wc -l` for example), so I'm not concerned with limits of the terminal."} {"id":"146502","title":"bash script not being run by cron","text":"I have a very simple bash script that runs flawlessly when I do .\/removeOldBackup.sh or sh \/home\/myusername\/backup\/removeOldBackup.sh but when I add it to crontab like * * * * * sh \/home\/myusername\/backup\/removeOldBackup.sh or * * * * * \/bin\/sh \/home\/myusername\/backup\/removeOldBackup.sh it never works... This is my script: #!\/bin\/sh find . -name 'files_20[1-3][0-9]-[0-9][0-9]-[1-2][1-9]--*' -delete find . -name 'files_20[1-3][0-9]-[0-9][0-9]-0[2-9]--*' -delete find . -name 'database_20[1-3][0-9]-[0-9][0-9]-[1-2][1-9]--*' -delete find . -name 'database_20[1-3][0-9]-[0-9][0-9]-0[2-9]--*' -delete This is my script permissions: -rwxr-xr-x 1 root root 295 Jul 25 10:07 \/home\/myusername\/backup\/removeOldBackup.sh Crontab is added for user root. This is what I find in `\/var\/log\/syslog`: Jul 25 10:11:01 myservername \/USR\/SBIN\/CRON[7583]: (root) CMD (sh \/home\/myusername\/backup\/removeOldBackup.sh) So again, when I run the script manually, my backup files get removed correctly. When it is run by cron, they never get removed. I'm using debian-6.0-x86_64."} {"id":"110856","title":"something is terribly wrong with pkg-config","text":"I've been having a harrowing time lately just trying to get several C programs compiled because I can't find where the libraries are located and pkg-config seems to be out of order. I installed GNU GSL like this: wget ftp:\/\/ftp.gnu.org\/gnu\/gsl\/gsl-1.15.tar.gz tar xvzf gsl-*gz cd gsl-1.15 .\/configure make sudo make install Apparently it installed in `\/usr\/local\/lib` which is a non-standard place? (1) What is a standard place? (2) How would I get it to install there? And I can't manage to compile a simple program that uses this library: $ gcc gsl_erf.c -o gsl -I\/usr\/local\/lib -L\/usr\/local\/lib \/tmp\/cc3WD9Zq.o: In function `main': gsl_erf.c:(.text+0x24): undefined reference to `gsl_cdf_gaussian_P' collect2: error: ld returned 1 exit status Now, with pkg-config : pkg-config --libs --cflags gslPackage gsl was not found in the pkg-config search path. Perhaps you should add the directory containing `gsl.pc' to the PKG_CONFIG_PATH environment variable No package 'gsl' found So I did add the directory: PKG_CONFIG_PATH=\/usr\/local\/lib\/pkgconfig But no luck yet! :( pkg-config still gives me the same message as above. (`Perhaps you sh ...`) This is a more general problem I face regularly when I have to compile some C program. I would love a general solution for: 1. Where and how do I install my C libs? (Perhaps the same place yum installs them?) 2. How do I correct\/configure and use pkg-config * * * **Update** : I tried one of the answer's suggestions below and running the compiled program gives me this : `.\/gsl_app: error while loading shared libraries: libgsl.so.0: cannot open shared object`"} {"id":"75932","title":"What stuff can be safely removed for disk space sake?","text":"I am using Scientific Linux. So is there any stuff that can be safely removed from disk except `\/tmp`?"} {"id":"73309","title":"why is filesystem intensive script not faster on ram disk","text":"I have a script which creates a lot of files and directories. The script does black box tests for a program which works with a lot of files and directories. The test count grew and the tests were taking too long (over 2 seconds). I thought I run the tests in a ram disk. I ran the test in `\/dev\/shm`. Strangely it did not run any faster. Average run time was about the same as on normal harddisk. I also tried in a fuse based ram disk written in perl. The website is gone but I found it in the internet archive. Average run time on the fuse ram disk is even slower. Perhaps because of the suboptimal implementation of the perl code. Here is a simplified version of my script: #! \/bin\/sh preparedir() { mkdir foo mkdir bar touch bar\/file mkdir bar\/baz echo qux > bar\/baz\/file } dostuff() { mkdir actual (cd actual; preparedir) find actual -type f -execdir cat '{}' \\; > \/dev\/null mkdir expected (cd expected; preparedir) diff -qr actual expected } dostuffoften() { while read dirname; do rm -rf $dirname mkdir $dirname (cd $dirname; dostuff) done } seq 100 | dostuffoften The real script does a bit more error checking and result collecting and a summary. The `find` is a dummy for the actual program I am testing. I wonder why my filesystem intensive script does not run faster on a memory backed filesystem. Is it because the linux kernel handles the filesystem cache so efficiently that it practically is a memory backed filesystem?"} {"id":"35532","title":"Why does this awk command not play as well with find as sed does?","text":"I am very much a **newbie** at Unix\/Linux command line stuff, and mostly get to where I'm going by copying, pasting, and modifying code I find on the internet. Just mentioning that in hopes people will keep answers simple and without assuming I know what's going on. I'm creating a **Bash shell script** to do some file manipulation on some HTML files. Among the many actions I do, I have this `sed` command which works great: find $DIR -type f -name '*.html' -exec sed -i 's\/.*